From: Helge Norberg Date: Tue, 12 May 2015 11:16:07 +0000 (+0200) Subject: * Merged html producer and updated to latest CEF version (does not have satisfactory... X-Git-Tag: 2.1.0_Beta1~364 X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=fa554b2c591a84274daa6a72497029f751a3c9a4;p=casparcg * Merged html producer and updated to latest CEF version (does not have satisfactory performance though see http://casparcg.com/forum/viewtopic.php?f=3&t=3153). Registers a cg_proxy implementation as well, to work seamlessly with CG commands. * Modules can now intercept command line arguments (used by html module) and take complete control of server start up. * Module uninitialization now in reverse order of initialization. --- diff --git a/CMakeLists.txt b/CMakeLists.txt index f0ecda98d..0153be90a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -32,6 +32,7 @@ set(ASMLIB_INCLUDE_PATH "${DEPENDENCIES_FOLDER}/asmlib") set(FREEIMAGE_INCLUDE_PATH "${DEPENDENCIES_FOLDER}/freeimage/include") set(OPENAL_INCLUDE_PATH "${DEPENDENCIES_FOLDER}/openal/include") set(BLUEFISH_INCLUDE_PATH "${DEPENDENCIES_FOLDER}/bluefish/include") +set(CEF_INCLUDE_PATH "${DEPENDENCIES_FOLDER}/cef/include") if (MSVC) set(PLATFORM_FOLDER_NAME "win32") @@ -45,6 +46,9 @@ set(GLEW_BIN_PATH "${DEPENDENCIES_FOLDER}/glew/bin") set(OPENAL_BIN_PATH "${DEPENDENCIES_FOLDER}/openal/bin") set(TBB_BIN_PATH "${DEPENDENCIES_FOLDER}/tbb/bin/${PLATFORM_FOLDER_NAME}") set(LIBERATION_FONTS_BIN_PATH "${DEPENDENCIES_FOLDER}/liberation-fonts") +set(CEF_PATH "${DEPENDENCIES_FOLDER}/cef") +set(CEF_BIN_PATH "${DEPENDENCIES_FOLDER}/cef/bin/${PLATFORM_FOLDER_NAME}") +set(CEF_RESOURCES_PATH "${DEPENDENCIES_FOLDER}/cef/bin/resources") link_directories("${DEPENDENCIES_FOLDER}/boost/stage/lib/${PLATFORM_FOLDER_NAME}") link_directories("${DEPENDENCIES_FOLDER}/tbb/lib/${PLATFORM_FOLDER_NAME}") @@ -58,6 +62,7 @@ link_directories("${DEPENDENCIES_FOLDER}/freeimage/lib/${PLATFORM_FOLDER_NAME}") link_directories("${DEPENDENCIES_FOLDER}/openal/lib") link_directories("${DEPENDENCIES_FOLDER}/bluefish/lib") link_directories("${DEPENDENCIES_FOLDER}/zlib/lib") +link_directories("${DEPENDENCIES_FOLDER}/cef/lib/${PLATFORM_FOLDER_NAME}") set_property(GLOBAL PROPERTY USE_FOLDERS ON) @@ -88,11 +93,12 @@ endif () include(CMake/PrecompiledHeader.cmake) -set(CASPARCG_MODULE_INCLUDE_STATEMENTS "" CACHE INTERNAL "") -set(CASPARCG_MODULE_INIT_STATEMENTS "" CACHE INTERNAL "") -set(CASPARCG_MODULE_UNINIT_STATEMENTS "" CACHE INTERNAL "") -set(CASPARCG_MODULE_PROJECTS "" CACHE INTERNAL "") -set(CASPARCG_RUNTIME_DEPENDENCIES "" CACHE INTERNAL "") +set(CASPARCG_MODULE_INCLUDE_STATEMENTS "" CACHE INTERNAL "") +set(CASPARCG_MODULE_INIT_STATEMENTS "" CACHE INTERNAL "") +set(CASPARCG_MODULE_UNINIT_STATEMENTS "" CACHE INTERNAL "") +set(CASPARCG_MODULE_COMMAND_LINE_ARG_INTERCEPTORS_STATEMENTS "" CACHE INTERNAL "") +set(CASPARCG_MODULE_PROJECTS "" CACHE INTERNAL "") +set(CASPARCG_RUNTIME_DEPENDENCIES "" CACHE INTERNAL "") function(casparcg_add_include_statement HEADER_FILE_TO_INCLUDE) set(CASPARCG_MODULE_INCLUDE_STATEMENTS "${CASPARCG_MODULE_INCLUDE_STATEMENTS}" @@ -109,8 +115,17 @@ function(casparcg_add_init_statement INIT_FUNCTION_NAME NAME_TO_LOG) endfunction() function(casparcg_add_uninit_statement UNINIT_FUNCTION_NAME) - set(CASPARCG_MODULE_UNINIT_STATEMENTS "${CASPARCG_MODULE_UNINIT_STATEMENTS}" + set(CASPARCG_MODULE_UNINIT_STATEMENTS " ${UNINIT_FUNCTION_NAME}()\;" + "${CASPARCG_MODULE_UNINIT_STATEMENTS}" + CACHE INTERNAL "") +endfunction() + +function(casparcg_add_command_line_arg_interceptor INTERCEPTOR_FUNCTION_NAME) + set(CASPARCG_MODULE_COMMAND_LINE_ARG_INTERCEPTORS_STATEMENTS "${CASPARCG_MODULE_COMMAND_LINE_ARG_INTERCEPTORS_STATEMENTS}" + " if (${INTERCEPTOR_FUNCTION_NAME}(argc, argv))" + " return true\;" + "" CACHE INTERNAL "") endfunction() diff --git a/common/lock.h b/common/lock.h index 5efd30977..647f09e34 100644 --- a/common/lock.h +++ b/common/lock.h @@ -5,7 +5,7 @@ namespace caspar { template auto lock(T& mutex, F&& func) -> decltype(func()) { - typename T::scoped_lock lock(mutex); + boost::lock_guard lock(mutex); return func(); } diff --git a/dependencies64/cef/LICENSE.txt b/dependencies64/cef/LICENSE.txt new file mode 100644 index 000000000..b69b14293 --- /dev/null +++ b/dependencies64/cef/LICENSE.txt @@ -0,0 +1,29 @@ +// Copyright (c) 2008-2014 Marshall A. Greenblatt. Portions Copyright (c) +// 2006-2009 Google Inc. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/dependencies64/cef/README.txt b/dependencies64/cef/README.txt new file mode 100644 index 000000000..f6f820b52 --- /dev/null +++ b/dependencies64/cef/README.txt @@ -0,0 +1,124 @@ +Chromium Embedded Framework (CEF) Standard Binary Distribution for Windows +------------------------------------------------------------------------------- + +Date: April 30, 2015 + +CEF Version: 3.2378.1268.g4715a16 +CEF URL: https://bitbucket.org/chromiumembedded/cef.git + @4715a1644e292e191d3840b59a74f821be91daec + +Chromium Verison: 44.0.2378.0 +Chromium URL: https://chromium.googlesource.com/chromium/src.git + @c03558c9998c74e25c302a1f5e9e164b572b9373 + +This distribution contains all components necessary to build and distribute an +application using CEF on the Windows platform. Please see the LICENSING +section of this document for licensing terms and conditions. + + +CONTENTS +-------- + +cefclient Contains the cefclient sample application configured to build + using the files in this distribution. This application demonstrates + a wide range of CEF functionalities. + +cefsimple Contains the cefsimple sample application configured to build + using the files in this distribution. This application demonstrates + the minimal functionality required to create a browser window. + +Debug Contains libcef.dll, libcef.lib and other components required to + build and run the debug version of CEF-based applications. By + default these files should be placed in the same directory as the + executable and will be copied there as part of the build process. + +include Contains all required CEF header files. + +libcef_dll Contains the source code for the libcef_dll_wrapper static library + that all applications using the CEF C++ API must link against. + +Release Contains libcef.dll, libcef.lib and other components required to + build and run the release version of CEF-based applications. By + default these files should be placed in the same directory as the + executable and will be copied there as part of the build process. + +Resources Contains resources required by libcef.dll. By default these files + should be placed in the same directory as libcef.dll. By default + these files should be placed in the same directory as libcef.dll + and will be copied there as part of the build process. + + +USAGE +----- + +Building using CMake: + CMake can be used to generate project files in many different formats. See + usage instructions at the top of the CMakeLists.txt file. + +Please visit the CEF Website for additional usage information. + +https://bitbucket.org/chromiumembedded/cef/ + + +REDISTRIBUTION +-------------- + +This binary distribution contains the below components. Components listed under +the "required" section must be redistributed with all applications using CEF. +Components listed under the "optional" section may be excluded if the related +features will not be used. + +Required components: + +* CEF core library + libcef.dll + +* Unicode support + icudtl.dat + +Optional components: + +* Localized resources + locales/ + Note: Contains localized strings for WebKit UI controls. A .pak file is loaded + from this folder based on the CefSettings.locale value. Only configured + locales need to be distributed. If no locale is configured the default locale + of "en-US" will be used. Locale file loading can be disabled completely using + CefSettings.pack_loading_disabled. The locales folder path can be customized + using CefSettings.locales_dir_path. + +* Other resources + cef.pak + cef_100_percent.pak + cef_200_percent.pak + devtools_resources.pak + Note: Contains WebKit image and inspector resources. Pack file loading can be + disabled completely using CefSettings.pack_loading_disabled. The resources + directory path can be customized using CefSettings.resources_dir_path. + +* FFmpeg audio and video support + ffmpegsumo.dll + Note: Without this component HTML5 audio and video will not function. + +* Angle and Direct3D support + d3dcompiler_43.dll (required for Windows XP) + d3dcompiler_47.dll (required for Windows Vista and newer) + libEGL.dll + libGLESv2.dll + Note: Without these components HTML5 accelerated content like 2D canvas, 3D + CSS and WebGL will not function. + +* Windows Vista 64-bit sandbox support (32-bit distributions only) + wow_helper.exe + Note: Without this component the 32-bit build of CEF will not run on 64-bit + Vista machines with the sandbox enabled. + + +LICENSING +--------- + +The CEF project is BSD licensed. Please read the LICENSE.txt file included with +this binary distribution for licensing terms and conditions. Other software +included in this distribution is provided under other licenses. Please visit +"about:credits" in a CEF-based application for complete Chromium and third-party +licensing information. diff --git a/dependencies64/cef/bin/resources/cef.pak b/dependencies64/cef/bin/resources/cef.pak new file mode 100644 index 000000000..6efb501d4 Binary files /dev/null and b/dependencies64/cef/bin/resources/cef.pak differ diff --git a/dependencies64/cef/bin/resources/cef_100_percent.pak b/dependencies64/cef/bin/resources/cef_100_percent.pak new file mode 100644 index 000000000..03fdfb5d4 Binary files /dev/null and b/dependencies64/cef/bin/resources/cef_100_percent.pak differ diff --git a/dependencies64/cef/bin/resources/cef_200_percent.pak b/dependencies64/cef/bin/resources/cef_200_percent.pak new file mode 100644 index 000000000..affbf9d3e Binary files /dev/null and b/dependencies64/cef/bin/resources/cef_200_percent.pak differ diff --git a/dependencies64/cef/bin/resources/devtools_resources.pak b/dependencies64/cef/bin/resources/devtools_resources.pak new file mode 100644 index 000000000..df96d1dab Binary files /dev/null and b/dependencies64/cef/bin/resources/devtools_resources.pak differ diff --git a/dependencies64/cef/bin/resources/icudtl.dat b/dependencies64/cef/bin/resources/icudtl.dat new file mode 100644 index 000000000..11e4e06c1 Binary files /dev/null and b/dependencies64/cef/bin/resources/icudtl.dat differ diff --git a/dependencies64/cef/bin/resources/locales/am.pak b/dependencies64/cef/bin/resources/locales/am.pak new file mode 100644 index 000000000..6acc83961 Binary files /dev/null and b/dependencies64/cef/bin/resources/locales/am.pak differ diff --git a/dependencies64/cef/bin/resources/locales/ar.pak b/dependencies64/cef/bin/resources/locales/ar.pak new file mode 100644 index 000000000..e380df144 Binary files /dev/null and b/dependencies64/cef/bin/resources/locales/ar.pak differ diff --git a/dependencies64/cef/bin/resources/locales/bg.pak b/dependencies64/cef/bin/resources/locales/bg.pak new file mode 100644 index 000000000..e251e8929 Binary files /dev/null and b/dependencies64/cef/bin/resources/locales/bg.pak differ diff --git a/dependencies64/cef/bin/resources/locales/bn.pak b/dependencies64/cef/bin/resources/locales/bn.pak new file mode 100644 index 000000000..7b2c00771 Binary files /dev/null and b/dependencies64/cef/bin/resources/locales/bn.pak differ diff --git a/dependencies64/cef/bin/resources/locales/ca.pak b/dependencies64/cef/bin/resources/locales/ca.pak new file mode 100644 index 000000000..11abefee0 Binary files /dev/null and b/dependencies64/cef/bin/resources/locales/ca.pak differ diff --git a/dependencies64/cef/bin/resources/locales/cs.pak b/dependencies64/cef/bin/resources/locales/cs.pak new file mode 100644 index 000000000..764c8ba35 Binary files /dev/null and b/dependencies64/cef/bin/resources/locales/cs.pak differ diff --git a/dependencies64/cef/bin/resources/locales/da.pak b/dependencies64/cef/bin/resources/locales/da.pak new file mode 100644 index 000000000..50f7bdd7e Binary files /dev/null and b/dependencies64/cef/bin/resources/locales/da.pak differ diff --git a/dependencies64/cef/bin/resources/locales/de.pak b/dependencies64/cef/bin/resources/locales/de.pak new file mode 100644 index 000000000..aa80e64df Binary files /dev/null and b/dependencies64/cef/bin/resources/locales/de.pak differ diff --git a/dependencies64/cef/bin/resources/locales/el.pak b/dependencies64/cef/bin/resources/locales/el.pak new file mode 100644 index 000000000..038a84b35 Binary files /dev/null and b/dependencies64/cef/bin/resources/locales/el.pak differ diff --git a/dependencies64/cef/bin/resources/locales/en-GB.pak b/dependencies64/cef/bin/resources/locales/en-GB.pak new file mode 100644 index 000000000..588423260 Binary files /dev/null and b/dependencies64/cef/bin/resources/locales/en-GB.pak differ diff --git a/dependencies64/cef/bin/resources/locales/en-US.pak b/dependencies64/cef/bin/resources/locales/en-US.pak new file mode 100644 index 000000000..7f8d50681 Binary files /dev/null and b/dependencies64/cef/bin/resources/locales/en-US.pak differ diff --git a/dependencies64/cef/bin/resources/locales/es-419.pak b/dependencies64/cef/bin/resources/locales/es-419.pak new file mode 100644 index 000000000..3933f39a5 Binary files /dev/null and b/dependencies64/cef/bin/resources/locales/es-419.pak differ diff --git a/dependencies64/cef/bin/resources/locales/es.pak b/dependencies64/cef/bin/resources/locales/es.pak new file mode 100644 index 000000000..5770aff14 Binary files /dev/null and b/dependencies64/cef/bin/resources/locales/es.pak differ diff --git a/dependencies64/cef/bin/resources/locales/et.pak b/dependencies64/cef/bin/resources/locales/et.pak new file mode 100644 index 000000000..50d91ac4a Binary files /dev/null and b/dependencies64/cef/bin/resources/locales/et.pak differ diff --git a/dependencies64/cef/bin/resources/locales/fa.pak b/dependencies64/cef/bin/resources/locales/fa.pak new file mode 100644 index 000000000..b749435f8 Binary files /dev/null and b/dependencies64/cef/bin/resources/locales/fa.pak differ diff --git a/dependencies64/cef/bin/resources/locales/fi.pak b/dependencies64/cef/bin/resources/locales/fi.pak new file mode 100644 index 000000000..b634294fb Binary files /dev/null and b/dependencies64/cef/bin/resources/locales/fi.pak differ diff --git a/dependencies64/cef/bin/resources/locales/fil.pak b/dependencies64/cef/bin/resources/locales/fil.pak new file mode 100644 index 000000000..26f77a3e1 Binary files /dev/null and b/dependencies64/cef/bin/resources/locales/fil.pak differ diff --git a/dependencies64/cef/bin/resources/locales/fr.pak b/dependencies64/cef/bin/resources/locales/fr.pak new file mode 100644 index 000000000..459cb3034 Binary files /dev/null and b/dependencies64/cef/bin/resources/locales/fr.pak differ diff --git a/dependencies64/cef/bin/resources/locales/gu.pak b/dependencies64/cef/bin/resources/locales/gu.pak new file mode 100644 index 000000000..75689f703 Binary files /dev/null and b/dependencies64/cef/bin/resources/locales/gu.pak differ diff --git a/dependencies64/cef/bin/resources/locales/he.pak b/dependencies64/cef/bin/resources/locales/he.pak new file mode 100644 index 000000000..7896a5230 Binary files /dev/null and b/dependencies64/cef/bin/resources/locales/he.pak differ diff --git a/dependencies64/cef/bin/resources/locales/hi.pak b/dependencies64/cef/bin/resources/locales/hi.pak new file mode 100644 index 000000000..8dee12024 Binary files /dev/null and b/dependencies64/cef/bin/resources/locales/hi.pak differ diff --git a/dependencies64/cef/bin/resources/locales/hr.pak b/dependencies64/cef/bin/resources/locales/hr.pak new file mode 100644 index 000000000..ffc56e28f Binary files /dev/null and b/dependencies64/cef/bin/resources/locales/hr.pak differ diff --git a/dependencies64/cef/bin/resources/locales/hu.pak b/dependencies64/cef/bin/resources/locales/hu.pak new file mode 100644 index 000000000..d78355d06 Binary files /dev/null and b/dependencies64/cef/bin/resources/locales/hu.pak differ diff --git a/dependencies64/cef/bin/resources/locales/id.pak b/dependencies64/cef/bin/resources/locales/id.pak new file mode 100644 index 000000000..9ad6e1635 Binary files /dev/null and b/dependencies64/cef/bin/resources/locales/id.pak differ diff --git a/dependencies64/cef/bin/resources/locales/it.pak b/dependencies64/cef/bin/resources/locales/it.pak new file mode 100644 index 000000000..4bc31ccb6 Binary files /dev/null and b/dependencies64/cef/bin/resources/locales/it.pak differ diff --git a/dependencies64/cef/bin/resources/locales/ja.pak b/dependencies64/cef/bin/resources/locales/ja.pak new file mode 100644 index 000000000..bd10e74ab Binary files /dev/null and b/dependencies64/cef/bin/resources/locales/ja.pak differ diff --git a/dependencies64/cef/bin/resources/locales/kn.pak b/dependencies64/cef/bin/resources/locales/kn.pak new file mode 100644 index 000000000..f1fd64303 Binary files /dev/null and b/dependencies64/cef/bin/resources/locales/kn.pak differ diff --git a/dependencies64/cef/bin/resources/locales/ko.pak b/dependencies64/cef/bin/resources/locales/ko.pak new file mode 100644 index 000000000..9a17d6c8e Binary files /dev/null and b/dependencies64/cef/bin/resources/locales/ko.pak differ diff --git a/dependencies64/cef/bin/resources/locales/lt.pak b/dependencies64/cef/bin/resources/locales/lt.pak new file mode 100644 index 000000000..10e31baf2 Binary files /dev/null and b/dependencies64/cef/bin/resources/locales/lt.pak differ diff --git a/dependencies64/cef/bin/resources/locales/lv.pak b/dependencies64/cef/bin/resources/locales/lv.pak new file mode 100644 index 000000000..f56abc240 Binary files /dev/null and b/dependencies64/cef/bin/resources/locales/lv.pak differ diff --git a/dependencies64/cef/bin/resources/locales/ml.pak b/dependencies64/cef/bin/resources/locales/ml.pak new file mode 100644 index 000000000..84c470813 Binary files /dev/null and b/dependencies64/cef/bin/resources/locales/ml.pak differ diff --git a/dependencies64/cef/bin/resources/locales/mr.pak b/dependencies64/cef/bin/resources/locales/mr.pak new file mode 100644 index 000000000..06b11b254 Binary files /dev/null and b/dependencies64/cef/bin/resources/locales/mr.pak differ diff --git a/dependencies64/cef/bin/resources/locales/ms.pak b/dependencies64/cef/bin/resources/locales/ms.pak new file mode 100644 index 000000000..9ff22e3e7 Binary files /dev/null and b/dependencies64/cef/bin/resources/locales/ms.pak differ diff --git a/dependencies64/cef/bin/resources/locales/nb.pak b/dependencies64/cef/bin/resources/locales/nb.pak new file mode 100644 index 000000000..82611238b Binary files /dev/null and b/dependencies64/cef/bin/resources/locales/nb.pak differ diff --git a/dependencies64/cef/bin/resources/locales/nl.pak b/dependencies64/cef/bin/resources/locales/nl.pak new file mode 100644 index 000000000..94b28ba2f Binary files /dev/null and b/dependencies64/cef/bin/resources/locales/nl.pak differ diff --git a/dependencies64/cef/bin/resources/locales/pl.pak b/dependencies64/cef/bin/resources/locales/pl.pak new file mode 100644 index 000000000..c956bba19 Binary files /dev/null and b/dependencies64/cef/bin/resources/locales/pl.pak differ diff --git a/dependencies64/cef/bin/resources/locales/pt-BR.pak b/dependencies64/cef/bin/resources/locales/pt-BR.pak new file mode 100644 index 000000000..a49ddc6a6 Binary files /dev/null and b/dependencies64/cef/bin/resources/locales/pt-BR.pak differ diff --git a/dependencies64/cef/bin/resources/locales/pt-PT.pak b/dependencies64/cef/bin/resources/locales/pt-PT.pak new file mode 100644 index 000000000..7a7d702e8 Binary files /dev/null and b/dependencies64/cef/bin/resources/locales/pt-PT.pak differ diff --git a/dependencies64/cef/bin/resources/locales/ro.pak b/dependencies64/cef/bin/resources/locales/ro.pak new file mode 100644 index 000000000..a7e56f3b3 Binary files /dev/null and b/dependencies64/cef/bin/resources/locales/ro.pak differ diff --git a/dependencies64/cef/bin/resources/locales/ru.pak b/dependencies64/cef/bin/resources/locales/ru.pak new file mode 100644 index 000000000..ca7b2a54c Binary files /dev/null and b/dependencies64/cef/bin/resources/locales/ru.pak differ diff --git a/dependencies64/cef/bin/resources/locales/sk.pak b/dependencies64/cef/bin/resources/locales/sk.pak new file mode 100644 index 000000000..12e974b5f Binary files /dev/null and b/dependencies64/cef/bin/resources/locales/sk.pak differ diff --git a/dependencies64/cef/bin/resources/locales/sl.pak b/dependencies64/cef/bin/resources/locales/sl.pak new file mode 100644 index 000000000..968d61abc Binary files /dev/null and b/dependencies64/cef/bin/resources/locales/sl.pak differ diff --git a/dependencies64/cef/bin/resources/locales/sr.pak b/dependencies64/cef/bin/resources/locales/sr.pak new file mode 100644 index 000000000..042c29cfa Binary files /dev/null and b/dependencies64/cef/bin/resources/locales/sr.pak differ diff --git a/dependencies64/cef/bin/resources/locales/sv.pak b/dependencies64/cef/bin/resources/locales/sv.pak new file mode 100644 index 000000000..413529a67 Binary files /dev/null and b/dependencies64/cef/bin/resources/locales/sv.pak differ diff --git a/dependencies64/cef/bin/resources/locales/sw.pak b/dependencies64/cef/bin/resources/locales/sw.pak new file mode 100644 index 000000000..27333adbc Binary files /dev/null and b/dependencies64/cef/bin/resources/locales/sw.pak differ diff --git a/dependencies64/cef/bin/resources/locales/ta.pak b/dependencies64/cef/bin/resources/locales/ta.pak new file mode 100644 index 000000000..13a8c3cae Binary files /dev/null and b/dependencies64/cef/bin/resources/locales/ta.pak differ diff --git a/dependencies64/cef/bin/resources/locales/te.pak b/dependencies64/cef/bin/resources/locales/te.pak new file mode 100644 index 000000000..f513f54b9 Binary files /dev/null and b/dependencies64/cef/bin/resources/locales/te.pak differ diff --git a/dependencies64/cef/bin/resources/locales/th.pak b/dependencies64/cef/bin/resources/locales/th.pak new file mode 100644 index 000000000..bef38de8f Binary files /dev/null and b/dependencies64/cef/bin/resources/locales/th.pak differ diff --git a/dependencies64/cef/bin/resources/locales/tr.pak b/dependencies64/cef/bin/resources/locales/tr.pak new file mode 100644 index 000000000..56ba47ab1 Binary files /dev/null and b/dependencies64/cef/bin/resources/locales/tr.pak differ diff --git a/dependencies64/cef/bin/resources/locales/uk.pak b/dependencies64/cef/bin/resources/locales/uk.pak new file mode 100644 index 000000000..2a92a3d78 Binary files /dev/null and b/dependencies64/cef/bin/resources/locales/uk.pak differ diff --git a/dependencies64/cef/bin/resources/locales/vi.pak b/dependencies64/cef/bin/resources/locales/vi.pak new file mode 100644 index 000000000..63538b65e Binary files /dev/null and b/dependencies64/cef/bin/resources/locales/vi.pak differ diff --git a/dependencies64/cef/bin/resources/locales/zh-CN.pak b/dependencies64/cef/bin/resources/locales/zh-CN.pak new file mode 100644 index 000000000..0f254c151 Binary files /dev/null and b/dependencies64/cef/bin/resources/locales/zh-CN.pak differ diff --git a/dependencies64/cef/bin/resources/locales/zh-TW.pak b/dependencies64/cef/bin/resources/locales/zh-TW.pak new file mode 100644 index 000000000..a788483da Binary files /dev/null and b/dependencies64/cef/bin/resources/locales/zh-TW.pak differ diff --git a/dependencies64/cef/bin/win32/d3dcompiler_43.dll b/dependencies64/cef/bin/win32/d3dcompiler_43.dll new file mode 100644 index 000000000..ab9616191 Binary files /dev/null and b/dependencies64/cef/bin/win32/d3dcompiler_43.dll differ diff --git a/dependencies64/cef/bin/win32/d3dcompiler_47.dll b/dependencies64/cef/bin/win32/d3dcompiler_47.dll new file mode 100644 index 000000000..56512f565 Binary files /dev/null and b/dependencies64/cef/bin/win32/d3dcompiler_47.dll differ diff --git a/dependencies64/cef/bin/win32/ffmpegsumo.dll b/dependencies64/cef/bin/win32/ffmpegsumo.dll new file mode 100644 index 000000000..5bd052bb1 Binary files /dev/null and b/dependencies64/cef/bin/win32/ffmpegsumo.dll differ diff --git a/dependencies64/cef/bin/win32/libEGL.dll b/dependencies64/cef/bin/win32/libEGL.dll new file mode 100644 index 000000000..45d0e6fcc Binary files /dev/null and b/dependencies64/cef/bin/win32/libEGL.dll differ diff --git a/dependencies64/cef/bin/win32/libGLESv2.dll b/dependencies64/cef/bin/win32/libGLESv2.dll new file mode 100644 index 000000000..0dfcb67b4 Binary files /dev/null and b/dependencies64/cef/bin/win32/libGLESv2.dll differ diff --git a/dependencies64/cef/bin/win32/libcef.dll b/dependencies64/cef/bin/win32/libcef.dll new file mode 100644 index 000000000..9a079acdf Binary files /dev/null and b/dependencies64/cef/bin/win32/libcef.dll differ diff --git a/dependencies64/cef/bin/win32/natives_blob.bin b/dependencies64/cef/bin/win32/natives_blob.bin new file mode 100644 index 000000000..5659a682b --- /dev/null +++ b/dependencies64/cef/bin/win32/natives_blob.bin @@ -0,0 +1,17499 @@ + debug֖ +"use strict"; +var kDefaultBacktraceLength=10; +var Debug={}; +var sourceLineBeginningSkip=/^(?:\s*(?:\/\*.*?\*\/)*)*/; +Debug.DebugEvent={Break:1, +Exception:2, +NewFunction:3, +BeforeCompile:4, +AfterCompile:5, +CompileError:6, +PromiseEvent:7, +AsyncTaskEvent:8, +BreakForCommand:9}; +Debug.ExceptionBreak={Caught:0, +Uncaught:1}; +Debug.StepAction={StepOut:0, +StepNext:1, +StepIn:2, +StepMin:3, +StepInMin:4, +StepFrame:5}; +Debug.ScriptType={Native:0, +Extension:1, +Normal:2}; +Debug.ScriptCompilationType={Host:0, +Eval:1, +JSON:2}; +Debug.ScriptBreakPointType={ScriptId:0, +ScriptName:1, +ScriptRegExp:2}; +Debug.BreakPositionAlignment={ +Statement:0, +BreakPosition:1 +}; +function ScriptTypeFlag(a){ +return(1<0){ +this.ignoreCount_--; +return false; +} +return true; +}; +function IsBreakPointTriggered(a,b){ +return b.isTriggered(MakeExecutionState(a)); +} +function ScriptBreakPoint(type,script_id_or_name,opt_line,opt_column, +opt_groupId,opt_position_alignment){ +this.type_=type; +if(type==Debug.ScriptBreakPointType.ScriptId){ +this.script_id_=script_id_or_name; +}else if(type==Debug.ScriptBreakPointType.ScriptName){ +this.script_name_=script_id_or_name; +}else if(type==Debug.ScriptBreakPointType.ScriptRegExp){ +this.script_regexp_object_=new RegExp(script_id_or_name); +}else{ +throw new Error("Unexpected breakpoint type "+type); +} +this.line_=opt_line||0; +this.column_=opt_column; +this.groupId_=opt_groupId; +this.position_alignment_=(opt_position_alignment===(void 0)) +?Debug.BreakPositionAlignment.Statement:opt_position_alignment; +this.hit_count_=0; +this.active_=true; +this.condition_=null; +this.ignoreCount_=0; +this.break_points_=[]; +} +ScriptBreakPoint.prototype.cloneForOtherScript=function(a){ +var b=new ScriptBreakPoint(Debug.ScriptBreakPointType.ScriptId, +a.id,this.line_,this.column_,this.groupId_, +this.position_alignment_); +b.number_=next_break_point_number++; +script_break_points.push(b); +b.hit_count_=this.hit_count_; +b.active_=this.active_; +b.condition_=this.condition_; +b.ignoreCount_=this.ignoreCount_; +return b; +}; +ScriptBreakPoint.prototype.number=function(){ +return this.number_; +}; +ScriptBreakPoint.prototype.groupId=function(){ +return this.groupId_; +}; +ScriptBreakPoint.prototype.type=function(){ +return this.type_; +}; +ScriptBreakPoint.prototype.script_id=function(){ +return this.script_id_; +}; +ScriptBreakPoint.prototype.script_name=function(){ +return this.script_name_; +}; +ScriptBreakPoint.prototype.script_regexp_object=function(){ +return this.script_regexp_object_; +}; +ScriptBreakPoint.prototype.line=function(){ +return this.line_; +}; +ScriptBreakPoint.prototype.column=function(){ +return this.column_; +}; +ScriptBreakPoint.prototype.actual_locations=function(){ +var a=[]; +for(var b=0;b=this.frameCount()){ +throw new Error('Illegal frame index.'); +} +return new FrameMirror(this.break_id,a); +}; +ExecutionState.prototype.setSelectedFrame=function(a){ +var b=%ToNumber(a); +if(b<0||b>=this.frameCount())throw new Error('Illegal frame index.'); +this.selected_frame=b; +}; +ExecutionState.prototype.selectedFrame=function(){ +return this.selected_frame; +}; +ExecutionState.prototype.debugCommandProcessor=function(a){ +return new DebugCommandProcessor(this,a); +}; +function MakeBreakEvent(a,b){ +return new BreakEvent(a,b); +} +function BreakEvent(a,b){ +this.frame_=new FrameMirror(a,0); +this.break_points_hit_=b; +} +BreakEvent.prototype.eventType=function(){ +return Debug.DebugEvent.Break; +}; +BreakEvent.prototype.func=function(){ +return this.frame_.func(); +}; +BreakEvent.prototype.sourceLine=function(){ +return this.frame_.sourceLine(); +}; +BreakEvent.prototype.sourceColumn=function(){ +return this.frame_.sourceColumn(); +}; +BreakEvent.prototype.sourceLineText=function(){ +return this.frame_.sourceLineText(); +}; +BreakEvent.prototype.breakPointsHit=function(){ +return this.break_points_hit_; +}; +BreakEvent.prototype.toJSONProtocol=function(){ +var a={seq:next_response_seq++, +type:"event", +event:"break", +body:{invocationText:this.frame_.invocationText()} +}; +var b=this.func().script(); +if(b){ +a.body.sourceLine=this.sourceLine(), +a.body.sourceColumn=this.sourceColumn(), +a.body.sourceLineText=this.sourceLineText(), +a.body.script=MakeScriptObject_(b,false); +} +if(this.breakPointsHit()){ +a.body.breakpoints=[]; +for(var c=0;c0){ +a.body.sourceLine=this.sourceLine(); +a.body.sourceColumn=this.sourceColumn(); +a.body.sourceLineText=this.sourceLineText(); +var b=this.func().script(); +if(b){ +a.body.script=MakeScriptObject_(b,false); +} +}else{ +a.body.sourceLine=-1; +} +return a.toJSONProtocol(); +}; +function MakeCompileEvent(a,b){ +return new CompileEvent(a,b); +} +function CompileEvent(a,b){ +this.script_=MakeMirror(a); +this.type_=b; +} +CompileEvent.prototype.eventType=function(){ +return this.type_; +}; +CompileEvent.prototype.script=function(){ +return this.script_; +}; +CompileEvent.prototype.toJSONProtocol=function(){ +var a=new ProtocolMessage(); +a.running=true; +switch(this.type_){ +case Debug.DebugEvent.BeforeCompile: +a.event="beforeCompile"; +break; +case Debug.DebugEvent.AfterCompile: +a.event="afterCompile"; +break; +case Debug.DebugEvent.CompileError: +a.event="compileError"; +break; +} +a.body={}; +a.body.script=this.script_; +return a.toJSONProtocol(); +}; +function MakeScriptObject_(a,b){ +var c={id:a.id(), +name:a.name(), +lineOffset:a.lineOffset(), +columnOffset:a.columnOffset(), +lineCount:a.lineCount(), +}; +if(!(a.data()===(void 0))){ +c.data=a.data(); +} +if(b){ +c.source=a.source(); +} +return c; +} +function MakePromiseEvent(a){ +return new PromiseEvent(a); +} +function PromiseEvent(a){ +this.promise_=a.promise; +this.parentPromise_=a.parentPromise; +this.status_=a.status; +this.value_=a.value; +} +PromiseEvent.prototype.promise=function(){ +return MakeMirror(this.promise_); +} +PromiseEvent.prototype.parentPromise=function(){ +return MakeMirror(this.parentPromise_); +} +PromiseEvent.prototype.status=function(){ +return this.status_; +} +PromiseEvent.prototype.value=function(){ +return MakeMirror(this.value_); +} +function MakeAsyncTaskEvent(a){ +return new AsyncTaskEvent(a); +} +function AsyncTaskEvent(a){ +this.type_=a.type; +this.name_=a.name; +this.id_=a.id; +} +AsyncTaskEvent.prototype.type=function(){ +return this.type_; +} +AsyncTaskEvent.prototype.name=function(){ +return this.name_; +} +AsyncTaskEvent.prototype.id=function(){ +return this.id_; +} +function DebugCommandProcessor(a,b){ +this.exec_state_=a; +this.running_=b||false; +} +DebugCommandProcessor.prototype.processDebugRequest=function(a){ +return this.processDebugJSONRequest(a); +}; +function ProtocolMessage(a){ +this.seq=next_response_seq++; +if(a){ +this.type='response'; +this.request_seq=a.seq; +this.command=a.command; +}else{ +this.type='event'; +} +this.success=true; +this.running=undefined; +} +ProtocolMessage.prototype.setOption=function(a,b){ +if(!this.options_){ +this.options_={}; +} +this.options_[a]=b; +}; +ProtocolMessage.prototype.failed=function(a,b){ +this.success=false; +this.message=a; +if((%_IsObject(b))){ +this.error_details=b; +} +}; +ProtocolMessage.prototype.toJSONProtocol=function(){ +var a={}; +a.seq=this.seq; +if(this.request_seq){ +a.request_seq=this.request_seq; +} +a.type=this.type; +if(this.event){ +a.event=this.event; +} +if(this.command){ +a.command=this.command; +} +if(this.success){ +a.success=this.success; +}else{ +a.success=false; +} +if(this.body){ +var b; +var c=MakeMirrorSerializer(true,this.options_); +if(this.body instanceof Mirror){ +b=c.serializeValue(this.body); +}else if(this.body instanceof Array){ +b=[]; +for(var d=0;d=this.exec_state_.frameCount()){ +return b.failed('Invalid frame "'+d+'"'); +} +b.body=this.exec_state_.frame(m).evaluate( +c,Boolean(g),i); +return; +}else{ +b.body=this.exec_state_.frame().evaluate( +c,Boolean(g),i); +return; +} +}; +DebugCommandProcessor.prototype.lookupRequest_=function(a,b){ +if(!a.arguments){ +return b.failed('Missing arguments'); +} +var c=a.arguments.handles; +if((c===(void 0))){ +return b.failed('Argument "handles" missing'); +} +if(!(a.arguments.includeSource===(void 0))){ +var d=%ToBoolean(a.arguments.includeSource); +b.setOption('includeSource',d); +} +var e={}; +for(var g=0;g=this.exec_state_.frameCount()){ +return b.failed('Invalid frame "'+e+'"'); +} +e=this.exec_state_.frame(g); +} +} +var h=e.func().script(); +if(!h){ +return b.failed('No source'); +} +var i=h.sourceSlice(c,d); +if(!i){ +return b.failed('Invalid line interval'); +} +b.body={}; +b.body.source=i.sourceText(); +b.body.fromLine=i.from_line; +b.body.toLine=i.to_line; +b.body.fromPosition=i.from_position; +b.body.toPosition=i.to_position; +b.body.totalLines=h.lineCount(); +}; +DebugCommandProcessor.prototype.scriptsRequest_=function(a,b){ +var c=ScriptTypeFlag(Debug.ScriptType.Normal); +var d=false; +var e=null; +if(a.arguments){ +if(!(a.arguments.types===(void 0))){ +c=%ToNumber(a.arguments.types); +if(isNaN(c)||c<0){ +return b.failed('Invalid types "'+ +a.arguments.types+'"'); +} +} +if(!(a.arguments.includeSource===(void 0))){ +d=%ToBoolean(a.arguments.includeSource); +b.setOption('includeSource',d); +} +if((%_IsArray(a.arguments.ids))){ +e={}; +var g=a.arguments.ids; +for(var h=0;h=0){ +n=true; +} +} +if(!n)continue; +} +if(c&ScriptTypeFlag(l[h].type)){ +b.body.push(MakeMirror(l[h])); +} +} +}; +DebugCommandProcessor.prototype.threadsRequest_=function(a,b){ +var c=this.exec_state_.threadCount(); +var d=[]; +for(var e=0;e=this.exec_state_.frameCount()){ +return response.failed('Invalid frame "'+a+'"'); +} +b=this.exec_state_.frame(c); +}else{ +b=this.exec_state_.frame(); +} +var d=Debug.LiveEdit.RestartFrame(b); +response.body={result:d}; +}; +DebugCommandProcessor.prototype.debuggerFlagsRequest_=function(request, +response){ +if(!request.arguments){ +response.failed('Missing arguments'); +return; +} +var a=request.arguments.flags; +response.body={flags:[]}; +if(!(a===(void 0))){ +for(var b=0;b"; +}; +function ValueMirror(a,b,c){ +%_CallFunction(this,a,Mirror); +this.value_=b; +if(!c){ +this.allocateHandle_(); +}else{ +this.allocateTransientHandle_(); +} +} +inherits(ValueMirror,Mirror); +Mirror.prototype.handle=function(){ +return this.handle_; +}; +ValueMirror.prototype.isPrimitive=function(){ +var a=this.type(); +return a==='undefined'|| +a==='null'|| +a==='boolean'|| +a==='number'|| +a==='string'|| +a==='symbol'; +}; +ValueMirror.prototype.value=function(){ +return this.value_; +}; +function UndefinedMirror(){ +%_CallFunction(this,UNDEFINED_TYPE,(void 0),ValueMirror); +} +inherits(UndefinedMirror,ValueMirror); +UndefinedMirror.prototype.toText=function(){ +return'undefined'; +}; +function NullMirror(){ +%_CallFunction(this,NULL_TYPE,null,ValueMirror); +} +inherits(NullMirror,ValueMirror); +NullMirror.prototype.toText=function(){ +return'null'; +}; +function BooleanMirror(a){ +%_CallFunction(this,BOOLEAN_TYPE,a,ValueMirror); +} +inherits(BooleanMirror,ValueMirror); +BooleanMirror.prototype.toText=function(){ +return this.value_?'true':'false'; +}; +function NumberMirror(a){ +%_CallFunction(this,NUMBER_TYPE,a,ValueMirror); +} +inherits(NumberMirror,ValueMirror); +NumberMirror.prototype.toText=function(){ +return %_NumberToString(this.value_); +}; +function StringMirror(a){ +%_CallFunction(this,STRING_TYPE,a,ValueMirror); +} +inherits(StringMirror,ValueMirror); +StringMirror.prototype.length=function(){ +return this.value_.length; +}; +StringMirror.prototype.getTruncatedValue=function(a){ +if(a!=-1&&this.length()>a){ +return this.value_.substring(0,a)+ +'... (length: '+this.length()+')'; +} +return this.value_; +}; +StringMirror.prototype.toText=function(){ +return this.getTruncatedValue(kMaxProtocolStringLength); +}; +function SymbolMirror(a){ +%_CallFunction(this,SYMBOL_TYPE,a,ValueMirror); +} +inherits(SymbolMirror,ValueMirror); +SymbolMirror.prototype.description=function(){ +return %SymbolDescription(%_ValueOf(this.value_)); +} +SymbolMirror.prototype.toText=function(){ +return %_CallFunction(this.value_,builtins.$symbolToString); +} +function ObjectMirror(a,b,c){ +%_CallFunction(this,b||OBJECT_TYPE,a,c,ValueMirror); +} +inherits(ObjectMirror,ValueMirror); +ObjectMirror.prototype.className=function(){ +return %_ClassOf(this.value_); +}; +ObjectMirror.prototype.constructorFunction=function(){ +return MakeMirror(%DebugGetProperty(this.value_,'constructor')); +}; +ObjectMirror.prototype.prototypeObject=function(){ +return MakeMirror(%DebugGetProperty(this.value_,'prototype')); +}; +ObjectMirror.prototype.protoObject=function(){ +return MakeMirror(%DebugGetPrototype(this.value_)); +}; +ObjectMirror.prototype.hasNamedInterceptor=function(){ +var a=%GetInterceptorInfo(this.value_); +return(a&2)!=0; +}; +ObjectMirror.prototype.hasIndexedInterceptor=function(){ +var a=%GetInterceptorInfo(this.value_); +return(a&1)!=0; +}; +function TryGetPropertyNames(a){ +try{ +return %GetOwnPropertyNames(a,32); +}catch(e){ +return[]; +} +} +ObjectMirror.prototype.propertyNames=function(a,b){ +a=a||PropertyKind.Named|PropertyKind.Indexed; +var c; +var d; +var e=0; +if(a&PropertyKind.Named){ +c=TryGetPropertyNames(this.value_); +e+=c.length; +if(this.hasNamedInterceptor()&&(a&PropertyKind.Named)){ +var g= +%GetNamedInterceptorPropertyNames(this.value_); +if(g){ +c=c.concat(g); +e+=g.length; +} +} +} +if(a&PropertyKind.Indexed){ +d=%GetOwnElementNames(this.value_); +e+=d.length; +if(this.hasIndexedInterceptor()&&(a&PropertyKind.Indexed)){ +var h= +%GetIndexedInterceptorElementNames(this.value_); +if(h){ +d=d.concat(h); +e+=h.length; +} +} +} +b=Math.min(b||e,e); +var i=new Array(b); +var j=0; +if(a&PropertyKind.Named){ +for(var k=0;j'; +}; +ObjectMirror.GetInternalProperties=function(a){ +if((%_ClassOf(a)==='String')||(%_ClassOf(a)==='Number')|| +(%_ClassOf(a)==='Boolean')){ +var b=%_ValueOf(a); +return[new InternalPropertyMirror("[[PrimitiveValue]]",b)]; +}else if((%_IsFunction(a))){ +var c=%BoundFunctionGetBindings(a); +var d=[]; +if(c&&(%_IsArray(c))){ +d.push(new InternalPropertyMirror("[[TargetFunction]]", +c[0])); +d.push(new InternalPropertyMirror("[[BoundThis]]",c[1])); +var e=[]; +for(var g=2;gb)return new Array(); +var c=new Array(b-a+1); +for(var d=a;d<=b;d++){ +var e=%DebugGetPropertyDetails(this.value_,%ToString(d)); +var g; +if(e){ +g=new PropertyMirror(this,d,e); +}else{ +g=GetUndefinedMirror(); +} +c[d-a]=g; +} +return c; +}; +function DateMirror(a){ +%_CallFunction(this,a,ObjectMirror); +} +inherits(DateMirror,ObjectMirror); +DateMirror.prototype.toText=function(){ +var a=JSON.stringify(this.value_); +return a.substring(1,a.length-1); +}; +function RegExpMirror(a){ +%_CallFunction(this,a,REGEXP_TYPE,ObjectMirror); +} +inherits(RegExpMirror,ObjectMirror); +RegExpMirror.prototype.source=function(){ +return this.value_.source; +}; +RegExpMirror.prototype.global=function(){ +return this.value_.global; +}; +RegExpMirror.prototype.ignoreCase=function(){ +return this.value_.ignoreCase; +}; +RegExpMirror.prototype.multiline=function(){ +return this.value_.multiline; +}; +RegExpMirror.prototype.sticky=function(){ +return this.value_.sticky; +}; +RegExpMirror.prototype.unicode=function(){ +return this.value_.unicode; +}; +RegExpMirror.prototype.toText=function(){ +return"/"+this.source()+"/"; +}; +function ErrorMirror(a){ +%_CallFunction(this,a,ERROR_TYPE,ObjectMirror); +} +inherits(ErrorMirror,ObjectMirror); +ErrorMirror.prototype.message=function(){ +return this.value_.message; +}; +ErrorMirror.prototype.toText=function(){ +var a; +try{ +a=%_CallFunction(this.value_,builtins.ErrorToString); +}catch(e){ +a='#'; +} +return a; +}; +function PromiseMirror(a){ +%_CallFunction(this,a,PROMISE_TYPE,ObjectMirror); +} +inherits(PromiseMirror,ObjectMirror); +function PromiseGetStatus_(a){ +var b=%DebugGetProperty(a,builtins.$promiseStatus); +if(b==0)return"pending"; +if(b==1)return"resolved"; +return"rejected"; +} +function PromiseGetValue_(a){ +return %DebugGetProperty(a,builtins.$promiseValue); +} +PromiseMirror.prototype.status=function(){ +return PromiseGetStatus_(this.value_); +}; +PromiseMirror.prototype.promiseValue=function(){ +return MakeMirror(PromiseGetValue_(this.value_)); +}; +function MapMirror(a){ +%_CallFunction(this,a,MAP_TYPE,ObjectMirror); +} +inherits(MapMirror,ObjectMirror); +MapMirror.prototype.entries=function(a){ +var b=[]; +if((%_ClassOf(this.value_)==='WeakMap')){ +var c=%GetWeakMapEntries(this.value_,a||0); +for(var d=0;d3){ +this.exception_=c[3]; +this.getter_=c[4]; +this.setter_=c[5]; +} +} +inherits(PropertyMirror,Mirror); +PropertyMirror.prototype.isReadOnly=function(){ +return(this.attributes()&PropertyAttribute.ReadOnly)!=0; +}; +PropertyMirror.prototype.isEnum=function(){ +return(this.attributes()&PropertyAttribute.DontEnum)==0; +}; +PropertyMirror.prototype.canDelete=function(){ +return(this.attributes()&PropertyAttribute.DontDelete)==0; +}; +PropertyMirror.prototype.name=function(){ +return this.name_; +}; +PropertyMirror.prototype.isIndexed=function(){ +for(var a=0;a0; +}; +FrameDetails.prototype.inlinedFrameIndex=function(){ +%CheckExecutionState(this.break_id_); +var a=kFrameDetailsFlagInlinedFrameIndexMask; +return(this.details_[kFrameDetailsFlagsIndex]&a)>>2; +}; +FrameDetails.prototype.argumentCount=function(){ +%CheckExecutionState(this.break_id_); +return this.details_[kFrameDetailsArgumentCountIndex]; +}; +FrameDetails.prototype.argumentName=function(a){ +%CheckExecutionState(this.break_id_); +if(a>=0&&a=0&&a=0&&a=0&&a0){ +for(var c=0;c0){ +a+=this.lineOffset(); +a+='-'; +a+=this.lineOffset()+this.lineCount()-1; +}else{ +a+=this.lineCount(); +} +a+=')'; +return a; +}; +function ContextMirror(a){ +%_CallFunction(this,CONTEXT_TYPE,Mirror); +this.data_=a; +this.allocateHandle_(); +} +inherits(ContextMirror,Mirror); +ContextMirror.prototype.data=function(){ +return this.data_; +}; +function MakeMirrorSerializer(a,b){ +return new JSONProtocolSerializer(a,b); +} +function JSONProtocolSerializer(a,b){ +this.details_=a; +this.options_=b; +this.mirrors_=[]; +} +JSONProtocolSerializer.prototype.serializeReference=function(a){ +return this.serialize_(a,true,true); +}; +JSONProtocolSerializer.prototype.serializeValue=function(a){ +var b=this.serialize_(a,false,true); +return b; +}; +JSONProtocolSerializer.prototype.serializeReferencedObjects=function(){ +var a=[]; +var b=this.mirrors_.length; +for(var c=0;cthis.maxStringLength_()){ +var b=mirror.getTruncatedValue(this.maxStringLength_()); +a.value=b; +a.fromIndex=0; +a.toIndex=this.maxStringLength_(); +}else{ +a.value=mirror.value(); +} +a.length=mirror.length(); +break; +case SYMBOL_TYPE: +a.description=mirror.description(); +break; +case OBJECT_TYPE: +case FUNCTION_TYPE: +case ERROR_TYPE: +case REGEXP_TYPE: +case PROMISE_TYPE: +case GENERATOR_TYPE: +this.serializeObject_(mirror,a,details); +break; +case PROPERTY_TYPE: +case INTERNAL_PROPERTY_TYPE: +throw new Error('PropertyMirror cannot be serialized independently'); +break; +case FRAME_TYPE: +this.serializeFrame_(mirror,a); +break; +case SCOPE_TYPE: +this.serializeScope_(mirror,a); +break; +case SCRIPT_TYPE: +if(mirror.name()){ +a.name=mirror.name(); +} +a.id=mirror.id(); +a.lineOffset=mirror.lineOffset(); +a.columnOffset=mirror.columnOffset(); +a.lineCount=mirror.lineCount(); +if(mirror.data()){ +a.data=mirror.data(); +} +if(this.includeSource_()){ +a.source=mirror.source(); +}else{ +var c=mirror.source().substring(0,80); +a.sourceStart=c; +} +a.sourceLength=mirror.source().length; +a.scriptType=mirror.scriptType(); +a.compilationType=mirror.compilationType(); +if(mirror.compilationType()==1&& +mirror.evalFromScript()){ +a.evalFromScript= +this.serializeReference(mirror.evalFromScript()); +var d=mirror.evalFromLocation(); +if(d){ +a.evalFromLocation={line:d.line, +column:d.column}; +} +if(mirror.evalFromFunctionName()){ +a.evalFromFunctionName=mirror.evalFromFunctionName(); +} +} +if(mirror.context()){ +a.context=this.serializeReference(mirror.context()); +} +break; +case CONTEXT_TYPE: +a.data=mirror.data(); +break; +} +a.text=mirror.toText(); +return a; +}; +JSONProtocolSerializer.prototype.serializeObject_=function(mirror,content, +details){ +content.className=mirror.className(); +content.constructorFunction= +this.serializeReference(mirror.constructorFunction()); +content.protoObject=this.serializeReference(mirror.protoObject()); +content.prototypeObject=this.serializeReference(mirror.prototypeObject()); +if(mirror.hasNamedInterceptor()){ +content.namedInterceptor=true; +} +if(mirror.hasIndexedInterceptor()){ +content.indexedInterceptor=true; +} +if(mirror.isFunction()){ +content.name=mirror.name(); +if(!(mirror.inferredName()===(void 0))){ +content.inferredName=mirror.inferredName(); +} +content.resolved=mirror.resolved(); +if(mirror.resolved()){ +content.source=mirror.source(); +} +if(mirror.script()){ +content.script=this.serializeReference(mirror.script()); +content.scriptId=mirror.script().id(); +serializeLocationFields(mirror.sourceLocation(),content); +} +content.scopes=[]; +for(var a=0;a0){ +var i=[]; +for(var a=0;a0){ +return'Infinity'; +}else{ +return'-Infinity'; +} +} +return a; +} + + liveeditÁø +"use strict"; +Debug.LiveEdit=new function(){ +var a; +var b="stack_update_needs_step_in"; +function ApplyPatchMultiChunk(script,diff_array,new_source,preview_only, +change_log){ +var c=script.source; +var d=GatherCompileInfo(c,script); +var e=BuildCodeInfoTree(d); +var g=new PosTranslator(diff_array); +MarkChangedFunctions(e,g.GetChunks()); +FindLiveSharedInfos(e,script); +var h; +try{ +h=GatherCompileInfo(new_source,script); +}catch(e){ +var i= +new Failure("Failed to compile new version of script: "+e); +if(e instanceof SyntaxError){ +var j={ +type:"liveedit_compile_error", +syntaxErrorMessage:e.message +}; +CopyErrorPositionToDetails(e,j); +i.details=j; +} +throw i; +} +var k=BuildCodeInfoTree(h); +FindCorrespondingFunctions(e,k); +var l=new Array(); +var m=new Array(); +var n=new Array(); +var o=new Array(); +function HarvestTodo(p){ +function CollectDamaged(q){ +m.push(q); +for(var r=0;rI[x].start_position){ +K=x; +} +} +if(K!=r){ +var L=I[K]; +var M=J[K]; +I[K]=I[r]; +J[K]=J[r]; +I[r]=L; +J[r]=M; +} +} +var N=0; +function ResetIndexes(O,P){ +var Q=-1; +while(N=aE.pos1+aE.len1){ +return ay+aE.pos2+aE.len2-aE.pos1-aE.len1; +} +if(!az){ +az=PosTranslator.DefaultInsideChunkHandler; +} +return az(ay,aE); +}; +PosTranslator.DefaultInsideChunkHandler=function(ay,aF){ +Assert(false,"Cannot translate position in changed area"); +}; +PosTranslator.ShiftWithTopInsideChunkHandler= +function(ay,aF){ +return ay-aF.pos1+aF.pos2; +}; +var a={ +UNCHANGED:"unchanged", +SOURCE_CHANGED:"source changed", +CHANGED:"changed", +DAMAGED:"damaged" +}; +function CodeInfoTreeNode(aG,aH,aI){ +this.info=aG; +this.children=aH; +this.array_index=aI; +this.parent=(void 0); +this.status=a.UNCHANGED; +this.status_explanation=(void 0); +this.new_start_pos=(void 0); +this.new_end_pos=(void 0); +this.corresponding_node=(void 0); +this.unmatched_new_nodes=(void 0); +this.textual_corresponding_node=(void 0); +this.textually_unmatched_new_nodes=(void 0); +this.live_shared_function_infos=(void 0); +} +function BuildCodeInfoTree(aJ){ +var aK=0; +function BuildNode(){ +var aL=aK; +aK++; +var aM=new Array(); +while(aK=as.length;}; +this.TranslatePos=function(ay){return ay+aR;}; +}; +function ProcessInternals(aS){ +aS.new_start_pos=aP.TranslatePos( +aS.info.start_position); +var aT=0; +var aU=false; +var aV=false; +while(!aP.done()&& +aP.current().pos1= +aP.current().pos1+aP.current().len1){ +aU=true; +aP.next(); +continue; +}else if(aW.info.start_position<=aP.current().pos1&& +aW.info.end_position>=aP.current().pos1+ +aP.current().len1){ +ProcessInternals(aW); +aV=aV|| +(aW.status!=a.UNCHANGED); +aU=aU|| +(aW.status==a.DAMAGED); +aT++; +continue; +}else{ +aU=true; +aW.status=a.DAMAGED; +aW.status_explanation= +"Text diff overlaps with function boundary"; +aT++; +continue; +} +}else{ +if(aP.current().pos1+aP.current().len1<= +aS.info.end_position){ +aS.status=a.CHANGED; +aP.next(); +continue; +}else{ +aS.status=a.DAMAGED; +aS.status_explanation= +"Text diff overlaps with function boundary"; +return; +} +} +Assert("Unreachable",false); +} +while(aT0){ +return bj; +} +} +function TraverseTree(q){ +q.live_shared_function_infos=FindFunctionInfos(q.info); +for(var r=0;r ["+br+"]"; +} +return; +} +var bs; +function CheckStackActivations(bt,S){ +var bu=new Array(); +for(var r=0;r0){ +S.push({dropped_from_stack:bx}); +} +if(bw.length>0){ +S.push({functions_on_stack:bw}); +throw new Failure("Blocked by functions on stack"); +} +return bx.length; +} +var bs={ +AVAILABLE_FOR_PATCH:1, +BLOCKED_ON_ACTIVE_STACK:2, +BLOCKED_ON_OTHER_STACK:3, +BLOCKED_UNDER_NATIVE_CODE:4, +REPLACED_ON_ACTIVE_STACK:5, +BLOCKED_UNDER_GENERATOR:6, +BLOCKED_ACTIVE_GENERATOR:7 +}; +bs.SymbolName=function(bA){ +var bB=bs; +for(var bC in bB){ +if(bB[bC]==bA){ +return bC; +} +} +}; +function Failure(am){ +this.message=am; +} +this.Failure=Failure; +Failure.prototype.toString=function(){ +return"LiveEdit Failure: "+this.message; +}; +function CopyErrorPositionToDetails(bD,j){ +function createPositionStruct(G,bE){ +if(bE==-1)return; +var bF=G.locationFromPosition(bE,true); +if(bF==null)return; +return{ +line:bF.line+1, +column:bF.column+1, +position:bE +}; +} +if(!("scriptObject"in bD)||!("startPosition"in bD)){ +return; +} +var G=bD.scriptObject; +var bG={ +start:createPositionStruct(G,bD.startPosition), +end:createPositionStruct(G,bD.endPosition) +}; +j.position=bG; +} +function GetPcFromSourcePos(bH,bI){ +return %GetFunctionCodePositionFromSource(bH,bI); +} +this.GetPcFromSourcePos=GetPcFromSourcePos; +function SetScriptSource(G,bJ,bK,S){ +var c=G.source; +var bL=CompareStrings(c,bJ); +return ApplyPatchMultiChunk(G,bL,bJ,bK, +S); +} +this.SetScriptSource=SetScriptSource; +function CompareStrings(bM,bN){ +return %LiveEditCompareStrings(bM,bN); +} +function ApplySingleChunkPatch(G,change_pos,change_len,new_str, +S){ +var c=G.source; +var bJ=c.substring(0,change_pos)+ +new_str+c.substring(change_pos+change_len); +return ApplyPatchMultiChunk(G, +[change_pos,change_pos+change_len,change_pos+new_str.length], +bJ,false,S); +} +function DescribeChangeTree(aX){ +function ProcessOldNode(q){ +var bO=[]; +for(var r=0;r=0&&b<0x800000&& +(%_ClassOf(this)==='Function')){ +return b; +} +} +b=(a==null)?0:%ToUint32(a.length); +if(b>0x800000)throw %MakeRangeError(39); +if(!(%_ClassOf(this)==='Function')){ +throw %MakeTypeError(1,%ToString(this),typeof this); +} +if(a!=null&&!(%_IsSpecObject(a))){ +throw %MakeTypeError(36,"Function.prototype.apply"); +} +return b; +} +function REFLECT_APPLY_PREPARE(a){ +var b; +if((%_IsArray(a))){ +b=a.length; +if(%_IsSmi(b)&&b>=0&&b<0x800000&& +(%_ClassOf(this)==='Function')){ +return b; +} +} +if(!(%_ClassOf(this)==='Function')){ +throw %MakeTypeError(2,%ToString(this)); +} +if(!(%_IsSpecObject(a))){ +throw %MakeTypeError(36,"Reflect.apply"); +} +b=%ToLength(a.length); +if(b>0x800000)throw %MakeRangeError(39); +return b; +} +function REFLECT_CONSTRUCT_PREPARE(a,b){ +var c; +var d=(%_ClassOf(this)==='Function')&&%IsConstructor(this); +var e=(%_ClassOf(b)==='Function')&&%IsConstructor(b); +if((%_IsArray(a))){ +c=a.length; +if(%_IsSmi(c)&&c>=0&&c<0x800000&& +d&&e){ +return c; +} +} +if(!d){ +if(!(%_ClassOf(this)==='Function')){ +throw %MakeTypeError(2,%ToString(this)); +}else{ +throw %MakeTypeError(13,%ToString(this)); +} +} +if(!e){ +if(!(%_ClassOf(b)==='Function')){ +throw %MakeTypeError(2,%ToString(b)); +}else{ +throw %MakeTypeError(13,%ToString(b)); +} +} +if(!(%_IsSpecObject(a))){ +throw %MakeTypeError(36,"Reflect.construct"); +} +c=%ToLength(a.length); +if(c>0x800000)throw %MakeRangeError(39); +return c; +} +function STACK_OVERFLOW(a){ +throw %MakeRangeError(39); +} +function TO_OBJECT(){ +return %ToObject(this); +} +function TO_NUMBER(){ +return %ToNumber(this); +} +function TO_STRING(){ +return %ToString(this); +} +function TO_NAME(){ +return %ToName(this); +} +function ToPrimitive(a,b){ +if((typeof(a)==='string'))return a; +if(!(%_IsSpecObject(a)))return a; +if((%_ClassOf(a)==='Symbol'))throw MakeTypeError(30); +if(b==0)b=((%_ClassOf(a)==='Date'))?2:1; +return(b==1)?%DefaultNumber(a):%DefaultString(a); +} +function ToBoolean(a){ +if((typeof(a)==='boolean'))return a; +if((typeof(a)==='string'))return a.length!=0; +if(a==null)return false; +if((typeof(a)==='number'))return!((a==0)||(!%_IsSmi(%IS_VAR(a))&&!(a==a))); +return true; +} +function ToNumber(a){ +if((typeof(a)==='number'))return a; +if((typeof(a)==='string')){ +return %_HasCachedArrayIndex(a)?%_GetCachedArrayIndex(a) +:%StringToNumber(a); +} +if((typeof(a)==='boolean'))return a?1:0; +if((a===(void 0)))return $NaN; +if((typeof(a)==='symbol'))throw MakeTypeError(31); +return((a===null))?0:ToNumber(%DefaultNumber(a)); +} +function NonNumberToNumber(a){ +if((typeof(a)==='string')){ +return %_HasCachedArrayIndex(a)?%_GetCachedArrayIndex(a) +:%StringToNumber(a); +} +if((typeof(a)==='boolean'))return a?1:0; +if((a===(void 0)))return $NaN; +if((typeof(a)==='symbol'))throw MakeTypeError(31); +return((a===null))?0:ToNumber(%DefaultNumber(a)); +} +function ToString(a){ +if((typeof(a)==='string'))return a; +if((typeof(a)==='number'))return %_NumberToString(a); +if((typeof(a)==='boolean'))return a?'true':'false'; +if((a===(void 0)))return'undefined'; +if((typeof(a)==='symbol'))throw %MakeTypeError(32); +return((a===null))?'null':%ToString(%DefaultString(a)); +} +function NonStringToString(a){ +if((typeof(a)==='number'))return %_NumberToString(a); +if((typeof(a)==='boolean'))return a?'true':'false'; +if((a===(void 0)))return'undefined'; +if((typeof(a)==='symbol'))throw %MakeTypeError(32); +return((a===null))?'null':%ToString(%DefaultString(a)); +} +function ToName(a){ +return(typeof(a)==='symbol')?a:%ToString(a); +} +function ToObject(a){ +if((typeof(a)==='string'))return new $String(a); +if((typeof(a)==='number'))return new $Number(a); +if((typeof(a)==='boolean'))return new $Boolean(a); +if((typeof(a)==='symbol'))return %NewSymbolWrapper(a); +if((a==null)&&!(%_IsUndetectableObject(a))){ +throw %MakeTypeError(33); +} +return a; +} +function ToInteger(a){ +if(%_IsSmi(a))return a; +return %NumberToInteger(ToNumber(a)); +} +function ToLength(a){ +a=ToInteger(a); +if(a<0)return 0; +return a<$Number.MAX_SAFE_INTEGER?a:$Number.MAX_SAFE_INTEGER; +} +function ToUint32(a){ +if(%_IsSmi(a)&&a>=0)return a; +return %NumberToJSUint32(ToNumber(a)); +} +function ToInt32(a){ +if(%_IsSmi(a))return a; +return %NumberToJSInt32(ToNumber(a)); +} +function SameValue(a,b){ +if(typeof a!=typeof b)return false; +if((typeof(a)==='number')){ +if((!%_IsSmi(%IS_VAR(a))&&!(a==a))&&(!%_IsSmi(%IS_VAR(b))&&!(b==b)))return true; +if(a===0&&b===0&&%_IsMinusZero(a)!=%_IsMinusZero(b)){ +return false; +} +} +return a===b; +} +function SameValueZero(a,b){ +if(typeof a!=typeof b)return false; +if((typeof(a)==='number')){ +if((!%_IsSmi(%IS_VAR(a))&&!(a==a))&&(!%_IsSmi(%IS_VAR(b))&&!(b==b)))return true; +} +return a===b; +} +function IsPrimitive(a){ +return!(%_IsSpecObject(a)); +} +function IsConcatSpreadable(a){ +if(!(%_IsSpecObject(a)))return false; +var b=a[symbolIsConcatSpreadable]; +if((b===(void 0)))return(%_IsArray(a)); +return ToBoolean(b); +} +function DefaultNumber(a){ +if(!(%_ClassOf(a)==='Symbol')){ +var b=a.valueOf; +if((%_ClassOf(b)==='Function')){ +var c=%_CallFunction(a,b); +if(%IsPrimitive(c))return c; +} +var d=a.toString; +if((%_ClassOf(d)==='Function')){ +var e=%_CallFunction(a,d); +if(%IsPrimitive(e))return e; +} +} +throw %MakeTypeError(4); +} +function DefaultString(a){ +if(!(%_ClassOf(a)==='Symbol')){ +var b=a.toString; +if((%_ClassOf(b)==='Function')){ +var c=%_CallFunction(a,b); +if(%IsPrimitive(c))return c; +} +var d=a.valueOf; +if((%_ClassOf(d)==='Function')){ +var e=%_CallFunction(a,d); +if(%IsPrimitive(e))return e; +} +} +throw %MakeTypeError(4); +} +function ToPositiveInteger(a,b){ +var c=(%_IsSmi(%IS_VAR(a))?a:%NumberToIntegerMapMinusZero(ToNumber(a))); +if(c<0)throw MakeRangeError(b); +return c; +} +%FunctionSetPrototype($Array,new $Array(0)); +function STRING_LENGTH_STUB(a){ +var b=this; +return %_StringGetLength(%_JSValueGetValue(b)); +} + +$v8nativesbè +var $isNaN=GlobalIsNaN; +var $isFinite=GlobalIsFinite; +function InstallFunctions(a,b,c){ +if(c.length>=8){ +%OptimizeObjectForAddingMultipleProperties(a,c.length>>1); +} +for(var d=0;d=4){ +%OptimizeObjectForAddingMultipleProperties(a,b.length>>1); +} +var c=2|4|1; +for(var d=0;d>1)+(b?b.length:0); +if(e>=4){ +%OptimizeObjectForAddingMultipleProperties(d,e); +} +if(b){ +for(var g=0;g>0)); +if(!(b==0||(2<=b&&b<=36))){ +return $NaN; +} +} +if(%_HasCachedArrayIndex(a)&& +(b==0||b==10)){ +return %_GetCachedArrayIndex(a); +} +return %StringParseInt(a,b); +} +function GlobalParseFloat(a){ +a=((typeof(%IS_VAR(a))==='string')?a:NonStringToString(a)); +if(%_HasCachedArrayIndex(a))return %_GetCachedArrayIndex(a); +return %StringParseFloat(a); +} +function GlobalEval(a){ +if(!(typeof(a)==='string'))return a; +var b=%GlobalProxy(global); +var c=%CompileString(a,false); +if(!(%_IsFunction(c)))return c; +return %_CallFunction(b,c); +} +function SetUpGlobal(){ +%CheckIsBootstrapping(); +var a=2|4|1; +%AddNamedProperty(global,"NaN",$NaN,a); +%AddNamedProperty(global,"Infinity",(1/0),a); +%AddNamedProperty(global,"undefined",(void 0),a); +InstallFunctions(global,2,[ +"isNaN",GlobalIsNaN, +"isFinite",GlobalIsFinite, +"parseInt",GlobalParseInt, +"parseFloat",GlobalParseFloat, +"eval",GlobalEval +]); +} +SetUpGlobal(); +function NoSideEffectsObjectToString(){ +if((this===(void 0))&&!(%_IsUndetectableObject(this)))return"[object Undefined]"; +if((this===null))return"[object Null]"; +return"[object "+%_ClassOf(((%_IsSpecObject(%IS_VAR(this)))?this:ToObject(this)))+"]"; +} +function ObjectToString(){ +if((this===(void 0))&&!(%_IsUndetectableObject(this)))return"[object Undefined]"; +if((this===null))return"[object Null]"; +var a=((%_IsSpecObject(%IS_VAR(this)))?this:ToObject(this)); +var b=%_ClassOf(a); +var c; +if(harmony_tostring){ +var c=a[symbolToStringTag]; +if(!(typeof(c)==='string')){ +c=b; +} +}else{ +c=b; +} +return`[object ${c}]`; +} +function ObjectToLocaleString(){ +if((this==null)&&!(%_IsUndetectableObject(this)))throw MakeTypeError('called_on_null_or_undefined',["Object.prototype.toLocaleString"]); +return this.toString(); +} +function ObjectValueOf(){ +return((%_IsSpecObject(%IS_VAR(this)))?this:ToObject(this)); +} +function ObjectHasOwnProperty(a){ +if(%_IsJSProxy(this)){ +if((typeof(a)==='symbol'))return false; +var b=%GetHandler(this); +return CallTrap1(b,"hasOwn",$proxyDerivedHasOwnTrap,ToName(a)); +} +return %HasOwnProperty(((%_IsSpecObject(%IS_VAR(this)))?this:ToObject(this)),ToName(a)); +} +function ObjectIsPrototypeOf(a){ +if(!(%_IsSpecObject(a)))return false; +if((this==null)&&!(%_IsUndetectableObject(this)))throw MakeTypeError('called_on_null_or_undefined',["Object.prototype.isPrototypeOf"]); +return %IsInPrototypeChain(this,a); +} +function ObjectPropertyIsEnumerable(a){ +var b=ToName(a); +if(%_IsJSProxy(this)){ +if((typeof(a)==='symbol'))return false; +var c=GetOwnPropertyJS(this,b); +return(c===(void 0))?false:c.isEnumerable(); +} +return %IsPropertyEnumerable(((%_IsSpecObject(%IS_VAR(this)))?this:ToObject(this)),b); +} +function ObjectDefineGetter(a,b){ +var c=this; +if(c==null&&!(%_IsUndetectableObject(c))){ +c=%GlobalProxy(global); +} +if(!(%_ClassOf(b)==='Function')){ +throw MakeTypeError(16); +} +var d=new PropertyDescriptor(); +d.setGet(b); +d.setEnumerable(true); +d.setConfigurable(true); +DefineOwnProperty(((%_IsSpecObject(%IS_VAR(c)))?c:ToObject(c)),ToName(a),d,false); +} +function ObjectLookupGetter(a){ +var b=this; +if(b==null&&!(%_IsUndetectableObject(b))){ +b=%GlobalProxy(global); +} +return %LookupAccessor(((%_IsSpecObject(%IS_VAR(b)))?b:ToObject(b)),ToName(a),0); +} +function ObjectDefineSetter(a,b){ +var c=this; +if(c==null&&!(%_IsUndetectableObject(c))){ +c=%GlobalProxy(global); +} +if(!(%_ClassOf(b)==='Function')){ +throw MakeTypeError(18); +} +var d=new PropertyDescriptor(); +d.setSet(b); +d.setEnumerable(true); +d.setConfigurable(true); +DefineOwnProperty(((%_IsSpecObject(%IS_VAR(c)))?c:ToObject(c)),ToName(a),d,false); +} +function ObjectLookupSetter(a){ +var b=this; +if(b==null&&!(%_IsUndetectableObject(b))){ +b=%GlobalProxy(global); +} +return %LookupAccessor(((%_IsSpecObject(%IS_VAR(b)))?b:ToObject(b)),ToName(a),1); +} +function ObjectKeys(a){ +a=((%_IsSpecObject(%IS_VAR(a)))?a:ToObject(a)); +if(%_IsJSProxy(a)){ +var b=%GetHandler(a); +var c=CallTrap0(b,"keys",$proxyDerivedKeysTrap); +return ToNameArray(c,"keys",false); +} +return %OwnKeys(a); +} +function IsAccessorDescriptor(a){ +if((a===(void 0)))return false; +return a.hasGetter()||a.hasSetter(); +} +function IsDataDescriptor(a){ +if((a===(void 0)))return false; +return a.hasValue()||a.hasWritable(); +} +function IsGenericDescriptor(a){ +if((a===(void 0)))return false; +return!(IsAccessorDescriptor(a)||IsDataDescriptor(a)); +} +function IsInconsistentDescriptor(a){ +return IsAccessorDescriptor(a)&&IsDataDescriptor(a); +} +function FromPropertyDescriptor(a){ +if((a===(void 0)))return a; +if(IsDataDescriptor(a)){ +return{value:a.getValue(), +writable:a.isWritable(), +enumerable:a.isEnumerable(), +configurable:a.isConfigurable()}; +} +return{get:a.getGet(), +set:a.getSet(), +enumerable:a.isEnumerable(), +configurable:a.isConfigurable()}; +} +function FromGenericPropertyDescriptor(a){ +if((a===(void 0)))return a; +var b=new $Object(); +if(a.hasValue()){ +%AddNamedProperty(b,"value",a.getValue(),0); +} +if(a.hasWritable()){ +%AddNamedProperty(b,"writable",a.isWritable(),0); +} +if(a.hasGetter()){ +%AddNamedProperty(b,"get",a.getGet(),0); +} +if(a.hasSetter()){ +%AddNamedProperty(b,"set",a.getSet(),0); +} +if(a.hasEnumerable()){ +%AddNamedProperty(b,"enumerable",a.isEnumerable(),0); +} +if(a.hasConfigurable()){ +%AddNamedProperty(b,"configurable",a.isConfigurable(),0); +} +return b; +} +function ToPropertyDescriptor(a){ +if(!(%_IsSpecObject(a)))throw MakeTypeError(20,a); +var b=new PropertyDescriptor(); +if("enumerable"in a){ +b.setEnumerable(ToBoolean(a.enumerable)); +} +if("configurable"in a){ +b.setConfigurable(ToBoolean(a.configurable)); +} +if("value"in a){ +b.setValue(a.value); +} +if("writable"in a){ +b.setWritable(ToBoolean(a.writable)); +} +if("get"in a){ +var c=a.get; +if(!(c===(void 0))&&!(%_ClassOf(c)==='Function')){ +throw MakeTypeError(17,c); +} +b.setGet(c); +} +if("set"in a){ +var d=a.set; +if(!(d===(void 0))&&!(%_ClassOf(d)==='Function')){ +throw MakeTypeError(19,d); +} +b.setSet(d); +} +if(IsInconsistentDescriptor(b)){ +throw MakeTypeError(34,a); +} +return b; +} +function ToCompletePropertyDescriptor(a){ +var b=ToPropertyDescriptor(a); +if(IsGenericDescriptor(b)||IsDataDescriptor(b)){ +if(!b.hasValue())b.setValue((void 0)); +if(!b.hasWritable())b.setWritable(false); +}else{ +if(!b.hasGetter())b.setGet((void 0)); +if(!b.hasSetter())b.setSet((void 0)); +} +if(!b.hasEnumerable())b.setEnumerable(false); +if(!b.hasConfigurable())b.setConfigurable(false); +return b; +} +function PropertyDescriptor(){ +this.value_=(void 0); +this.hasValue_=false; +this.writable_=false; +this.hasWritable_=false; +this.enumerable_=false; +this.hasEnumerable_=false; +this.configurable_=false; +this.hasConfigurable_=false; +this.get_=(void 0); +this.hasGetter_=false; +this.set_=(void 0); +this.hasSetter_=false; +} +SetUpLockedPrototype(PropertyDescriptor,[ +"value_", +"hasValue_", +"writable_", +"hasWritable_", +"enumerable_", +"hasEnumerable_", +"configurable_", +"hasConfigurable_", +"get_", +"hasGetter_", +"set_", +"hasSetter_" +],[ +"toString",function PropertyDescriptor_ToString(){ +return"[object PropertyDescriptor]"; +}, +"setValue",function PropertyDescriptor_SetValue(a){ +this.value_=a; +this.hasValue_=true; +}, +"getValue",function PropertyDescriptor_GetValue(){ +return this.value_; +}, +"hasValue",function PropertyDescriptor_HasValue(){ +return this.hasValue_; +}, +"setEnumerable",function PropertyDescriptor_SetEnumerable(a){ +this.enumerable_=a; +this.hasEnumerable_=true; +}, +"isEnumerable",function PropertyDescriptor_IsEnumerable(){ +return this.enumerable_; +}, +"hasEnumerable",function PropertyDescriptor_HasEnumerable(){ +return this.hasEnumerable_; +}, +"setWritable",function PropertyDescriptor_SetWritable(a){ +this.writable_=a; +this.hasWritable_=true; +}, +"isWritable",function PropertyDescriptor_IsWritable(){ +return this.writable_; +}, +"hasWritable",function PropertyDescriptor_HasWritable(){ +return this.hasWritable_; +}, +"setConfigurable", +function PropertyDescriptor_SetConfigurable(a){ +this.configurable_=a; +this.hasConfigurable_=true; +}, +"hasConfigurable",function PropertyDescriptor_HasConfigurable(){ +return this.hasConfigurable_; +}, +"isConfigurable",function PropertyDescriptor_IsConfigurable(){ +return this.configurable_; +}, +"setGet",function PropertyDescriptor_SetGetter(a){ +this.get_=a; +this.hasGetter_=true; +}, +"getGet",function PropertyDescriptor_GetGetter(){ +return this.get_; +}, +"hasGetter",function PropertyDescriptor_HasGetter(){ +return this.hasGetter_; +}, +"setSet",function PropertyDescriptor_SetSetter(a){ +this.set_=a; +this.hasSetter_=true; +}, +"getSet",function PropertyDescriptor_GetSetter(){ +return this.set_; +}, +"hasSetter",function PropertyDescriptor_HasSetter(){ +return this.hasSetter_; +} +]); +function ConvertDescriptorArrayToDescriptor(a){ +if((a===(void 0))){ +return(void 0); +} +var b=new PropertyDescriptor(); +if(a[0]){ +b.setGet(a[2]); +b.setSet(a[3]); +}else{ +b.setValue(a[1]); +b.setWritable(a[4]); +} +b.setEnumerable(a[5]); +b.setConfigurable(a[6]); +return b; +} +function GetTrap(a,b,c){ +var d=a[b]; +if((d===(void 0))){ +if((c===(void 0))){ +throw MakeTypeError(24,a,b); +} +d=c; +}else if(!(%_ClassOf(d)==='Function')){ +throw MakeTypeError(25,a,b); +} +return d; +} +function CallTrap0(a,b,c){ +return %_CallFunction(a,GetTrap(a,b,c)); +} +function CallTrap1(a,b,c,d){ +return %_CallFunction(a,d,GetTrap(a,b,c)); +} +function CallTrap2(a,b,c,d,e){ +return %_CallFunction(a,d,e,GetTrap(a,b,c)); +} +function GetOwnPropertyJS(a,b){ +var c=ToName(b); +if(%_IsJSProxy(a)){ +if((typeof(b)==='symbol'))return(void 0); +var d=%GetHandler(a); +var e=CallTrap1( +d,"getOwnPropertyDescriptor",(void 0),c); +if((e===(void 0)))return e; +var g=ToCompletePropertyDescriptor(e); +if(!g.isConfigurable()){ +throw MakeTypeError(28, +d,c,"getOwnPropertyDescriptor"); +} +return g; +} +var h=%GetOwnProperty(((%_IsSpecObject(%IS_VAR(a)))?a:ToObject(a)),c); +return ConvertDescriptorArrayToDescriptor(h); +} +function Delete(a,b,c){ +var d=GetOwnPropertyJS(a,b); +if((d===(void 0)))return true; +if(d.isConfigurable()){ +%DeleteProperty(a,b,0); +return true; +}else if(c){ +throw MakeTypeError(5,b); +}else{ +return; +} +} +function GetMethod(a,b){ +var c=a[b]; +if((c==null))return(void 0); +if((%_ClassOf(c)==='Function'))return c; +throw MakeTypeError(2,typeof c); +} +function DefineProxyProperty(a,b,c,d){ +if((typeof(b)==='symbol'))return false; +var e=%GetHandler(a); +var g=CallTrap2(e,"defineProperty",(void 0),b,c); +if(!ToBoolean(g)){ +if(d){ +throw MakeTypeError(23, +e,"false","defineProperty"); +}else{ +return false; +} +} +return true; +} +function DefineObjectProperty(a,b,c,d){ +var e=%GetOwnProperty(a,ToName(b)); +var g=ConvertDescriptorArrayToDescriptor(e); +var h=%IsExtensible(a); +if((g===(void 0))&&!h){ +if(d){ +throw MakeTypeError(5,b); +}else{ +return false; +} +} +if(!(g===(void 0))){ +if((IsGenericDescriptor(c)|| +IsDataDescriptor(c)==IsDataDescriptor(g))&& +(!c.hasEnumerable()|| +SameValue(c.isEnumerable(),g.isEnumerable()))&& +(!c.hasConfigurable()|| +SameValue(c.isConfigurable(),g.isConfigurable()))&& +(!c.hasWritable()|| +SameValue(c.isWritable(),g.isWritable()))&& +(!c.hasValue()|| +SameValue(c.getValue(),g.getValue()))&& +(!c.hasGetter()|| +SameValue(c.getGet(),g.getGet()))&& +(!c.hasSetter()|| +SameValue(c.getSet(),g.getSet()))){ +return true; +} +if(!g.isConfigurable()){ +if(c.isConfigurable()|| +(c.hasEnumerable()&& +c.isEnumerable()!=g.isEnumerable())){ +if(d){ +throw MakeTypeError(29,b); +}else{ +return false; +} +} +if(!IsGenericDescriptor(c)){ +if(IsDataDescriptor(g)!=IsDataDescriptor(c)){ +if(d){ +throw MakeTypeError(29,b); +}else{ +return false; +} +} +if(IsDataDescriptor(g)&&IsDataDescriptor(c)){ +if(!g.isWritable()&&c.isWritable()){ +if(d){ +throw MakeTypeError(29,b); +}else{ +return false; +} +} +if(!g.isWritable()&&c.hasValue()&& +!SameValue(c.getValue(),g.getValue())){ +if(d){ +throw MakeTypeError(29,b); +}else{ +return false; +} +} +} +if(IsAccessorDescriptor(c)&&IsAccessorDescriptor(g)){ +if(c.hasSetter()&&!SameValue(c.getSet(),g.getSet())){ +if(d){ +throw MakeTypeError(29,b); +}else{ +return false; +} +} +if(c.hasGetter()&&!SameValue(c.getGet(),g.getGet())){ +if(d){ +throw MakeTypeError(29,b); +}else{ +return false; +} +} +} +} +} +} +var i=0; +if(c.hasEnumerable()){ +i|=c.isEnumerable()?0:2; +}else if(!(g===(void 0))){ +i|=g.isEnumerable()?0:2; +}else{ +i|=2; +} +if(c.hasConfigurable()){ +i|=c.isConfigurable()?0:4; +}else if(!(g===(void 0))){ +i|=g.isConfigurable()?0:4; +}else +i|=4; +if(IsDataDescriptor(c)|| +(IsGenericDescriptor(c)&& +((g===(void 0))||IsDataDescriptor(g)))){ +if(c.hasWritable()){ +i|=c.isWritable()?0:1; +}else if(!(g===(void 0))){ +i|=g.isWritable()?0:1; +}else{ +i|=1; +} +var j=(void 0); +if(c.hasValue()){ +j=c.getValue(); +}else if(!(g===(void 0))&&IsDataDescriptor(g)){ +j=g.getValue(); +} +%DefineDataPropertyUnchecked(a,b,j,i); +}else{ +var k=null; +if(c.hasGetter()){ +k=c.getGet(); +}else if(IsAccessorDescriptor(g)&&g.hasGetter()){ +k=g.getGet(); +} +var l=null; +if(c.hasSetter()){ +l=c.getSet(); +}else if(IsAccessorDescriptor(g)&&g.hasSetter()){ +l=g.getSet(); +} +%DefineAccessorPropertyUnchecked(a,b,k,l,i); +} +return true; +} +function DefineArrayProperty(a,b,c,d){ +if(b==="length"){ +var e=a.length; +var g=e; +if(!c.hasValue()){ +return DefineObjectProperty(a,"length",c,d); +} +var h=ToUint32(c.getValue()); +if(h!=ToNumber(c.getValue())){ +throw MakeRangeError(37); +} +var i=GetOwnPropertyJS(a,"length"); +if(h!=e&&!i.isWritable()){ +if(d){ +throw MakeTypeError(29,b); +}else{ +return false; +} +} +var j=false; +var k=%IsObserved(a)&&h!==g; +var l; +if(k){ +$observeBeginPerformSplice(a); +l=[]; +if(hg?h-g:0); +} +if(j){ +if(d){ +throw MakeTypeError(29,b); +}else{ +return false; +} +} +return true; +} +if(!(typeof(b)==='symbol')){ +var m=ToUint32(b); +var k=false; +if(ToString(m)==b&&m!=4294967295){ +var e=a.length; +if(m>=e&&%IsObserved(a)){ +k=true; +$observeBeginPerformSplice(a); +} +var i=GetOwnPropertyJS(a,"length"); +if((m>=e&&!i.isWritable())|| +!DefineObjectProperty(a,b,c,true)){ +if(k) +$observeEndPerformSplice(a); +if(d){ +throw MakeTypeError(5,b); +}else{ +return false; +} +} +if(m>=e){ +a.length=m+1; +} +if(k){ +$observeEndPerformSplice(a); +$observeEnqueueSpliceRecord(a,e,[],m+1-e); +} +return true; +} +} +return DefineObjectProperty(a,b,c,d); +} +function DefineOwnProperty(a,b,c,d){ +if(%_IsJSProxy(a)){ +if((typeof(b)==='symbol'))return false; +var e=FromGenericPropertyDescriptor(c); +return DefineProxyProperty(a,b,e,d); +}else if((%_IsArray(a))){ +return DefineArrayProperty(a,b,c,d); +}else{ +return DefineObjectProperty(a,b,c,d); +} +} +function ObjectGetPrototypeOf(a){ +return %_GetPrototype(((%_IsSpecObject(%IS_VAR(a)))?a:ToObject(a))); +} +function ObjectSetPrototypeOf(a,b){ +if((a==null)&&!(%_IsUndetectableObject(a)))throw MakeTypeError('called_on_null_or_undefined',["Object.setPrototypeOf"]); +if(b!==null&&!(%_IsSpecObject(b))){ +throw MakeTypeError(22,b); +} +if((%_IsSpecObject(a))){ +%SetPrototype(a,b); +} +return a; +} +function ObjectGetOwnPropertyDescriptor(a,b){ +var c=GetOwnPropertyJS(((%_IsSpecObject(%IS_VAR(a)))?a:ToObject(a)),b); +return FromPropertyDescriptor(c); +} +function ToNameArray(a,b,c){ +if(!(%_IsSpecObject(a))){ +throw MakeTypeError(26,b,a); +} +var d=ToUint32(a.length); +var e=new $Array(d); +var g=0; +var h={__proto__:null}; +for(var i=0;i36){ +throw new $RangeError('toString() radix argument must be between 2 and 36'); +} +return %NumberToRadixString(b,a); +} +function NumberToLocaleString(){ +return %_CallFunction(this,NumberToStringJS); +} +function NumberValueOf(){ +if(!(typeof(this)==='number')&&!(%_ClassOf(this)==='Number')){ +throw MakeTypeError(14,'Number.prototype.valueOf'); +} +return %_ValueOf(this); +} +function NumberToFixedJS(a){ +var b=this; +if(!(typeof(this)==='number')){ +if(!(%_ClassOf(this)==='Number')){ +throw MakeTypeError(8, +"Number.prototype.toFixed",this); +} +b=%_ValueOf(this); +} +var c=(%_IsSmi(%IS_VAR(a))?a:%NumberToInteger(ToNumber(a))); +if(c<0||c>20){ +throw MakeRangeError(38,"toFixed() digits"); +} +if((!%_IsSmi(%IS_VAR(b))&&!(b==b)))return"NaN"; +if(b==(1/0))return"Infinity"; +if(b==-(1/0))return"-Infinity"; +return %NumberToFixed(b,c); +} +function NumberToExponentialJS(a){ +var b=this; +if(!(typeof(this)==='number')){ +if(!(%_ClassOf(this)==='Number')){ +throw MakeTypeError(8, +"Number.prototype.toExponential",this); +} +b=%_ValueOf(this); +} +var c=(a===(void 0))?(void 0):(%_IsSmi(%IS_VAR(a))?a:%NumberToInteger(ToNumber(a))); +if((!%_IsSmi(%IS_VAR(b))&&!(b==b)))return"NaN"; +if(b==(1/0))return"Infinity"; +if(b==-(1/0))return"-Infinity"; +if((c===(void 0))){ +c=-1; +}else if(c<0||c>20){ +throw MakeRangeError(38,"toExponential()"); +} +return %NumberToExponential(b,c); +} +function NumberToPrecisionJS(a){ +var b=this; +if(!(typeof(this)==='number')){ +if(!(%_ClassOf(this)==='Number')){ +throw MakeTypeError(8, +"Number.prototype.toPrecision",this); +} +b=%_ValueOf(this); +} +if((a===(void 0)))return ToString(%_ValueOf(this)); +var c=(%_IsSmi(%IS_VAR(a))?a:%NumberToInteger(ToNumber(a))); +if((!%_IsSmi(%IS_VAR(b))&&!(b==b)))return"NaN"; +if(b==(1/0))return"Infinity"; +if(b==-(1/0))return"-Infinity"; +if(c<1||c>21){ +throw MakeRangeError(40); +} +return %NumberToPrecision(b,c); +} +function NumberIsFinite(a){ +return(typeof(a)==='number')&&(%_IsSmi(%IS_VAR(a))||((a==a)&&(a!=1/0)&&(a!=-1/0))); +} +function NumberIsInteger(a){ +return NumberIsFinite(a)&&(%_IsSmi(%IS_VAR(a))?a:%NumberToInteger(ToNumber(a)))==a; +} +function NumberIsNaN(a){ +return(typeof(a)==='number')&&(!%_IsSmi(%IS_VAR(a))&&!(a==a)); +} +function NumberIsSafeInteger(a){ +if(NumberIsFinite(a)){ +var b=(%_IsSmi(%IS_VAR(a))?a:%NumberToInteger(ToNumber(a))); +if(b==a)return $abs(b)<=$Number.MAX_SAFE_INTEGER; +} +return false; +} +function SetUpNumber(){ +%CheckIsBootstrapping(); +%SetCode($Number,NumberConstructor); +%FunctionSetPrototype($Number,new $Number(0)); +%OptimizeObjectForAddingMultipleProperties($Number.prototype,8); +%AddNamedProperty($Number.prototype,"constructor",$Number,2); +InstallConstants($Number,[ +"MAX_VALUE",1.7976931348623157e+308, +"MIN_VALUE",5e-324, +"NaN",$NaN, +"NEGATIVE_INFINITY",-(1/0), +"POSITIVE_INFINITY",(1/0), +"MAX_SAFE_INTEGER",%_MathPow(2,53)-1, +"MIN_SAFE_INTEGER",-%_MathPow(2,53)+1, +"EPSILON",%_MathPow(2,-52) +]); +InstallFunctions($Number.prototype,2,[ +"toString",NumberToStringJS, +"toLocaleString",NumberToLocaleString, +"valueOf",NumberValueOf, +"toFixed",NumberToFixedJS, +"toExponential",NumberToExponentialJS, +"toPrecision",NumberToPrecisionJS +]); +InstallFunctions($Number,2,[ +"isFinite",NumberIsFinite, +"isInteger",NumberIsInteger, +"isNaN",NumberIsNaN, +"isSafeInteger",NumberIsSafeInteger, +"parseInt",GlobalParseInt, +"parseFloat",GlobalParseFloat +]); +%SetInlineBuiltinFlag(NumberIsNaN); +} +SetUpNumber(); +function FunctionSourceString(a){ +while(%IsJSFunctionProxy(a)){ +a=%GetCallTrap(a); +} +if(!(%_IsFunction(a))){ +throw MakeTypeError(14,'Function.prototype.toString'); +} +var b=%ClassGetSourceCode(a); +if((typeof(b)==='string')){ +return b; +} +var c=%FunctionGetSourceCode(a); +if(!(typeof(c)==='string')||%FunctionIsBuiltin(a)){ +var d=%FunctionGetName(a); +if(d){ +return'function '+d+'() { [native code] }'; +}else{ +return'function () { [native code] }'; +} +} +if(%FunctionIsArrow(a)){ +return c; +} +var d=%FunctionNameShouldPrintAsAnonymous(a) +?'anonymous' +:%FunctionGetName(a); +var e=%FunctionIsGenerator(a); +var g=%FunctionIsConciseMethod(a) +?(e?'*':'') +:(e?'function* ':'function '); +return g+d+c; +} +function FunctionToString(){ +return FunctionSourceString(this); +} +function FunctionBind(a){ +if(!(%_ClassOf(this)==='Function'))throw MakeTypeError(7); +var b=function(){ +"use strict"; +if(%_IsConstructCall()){ +return %NewObjectFromBound(b); +} +var c=%BoundFunctionGetBindings(b); +var d=%_ArgumentsLength(); +if(d==0){ +return %Apply(c[0],c[1],c,2,c.length-2); +} +if(c.length===2){ +return %Apply(c[0],c[1],arguments,0,d); +} +var e=c.length-2; +var g=new InternalArray(e+d); +for(var h=0;h>>0)===k)){ +var d=%_ArgumentsLength(); +if(d>0)d--; +j=k-d; +if(j<0)j=0; +} +var l=%FunctionBindArguments(b,this, +a,j); +return l; +} +function NewFunctionString(a,b){ +var c=a.length; +var d=''; +if(c>1){ +d=ToString(a[0]); +for(var e=1;e0)?ToString(a[c-1]):''; +return'('+b+'('+d+') {\n'+g+'\n})'; +} +function FunctionConstructor(a){ +var b=NewFunctionString(arguments,'function'); +var c=%GlobalProxy(global); +var d=%_CallFunction(c,%CompileString(b,true)); +%FunctionMarkNameShouldPrintAsAnonymous(d); +return d; +} +function SetUpFunction(){ +%CheckIsBootstrapping(); +%SetCode($Function,FunctionConstructor); +%AddNamedProperty($Function.prototype,"constructor",$Function,2); +InstallFunctions($Function.prototype,2,[ +"bind",FunctionBind, +"toString",FunctionToString +]); +} +SetUpFunction(); +function GetIterator(a,b){ +if((b===(void 0))){ +b=a[symbolIterator]; +} +if(!(%_ClassOf(b)==='Function')){ +throw MakeTypeError(15,a); +} +var c=%_CallFunction(a,b); +if(!(%_IsSpecObject(c))){ +throw MakeTypeError(12,c); +} +return c; +} + +symbol­ +var $symbolToString; +(function(){ +"use strict"; +%CheckIsBootstrapping(); +var a=global.Object; +var b=global.Symbol; +function SymbolConstructor(c){ +if(%_IsConstructCall())throw MakeTypeError(13,"Symbol"); +return %CreateSymbol((c===(void 0))?c:ToString(c)); +} +function SymbolToString(){ +if(!((typeof(this)==='symbol')||(%_ClassOf(this)==='Symbol'))){ +throw MakeTypeError(8, +"Symbol.prototype.toString",this); +} +var d=%SymbolDescription(%_ValueOf(this)); +return"Symbol("+((d===(void 0))?"":d)+")"; +} +function SymbolValueOf(){ +if(!((typeof(this)==='symbol')||(%_ClassOf(this)==='Symbol'))){ +throw MakeTypeError(8, +"Symbol.prototype.valueOf",this); +} +return %_ValueOf(this); +} +function SymbolFor(e){ +e=((typeof(%IS_VAR(e))==='string')?e:NonStringToString(e)); +var g=%SymbolRegistry(); +if((g.for[e]===(void 0))){ +var h=%CreateSymbol(e); +g.for[e]=h; +g.keyFor[h]=e; +} +return g.for[e]; +} +function SymbolKeyFor(h){ +if(!(typeof(h)==='symbol'))throw MakeTypeError("not_a_symbol",[h]); +return %SymbolRegistry().keyFor[h]; +} +function ObjectGetOwnPropertySymbols(i){ +i=ToObject(i); +return ObjectGetOwnPropertyKeys(i,8); +} +%SetCode(b,SymbolConstructor); +%FunctionSetPrototype(b,new a()); +InstallConstants(b,[ +"iterator",symbolIterator, +"unscopables",symbolUnscopables +]); +InstallFunctions(b,2,[ +"for",SymbolFor, +"keyFor",SymbolKeyFor +]); +%AddNamedProperty( +b.prototype,"constructor",b,2); +%AddNamedProperty( +b.prototype,symbolToStringTag,"Symbol",2|1); +InstallFunctions(b.prototype,2,[ +"toString",SymbolToString, +"valueOf",SymbolValueOf +]); +InstallFunctions(a,2,[ +"getOwnPropertySymbols",ObjectGetOwnPropertySymbols +]); +$symbolToString=SymbolToString; +})(); + +array¾… +var $arrayConcat; +var $arrayJoin; +var $arrayPush; +var $arrayPop; +var $arrayShift; +var $arraySlice; +var $arraySplice; +var $arrayUnshift; +(function(){ +"use strict"; +%CheckIsBootstrapping(); +var a=global.Array; +var b=new InternalArray(); +function GetSortedArrayKeys(c,d){ +var e=new InternalArray(); +if((typeof(d)==='number')){ +var g=d; +for(var h=0;h>2; +var G=%EstimateNumberOfElements(c); +return(GG*4); +} +function Join(c,j,r,q){ +if(j==0)return''; +var C=(%_IsArray(c)); +if(C){ +if(!%PushIfAbsent(b,c))return''; +} +try{ +if(UseSparseVariant(c,j,C,j)){ +%NormalizeElements(c); +if(r.length==0){ +return SparseJoin(c,j,q); +}else{ +return SparseJoinWithSeparatorJS(c,j,q,r); +} +} +if(j==1){ +var i=c[0]; +if((typeof(i)==='string'))return i; +return q(i); +} +var u=new InternalArray(j); +if(r.length==0){ +var B=0; +for(var h=0;h=K){ +var N=c[l]; +if(!(N===(void 0))||l in c){ +%AddElement(M,l-K,N,0); +} +} +} +} +} +} +function SparseMove(c,K,L,o,P){ +if(P===L)return; +var Q=new InternalArray( +$min(o-L+P,0xffffffff)); +var R; +var d=%GetArrayKeys(c,o); +if((typeof(d)==='number')){ +var g=d; +for(var h=0;h=K+L){ +var N=c[l]; +if(!(N===(void 0))||l in c){ +var S=l-L+P; +Q[S]=N; +if(S>0xffffffff){ +R=R||new InternalArray(); +R.push(S); +} +} +} +} +} +} +%MoveArrayContents(Q,c); +if(!(R===(void 0))){ +var j=R.length; +for(var h=0;hL){ +for(var h=o-L;h>K;h--){ +var U=h+L-1; +var W=h+P-1; +if(((C&&%_HasFastPackedElements(%IS_VAR(c)))?(Uo-L+P;h--){ +delete c[h-1]; +} +} +} +} +function ArrayToString(){ +var c; +var X; +if((%_IsArray(this))){ +X=this.join; +if(X===ArrayJoin){ +return Join(this,this.length,',',ConvertToString); +} +c=this; +}else{ +c=ToObject(this); +X=c.join; +} +if(!(%_ClassOf(X)==='Function')){ +return %_CallFunction(c,ObjectToString); +} +return %_CallFunction(c,X); +} +function ArrayToLocaleString(){ +var c=ToObject(this); +var Y=c.length; +var o=(Y>>>0); +if(o===0)return""; +return Join(c,o,',',ConvertToLocaleString); +} +function ArrayJoin(r){ +if((this==null)&&!(%_IsUndetectableObject(this)))throw MakeTypeError('called_on_null_or_undefined',["Array.prototype.join"]); +var c=((%_IsSpecObject(%IS_VAR(this)))?this:ToObject(this)); +var j=(c.length>>>0); +if((r===(void 0))){ +r=','; +}else if(!(typeof(r)==='string')){ +r=NonStringToString(r); +} +var H=%_FastOneByteArrayJoin(c,r); +if(!(H===(void 0)))return H; +if(j===1){ +var i=c[0]; +if((typeof(i)==='string'))return i; +if((i==null))return''; +return NonStringToString(i); +} +return Join(c,j,r,ConvertToString); +} +function ObservedArrayPop(Z){ +Z--; +var aa=this[Z]; +try{ +$observeBeginPerformSplice(this); +delete this[Z]; +this.length=Z; +}finally{ +$observeEndPerformSplice(this); +$observeEnqueueSpliceRecord(this,Z,[aa],0); +} +return aa; +} +function ArrayPop(){ +if((this==null)&&!(%_IsUndetectableObject(this)))throw MakeTypeError('called_on_null_or_undefined',["Array.prototype.pop"]); +var c=((%_IsSpecObject(%IS_VAR(this)))?this:ToObject(this)); +var Z=(c.length>>>0); +if(Z==0){ +c.length=Z; +return; +} +if(%IsObserved(c)) +return ObservedArrayPop.call(c,Z); +Z--; +var aa=c[Z]; +Delete(c,ToName(Z),true); +c.length=Z; +return aa; +} +function ObservedArrayPush(){ +var Z=(this.length>>>0); +var ab=%_ArgumentsLength(); +try{ +$observeBeginPerformSplice(this); +for(var h=0;h>>0); +var ab=%_ArgumentsLength(); +for(var h=0;h=h){ +ak=h; +while(e[++ah]==h){} +al=o-h-1; +} +var am=c[ak]; +if(!(am===(void 0))||ak in c){ +var an=c[al]; +if(!(an===(void 0))||al in c){ +c[ak]=an; +c[al]=am; +}else{ +c[al]=am; +delete c[ak]; +} +}else{ +var an=c[al]; +if(!(an===(void 0))||al in c){ +c[ak]=an; +delete c[al]; +} +} +} +} +function ArrayReverse(){ +if((this==null)&&!(%_IsUndetectableObject(this)))throw MakeTypeError('called_on_null_or_undefined',["Array.prototype.reverse"]); +var c=((%_IsSpecObject(%IS_VAR(this)))?this:ToObject(this)); +var o=(c.length>>>0); +if(UseSparseVariant(c,o,(%_IsArray(c)),o)){ +%NormalizeElements(c); +SparseReverse(c,o); +return c; +} +var ai=o-1; +for(var h=0;h>>0); +if(o===0){ +c.length=0; +return; +} +if(ObjectIsSealed(c)){ +throw MakeTypeError("array_functions_change_sealed", +["Array.prototype.shift"]); +} +if(%IsObserved(c)) +return ObservedArrayShift.call(c,o); +var ao=c[0]; +if(UseSparseVariant(c,o,(%_IsArray(c)),o)){ +SparseMove(c,0,1,o,0); +}else{ +SimpleMove(c,0,1,o,0); +} +c.length=o-1; +return ao; +} +function ObservedArrayUnshift(){ +var o=(this.length>>>0); +var ap=%_ArgumentsLength(); +try{ +$observeBeginPerformSplice(this); +SimpleMove(this,0,0,o,ap); +for(var h=0;h>>0); +var ap=%_ArgumentsLength(); +if(o>0&&UseSparseVariant(c,o,(%_IsArray(c)),o)&& +!ObjectIsSealed(c)){ +SparseMove(c,0,0,o,ap); +}else{ +SimpleMove(c,0,0,o,ap); +} +for(var h=0;h>>0); +var K=(%_IsSmi(%IS_VAR(aq))?aq:%NumberToInteger(ToNumber(aq))); +var as=o; +if(!(ar===(void 0)))as=(%_IsSmi(%IS_VAR(ar))?ar:%NumberToInteger(ToNumber(ar))); +if(K<0){ +K+=o; +if(K<0)K=0; +}else{ +if(K>o)K=o; +} +if(as<0){ +as+=o; +if(as<0)as=0; +}else{ +if(as>o)as=o; +} +var H=[]; +if(aso?o:K; +} +function ComputeSpliceDeleteCount(at,ap,o,K){ +var L=0; +if(ap==1) +return o-K; +L=(%_IsSmi(%IS_VAR(at))?at:%NumberToInteger(ToNumber(at))); +if(L<0) +return 0; +if(L>o-K) +return o-K; +return L; +} +function ObservedArraySplice(aq,at){ +var ap=%_ArgumentsLength(); +var o=(this.length>>>0); +var K=ComputeSpliceStartIndex((%_IsSmi(%IS_VAR(aq))?aq:%NumberToInteger(ToNumber(aq))),o); +var L=ComputeSpliceDeleteCount(at,ap,o, +K); +var M=[]; +M.length=L; +var au=ap>2?ap-2:0; +try{ +$observeBeginPerformSplice(this); +SimpleSlice(this,K,L,o,M); +SimpleMove(this,K,L,o,au); +var h=K; +var av=2; +var aw=%_ArgumentsLength(); +while(av>>0); +var K=ComputeSpliceStartIndex((%_IsSmi(%IS_VAR(aq))?aq:%NumberToInteger(ToNumber(aq))),o); +var L=ComputeSpliceDeleteCount(at,ap,o, +K); +var M=[]; +M.length=L; +var au=ap>2?ap-2:0; +if(L!=au&&ObjectIsSealed(c)){ +throw MakeTypeError("array_functions_change_sealed", +["Array.prototype.splice"]); +}else if(L>0&&ObjectIsFrozen(c)){ +throw MakeTypeError("array_functions_on_frozen", +["Array.prototype.splice"]); +} +var ax=L; +if(au!=L){ +ax+=o-K-L; +} +if(UseSparseVariant(c,o,(%_IsArray(c)),ax)){ +%NormalizeElements(c); +%NormalizeElements(M); +SparseSlice(c,K,L,o,M); +SparseMove(c,K,L,o,au); +}else{ +SimpleSlice(c,K,L,o,M); +SimpleMove(c,K,L,o,au); +} +var h=K; +var av=2; +var aw=%_ArgumentsLength(); +while(av=aC;ai--){ +var aF=m[ai]; +var aG=%_CallFunction(aA,aF,aE,ay); +if(aG>0){ +m[ai+1]=aF; +}else{ +break; +} +} +m[ai+1]=aE; +} +}; +var aH=function(m,aC,aD){ +var aI=[]; +var aJ=200+((aD-aC)&15); +for(var h=aC+1,ai=0;h>1][0]; +return aK; +} +var aL=function QuickSort(m,aC,aD){ +var aK=0; +while(true){ +if(aD-aC<=10){ +aB(m,aC,aD); +return; +} +if(aD-aC>1000){ +aK=aH(m,aC,aD); +}else{ +aK=aC+((aD-aC)>>1); +} +var aM=m[aC]; +var aN=m[aD-1]; +var aO=m[aK]; +var aP=%_CallFunction(aA,aM,aN,ay); +if(aP>0){ +var aF=aM; +aM=aN; +aN=aF; +} +var aQ=%_CallFunction(aA,aM,aO,ay); +if(aQ>=0){ +var aF=aM; +aM=aO; +aO=aN; +aN=aF; +}else{ +var aR=%_CallFunction(aA,aN,aO,ay); +if(aR>0){ +var aF=aN; +aN=aO; +aO=aF; +} +} +m[aC]=aM; +m[aD-1]=aO; +var aS=aN; +var aT=aC+1; +var aU=aD-1; +m[aK]=m[aT]; +m[aT]=aS; +partition:for(var h=aT+1;h0){ +do{ +aU--; +if(aU==h)break partition; +var aV=m[aU]; +aG=%_CallFunction(aA,aV,aS,ay); +}while(aG>0); +m[h]=m[aU]; +m[aU]=aE; +if(aG<0){ +aE=m[h]; +m[h]=m[aT]; +m[aT]=aE; +aT++; +} +} +} +if(aD-aU=aY){aY=h+1;} +} +} +}else{ +for(var h=0;h=aY){aY=T+1;} +} +} +} +} +return aY; +}; +var bb=function(aX,aC,aD){ +for(var aZ=%_GetPrototype(aX);aZ;aZ=%_GetPrototype(aZ)){ +var d=%GetArrayKeys(aZ,aD); +if((typeof(d)==='number')){ +var ba=d; +for(var h=aC;h>>0); +if(j<2)return this; +var C=(%_IsArray(this)); +var bg; +if(!C){ +bg=aW(this,j); +} +var bh=%RemoveArrayHoles(this,j); +if(bh==-1){ +bh=bc(this); +} +aL(this,0,bh); +if(!C&&(bh+1>>0); +if(!(%_ClassOf(bi)==='Function'))throw MakeTypeError(2,bi); +var bj=false; +if((aA==null)){ +aA=%GetDefaultReceiver(bi)||aA; +}else{ +bj=(!(%_IsSpecObject(aA))&&%IsSloppyModeFunction(bi)); +} +var C=(%_IsArray(c)); +var bm=(%_DebugIsActive()!=0)&&%DebugCallbackSupportsStepping(bi); +for(var h=0;h>>0); +if(!(%_ClassOf(bi)==='Function'))throw MakeTypeError(2,bi); +var bj=false; +if((aA==null)){ +aA=%GetDefaultReceiver(bi)||aA; +}else{ +bj=(!(%_IsSpecObject(aA))&&%IsSloppyModeFunction(bi)); +} +var C=(%_IsArray(c)); +var bm=(%_DebugIsActive()!=0)&&%DebugCallbackSupportsStepping(bi); +for(var h=0;h>>0); +if(!(%_ClassOf(bi)==='Function'))throw MakeTypeError(2,bi); +var bj=false; +if((aA==null)){ +aA=%GetDefaultReceiver(bi)||aA; +}else{ +bj=(!(%_IsSpecObject(aA))&&%IsSloppyModeFunction(bi)); +} +var C=(%_IsArray(c)); +var bm=(%_DebugIsActive()!=0)&&%DebugCallbackSupportsStepping(bi); +for(var h=0;h>>0); +if(!(%_ClassOf(bi)==='Function'))throw MakeTypeError(2,bi); +var bj=false; +if((aA==null)){ +aA=%GetDefaultReceiver(bi)||aA; +}else{ +bj=(!(%_IsSpecObject(aA))&&%IsSloppyModeFunction(bi)); +} +var H=new a(); +var bk=new InternalArray(j); +var C=(%_IsArray(c)); +var bm=(%_DebugIsActive()!=0)&&%DebugCallbackSupportsStepping(bi); +for(var h=0;h>>0); +if(j==0)return-1; +if((T===(void 0))){ +T=0; +}else{ +T=(%_IsSmi(%IS_VAR(T))?T:%NumberToInteger(ToNumber(T))); +if(T<0){ +T=j+T; +if(T<0)T=0; +} +} +var bo=T; +var aY=j; +if(UseSparseVariant(this,j,(%_IsArray(this)),aY-bo)){ +%NormalizeElements(this); +var d=%GetArrayKeys(this,j); +if((typeof(d)==='number')){ +aY=d; +}else{ +if(d.length==0)return-1; +var bp=GetSortedArrayKeys(this,d); +var Z=bp.length; +var h=0; +while(h>>0); +if(j==0)return-1; +if(%_ArgumentsLength()<2){ +T=j-1; +}else{ +T=(%_IsSmi(%IS_VAR(T))?T:%NumberToInteger(ToNumber(T))); +if(T<0)T+=j; +if(T<0)return-1; +else if(T>=j)T=j-1; +} +var bo=0; +var aY=T; +if(UseSparseVariant(this,j,(%_IsArray(this)),T)){ +%NormalizeElements(this); +var d=%GetArrayKeys(this,T+1); +if((typeof(d)==='number')){ +aY=d; +}else{ +if(d.length==0)return-1; +var bp=GetSortedArrayKeys(this,d); +var h=bp.length-1; +while(h>=0){ +var l=bp[h]; +if(!(l===(void 0))&&this[l]===aE)return l; +h--; +} +return-1; +} +} +if(!(aE===(void 0))){ +for(var h=aY;h>=bo;h--){ +if(this[h]===aE)return h; +} +return-1; +} +for(var h=aY;h>=bo;h--){ +if((this[h]===(void 0))&&h in this){ +return h; +} +} +return-1; +} +function ArrayReduce(bq,N){ +if((this==null)&&!(%_IsUndetectableObject(this)))throw MakeTypeError('called_on_null_or_undefined',["Array.prototype.reduce"]); +var c=ToObject(this); +var j=ToUint32(c.length); +if(!(%_ClassOf(bq)==='Function')){ +throw MakeTypeError(2,bq); +} +var C=(%_IsArray(c)); +var h=0; +find_initial:if(%_ArgumentsLength()<2){ +for(;h=0;h--){ +if(((C&&%_HasFastPackedElements(%IS_VAR(c)))?(h=0;h--){ +if(((C&&%_HasFastPackedElements(%IS_VAR(c)))?(h1){ +o=%_Arguments(1); +o=(%_IsSmi(%IS_VAR(o))?o:%NumberToInteger(ToNumber(o))); +if(o<0)o=0; +if(o>n.length)o=n.length; +} +return %StringIndexOf(n,m,o); +} +function StringLastIndexOfJS(q){ +if((this==null)&&!(%_IsUndetectableObject(this)))throw MakeTypeError('called_on_null_or_undefined',["String.prototype.lastIndexOf"]); +var r=((typeof(%IS_VAR(this))==='string')?this:NonStringToString(this)); +var t=r.length; +var q=((typeof(%IS_VAR(q))==='string')?q:NonStringToString(q)); +var u=q.length; +var o=t-u; +if(%_ArgumentsLength()>1){ +var w=ToNumber(%_Arguments(1)); +if(!(!%_IsSmi(%IS_VAR(w))&&!(w==w))){ +w=(%_IsSmi(%IS_VAR(w))?w:%NumberToInteger(ToNumber(w))); +if(w<0){ +w=0; +} +if(w+u0xFF&& +(typeof(H)==='string')&& +%StringIndexOf(H,'$',0)<0){ +return %StringReplaceOneCharWithString(n,G,H); +} +var L=%StringIndexOf(n,G,0); +if(L<0)return n; +var M=L+G.length; +var e=%_SubString(n,0,L); +if((%_ClassOf(H)==='Function')){ +var N=%GetDefaultReceiver(H); +e+=%_CallFunction(N,G,L,n,H); +}else{ +E[3]=L; +E[4]=M; +e=ExpandReplacement(((typeof(%IS_VAR(H))==='string')?H:NonStringToString(H)), +n, +E, +e); +} +return e+%_SubString(n,M,n.length); +} +function ExpandReplacement(P,n,Q,e){ +var R=P.length; +var S=%StringIndexOf(P,'$',0); +if(S<0){ +if(R>0)e+=P; +return e; +} +if(S>0)e+=%_SubString(P,0,S); +while(true){ +var T='$'; +var w=S+1; +if(w=48&&U<=57){ +var W=(U-48)<<1; +var X=1; +var Y=((Q)[0]); +if(w+1=48&&S<=57){ +var Z=W*10+((S-48)<<1); +if(Z=0){ +e+= +%_SubString(n,L,Q[(3+(W+1))]); +} +w+=X; +}else{ +e+='$'; +} +}else{ +e+='$'; +} +}else{ +e+='$'; +} +S=%StringIndexOf(P,'$',w); +if(S<0){ +if(ww){ +e+=%_SubString(P,w,S); +} +} +return e; +} +function CaptureString(P,aa,o){ +var ab=o<<1; +var L=aa[(3+(ab))]; +if(L<0)return; +var M=aa[(3+(ab+1))]; +return %_SubString(P,L,M); +} +var ac=new InternalArray(16); +function StringReplaceGlobalRegExpWithFunction(n,z,H){ +var ad=ac; +if(ad){ +ac=null; +}else{ +ad=new InternalArray(16); +} +var ae=%RegExpExecMultiple(z, +n, +$regexpLastMatchInfo, +ad); +z.lastIndex=0; +if((ae===null)){ +ac=ad; +return n; +} +var h=ae.length; +if((($regexpLastMatchInfo)[0])==2){ +var af=0; +var ag=new InternalPackedArray(null,0,n); +var N=%GetDefaultReceiver(H); +for(var k=0;k0){ +af=(ah>>11)+(ah&0x7ff); +}else{ +af=ae[++k]-ah; +} +}else{ +ag[0]=ah; +ag[1]=af; +$regexpLastMatchInfoOverride=ag; +var ai= +%_CallFunction(N,ah,af,n,H); +ae[k]=((typeof(%IS_VAR(ai))==='string')?ai:NonStringToString(ai)); +af+=ah.length; +} +} +}else{ +var N=%GetDefaultReceiver(H); +for(var k=0;k>1; +var al; +var N=%GetDefaultReceiver(H); +if(ak==1){ +var am=%_SubString(n,o,aj); +al=%_CallFunction(N,am,o,n,H); +}else{ +var an=new InternalArray(ak+2); +for(var ao=0;aoaq){ +return''; +} +} +if(as<0){ +as+=aq; +if(as<0){ +return''; +} +}else{ +if(as>aq){ +as=aq; +} +} +if(as<=ar){ +return''; +} +return %_SubString(am,ar,as); +} +function StringSplitJS(at,au){ +if((this==null)&&!(%_IsUndetectableObject(this)))throw MakeTypeError('called_on_null_or_undefined',["String.prototype.split"]); +var n=((typeof(%IS_VAR(this))==='string')?this:NonStringToString(this)); +au=((au===(void 0)))?0xffffffff:(au>>>0); +var R=n.length; +if(!(%_IsRegExp(at))){ +var av=((typeof(%IS_VAR(at))==='string')?at:NonStringToString(at)); +if(au===0)return[]; +if((at===(void 0)))return[n]; +var aw=av.length; +if(aw===0)return %StringToArray(n,au); +var e=%StringSplit(n,av,au); +return e; +} +if(au===0)return[]; +return StringSplitOnRegExp(n,at,au,R); +} +function StringSplitOnRegExp(n,at,au,R){ +if(R===0){ +if($regexpExec(at,n,0,0)!=null){ +return[]; +} +return[n]; +} +var ax=0; +var ay=0; +var az=0; +var e=new InternalArray(); +outer_loop: +while(true){ +if(ay===R){ +e[e.length]=%_SubString(n,ax,R); +break; +} +var Q=$regexpExec(at,n,ay); +if(Q==null||R===(az=Q[3])){ +e[e.length]=%_SubString(n,ax,R); +break; +} +var aA=Q[4]; +if(ay===aA&&aA===ax){ +ay++; +continue; +} +e[e.length]=%_SubString(n,ax,az); +if(e.length===au)break; +var aB=((Q)[0])+3; +for(var k=3+2;kaq){ +ar=aq; +} +var as=aq; +if(!(M===(void 0))){ +as=(%_IsSmi(%IS_VAR(M))?M:%NumberToInteger(ToNumber(M))); +if(as>aq){ +as=aq; +}else{ +if(as<0)as=0; +if(ar>as){ +var aD=as; +as=ar; +ar=aD; +} +} +} +return %_SubString(am,ar,as); +} +function StringSubstr(L,aE){ +if((this==null)&&!(%_IsUndetectableObject(this)))throw MakeTypeError('called_on_null_or_undefined',["String.prototype.substr"]); +var am=((typeof(%IS_VAR(this))==='string')?this:NonStringToString(this)); +var h; +if((aE===(void 0))){ +h=am.length; +}else{ +h=(%_IsSmi(%IS_VAR(aE))?aE:%NumberToInteger(ToNumber(aE))); +if(h<=0)return''; +} +if((L===(void 0))){ +L=0; +}else{ +L=(%_IsSmi(%IS_VAR(L))?L:%NumberToInteger(ToNumber(L))); +if(L>=am.length)return''; +if(L<0){ +L+=am.length; +if(L<0)L=0; +} +} +var M=L+h; +if(M>am.length)M=am.length; +return %_SubString(am,L,M); +} +function StringToLowerCaseJS(){ +if((this==null)&&!(%_IsUndetectableObject(this)))throw MakeTypeError('called_on_null_or_undefined',["String.prototype.toLowerCase"]); +return %StringToLowerCase(((typeof(%IS_VAR(this))==='string')?this:NonStringToString(this))); +} +function StringToLocaleLowerCase(){ +if((this==null)&&!(%_IsUndetectableObject(this)))throw MakeTypeError('called_on_null_or_undefined',["String.prototype.toLocaleLowerCase"]); +return %StringToLowerCase(((typeof(%IS_VAR(this))==='string')?this:NonStringToString(this))); +} +function StringToUpperCaseJS(){ +if((this==null)&&!(%_IsUndetectableObject(this)))throw MakeTypeError('called_on_null_or_undefined',["String.prototype.toUpperCase"]); +return %StringToUpperCase(((typeof(%IS_VAR(this))==='string')?this:NonStringToString(this))); +} +function StringToLocaleUpperCase(){ +if((this==null)&&!(%_IsUndetectableObject(this)))throw MakeTypeError('called_on_null_or_undefined',["String.prototype.toLocaleUpperCase"]); +return %StringToUpperCase(((typeof(%IS_VAR(this))==='string')?this:NonStringToString(this))); +} +function StringTrimJS(){ +if((this==null)&&!(%_IsUndetectableObject(this)))throw MakeTypeError('called_on_null_or_undefined',["String.prototype.trim"]); +return %StringTrim(((typeof(%IS_VAR(this))==='string')?this:NonStringToString(this)),true,true); +} +function StringTrimLeft(){ +if((this==null)&&!(%_IsUndetectableObject(this)))throw MakeTypeError('called_on_null_or_undefined',["String.prototype.trimLeft"]); +return %StringTrim(((typeof(%IS_VAR(this))==='string')?this:NonStringToString(this)),true,false); +} +function StringTrimRight(){ +if((this==null)&&!(%_IsUndetectableObject(this)))throw MakeTypeError('called_on_null_or_undefined',["String.prototype.trimRight"]); +return %StringTrim(((typeof(%IS_VAR(this))==='string')?this:NonStringToString(this)),false,true); +} +function StringFromCharCode(aF){ +var aE=%_ArgumentsLength(); +if(aE==1){ +if(!%_IsSmi(aF))aF=ToNumber(aF); +return %_StringCharFromCode(aF&0xffff); +} +var aG=%NewString(aE,true); +var k; +for(k=0;k0xff)break; +%_OneByteSeqStringSetChar(k,aF,aG); +} +if(k==aE)return aG; +aG=%TruncateString(aG,k); +var aH=%NewString(aE-k,false); +for(var ao=0;k"+this+""; +} +function StringBig(){ +if((this==null)&&!(%_IsUndetectableObject(this)))throw MakeTypeError('called_on_null_or_undefined',["String.prototype.big"]); +return""+this+""; +} +function StringBlink(){ +if((this==null)&&!(%_IsUndetectableObject(this)))throw MakeTypeError('called_on_null_or_undefined',["String.prototype.blink"]); +return""+this+""; +} +function StringBold(){ +if((this==null)&&!(%_IsUndetectableObject(this)))throw MakeTypeError('called_on_null_or_undefined',["String.prototype.bold"]); +return""+this+""; +} +function StringFixed(){ +if((this==null)&&!(%_IsUndetectableObject(this)))throw MakeTypeError('called_on_null_or_undefined',["String.prototype.fixed"]); +return""+this+""; +} +function StringFontcolor(aK){ +if((this==null)&&!(%_IsUndetectableObject(this)))throw MakeTypeError('called_on_null_or_undefined',["String.prototype.fontcolor"]); +return""+this+""; +} +function StringFontsize(aL){ +if((this==null)&&!(%_IsUndetectableObject(this)))throw MakeTypeError('called_on_null_or_undefined',["String.prototype.fontsize"]); +return""+this+""; +} +function StringItalics(){ +if((this==null)&&!(%_IsUndetectableObject(this)))throw MakeTypeError('called_on_null_or_undefined',["String.prototype.italics"]); +return""+this+""; +} +function StringLink(am){ +if((this==null)&&!(%_IsUndetectableObject(this)))throw MakeTypeError('called_on_null_or_undefined',["String.prototype.link"]); +return""+this+""; +} +function StringSmall(){ +if((this==null)&&!(%_IsUndetectableObject(this)))throw MakeTypeError('called_on_null_or_undefined',["String.prototype.small"]); +return""+this+""; +} +function StringStrike(){ +if((this==null)&&!(%_IsUndetectableObject(this)))throw MakeTypeError('called_on_null_or_undefined',["String.prototype.strike"]); +return""+this+""; +} +function StringSub(){ +if((this==null)&&!(%_IsUndetectableObject(this)))throw MakeTypeError('called_on_null_or_undefined',["String.prototype.sub"]); +return""+this+""; +} +function StringSup(){ +if((this==null)&&!(%_IsUndetectableObject(this)))throw MakeTypeError('called_on_null_or_undefined',["String.prototype.sup"]); +return""+this+""; +} +function StringRepeat(aM){ +if((this==null)&&!(%_IsUndetectableObject(this)))throw MakeTypeError('called_on_null_or_undefined',["String.prototype.repeat"]); +var am=((typeof(%IS_VAR(this))==='string')?this:NonStringToString(this)); +var aE=ToInteger(aM); +if(aE<0||aE>%_MaxSmi()){ +throw MakeRangeError("invalid_count_value",[]); +} +var aN=""; +while(true){ +if(aE&1)aN+=am; +aE>>=1; +if(aE===0)return aN; +am+=am; +} +} +function StringStartsWith(aO){ +if((this==null)&&!(%_IsUndetectableObject(this)))throw MakeTypeError('called_on_null_or_undefined',["String.prototype.startsWith"]); +var am=((typeof(%IS_VAR(this))==='string')?this:NonStringToString(this)); +if((%_IsRegExp(aO))){ +throw MakeTypeError("first_argument_not_regexp", +["String.prototype.startsWith"]); +} +var aP=((typeof(%IS_VAR(aO))==='string')?aO:NonStringToString(aO)); +var d=0; +if(%_ArgumentsLength()>1){ +d=%_Arguments(1); +d=ToInteger(d); +} +var aq=am.length; +var L=$min($max(d,0),aq); +var aQ=aP.length; +if(aQ+L>aq){ +return false; +} +return %StringIndexOf(am,aP,L)===L; +} +function StringEndsWith(aO){ +if((this==null)&&!(%_IsUndetectableObject(this)))throw MakeTypeError('called_on_null_or_undefined',["String.prototype.endsWith"]); +var am=((typeof(%IS_VAR(this))==='string')?this:NonStringToString(this)); +if((%_IsRegExp(aO))){ +throw MakeTypeError("first_argument_not_regexp", +["String.prototype.endsWith"]); +} +var aP=((typeof(%IS_VAR(aO))==='string')?aO:NonStringToString(aO)); +var aq=am.length; +var d=aq; +if(%_ArgumentsLength()>1){ +var aR=%_Arguments(1); +if(!(aR===(void 0))){ +d=ToInteger(aR); +} +} +var M=$min($max(d,0),aq); +var aQ=aP.length; +var L=M-aQ; +if(L<0){ +return false; +} +return %StringLastIndexOf(am,aP,L)===L; +} +function StringIncludes(aO){ +if((this==null)&&!(%_IsUndetectableObject(this)))throw MakeTypeError('called_on_null_or_undefined',["String.prototype.includes"]); +var am=((typeof(%IS_VAR(this))==='string')?this:NonStringToString(this)); +if((%_IsRegExp(aO))){ +throw MakeTypeError("first_argument_not_regexp", +["String.prototype.includes"]); +} +var aP=((typeof(%IS_VAR(aO))==='string')?aO:NonStringToString(aO)); +var d=0; +if(%_ArgumentsLength()>1){ +d=%_Arguments(1); +d=ToInteger(d); +} +var aq=am.length; +var L=$min($max(d,0),aq); +var aQ=aP.length; +if(aQ+L>aq){ +return false; +} +return %StringIndexOf(am,aP,L)!==-1; +} +function StringCodePointAt(d){ +if((this==null)&&!(%_IsUndetectableObject(this)))throw MakeTypeError('called_on_null_or_undefined',["String.prototype.codePointAt"]); +var P=((typeof(%IS_VAR(this))==='string')?this:NonStringToString(this)); +var aL=P.length; +d=(%_IsSmi(%IS_VAR(d))?d:%NumberToInteger(ToNumber(d))); +if(d<0||d>=aL){ +return(void 0); +} +var aS=%_StringCharCodeAt(P,d); +if(aS<0xD800||aS>0xDBFF||d+1==aL){ +return aS; +} +var aT=%_StringCharCodeAt(P,d+1); +if(aT<0xDC00||aT>0xDFFF){ +return aS; +} +return(aS-0xD800)*0x400+aT+0x2400; +} +function StringFromCodePoint(aU){ +var aF; +var R=%_ArgumentsLength(); +var o; +var e=""; +for(o=0;o0x10FFFF||aF!==(%_IsSmi(%IS_VAR(aF))?aF:%NumberToInteger(ToNumber(aF)))){ +throw MakeRangeError("invalid_code_point",[aF]); +} +if(aF<=0xFFFF){ +e+=%_StringCharFromCode(aF); +}else{ +aF-=0x10000; +e+=%_StringCharFromCode((aF>>>10)&0x3FF|0xD800); +e+=%_StringCharFromCode(aF&0x3FF|0xDC00); +} +} +return e; +} +function StringRaw(aV){ +var aW=%_ArgumentsLength(); +var aX=ToObject(aV); +var aY=ToObject(aX.raw); +var aZ=ToLength(aY.length); +if(aZ<=0)return""; +var e=ToString(aY[0]); +for(var k=1;k=48&&c<=57)return c-48; +if(c>=65&&c<=70)return c-55; +if(c>=97&&c<=102)return c-87; +return-1; +} +function isAlphaNumeric(d){ +if(97<=d&&d<=122)return true; +if(65<=d&&d<=90)return true; +if(48<=d&&d<=57)return true; +return false; +} +var e=0; +function URIAddEncodedOctetToBuffer(g,h,i){ +h[i++]=37; +h[i++]=e[g>>4]; +h[i++]=e[g&0x0F]; +return i; +} +function URIEncodeOctets(j,h,i){ +if(e===0){ +e=[48,49,50,51,52,53,54,55,56,57, +65,66,67,68,69,70]; +} +i=URIAddEncodedOctetToBuffer(j[0],h,i); +if(j[1])i=URIAddEncodedOctetToBuffer(j[1],h,i); +if(j[2])i=URIAddEncodedOctetToBuffer(j[2],h,i); +if(j[3])i=URIAddEncodedOctetToBuffer(j[3],h,i); +return i; +} +function URIEncodeSingle(d,h,i){ +var k=(d>>12)&0xF; +var l=(d>>6)&63; +var m=d&63; +var j=new b(3); +if(d<=0x007F){ +j[0]=d; +}else if(d<=0x07FF){ +j[0]=l+192; +j[1]=m+128; +}else{ +j[0]=k+224; +j[1]=l+128; +j[2]=m+128; +} +return URIEncodeOctets(j,h,i); +} +function URIEncodePair(n,o,h,i){ +var q=((n>>6)&0xF)+1; +var r=(n>>2)&0xF; +var k=n&3; +var l=(o>>6)&0xF; +var m=o&63; +var j=new b(4); +j[0]=(q>>2)+240; +j[1]=(((q&3)<<4)|r)+128; +j[2]=((k<<4)|l)+128; +j[3]=m+128; +return URIEncodeOctets(j,h,i); +} +function URIHexCharsToCharCode(t,u){ +var w=HexValueOf(t); +var z=HexValueOf(u); +if(w==-1||z==-1){ +throw new $URIError("URI malformed"); +} +return(w<<4)|z; +} +function URIDecodeOctets(j,h,i){ +var A; +var B=j[0]; +if(B<0x80){ +A=B; +}else if(B<0xc2){ +throw new $URIError("URI malformed"); +}else{ +var C=j[1]; +if(B<0xe0){ +var D=B&0x1f; +if((C<0x80)||(C>0xbf)){ +throw new $URIError("URI malformed"); +} +var E=C&0x3f; +A=(D<<6)+E; +if(A<0x80||A>0x7ff){ +throw new $URIError("URI malformed"); +} +}else{ +var G=j[2]; +if(B<0xf0){ +var D=B&0x0f; +if((C<0x80)||(C>0xbf)){ +throw new $URIError("URI malformed"); +} +var E=C&0x3f; +if((G<0x80)||(G>0xbf)){ +throw new $URIError("URI malformed"); +} +var H=G&0x3f; +A=(D<<12)+(E<<6)+H; +if((A<0x800)||(A>0xffff)){ +throw new $URIError("URI malformed"); +} +}else{ +var I=j[3]; +if(B<0xf8){ +var D=(B&0x07); +if((C<0x80)||(C>0xbf)){ +throw new $URIError("URI malformed"); +} +var E=(C&0x3f); +if((G<0x80)||(G>0xbf)){ +throw new $URIError("URI malformed"); +} +var H=(G&0x3f); +if((I<0x80)||(I>0xbf)){ +throw new $URIError("URI malformed"); +} +var J=(I&0x3f); +A=(D<<18)+(E<<12)+(H<<6)+J; +if((A<0x10000)||(A>0x10ffff)){ +throw new $URIError("URI malformed"); +} +}else{ +throw new $URIError("URI malformed"); +} +} +} +} +if(0xD800<=A&&A<=0xDFFF){ +throw new $URIError("URI malformed"); +} +if(A<0x10000){ +%_TwoByteSeqStringSetChar(i++,A,h); +}else{ +%_TwoByteSeqStringSetChar(i++,(A>>10)+0xd7c0,h); +%_TwoByteSeqStringSetChar(i++,(A&0x3ff)+0xdc00,h); +} +return i; +} +function Encode(K,L){ +var M=K.length; +var N=new InternalArray(M); +var i=0; +for(var P=0;P=0xDC00&&n<=0xDFFF)throw new $URIError("URI malformed"); +if(n<0xD800||n>0xDBFF){ +i=URIEncodeSingle(n,N,i); +}else{ +P++; +if(P==M)throw new $URIError("URI malformed"); +var o=K.charCodeAt(P); +if(o<0xDC00||o>0xDFFF)throw new $URIError("URI malformed"); +i=URIEncodePair(n,o,N,i); +} +} +} +var h=%NewString(N.length,true); +for(var Q=0;Q=M)throw new $URIError("URI malformed"); +var d=URIHexCharsToCharCode(K.charCodeAt(P+1),K.charCodeAt(P+2)); +if(d>>7)break; +if(R(d)){ +%_OneByteSeqStringSetChar(i++,37,S); +%_OneByteSeqStringSetChar(i++,K.charCodeAt(P+1),S); +%_OneByteSeqStringSetChar(i++,K.charCodeAt(P+2),S); +}else{ +%_OneByteSeqStringSetChar(i++,d,S); +} +P+=2; +}else{ +if(c>0x7f)break; +%_OneByteSeqStringSetChar(i++,c,S); +} +} +S=%TruncateString(S,i); +if(P==M)return S; +var T=%NewString(M-P,false); +i=0; +for(;P=M)throw new $URIError("URI malformed"); +var d=URIHexCharsToCharCode(K.charCodeAt(++P),K.charCodeAt(++P)); +if(d>>7){ +var U=0; +while(((d<<++U)&0x80)!=0){} +if(U==1||U>4)throw new $URIError("URI malformed"); +var j=new b(U); +j[0]=d; +if(P+3*(U-1)>=M)throw new $URIError("URI malformed"); +for(var Q=1;Q0)?b:0-b; +} +function MathAcosJS(b){ +return %_MathAcos(+b); +} +function MathAsinJS(b){ +return %_MathAsin(+b); +} +function MathAtanJS(b){ +return %_MathAtan(+b); +} +function MathAtan2JS(c,b){ +c=+c; +b=+b; +return %_MathAtan2(c,b); +} +function MathCeil(b){ +return-%_MathFloor(-b); +} +function MathExp(b){ +return %MathExpRT(((typeof(%IS_VAR(b))==='number')?b:NonNumberToNumber(b))); +} +function MathFloorJS(b){ +return %_MathFloor(+b); +} +function MathLog(b){ +return %_MathLogRT(((typeof(%IS_VAR(b))==='number')?b:NonNumberToNumber(b))); +} +function MathMax(d,e){ +var g=%_ArgumentsLength(); +if(g==2){ +d=((typeof(%IS_VAR(d))==='number')?d:NonNumberToNumber(d)); +e=((typeof(%IS_VAR(e))==='number')?e:NonNumberToNumber(e)); +if(e>d)return e; +if(d>e)return d; +if(d==e){ +return(d===0&&%_IsMinusZero(d))?e:d; +} +return $NaN; +} +var h=-(1/0); +for(var i=0;ih||(h===0&&j===0&&%_IsMinusZero(h))){ +h=j; +} +} +return h; +} +function MathMin(d,e){ +var g=%_ArgumentsLength(); +if(g==2){ +d=((typeof(%IS_VAR(d))==='number')?d:NonNumberToNumber(d)); +e=((typeof(%IS_VAR(e))==='number')?e:NonNumberToNumber(e)); +if(e>d)return d; +if(d>e)return e; +if(d==e){ +return(d===0&&%_IsMinusZero(d))?d:e; +} +return $NaN; +} +var h=(1/0); +for(var i=0;i>>16))|0; +rngstate[0]=k; +var l=(MathImul(36969,rngstate[1]&0xFFFF)+(rngstate[1]>>>16))|0; +rngstate[1]=l; +var b=((k<<16)+(l&0xFFFF))|0; +return(b<0?(b+0x100000000):b)*2.3283064365386962890625e-10; +} +function MathRound(b){ +return %RoundNumber(((typeof(%IS_VAR(b))==='number')?b:NonNumberToNumber(b))); +} +function MathSqrtJS(b){ +return %_MathSqrt(+b); +} +function MathImul(b,c){ +return %NumberImul(((typeof(%IS_VAR(b))==='number')?b:NonNumberToNumber(b)),((typeof(%IS_VAR(c))==='number')?c:NonNumberToNumber(c))); +} +function MathSign(b){ +b=+b; +if(b>0)return 1; +if(b<0)return-1; +return b; +} +function MathTrunc(b){ +b=+b; +if(b>0)return %_MathFloor(b); +if(b<0)return-%_MathFloor(-b); +return b; +} +function MathTanh(b){ +if(!(typeof(b)==='number'))b=NonNumberToNumber(b); +if(b===0)return b; +if(!(%_IsSmi(%IS_VAR(b))||((b==b)&&(b!=1/0)&&(b!=-1/0))))return MathSign(b); +var m=MathExp(b); +var n=MathExp(-b); +return(m-n)/(m+n); +} +function MathAsinh(b){ +if(!(typeof(b)==='number'))b=NonNumberToNumber(b); +if(b===0||!(%_IsSmi(%IS_VAR(b))||((b==b)&&(b!=1/0)&&(b!=-1/0))))return b; +if(b>0)return MathLog(b+%_MathSqrt(b*b+1)); +return-MathLog(-b+%_MathSqrt(b*b+1)); +} +function MathAcosh(b){ +if(!(typeof(b)==='number'))b=NonNumberToNumber(b); +if(b<1)return $NaN; +if(!(%_IsSmi(%IS_VAR(b))||((b==b)&&(b!=1/0)&&(b!=-1/0))))return b; +return MathLog(b+%_MathSqrt(b+1)*%_MathSqrt(b-1)); +} +function MathAtanh(b){ +if(!(typeof(b)==='number'))b=NonNumberToNumber(b); +if(b===0)return b; +if(!(%_IsSmi(%IS_VAR(b))||((b==b)&&(b!=1/0)&&(b!=-1/0))))return $NaN; +return 0.5*MathLog((1+b)/(1-b)); +} +function MathHypot(b,c){ +var g=%_ArgumentsLength(); +var o=new InternalArray(g); +var q=0; +for(var i=0;iq)q=j; +o[i]=j; +} +if(q===0)q=1; +var r=0; +var t=0; +for(var i=0;i>>0); +} +function MathCbrt(b){ +if(!(typeof(b)==='number'))b=NonNumberToNumber(b); +if(b==0||!(%_IsSmi(%IS_VAR(b))||((b==b)&&(b!=1/0)&&(b!=-1/0))))return b; +return b>=0?CubeRoot(b):-CubeRoot(-b); +} +function CubeRoot(b){ +var z=MathFloorJS(%_DoubleHi(b)/3)+0x2A9F7893; +var A=%_ConstructDouble(z,0); +A=(1.0/3.0)*(b/(A*A)+2*A); +; +A=(1.0/3.0)*(b/(A*A)+2*A); +; +A=(1.0/3.0)*(b/(A*A)+2*A); +; +return(1.0/3.0)*(b/(A*A)+2*A); +; +} +function MathConstructor(){} +var B=new MathConstructor(); +%InternalSetPrototype(B,a.prototype); +%AddNamedProperty(global,"Math",B,2); +%FunctionSetInstanceClassName(MathConstructor,'Math'); +%AddNamedProperty(B,symbolToStringTag,"Math",1|2); +InstallConstants(B,[ +"E",2.7182818284590452354, +"LN10",2.302585092994046, +"LN2",0.6931471805599453, +"LOG2E",1.4426950408889634, +"LOG10E",0.4342944819032518, +"PI",3.1415926535897932, +"SQRT1_2",0.7071067811865476, +"SQRT2",1.4142135623730951 +]); +InstallFunctions(B,2,[ +"random",MathRandom, +"abs",MathAbs, +"acos",MathAcosJS, +"asin",MathAsinJS, +"atan",MathAtanJS, +"ceil",MathCeil, +"exp",MathExp, +"floor",MathFloorJS, +"log",MathLog, +"round",MathRound, +"sqrt",MathSqrtJS, +"atan2",MathAtan2JS, +"pow",MathPowJS, +"max",MathMax, +"min",MathMin, +"imul",MathImul, +"sign",MathSign, +"trunc",MathTrunc, +"tanh",MathTanh, +"asinh",MathAsinh, +"acosh",MathAcosh, +"atanh",MathAtanh, +"hypot",MathHypot, +"fround",MathFroundJS, +"clz32",MathClz32JS, +"cbrt",MathCbrt +]); +%SetInlineBuiltinFlag(MathAbs); +%SetInlineBuiltinFlag(MathAcosJS); +%SetInlineBuiltinFlag(MathAsinJS); +%SetInlineBuiltinFlag(MathAtanJS); +%SetInlineBuiltinFlag(MathAtan2JS); +%SetInlineBuiltinFlag(MathCeil); +%SetInlineBuiltinFlag(MathClz32JS); +%SetInlineBuiltinFlag(MathFloorJS); +%SetInlineBuiltinFlag(MathRandom); +%SetInlineBuiltinFlag(MathSign); +%SetInlineBuiltinFlag(MathSqrtJS); +%SetInlineBuiltinFlag(MathTrunc); +$abs=MathAbs; +$exp=MathExp; +$floor=MathFloorJS; +$max=MathMax; +$min=MathMin; +})(); + +fdlibme¨ +var kMath; +var rempio2result; +(function(){ +"use strict"; +%CheckIsBootstrapping(); +var a=global.Math; + + + + + + + + + + + + + + + + + + + + + +function KernelTan(b,c,d){ +var e; +var g; +var h=%_DoubleHi(b); +var i=h&0x7fffffff; +if(i<0x3e300000){ +if(((i|%_DoubleLo(b))|(d+1))==0){ +return 1/$abs(b); +}else{ +if(d==1){ +return b; +}else{ +var g=b+c; +var e=%_ConstructDouble(%_DoubleHi(g),0); +var j=c-(e-b); +var k=-1/g; +var l=%_ConstructDouble(%_DoubleHi(k),0); +var m=1+l*e; +return l+k*(m+l*j); +} +} +} +if(i>=0x3fe59428){ +if(b<0){ +b=-b; +c=-c; +} +e=kMath[32]-b; +g=kMath[33]-c; +b=e+g; +c=0; +} +e=b*b; +g=e*e; +var n=kMath[19+1] ++g*(kMath[19+3] ++g*(kMath[19+5] ++ +g*(kMath[19+7] ++g*(kMath[19+9] ++g*kMath[19+11] +)))); +var j=e*(kMath[19+2] ++g*(kMath[19+4] ++g*(kMath[19+6] ++ +g*(kMath[19+8] ++g*(kMath[19+10] ++g*kMath[19+12] +))))); +var m=e*b; +n=c+e*(m*(n+j)+c); +n=n+kMath[19+0] +*m; +g=b+n; +if(i>=0x3fe59428){ +return(1-((h>>30)&2))* +(d-2.0*(b-(g*g/(g+d)-n))); +} +if(d==1){ +return g; +}else{ +e=%_ConstructDouble(%_DoubleHi(g),0); +j=n-(e-b); +var k=-1/g; +var l=%_ConstructDouble(%_DoubleHi(k),0); +m=1+l*e; +return l+k*(m+l*j); +} +} +function MathSinSlow(b){ +var o,q,r; +var h=%_DoubleHi(b); +var i=h&0x7fffffff; +if(i<0x4002d97c){ +if(h>0){ +var e=b-kMath[1]; +if(i!=0x3ff921fb){ +q=e-kMath[2]; +r=(e-q)-kMath[2]; +}else{ +e-=kMath[3]; +q=e-kMath[4]; +r=(e-q)-kMath[4]; +} +o=1; +}else{ +var e=b+kMath[1]; +if(i!=0x3ff921fb){ +q=e+kMath[2]; +r=(e-q)+kMath[2]; +}else{ +e+=kMath[3]; +q=e+kMath[4]; +r=(e-q)+kMath[4]; +} +o=-1; +} +}else if(i<=0x413921fb){ +var l=$abs(b); +o=(l*kMath[0]+0.5)|0; +var n=l-o*kMath[1]; +var g=o*kMath[2]; +q=n-g; +if(i-(%_DoubleHi(q)&0x7ff00000)>0x1000000){ +l=n; +g=o*kMath[3]; +n=l-g; +g=o*kMath[4]-((l-n)-g); +q=n-g; +if(i-(%_DoubleHi(q)&0x7ff00000)>0x3100000){ +l=n; +g=o*kMath[5]; +n=l-g; +g=o*kMath[6]-((l-n)-g); +q=n-g; +} +} +r=(n-q)-g; +if(h<0){ +o=-o; +q=-q; +r=-r; +} +}else{ +o=%RemPiO2(b,rempio2result); +q=rempio2result[0]; +r=rempio2result[1]; +} +; +var t=1-(o&2); +if(o&1){ +var i=%_DoubleHi(q)&0x7fffffff; +var e=q*q; +var n=e*(4.16666666666666019037e-02+e*(-1.38888888888741095749e-03+e*(2.48015872894767294178e-05+e*(-2.75573143513906633035e-07+e*(2.08757232129817482790e-09+e*-1.13596475577881948265e-11))))); +if(i<0x3fd33333){ +return(1-(0.5*e-(e*n-q*r)))*t; +}else{ +var u; +if(i>0x3fe90000){ +u=0.28125; +}else{ +u=%_ConstructDouble(%_DoubleHi(0.25*q),0); +} +var w=0.5*e-u; +return(1-u-(w-(e*n-q*r)))*t; +} +; +}else{ +var e=q*q; +var j=e*q; +var n=8.33333333332248946124e-03+e*(-1.98412698298579493134e-04+e*(2.75573137070700676789e-06+e*(-2.50507602534068634195e-08+e*1.58969099521155010221e-10))); +return(q-((e*(0.5*r-j*n)-r)-j*-1.66666666666666324348e-01))*t; +; +} +} +function MathCosSlow(b){ +var o,q,r; +var h=%_DoubleHi(b); +var i=h&0x7fffffff; +if(i<0x4002d97c){ +if(h>0){ +var e=b-kMath[1]; +if(i!=0x3ff921fb){ +q=e-kMath[2]; +r=(e-q)-kMath[2]; +}else{ +e-=kMath[3]; +q=e-kMath[4]; +r=(e-q)-kMath[4]; +} +o=1; +}else{ +var e=b+kMath[1]; +if(i!=0x3ff921fb){ +q=e+kMath[2]; +r=(e-q)+kMath[2]; +}else{ +e+=kMath[3]; +q=e+kMath[4]; +r=(e-q)+kMath[4]; +} +o=-1; +} +}else if(i<=0x413921fb){ +var l=$abs(b); +o=(l*kMath[0]+0.5)|0; +var n=l-o*kMath[1]; +var g=o*kMath[2]; +q=n-g; +if(i-(%_DoubleHi(q)&0x7ff00000)>0x1000000){ +l=n; +g=o*kMath[3]; +n=l-g; +g=o*kMath[4]-((l-n)-g); +q=n-g; +if(i-(%_DoubleHi(q)&0x7ff00000)>0x3100000){ +l=n; +g=o*kMath[5]; +n=l-g; +g=o*kMath[6]-((l-n)-g); +q=n-g; +} +} +r=(n-q)-g; +if(h<0){ +o=-o; +q=-q; +r=-r; +} +}else{ +o=%RemPiO2(b,rempio2result); +q=rempio2result[0]; +r=rempio2result[1]; +} +; +if(o&1){ +var t=(o&2)-1; +var e=q*q; +var j=e*q; +var n=8.33333333332248946124e-03+e*(-1.98412698298579493134e-04+e*(2.75573137070700676789e-06+e*(-2.50507602534068634195e-08+e*1.58969099521155010221e-10))); +return(q-((e*(0.5*r-j*n)-r)-j*-1.66666666666666324348e-01))*t; +; +}else{ +var t=1-(o&2); +var i=%_DoubleHi(q)&0x7fffffff; +var e=q*q; +var n=e*(4.16666666666666019037e-02+e*(-1.38888888888741095749e-03+e*(2.48015872894767294178e-05+e*(-2.75573143513906633035e-07+e*(2.08757232129817482790e-09+e*-1.13596475577881948265e-11))))); +if(i<0x3fd33333){ +return(1-(0.5*e-(e*n-q*r)))*t; +}else{ +var u; +if(i>0x3fe90000){ +u=0.28125; +}else{ +u=%_ConstructDouble(%_DoubleHi(0.25*q),0); +} +var w=0.5*e-u; +return(1-u-(w-(e*n-q*r)))*t; +} +; +} +} +function MathSin(b){ +b=+b; +if((%_DoubleHi(b)&0x7fffffff)<=0x3fe921fb){ +var e=b*b; +var j=e*b; +var n=8.33333333332248946124e-03+e*(-1.98412698298579493134e-04+e*(2.75573137070700676789e-06+e*(-2.50507602534068634195e-08+e*1.58969099521155010221e-10))); +return(b-((e*(0.5*0-j*n)-0)-j*-1.66666666666666324348e-01)); +; +} +return+MathSinSlow(b); +} +function MathCos(b){ +b=+b; +if((%_DoubleHi(b)&0x7fffffff)<=0x3fe921fb){ +var i=%_DoubleHi(b)&0x7fffffff; +var e=b*b; +var n=e*(4.16666666666666019037e-02+e*(-1.38888888888741095749e-03+e*(2.48015872894767294178e-05+e*(-2.75573143513906633035e-07+e*(2.08757232129817482790e-09+e*-1.13596475577881948265e-11))))); +if(i<0x3fd33333){ +return(1-(0.5*e-(e*n-b*0))); +}else{ +var u; +if(i>0x3fe90000){ +u=0.28125; +}else{ +u=%_ConstructDouble(%_DoubleHi(0.25*b),0); +} +var w=0.5*e-u; +return(1-u-(w-(e*n-b*0))); +} +; +} +return+MathCosSlow(b); +} +function MathTan(b){ +b=b*1; +if((%_DoubleHi(b)&0x7fffffff)<=0x3fe921fb){ +return KernelTan(b,0,1); +} +var o,q,r; +var h=%_DoubleHi(b); +var i=h&0x7fffffff; +if(i<0x4002d97c){ +if(h>0){ +var e=b-kMath[1]; +if(i!=0x3ff921fb){ +q=e-kMath[2]; +r=(e-q)-kMath[2]; +}else{ +e-=kMath[3]; +q=e-kMath[4]; +r=(e-q)-kMath[4]; +} +o=1; +}else{ +var e=b+kMath[1]; +if(i!=0x3ff921fb){ +q=e+kMath[2]; +r=(e-q)+kMath[2]; +}else{ +e+=kMath[3]; +q=e+kMath[4]; +r=(e-q)+kMath[4]; +} +o=-1; +} +}else if(i<=0x413921fb){ +var l=$abs(b); +o=(l*kMath[0]+0.5)|0; +var n=l-o*kMath[1]; +var g=o*kMath[2]; +q=n-g; +if(i-(%_DoubleHi(q)&0x7ff00000)>0x1000000){ +l=n; +g=o*kMath[3]; +n=l-g; +g=o*kMath[4]-((l-n)-g); +q=n-g; +if(i-(%_DoubleHi(q)&0x7ff00000)>0x3100000){ +l=n; +g=o*kMath[5]; +n=l-g; +g=o*kMath[6]-((l-n)-g); +q=n-g; +} +} +r=(n-q)-g; +if(h<0){ +o=-o; +q=-q; +r=-r; +} +}else{ +o=%RemPiO2(b,rempio2result); +q=rempio2result[0]; +r=rempio2result[1]; +} +; +return KernelTan(q,r,(o&1)?-1:1); +} + + + + +function MathLog1p(b){ +b=b*1; +var h=%_DoubleHi(b); +var z=h&0x7fffffff; +var A=1; +var B=b; +var C=1; +var D=0; +var E=b; +if(h<0x3fda827a){ +if(z>=0x3ff00000){ +if(b===-1){ +return-(1/0); +}else{ +return $NaN; +} +}else if(z<0x3c900000){ +return b; +}else if(z<0x3e200000){ +return b-b*b*0.5; +} +if((h>0)||(h<=-0x402D413D)){ +A=0; +} +} +if(h>=0x7ff00000)return b; +if(A!==0){ +if(h<0x43400000){ +E=1+b; +C=%_DoubleHi(E); +A=(C>>20)-1023; +D=(A>0)?1-(E-b):b-(E-1); +D=D/E; +}else{ +C=%_DoubleHi(E); +A=(C>>20)-1023; +} +C=C&0xfffff; +if(C<0x6a09e){ +E=%_ConstructDouble(C|0x3ff00000,%_DoubleLo(E)); +}else{ +++A; +E=%_ConstructDouble(C|0x3fe00000,%_DoubleLo(E)); +C=(0x00100000-C)>>2; +} +B=E-1; +} +var G=0.5*B*B; +if(C===0){ +if(B===0){ +if(A===0){ +return 0.0; +}else{ +return A*kMath[34]+(D+A*kMath[35]); +} +} +var H=G*(1-kMath[36]*B); +if(A===0){ +return B-H; +}else{ +return A*kMath[34]-((H-(A*kMath[35]+D))-B); +} +} +var m=B/(2+B); +var e=m*m; +var H=e*((kMath[37+0]) ++e*((kMath[37+1]) ++e* +((kMath[37+2]) ++e*((kMath[37+3]) ++e* +((kMath[37+4]) ++e*((kMath[37+5]) ++e*(kMath[37+6]) +)))))); +if(A===0){ +return B-(G-m*(G+H)); +}else{ +return A*kMath[34]-((G-(m*(G+H)+(A*kMath[35]+D)))-B); +} +} + + +function MathExpm1(b){ +b=b*1; +var c; +var I; +var J; +var A; +var l; +var D; +var h=%_DoubleHi(b); +var K=h&0x80000000; +var c=(K===0)?b:-b; +h&=0x7fffffff; +if(h>=0x4043687a){ +if(h>=0x40862e42){ +if(h>=0x7ff00000){ +return(b===-(1/0))?-1:b; +} +if(b>kMath[44])return(1/0); +} +if(K!=0)return-1; +} +if(h>0x3fd62e42){ +if(h<0x3ff0a2b2){ +if(K===0){ +I=b-kMath[34]; +J=kMath[35]; +A=1; +}else{ +I=b+kMath[34]; +J=-kMath[35]; +A=-1; +} +}else{ +A=(kMath[45]*b+((K===0)?0.5:-0.5))|0; +l=A; +I=b-l*kMath[34]; +J=l*kMath[35]; +} +b=I-J; +D=(I-b)-J; +}else if(h<0x3c900000){ +return b; +}else{ +A=0; +} +var L=0.5*b; +var M=b*L; +var N=1+M*((kMath[46+0]) ++M*((kMath[46+1]) ++M* +((kMath[46+2]) ++M*((kMath[46+3]) ++M*(kMath[46+4]) +)))); +l=3-N*L; +var P=M*((N-l)/(6-b*l)); +if(A===0){ +return b-(b*P-M); +}else{ +P=(b*(P-D)-D); +P-=M; +if(A===-1)return 0.5*(b-P)-0.5; +if(A===1){ +if(b<-0.25)return-2*(P-(b+0.5)); +return 1+2*(b-P); +} +if(A<=-2||A>56){ +c=1-(P-b); +c=%_ConstructDouble(%_DoubleHi(c)+(A<<20),%_DoubleLo(c)); +return c-1; +} +if(A<20){ +l=%_ConstructDouble(0x3ff00000-(0x200000>>A),0); +c=l-(P-b); +c=%_ConstructDouble(%_DoubleHi(c)+(A<<20),%_DoubleLo(c)); +}else{ +l=%_ConstructDouble((0x3ff-A)<<20,0); +c=b-(P+l); +c+=1; +c=%_ConstructDouble(%_DoubleHi(c)+(A<<20),%_DoubleLo(c)); +} +} +return c; +} + + + +function MathSinh(b){ +b=b*1; +var Q=(b<0)?-0.5:0.5; +var z=$abs(b); +if(z<22){ +if(z<3.725290298461914e-9)return b; +var l=MathExpm1(z); +if(z<1)return Q*(2*l-l*l/(l+1)); +return Q*(l+l/(l+1)); +} +if(z<709.7822265625)return Q*$exp(z); +if(z<=kMath[51]){ +var g=$exp(0.5*z); +var l=Q*g; +return l*g; +} +return b*(1/0); +} + +function MathCosh(b){ +b=b*1; +var i=%_DoubleHi(b)&0x7fffffff; +if(i<0x3fd62e43){ +var l=MathExpm1($abs(b)); +var g=1+l; +if(i<0x3c800000)return g; +return 1+(l*l)/(g+g); +} +if(i<0x40360000){ +var l=$exp($abs(b)); +return 0.5*l+0.5/l; +} +if(i<0x40862e42)return 0.5*$exp($abs(b)); +if($abs(b)<=kMath[51]){ +var g=$exp(0.5*$abs(b)); +var l=0.5*g; +return l*g; +} +if((!%_IsSmi(%IS_VAR(b))&&!(b==b)))return b; +return(1/0); +} + + + +function MathLog10(b){ +b=b*1; +var h=%_DoubleHi(b); +var R=%_DoubleLo(b); +var A=0; +if(h<0x00100000){ +if(((h&0x7fffffff)|R)===0)return-(1/0); +if(h<0)return $NaN; +A-=54; +b*=18014398509481984; +h=%_DoubleHi(b); +R=%_DoubleLo(b); +} +if(h>=0x7ff00000)return b; +A+=(h>>20)-1023; +var S=(A&0x80000000)>>>31; +h=(h&0x000fffff)|((0x3ff-S)<<20); +var c=A+S; +b=%_ConstructDouble(h,R); +var e=c*kMath[54]+kMath[52]*%_MathLogRT(b); +return e+c*kMath[53]; +} + + + + + + +function MathLog2(b){ +b=b*1; +var z=$abs(b); +var h=%_DoubleHi(b); +var R=%_DoubleLo(b); +var i=h&0x7fffffff; +if((i|R)==0)return-(1/0); +if(h<0)return $NaN; +if(i>=0x7ff00000)return b; +var o=0; +if(i<0x00100000){ +z*=9007199254740992; +o-=53; +i=%_DoubleHi(z); +} +o+=(i>>20)-0x3ff; +var T=i&0x000fffff; +i=T|0x3ff00000; +var U=1; +var W=0; +var X=0; +if(T>0x3988e){ +if(T<0xbb67a){ +U=1.5; +W=kMath[64]; +X=kMath[65]; +}else{ +o+=1; +i-=0x00100000; +} +} +z=%_ConstructDouble(i,%_DoubleLo(z)); +var E=z-U; +var j=1/(z+U); +var Y=E*j; +var Z=%_ConstructDouble(%_DoubleHi(Y),0); +var aa=%_ConstructDouble(%_DoubleHi(z+U),0) +var ab=z-(aa-U); +var ac=j*((E-Z*aa)-Z*ab); +var ad=Y*Y; +var n=ad*ad*((kMath[55+0]) ++ad*((kMath[55+1]) ++ad*((kMath[55+2]) ++ad*( +(kMath[55+3]) ++ad*((kMath[55+4]) ++ad*(kMath[55+5]) +))))); +n+=ac*(Z+Y); +ad=Z*Z; +aa=%_ConstructDouble(%_DoubleHi(3.0+ad+n),0); +ab=n-((aa-3.0)-ad); +E=Z*aa; +j=ac*aa+ab*Y; +p_h=%_ConstructDouble(%_DoubleHi(E+j),0); +p_l=j-(p_h-E); +z_h=kMath[62]*p_h; +z_l=kMath[63]*p_h+p_l*kMath[61]+X; +var l=o; +var ae=%_ConstructDouble(%_DoubleHi(((z_h+z_l)+W)+l),0); +var af=z_l-(((ae-l)-W)-z_h); +return ae+af; +} +InstallFunctions(a,2,[ +"cos",MathCos, +"sin",MathSin, +"tan",MathTan, +"sinh",MathSinh, +"cosh",MathCosh, +"log10",MathLog10, +"log2",MathLog2, +"log1p",MathLog1p, +"expm1",MathExpm1 +]); +%SetInlineBuiltinFlag(MathSin); +%SetInlineBuiltinFlag(MathCos); +})(); + +dateAå +var $createDate; +(function(){ +"use strict"; +%CheckIsBootstrapping(); +var a=global.Date; +function ThrowDateTypeError(){ +throw new $TypeError('this is not a Date object.'); +} +var b=$NaN; +var c; +function LocalTimezone(d){ +if((!%_IsSmi(%IS_VAR(d))&&!(d==d)))return""; +CheckDateCacheCurrent(); +if(d==b){ +return c; +} +var e=%DateLocalTimezone(d); +b=d; +c=e; +return e; +} +function UTC(g){ +if((!%_IsSmi(%IS_VAR(g))&&!(g==g)))return g; +return %DateToUTC(g); +} +function MakeTime(h,i,j,k){ +if(!$isFinite(h))return $NaN; +if(!$isFinite(i))return $NaN; +if(!$isFinite(j))return $NaN; +if(!$isFinite(k))return $NaN; +return(%_IsSmi(%IS_VAR(h))?h:%NumberToInteger(ToNumber(h)))*3600000 ++(%_IsSmi(%IS_VAR(i))?i:%NumberToInteger(ToNumber(i)))*60000 ++(%_IsSmi(%IS_VAR(j))?j:%NumberToInteger(ToNumber(j)))*1000 ++(%_IsSmi(%IS_VAR(k))?k:%NumberToInteger(ToNumber(k))); +} +function TimeInYear(l){ +return DaysInYear(l)*86400000; +} +function MakeDay(l,m,n){ +if(!$isFinite(l)||!$isFinite(m)||!$isFinite(n))return $NaN; +l=(%_IsSmi(%IS_VAR(l))?l:%NumberToIntegerMapMinusZero(ToNumber(l))); +m=(%_IsSmi(%IS_VAR(m))?m:%NumberToIntegerMapMinusZero(ToNumber(m))); +n=(%_IsSmi(%IS_VAR(n))?n:%NumberToIntegerMapMinusZero(ToNumber(n))); +if(l<-1000000||l>1000000|| +m<-10000000||m>10000000){ +return $NaN; +} +return %DateMakeDay(l|0,m|0)+n-1; +} +function MakeDate(o,g){ +var g=o*86400000+g; +if($abs(g)>8640002592000000)return $NaN; +return g; +} +function TimeClip(g){ +if(!$isFinite(g))return $NaN; +if($abs(g)>8640000000000000)return $NaN; +return(%_IsSmi(%IS_VAR(g))?g:%NumberToInteger(ToNumber(g))); +} +var q={ +time:0, +string:null +}; +function DateConstructor(l,m,n,r,t,u,k){ +if(!%_IsConstructCall()){ +return(new a()).toString(); +} +var w=%_ArgumentsLength(); +var z; +if(w==0){ +z=%DateCurrentTime(); +(%DateSetValue(this,z,1)); +}else if(w==1){ +if((typeof(l)==='number')){ +z=l; +}else if((typeof(l)==='string')){ +CheckDateCacheCurrent(); +var A=q; +if(A.string===l){ +z=A.time; +}else{ +z=DateParse(l); +if(!(!%_IsSmi(%IS_VAR(z))&&!(z==z))){ +A.time=z; +A.string=l; +} +} +}else{ +var g=ToPrimitive(l,1); +z=(typeof(g)==='string')?DateParse(g):ToNumber(g); +} +(%DateSetValue(this,z,1)); +}else{ +l=ToNumber(l); +m=ToNumber(m); +n=w>2?ToNumber(n):1; +r=w>3?ToNumber(r):0; +t=w>4?ToNumber(t):0; +u=w>5?ToNumber(u):0; +k=w>6?ToNumber(k):0; +l=(!(!%_IsSmi(%IS_VAR(l))&&!(l==l))&& +0<=(%_IsSmi(%IS_VAR(l))?l:%NumberToInteger(ToNumber(l)))&& +(%_IsSmi(%IS_VAR(l))?l:%NumberToInteger(ToNumber(l)))<=99)?1900+(%_IsSmi(%IS_VAR(l))?l:%NumberToInteger(ToNumber(l))):l; +var o=MakeDay(l,m,n); +var g=MakeTime(r,t,u,k); +z=MakeDate(o,g); +(%DateSetValue(this,z,0)); +} +} +var B=['Sun','Mon','Tue','Wed','Thu','Fri','Sat']; +var C=['Jan','Feb','Mar','Apr','May','Jun', +'Jul','Aug','Sep','Oct','Nov','Dec']; +function TwoDigitString(z){ +return z<10?"0"+z:""+z; +} +function DateString(n){ +return B[(%_DateField(n,4))]+' ' ++C[(%_DateField(n,2))]+' ' ++TwoDigitString((%_DateField(n,3)))+' ' ++(%_DateField(n,1)); +} +var D=['Sunday','Monday','Tuesday','Wednesday', +'Thursday','Friday','Saturday']; +var E=['January','February','March','April','May','June', +'July','August','September','October','November','December']; +function LongDateString(n){ +return D[(%_DateField(n,4))]+', ' ++E[(%_DateField(n,2))]+' ' ++TwoDigitString((%_DateField(n,3)))+', ' ++(%_DateField(n,1)); +} +function TimeString(n){ +return TwoDigitString((%_DateField(n,5)))+':' ++TwoDigitString((%_DateField(n,6)))+':' ++TwoDigitString((%_DateField(n,7))); +} +function TimeStringUTC(n){ +return TwoDigitString((%_DateField(n,15)))+':' ++TwoDigitString((%_DateField(n,16)))+':' ++TwoDigitString((%_DateField(n,17))); +} +function LocalTimezoneString(n){ +var e=LocalTimezone((%_DateField(n,0))); +var G=-(%_DateField(n,21)); +var H=(G>=0)?1:-1; +var r=$floor((H*G)/60); +var i=$floor((H*G)%60); +var I=' GMT'+((H==1)?'+':'-')+ +TwoDigitString(r)+TwoDigitString(i); +return I+' ('+e+')'; +} +function DatePrintString(n){ +return DateString(n)+' '+TimeString(n); +} +var J=new InternalArray(8); +function DateParse(K){ +var L=%DateParseString(ToString(K),J); +if((L===null))return $NaN; +var o=MakeDay(L[0],L[1],L[2]); +var g=MakeTime(L[3],L[4],L[5],L[6]); +var n=MakeDate(o,g); +if((L[7]===null)){ +return TimeClip(UTC(n)); +}else{ +return TimeClip(n-L[7]*1000); +} +} +function DateUTC(l,m,n,r,t,u,k){ +l=ToNumber(l); +m=ToNumber(m); +var w=%_ArgumentsLength(); +n=w>2?ToNumber(n):1; +r=w>3?ToNumber(r):0; +t=w>4?ToNumber(t):0; +u=w>5?ToNumber(u):0; +k=w>6?ToNumber(k):0; +l=(!(!%_IsSmi(%IS_VAR(l))&&!(l==l))&& +0<=(%_IsSmi(%IS_VAR(l))?l:%NumberToInteger(ToNumber(l)))&& +(%_IsSmi(%IS_VAR(l))?l:%NumberToInteger(ToNumber(l)))<=99)?1900+(%_IsSmi(%IS_VAR(l))?l:%NumberToInteger(ToNumber(l))):l; +var o=MakeDay(l,m,n); +var g=MakeTime(r,t,u,k); +return TimeClip(MakeDate(o,g)); +} +function DateNow(){ +return %DateCurrentTime(); +} +function DateToString(){ +var d=(%_DateField(this,0)) +if((!%_IsSmi(%IS_VAR(d))&&!(d==d)))return'Invalid Date'; +var M=LocalTimezoneString(this) +return DatePrintString(this)+M; +} +function DateToDateString(){ +var d=(%_DateField(this,0)); +if((!%_IsSmi(%IS_VAR(d))&&!(d==d)))return'Invalid Date'; +return DateString(this); +} +function DateToTimeString(){ +var d=(%_DateField(this,0)); +if((!%_IsSmi(%IS_VAR(d))&&!(d==d)))return'Invalid Date'; +var M=LocalTimezoneString(this); +return TimeString(this)+M; +} +function DateToLocaleString(){ +return %_CallFunction(this,DateToString); +} +function DateToLocaleDateString(){ +var d=(%_DateField(this,0)); +if((!%_IsSmi(%IS_VAR(d))&&!(d==d)))return'Invalid Date'; +return LongDateString(this); +} +function DateToLocaleTimeString(){ +var d=(%_DateField(this,0)); +if((!%_IsSmi(%IS_VAR(d))&&!(d==d)))return'Invalid Date'; +return TimeString(this); +} +function DateValueOf(){ +return(%_DateField(this,0)); +} +function DateGetTime(){ +return(%_DateField(this,0)); +} +function DateGetFullYear(){ +return(%_DateField(this,1)); +} +function DateGetUTCFullYear(){ +return(%_DateField(this,11)); +} +function DateGetMonth(){ +return(%_DateField(this,2)); +} +function DateGetUTCMonth(){ +return(%_DateField(this,12)); +} +function DateGetDate(){ +return(%_DateField(this,3)); +} +function DateGetUTCDate(){ +return(%_DateField(this,13)); +} +function DateGetDay(){ +return(%_DateField(this,4)); +} +function DateGetUTCDay(){ +return(%_DateField(this,14)); +} +function DateGetHours(){ +return(%_DateField(this,5)); +} +function DateGetUTCHours(){ +return(%_DateField(this,15)); +} +function DateGetMinutes(){ +return(%_DateField(this,6)); +} +function DateGetUTCMinutes(){ +return(%_DateField(this,16)); +} +function DateGetSeconds(){ +return(%_DateField(this,7)); +} +function DateGetUTCSeconds(){ +return(%_DateField(this,17)) +} +function DateGetMilliseconds(){ +return(%_DateField(this,8)); +} +function DateGetUTCMilliseconds(){ +return(%_DateField(this,18)); +} +function DateGetTimezoneOffset(){ +return(%_DateField(this,21)); +} +function DateSetTime(k){ +if(%_ClassOf(this)!=='Date')ThrowDateTypeError(); +(%DateSetValue(this,ToNumber(k),1)); +return(%_DateField(this,0)); +} +function DateSetMilliseconds(k){ +var d=(%_DateField(this,0)+%_DateField(this,21)); +k=ToNumber(k); +var g=MakeTime((%_DateField(this,5)),(%_DateField(this,6)),(%_DateField(this,7)),k); +return(%DateSetValue(this,MakeDate((%_DateField(this,9)),g),0)); +} +function DateSetUTCMilliseconds(k){ +var d=(%_DateField(this,0)); +k=ToNumber(k); +var g=MakeTime((%_DateField(this,15)), +(%_DateField(this,16)), +(%_DateField(this,17)), +k); +return(%DateSetValue(this,MakeDate((%_DateField(this,19)),g),1)); +} +function DateSetSeconds(j,k){ +var d=(%_DateField(this,0)+%_DateField(this,21)); +j=ToNumber(j); +k=%_ArgumentsLength()<2?(%_DateField(this,8)):ToNumber(k); +var g=MakeTime((%_DateField(this,5)),(%_DateField(this,6)),j,k); +return(%DateSetValue(this,MakeDate((%_DateField(this,9)),g),0)); +} +function DateSetUTCSeconds(j,k){ +var d=(%_DateField(this,0)); +j=ToNumber(j); +k=%_ArgumentsLength()<2?(%_DateField(this,18)):ToNumber(k); +var g=MakeTime((%_DateField(this,15)),(%_DateField(this,16)),j,k); +return(%DateSetValue(this,MakeDate((%_DateField(this,19)),g),1)); +} +function DateSetMinutes(i,j,k){ +var d=(%_DateField(this,0)+%_DateField(this,21)); +i=ToNumber(i); +var w=%_ArgumentsLength(); +j=w<2?(%_DateField(this,7)):ToNumber(j); +k=w<3?(%_DateField(this,8)):ToNumber(k); +var g=MakeTime((%_DateField(this,5)),i,j,k); +return(%DateSetValue(this,MakeDate((%_DateField(this,9)),g),0)); +} +function DateSetUTCMinutes(i,j,k){ +var d=(%_DateField(this,0)); +i=ToNumber(i); +var w=%_ArgumentsLength(); +j=w<2?(%_DateField(this,17)):ToNumber(j); +k=w<3?(%_DateField(this,18)):ToNumber(k); +var g=MakeTime((%_DateField(this,15)),i,j,k); +return(%DateSetValue(this,MakeDate((%_DateField(this,19)),g),1)); +} +function DateSetHours(h,i,j,k){ +var d=(%_DateField(this,0)+%_DateField(this,21)); +h=ToNumber(h); +var w=%_ArgumentsLength(); +i=w<2?(%_DateField(this,6)):ToNumber(i); +j=w<3?(%_DateField(this,7)):ToNumber(j); +k=w<4?(%_DateField(this,8)):ToNumber(k); +var g=MakeTime(h,i,j,k); +return(%DateSetValue(this,MakeDate((%_DateField(this,9)),g),0)); +} +function DateSetUTCHours(h,i,j,k){ +var d=(%_DateField(this,0)); +h=ToNumber(h); +var w=%_ArgumentsLength(); +i=w<2?(%_DateField(this,16)):ToNumber(i); +j=w<3?(%_DateField(this,17)):ToNumber(j); +k=w<4?(%_DateField(this,18)):ToNumber(k); +var g=MakeTime(h,i,j,k); +return(%DateSetValue(this,MakeDate((%_DateField(this,19)),g),1)); +} +function DateSetDate(n){ +var d=(%_DateField(this,0)+%_DateField(this,21)); +n=ToNumber(n); +var o=MakeDay((%_DateField(this,1)),(%_DateField(this,2)),n); +return(%DateSetValue(this,MakeDate(o,(%_DateField(this,10))),0)); +} +function DateSetUTCDate(n){ +var d=(%_DateField(this,0)); +n=ToNumber(n); +var o=MakeDay((%_DateField(this,11)),(%_DateField(this,12)),n); +return(%DateSetValue(this,MakeDate(o,(%_DateField(this,20))),1)); +} +function DateSetMonth(m,n){ +var d=(%_DateField(this,0)+%_DateField(this,21)); +m=ToNumber(m); +n=%_ArgumentsLength()<2?(%_DateField(this,3)):ToNumber(n); +var o=MakeDay((%_DateField(this,1)),m,n); +return(%DateSetValue(this,MakeDate(o,(%_DateField(this,10))),0)); +} +function DateSetUTCMonth(m,n){ +var d=(%_DateField(this,0)); +m=ToNumber(m); +n=%_ArgumentsLength()<2?(%_DateField(this,13)):ToNumber(n); +var o=MakeDay((%_DateField(this,11)),m,n); +return(%DateSetValue(this,MakeDate(o,(%_DateField(this,20))),1)); +} +function DateSetFullYear(l,m,n){ +var d=(%_DateField(this,0)+%_DateField(this,21)); +l=ToNumber(l); +var w=%_ArgumentsLength(); +var g; +if((!%_IsSmi(%IS_VAR(d))&&!(d==d))){ +m=w<2?0:ToNumber(m); +n=w<3?1:ToNumber(n); +g=0; +}else{ +m=w<2?(%_DateField(this,2)):ToNumber(m); +n=w<3?(%_DateField(this,3)):ToNumber(n); +g=(%_DateField(this,10)); +} +var o=MakeDay(l,m,n); +return(%DateSetValue(this,MakeDate(o,g),0)); +} +function DateSetUTCFullYear(l,m,n){ +var d=(%_DateField(this,0)); +l=ToNumber(l); +var w=%_ArgumentsLength(); +var g; +if((!%_IsSmi(%IS_VAR(d))&&!(d==d))){ +m=w<2?0:ToNumber(m); +n=w<3?1:ToNumber(n); +g=0; +}else{ +m=w<2?(%_DateField(this,12)):ToNumber(m); +n=w<3?(%_DateField(this,13)):ToNumber(n); +g=(%_DateField(this,20)); +} +var o=MakeDay(l,m,n); +return(%DateSetValue(this,MakeDate(o,g),1)); +} +function DateToUTCString(){ +var d=(%_DateField(this,0)); +if((!%_IsSmi(%IS_VAR(d))&&!(d==d)))return'Invalid Date'; +return B[(%_DateField(this,14))]+', ' ++TwoDigitString((%_DateField(this,13)))+' ' ++C[(%_DateField(this,12))]+' ' ++(%_DateField(this,11))+' ' ++TimeStringUTC(this)+' GMT'; +} +function DateGetYear(){ +return(%_DateField(this,1))-1900; +} +function DateSetYear(l){ +if(%_ClassOf(this)!=='Date')ThrowDateTypeError(); +l=ToNumber(l); +if((!%_IsSmi(%IS_VAR(l))&&!(l==l)))return(%DateSetValue(this,$NaN,1)); +l=(0<=(%_IsSmi(%IS_VAR(l))?l:%NumberToInteger(ToNumber(l)))&&(%_IsSmi(%IS_VAR(l))?l:%NumberToInteger(ToNumber(l)))<=99) +?1900+(%_IsSmi(%IS_VAR(l))?l:%NumberToInteger(ToNumber(l))):l; +var d=(%_DateField(this,0)+%_DateField(this,21)); +var m,n,g; +if((!%_IsSmi(%IS_VAR(d))&&!(d==d))){ +m=0; +n=1; +g=0; +}else{ +m=(%_DateField(this,2)); +n=(%_DateField(this,3)); +g=(%_DateField(this,10)); +} +var o=MakeDay(l,m,n); +return(%DateSetValue(this,MakeDate(o,g),0)); +} +function DateToGMTString(){ +return %_CallFunction(this,DateToUTCString); +} +function PadInt(N,P){ +if(P==1)return N; +return N<%_MathPow(10,P-1)?'0'+PadInt(N,P-1):N; +} +function DateToISOString(){ +var d=(%_DateField(this,0)); +if((!%_IsSmi(%IS_VAR(d))&&!(d==d)))throw MakeRangeError("invalid_time_value",[]); +var l=this.getUTCFullYear(); +var Q; +if(l>=0&&l<=9999){ +Q=PadInt(l,4); +}else{ +if(l<0){ +Q="-"+PadInt(-l,6); +}else{ +Q="+"+PadInt(l,6); +} +} +return Q+ +'-'+PadInt(this.getUTCMonth()+1,2)+ +'-'+PadInt(this.getUTCDate(),2)+ +'T'+PadInt(this.getUTCHours(),2)+ +':'+PadInt(this.getUTCMinutes(),2)+ +':'+PadInt(this.getUTCSeconds(),2)+ +'.'+PadInt(this.getUTCMilliseconds(),3)+ +'Z'; +} +function DateToJSON(R){ +var S=ToObject(this); +var T=DefaultNumber(S); +if((typeof(T)==='number')&&!(%_IsSmi(%IS_VAR(T))||((T==T)&&(T!=1/0)&&(T!=-1/0)))){ +return null; +} +return S.toISOString(); +} +var U; +var W=$NaN; +function CheckDateCacheCurrent(){ +if(!U){ +U=%DateCacheVersion(); +if(!U)return; +} +if(U[0]==W){ +return; +} +W=U[0]; +b=$NaN; +c=(void 0); +q.time=$NaN; +q.string=null; +} +function CreateDate(g){ +var n=new a(); +n.setTime(g); +return n; +} +%SetCode(a,DateConstructor); +%FunctionSetPrototype(a,new a($NaN)); +InstallFunctions(a,2,[ +"UTC",DateUTC, +"parse",DateParse, +"now",DateNow +]); +%AddNamedProperty(a.prototype,"constructor",a,2); +InstallFunctions(a.prototype,2,[ +"toString",DateToString, +"toDateString",DateToDateString, +"toTimeString",DateToTimeString, +"toLocaleString",DateToLocaleString, +"toLocaleDateString",DateToLocaleDateString, +"toLocaleTimeString",DateToLocaleTimeString, +"valueOf",DateValueOf, +"getTime",DateGetTime, +"getFullYear",DateGetFullYear, +"getUTCFullYear",DateGetUTCFullYear, +"getMonth",DateGetMonth, +"getUTCMonth",DateGetUTCMonth, +"getDate",DateGetDate, +"getUTCDate",DateGetUTCDate, +"getDay",DateGetDay, +"getUTCDay",DateGetUTCDay, +"getHours",DateGetHours, +"getUTCHours",DateGetUTCHours, +"getMinutes",DateGetMinutes, +"getUTCMinutes",DateGetUTCMinutes, +"getSeconds",DateGetSeconds, +"getUTCSeconds",DateGetUTCSeconds, +"getMilliseconds",DateGetMilliseconds, +"getUTCMilliseconds",DateGetUTCMilliseconds, +"getTimezoneOffset",DateGetTimezoneOffset, +"setTime",DateSetTime, +"setMilliseconds",DateSetMilliseconds, +"setUTCMilliseconds",DateSetUTCMilliseconds, +"setSeconds",DateSetSeconds, +"setUTCSeconds",DateSetUTCSeconds, +"setMinutes",DateSetMinutes, +"setUTCMinutes",DateSetUTCMinutes, +"setHours",DateSetHours, +"setUTCHours",DateSetUTCHours, +"setDate",DateSetDate, +"setUTCDate",DateSetUTCDate, +"setMonth",DateSetMonth, +"setUTCMonth",DateSetUTCMonth, +"setFullYear",DateSetFullYear, +"setUTCFullYear",DateSetUTCFullYear, +"toGMTString",DateToGMTString, +"toUTCString",DateToUTCString, +"getYear",DateGetYear, +"setYear",DateSetYear, +"toISOString",DateToISOString, +"toJSON",DateToJSON +]); +$createDate=CreateDate; +})(); + +regexp9m +var $regexpExec; +var $regexpExecNoTests; +var $regexpLastMatchInfo; +var $regexpLastMatchInfoOverride; +var harmony_regexps=false; +var harmony_unicode_regexps=false; +(function(){ +%CheckIsBootstrapping(); +var a=global.RegExp; +$regexpLastMatchInfo=new InternalPackedArray( +2, +"", +(void 0), +0, +0 +); +$regexpLastMatchInfoOverride=null; +function DoConstructRegExp(b,c,d){ +if((%_IsRegExp(c))){ +if(!(d===(void 0))){ +throw MakeTypeError('regexp_flags',[]); +} +d=(c.global?'g':'') ++(c.ignoreCase?'i':'') ++(c.multiline?'m':''); +if(harmony_unicode_regexps) +d+=(c.unicode?'u':''); +if(harmony_regexps) +d+=(c.sticky?'y':''); +c=c.source; +} +c=(c===(void 0))?'':ToString(c); +d=(d===(void 0))?'':ToString(d); +%RegExpInitializeAndCompile(b,c,d); +} +function RegExpConstructor(c,d){ +if(%_IsConstructCall()){ +DoConstructRegExp(this,c,d); +}else{ +if((%_IsRegExp(c))&&(d===(void 0))){ +return c; +} +return new a(c,d); +} +} +function RegExpCompileJS(c,d){ +if(this==a.prototype){ +throw MakeTypeError(8, +'RegExp.prototype.compile',this); +} +if((c===(void 0))&&%_ArgumentsLength()!=0){ +DoConstructRegExp(this,'undefined',d); +}else{ +DoConstructRegExp(this,c,d); +} +} +function DoRegExpExec(e,g,h){ +var i=%_RegExpExec(e,g,h,$regexpLastMatchInfo); +if(i!==null)$regexpLastMatchInfoOverride=null; +return i; +} +function RegExpExecNoTests(e,g,j){ +var k=%_RegExpExec(e,g,j,$regexpLastMatchInfo); +if(k!==null){ +$regexpLastMatchInfoOverride=null; +var l=((k)[0])>>1; +var j=k[3]; +var m=k[4]; +var n=%_SubString(g,j,m); +var i=%_RegExpConstructResult(l,j,g); +i[0]=n; +if(l==1)return i; +var o=3+2; +for(var q=1;qg.length){ +this.lastIndex=0; +return null; +} +}else{ +q=0; +} +var u=%_RegExpExec(this,g,q,$regexpLastMatchInfo); +if((u===null)){ +this.lastIndex=0; +return null; +} +$regexpLastMatchInfoOverride=null; +if(t){ +this.lastIndex=$regexpLastMatchInfo[4]; +} +var l=((u)[0])>>1; +var j=u[3]; +var m=u[4]; +var n=%_SubString(g,j,m); +var i=%_RegExpConstructResult(l,j,g); +i[0]=n; +if(l==1)return i; +var o=3+2; +for(var q=1;qg.length){ +this.lastIndex=0; +return false; +} +var u=%_RegExpExec(this,g,q,$regexpLastMatchInfo); +if((u===null)){ +this.lastIndex=0; +return false; +} +$regexpLastMatchInfoOverride=null; +this.lastIndex=$regexpLastMatchInfo[4]; +return true; +}else{ +var e=this; +if(e.source.length>=3&& +%_StringCharCodeAt(e.source,0)==46&& +%_StringCharCodeAt(e.source,1)==42&& +%_StringCharCodeAt(e.source,2)!=63){ +e=TrimRegExp(e); +} +var u=%_RegExpExec(e,g,0,$regexpLastMatchInfo); +if((u===null)){ +this.lastIndex=0; +return false; +} +$regexpLastMatchInfoOverride=null; +return true; +} +} +function TrimRegExp(e){ +if(!%_ObjectEquals(w,e)){ +w=e; +z= +new a(%_SubString(e.source,2,e.source.length), +(e.ignoreCase?e.multiline?"im":"i" +:e.multiline?"m":"")); +} +return z; +} +function RegExpToString(){ +if(!(%_IsRegExp(this))){ +throw MakeTypeError(8, +'RegExp.prototype.toString',this); +} +var i='/'+this.source+'/'; +if(this.global)i+='g'; +if(this.ignoreCase)i+='i'; +if(this.multiline)i+='m'; +if(harmony_unicode_regexps&&this.unicode)i+='u'; +if(harmony_regexps&&this.sticky)i+='y'; +return i; +} +function RegExpGetLastMatch(){ +if($regexpLastMatchInfoOverride!==null){ +return(($regexpLastMatchInfoOverride)[0]); +} +var A=(($regexpLastMatchInfo)[1]); +return %_SubString(A, +$regexpLastMatchInfo[3], +$regexpLastMatchInfo[4]); +} +function RegExpGetLastParen(){ +if($regexpLastMatchInfoOverride){ +var B=$regexpLastMatchInfoOverride; +if(B.length<=3)return''; +return B[B.length-3]; +} +var C=(($regexpLastMatchInfo)[0]); +if(C<=2)return''; +var A=(($regexpLastMatchInfo)[1]); +var j=$regexpLastMatchInfo[(3+(C-2))]; +var m=$regexpLastMatchInfo[(3+(C-1))]; +if(j!=-1&&m!=-1){ +return %_SubString(A,j,m); +} +return""; +} +function RegExpGetLeftContext(){ +var D; +var E; +if(!$regexpLastMatchInfoOverride){ +D=$regexpLastMatchInfo[3]; +E=(($regexpLastMatchInfo)[1]); +}else{ +var B=$regexpLastMatchInfoOverride; +D=((B)[(B).length-2]); +E=((B)[(B).length-1]); +} +return %_SubString(E,0,D); +} +function RegExpGetRightContext(){ +var D; +var E; +if(!$regexpLastMatchInfoOverride){ +D=$regexpLastMatchInfo[4]; +E=(($regexpLastMatchInfo)[1]); +}else{ +var B=$regexpLastMatchInfoOverride; +E=((B)[(B).length-1]); +var G=((B)[0]); +D=((B)[(B).length-2])+G.length; +} +return %_SubString(E,D,E.length); +} +function RegExpMakeCaptureGetter(H){ +return function foo(){ +if($regexpLastMatchInfoOverride){ +if(H<$regexpLastMatchInfoOverride.length-2){ +return(($regexpLastMatchInfoOverride)[(H)]); +} +return''; +} +var h=H*2; +if(h>=(($regexpLastMatchInfo)[0]))return''; +var I=$regexpLastMatchInfo[(3+(h))]; +var J=$regexpLastMatchInfo[(3+(h+1))]; +if(I==-1||J==-1)return''; +return %_SubString((($regexpLastMatchInfo)[1]),I,J); +}; +} +%FunctionSetInstanceClassName(a,'RegExp'); +%AddNamedProperty( +a.prototype,'constructor',a,2); +%SetCode(a,RegExpConstructor); +InstallFunctions(a.prototype,2,[ +"exec",RegExpExecJS, +"test",RegExpTest, +"toString",RegExpToString, +"compile",RegExpCompileJS +]); +%FunctionSetLength(a.prototype.compile,1); +var K=function(){ +var L=(($regexpLastMatchInfo)[2]); +return(L===(void 0))?"":L; +}; +var M=function(g){ +(($regexpLastMatchInfo)[2])=ToString(g); +}; +%OptimizeObjectForAddingMultipleProperties(a,22); +%DefineAccessorPropertyUnchecked(a,'input',K, +M,4); +%DefineAccessorPropertyUnchecked(a,'$_',K, +M,2|4); +var N=false; +var P=function(){return N;}; +var Q=function(R){N=R?true:false;}; +%DefineAccessorPropertyUnchecked(a,'multiline',P, +Q,4); +%DefineAccessorPropertyUnchecked(a,'$*',P, +Q, +2|4); +var S=function(T){}; +%DefineAccessorPropertyUnchecked(a,'lastMatch',RegExpGetLastMatch, +S,4); +%DefineAccessorPropertyUnchecked(a,'$&',RegExpGetLastMatch, +S,2|4); +%DefineAccessorPropertyUnchecked(a,'lastParen',RegExpGetLastParen, +S,4); +%DefineAccessorPropertyUnchecked(a,'$+',RegExpGetLastParen, +S,2|4); +%DefineAccessorPropertyUnchecked(a,'leftContext', +RegExpGetLeftContext,S, +4); +%DefineAccessorPropertyUnchecked(a,'$`',RegExpGetLeftContext, +S,2|4); +%DefineAccessorPropertyUnchecked(a,'rightContext', +RegExpGetRightContext,S, +4); +%DefineAccessorPropertyUnchecked(a,"$'",RegExpGetRightContext, +S,2|4); +for(var q=1;q<10;++q){ +%DefineAccessorPropertyUnchecked(a,'$'+q, +RegExpMakeCaptureGetter(q),S, +4); +} +%ToFastProperties(a); +$regexpExecNoTests=RegExpExecNoTests; +$regexpExec=DoRegExpExec; +})(); + +,arraybufferE +(function(){ +"use strict"; +%CheckIsBootstrapping(); +var a=global.ArrayBuffer; +var b=global.Object; +function ArrayBufferConstructor(c){ +if(%_IsConstructCall()){ +var d=ToPositiveInteger(c,'invalid_array_buffer_length'); +%ArrayBufferInitialize(this,d); +}else{ +throw MakeTypeError('constructor_not_function',["ArrayBuffer"]); +} +} +function ArrayBufferGetByteLen(){ +if(!(%_ClassOf(this)==='ArrayBuffer')){ +throw MakeTypeError(8, +'ArrayBuffer.prototype.byteLength',this); +} +return %_ArrayBufferGetByteLength(this); +} +function ArrayBufferSlice(e,g){ +if(!(%_ClassOf(this)==='ArrayBuffer')){ +throw MakeTypeError(8, +'ArrayBuffer.prototype.slice',this); +} +var h=(%_IsSmi(%IS_VAR(e))?e:%NumberToInteger(ToNumber(e))); +if(!(g===(void 0))){ +g=(%_IsSmi(%IS_VAR(g))?g:%NumberToInteger(ToNumber(g))); +} +var i; +var j=%_ArrayBufferGetByteLength(this); +if(h<0){ +i=$max(j+h,0); +}else{ +i=$min(h,j); +} +var k=(g===(void 0))?j:g; +var l; +if(k<0){ +l=$max(j+k,0); +}else{ +l=$min(k,j); +} +if(lh){ +throw MakeRangeError("invalid_typed_array_offset"); +} +} +var j; +var k; +if((g===(void 0))){ +if(h % 1!==0){ +throw MakeRangeError("invalid_typed_array_alignment", +["byte length","Uint8Array",1]); +} +j=h-i; +k=j/1; +}else{ +var k=g; +j=k*1; +} +if((i+j>h) +||(k>%_MaxSmi())){ +throw MakeRangeError("invalid_typed_array_length"); +} +%_TypedArrayInitialize(c,1,d,i,j); +} +function Uint8ArrayConstructByLength(c,g){ +var l=(g===(void 0))? +0:ToPositiveInteger(g,"invalid_typed_array_length"); +if(l>%_MaxSmi()){ +throw MakeRangeError("invalid_typed_array_length"); +} +var m=l*1; +if(m>%_TypedArrayMaxSizeInHeap()){ +var d=new b(m); +%_TypedArrayInitialize(c,1,d,0,m); +}else{ +%_TypedArrayInitialize(c,1,null,0,m); +} +} +function Uint8ArrayConstructByArrayLike(c,n){ +var g=n.length; +var l=ToPositiveInteger(g,"invalid_typed_array_length"); +if(l>%_MaxSmi()){ +throw MakeRangeError("invalid_typed_array_length"); +} +if(!%TypedArrayInitializeFromArrayLike(c,1,n,l)){ +for(var o=0;oh){ +throw MakeRangeError("invalid_typed_array_offset"); +} +} +var j; +var k; +if((g===(void 0))){ +if(h % 1!==0){ +throw MakeRangeError("invalid_typed_array_alignment", +["byte length","Int8Array",1]); +} +j=h-i; +k=j/1; +}else{ +var k=g; +j=k*1; +} +if((i+j>h) +||(k>%_MaxSmi())){ +throw MakeRangeError("invalid_typed_array_length"); +} +%_TypedArrayInitialize(c,2,d,i,j); +} +function Int8ArrayConstructByLength(c,g){ +var l=(g===(void 0))? +0:ToPositiveInteger(g,"invalid_typed_array_length"); +if(l>%_MaxSmi()){ +throw MakeRangeError("invalid_typed_array_length"); +} +var m=l*1; +if(m>%_TypedArrayMaxSizeInHeap()){ +var d=new b(m); +%_TypedArrayInitialize(c,2,d,0,m); +}else{ +%_TypedArrayInitialize(c,2,null,0,m); +} +} +function Int8ArrayConstructByArrayLike(c,n){ +var g=n.length; +var l=ToPositiveInteger(g,"invalid_typed_array_length"); +if(l>%_MaxSmi()){ +throw MakeRangeError("invalid_typed_array_length"); +} +if(!%TypedArrayInitializeFromArrayLike(c,2,n,l)){ +for(var o=0;oh){ +throw MakeRangeError("invalid_typed_array_offset"); +} +} +var j; +var k; +if((g===(void 0))){ +if(h % 2!==0){ +throw MakeRangeError("invalid_typed_array_alignment", +["byte length","Uint16Array",2]); +} +j=h-i; +k=j/2; +}else{ +var k=g; +j=k*2; +} +if((i+j>h) +||(k>%_MaxSmi())){ +throw MakeRangeError("invalid_typed_array_length"); +} +%_TypedArrayInitialize(c,3,d,i,j); +} +function Uint16ArrayConstructByLength(c,g){ +var l=(g===(void 0))? +0:ToPositiveInteger(g,"invalid_typed_array_length"); +if(l>%_MaxSmi()){ +throw MakeRangeError("invalid_typed_array_length"); +} +var m=l*2; +if(m>%_TypedArrayMaxSizeInHeap()){ +var d=new b(m); +%_TypedArrayInitialize(c,3,d,0,m); +}else{ +%_TypedArrayInitialize(c,3,null,0,m); +} +} +function Uint16ArrayConstructByArrayLike(c,n){ +var g=n.length; +var l=ToPositiveInteger(g,"invalid_typed_array_length"); +if(l>%_MaxSmi()){ +throw MakeRangeError("invalid_typed_array_length"); +} +if(!%TypedArrayInitializeFromArrayLike(c,3,n,l)){ +for(var o=0;oh){ +throw MakeRangeError("invalid_typed_array_offset"); +} +} +var j; +var k; +if((g===(void 0))){ +if(h % 2!==0){ +throw MakeRangeError("invalid_typed_array_alignment", +["byte length","Int16Array",2]); +} +j=h-i; +k=j/2; +}else{ +var k=g; +j=k*2; +} +if((i+j>h) +||(k>%_MaxSmi())){ +throw MakeRangeError("invalid_typed_array_length"); +} +%_TypedArrayInitialize(c,4,d,i,j); +} +function Int16ArrayConstructByLength(c,g){ +var l=(g===(void 0))? +0:ToPositiveInteger(g,"invalid_typed_array_length"); +if(l>%_MaxSmi()){ +throw MakeRangeError("invalid_typed_array_length"); +} +var m=l*2; +if(m>%_TypedArrayMaxSizeInHeap()){ +var d=new b(m); +%_TypedArrayInitialize(c,4,d,0,m); +}else{ +%_TypedArrayInitialize(c,4,null,0,m); +} +} +function Int16ArrayConstructByArrayLike(c,n){ +var g=n.length; +var l=ToPositiveInteger(g,"invalid_typed_array_length"); +if(l>%_MaxSmi()){ +throw MakeRangeError("invalid_typed_array_length"); +} +if(!%TypedArrayInitializeFromArrayLike(c,4,n,l)){ +for(var o=0;oh){ +throw MakeRangeError("invalid_typed_array_offset"); +} +} +var j; +var k; +if((g===(void 0))){ +if(h % 4!==0){ +throw MakeRangeError("invalid_typed_array_alignment", +["byte length","Uint32Array",4]); +} +j=h-i; +k=j/4; +}else{ +var k=g; +j=k*4; +} +if((i+j>h) +||(k>%_MaxSmi())){ +throw MakeRangeError("invalid_typed_array_length"); +} +%_TypedArrayInitialize(c,5,d,i,j); +} +function Uint32ArrayConstructByLength(c,g){ +var l=(g===(void 0))? +0:ToPositiveInteger(g,"invalid_typed_array_length"); +if(l>%_MaxSmi()){ +throw MakeRangeError("invalid_typed_array_length"); +} +var m=l*4; +if(m>%_TypedArrayMaxSizeInHeap()){ +var d=new b(m); +%_TypedArrayInitialize(c,5,d,0,m); +}else{ +%_TypedArrayInitialize(c,5,null,0,m); +} +} +function Uint32ArrayConstructByArrayLike(c,n){ +var g=n.length; +var l=ToPositiveInteger(g,"invalid_typed_array_length"); +if(l>%_MaxSmi()){ +throw MakeRangeError("invalid_typed_array_length"); +} +if(!%TypedArrayInitializeFromArrayLike(c,5,n,l)){ +for(var o=0;oh){ +throw MakeRangeError("invalid_typed_array_offset"); +} +} +var j; +var k; +if((g===(void 0))){ +if(h % 4!==0){ +throw MakeRangeError("invalid_typed_array_alignment", +["byte length","Int32Array",4]); +} +j=h-i; +k=j/4; +}else{ +var k=g; +j=k*4; +} +if((i+j>h) +||(k>%_MaxSmi())){ +throw MakeRangeError("invalid_typed_array_length"); +} +%_TypedArrayInitialize(c,6,d,i,j); +} +function Int32ArrayConstructByLength(c,g){ +var l=(g===(void 0))? +0:ToPositiveInteger(g,"invalid_typed_array_length"); +if(l>%_MaxSmi()){ +throw MakeRangeError("invalid_typed_array_length"); +} +var m=l*4; +if(m>%_TypedArrayMaxSizeInHeap()){ +var d=new b(m); +%_TypedArrayInitialize(c,6,d,0,m); +}else{ +%_TypedArrayInitialize(c,6,null,0,m); +} +} +function Int32ArrayConstructByArrayLike(c,n){ +var g=n.length; +var l=ToPositiveInteger(g,"invalid_typed_array_length"); +if(l>%_MaxSmi()){ +throw MakeRangeError("invalid_typed_array_length"); +} +if(!%TypedArrayInitializeFromArrayLike(c,6,n,l)){ +for(var o=0;oh){ +throw MakeRangeError("invalid_typed_array_offset"); +} +} +var j; +var k; +if((g===(void 0))){ +if(h % 4!==0){ +throw MakeRangeError("invalid_typed_array_alignment", +["byte length","Float32Array",4]); +} +j=h-i; +k=j/4; +}else{ +var k=g; +j=k*4; +} +if((i+j>h) +||(k>%_MaxSmi())){ +throw MakeRangeError("invalid_typed_array_length"); +} +%_TypedArrayInitialize(c,7,d,i,j); +} +function Float32ArrayConstructByLength(c,g){ +var l=(g===(void 0))? +0:ToPositiveInteger(g,"invalid_typed_array_length"); +if(l>%_MaxSmi()){ +throw MakeRangeError("invalid_typed_array_length"); +} +var m=l*4; +if(m>%_TypedArrayMaxSizeInHeap()){ +var d=new b(m); +%_TypedArrayInitialize(c,7,d,0,m); +}else{ +%_TypedArrayInitialize(c,7,null,0,m); +} +} +function Float32ArrayConstructByArrayLike(c,n){ +var g=n.length; +var l=ToPositiveInteger(g,"invalid_typed_array_length"); +if(l>%_MaxSmi()){ +throw MakeRangeError("invalid_typed_array_length"); +} +if(!%TypedArrayInitializeFromArrayLike(c,7,n,l)){ +for(var o=0;oh){ +throw MakeRangeError("invalid_typed_array_offset"); +} +} +var j; +var k; +if((g===(void 0))){ +if(h % 8!==0){ +throw MakeRangeError("invalid_typed_array_alignment", +["byte length","Float64Array",8]); +} +j=h-i; +k=j/8; +}else{ +var k=g; +j=k*8; +} +if((i+j>h) +||(k>%_MaxSmi())){ +throw MakeRangeError("invalid_typed_array_length"); +} +%_TypedArrayInitialize(c,8,d,i,j); +} +function Float64ArrayConstructByLength(c,g){ +var l=(g===(void 0))? +0:ToPositiveInteger(g,"invalid_typed_array_length"); +if(l>%_MaxSmi()){ +throw MakeRangeError("invalid_typed_array_length"); +} +var m=l*8; +if(m>%_TypedArrayMaxSizeInHeap()){ +var d=new b(m); +%_TypedArrayInitialize(c,8,d,0,m); +}else{ +%_TypedArrayInitialize(c,8,null,0,m); +} +} +function Float64ArrayConstructByArrayLike(c,n){ +var g=n.length; +var l=ToPositiveInteger(g,"invalid_typed_array_length"); +if(l>%_MaxSmi()){ +throw MakeRangeError("invalid_typed_array_length"); +} +if(!%TypedArrayInitializeFromArrayLike(c,8,n,l)){ +for(var o=0;oh){ +throw MakeRangeError("invalid_typed_array_offset"); +} +} +var j; +var k; +if((g===(void 0))){ +if(h % 1!==0){ +throw MakeRangeError("invalid_typed_array_alignment", +["byte length","Uint8ClampedArray",1]); +} +j=h-i; +k=j/1; +}else{ +var k=g; +j=k*1; +} +if((i+j>h) +||(k>%_MaxSmi())){ +throw MakeRangeError("invalid_typed_array_length"); +} +%_TypedArrayInitialize(c,9,d,i,j); +} +function Uint8ClampedArrayConstructByLength(c,g){ +var l=(g===(void 0))? +0:ToPositiveInteger(g,"invalid_typed_array_length"); +if(l>%_MaxSmi()){ +throw MakeRangeError("invalid_typed_array_length"); +} +var m=l*1; +if(m>%_TypedArrayMaxSizeInHeap()){ +var d=new b(m); +%_TypedArrayInitialize(c,9,d,0,m); +}else{ +%_TypedArrayInitialize(c,9,null,0,m); +} +} +function Uint8ClampedArrayConstructByArrayLike(c,n){ +var g=n.length; +var l=ToPositiveInteger(g,"invalid_typed_array_length"); +if(l>%_MaxSmi()){ +throw MakeRangeError("invalid_typed_array_length"); +} +if(!%TypedArrayInitializeFromArrayLike(c,9,n,l)){ +for(var o=0;o0){ +for(var o=0;o=W&&T>=U; +X--){ +N[i+X]=P[X]; +T-=S; +U-=R; +} +return X; +} +var X=CopyRightPart(); +var Y=new a(X+1-W); +for(var o=W;o<=X;o++){ +Y[o-W]=P[o]; +} +for(o=W;o<=X;o++){ +N[i+o]=Y[o-W]; +} +} +function TypedArraySet(c,i){ +var Z=(i===(void 0))?0:(%_IsSmi(%IS_VAR(i))?i:%NumberToInteger(ToNumber(i))); +if(Z<0){ +throw MakeTypeError("typed_array_set_negative_offset"); +} +if(Z>%_MaxSmi()){ +throw MakeRangeError("typed_array_set_source_too_large"); +} +switch(%TypedArraySetFastCases(this,c,Z)){ +case 0: +return; +case 1: +TypedArraySetFromOverlappingTypedArray(this,c,Z); +return; +case 2: +TypedArraySetFromArrayLike(this,c,c.length,Z); +return; +case 3: +var l=c.length; +if((l===(void 0))){ +if((typeof(c)==='number')){ +throw MakeTypeError("invalid_argument"); +} +return; +} +if(Z+l>this.length){ +throw MakeRangeError("typed_array_set_source_too_large"); +} +TypedArraySetFromArrayLike(this,c,l,Z); +return; +} +} +function TypedArrayGetToStringTag(){ +if(!%IsTypedArray(this))return; +var aa=%_ClassOf(this); +if((aa===(void 0)))return; +return aa; +} +%SetCode(global.Uint8Array,Uint8ArrayConstructor); +%FunctionSetPrototype(global.Uint8Array,new $Object()); +%AddNamedProperty(global.Uint8Array,"BYTES_PER_ELEMENT",1, +1|2|4); +%AddNamedProperty(global.Uint8Array.prototype, +"constructor",global.Uint8Array,2); +%AddNamedProperty(global.Uint8Array.prototype, +"BYTES_PER_ELEMENT",1, +1|2|4); +InstallGetter(global.Uint8Array.prototype,"buffer",Uint8Array_GetBuffer); +InstallGetter(global.Uint8Array.prototype,"byteOffset",Uint8Array_GetByteOffset, +2|4); +InstallGetter(global.Uint8Array.prototype,"byteLength",Uint8Array_GetByteLength, +2|4); +InstallGetter(global.Uint8Array.prototype,"length",Uint8Array_GetLength, +2|4); +InstallGetter(global.Uint8Array.prototype,symbolToStringTag, +TypedArrayGetToStringTag); +InstallFunctions(global.Uint8Array.prototype,2,[ +"subarray",Uint8ArraySubArray, +"set",TypedArraySet +]); + +%SetCode(global.Int8Array,Int8ArrayConstructor); +%FunctionSetPrototype(global.Int8Array,new $Object()); +%AddNamedProperty(global.Int8Array,"BYTES_PER_ELEMENT",1, +1|2|4); +%AddNamedProperty(global.Int8Array.prototype, +"constructor",global.Int8Array,2); +%AddNamedProperty(global.Int8Array.prototype, +"BYTES_PER_ELEMENT",1, +1|2|4); +InstallGetter(global.Int8Array.prototype,"buffer",Int8Array_GetBuffer); +InstallGetter(global.Int8Array.prototype,"byteOffset",Int8Array_GetByteOffset, +2|4); +InstallGetter(global.Int8Array.prototype,"byteLength",Int8Array_GetByteLength, +2|4); +InstallGetter(global.Int8Array.prototype,"length",Int8Array_GetLength, +2|4); +InstallGetter(global.Int8Array.prototype,symbolToStringTag, +TypedArrayGetToStringTag); +InstallFunctions(global.Int8Array.prototype,2,[ +"subarray",Int8ArraySubArray, +"set",TypedArraySet +]); + +%SetCode(global.Uint16Array,Uint16ArrayConstructor); +%FunctionSetPrototype(global.Uint16Array,new $Object()); +%AddNamedProperty(global.Uint16Array,"BYTES_PER_ELEMENT",2, +1|2|4); +%AddNamedProperty(global.Uint16Array.prototype, +"constructor",global.Uint16Array,2); +%AddNamedProperty(global.Uint16Array.prototype, +"BYTES_PER_ELEMENT",2, +1|2|4); +InstallGetter(global.Uint16Array.prototype,"buffer",Uint16Array_GetBuffer); +InstallGetter(global.Uint16Array.prototype,"byteOffset",Uint16Array_GetByteOffset, +2|4); +InstallGetter(global.Uint16Array.prototype,"byteLength",Uint16Array_GetByteLength, +2|4); +InstallGetter(global.Uint16Array.prototype,"length",Uint16Array_GetLength, +2|4); +InstallGetter(global.Uint16Array.prototype,symbolToStringTag, +TypedArrayGetToStringTag); +InstallFunctions(global.Uint16Array.prototype,2,[ +"subarray",Uint16ArraySubArray, +"set",TypedArraySet +]); + +%SetCode(global.Int16Array,Int16ArrayConstructor); +%FunctionSetPrototype(global.Int16Array,new $Object()); +%AddNamedProperty(global.Int16Array,"BYTES_PER_ELEMENT",2, +1|2|4); +%AddNamedProperty(global.Int16Array.prototype, +"constructor",global.Int16Array,2); +%AddNamedProperty(global.Int16Array.prototype, +"BYTES_PER_ELEMENT",2, +1|2|4); +InstallGetter(global.Int16Array.prototype,"buffer",Int16Array_GetBuffer); +InstallGetter(global.Int16Array.prototype,"byteOffset",Int16Array_GetByteOffset, +2|4); +InstallGetter(global.Int16Array.prototype,"byteLength",Int16Array_GetByteLength, +2|4); +InstallGetter(global.Int16Array.prototype,"length",Int16Array_GetLength, +2|4); +InstallGetter(global.Int16Array.prototype,symbolToStringTag, +TypedArrayGetToStringTag); +InstallFunctions(global.Int16Array.prototype,2,[ +"subarray",Int16ArraySubArray, +"set",TypedArraySet +]); + +%SetCode(global.Uint32Array,Uint32ArrayConstructor); +%FunctionSetPrototype(global.Uint32Array,new $Object()); +%AddNamedProperty(global.Uint32Array,"BYTES_PER_ELEMENT",4, +1|2|4); +%AddNamedProperty(global.Uint32Array.prototype, +"constructor",global.Uint32Array,2); +%AddNamedProperty(global.Uint32Array.prototype, +"BYTES_PER_ELEMENT",4, +1|2|4); +InstallGetter(global.Uint32Array.prototype,"buffer",Uint32Array_GetBuffer); +InstallGetter(global.Uint32Array.prototype,"byteOffset",Uint32Array_GetByteOffset, +2|4); +InstallGetter(global.Uint32Array.prototype,"byteLength",Uint32Array_GetByteLength, +2|4); +InstallGetter(global.Uint32Array.prototype,"length",Uint32Array_GetLength, +2|4); +InstallGetter(global.Uint32Array.prototype,symbolToStringTag, +TypedArrayGetToStringTag); +InstallFunctions(global.Uint32Array.prototype,2,[ +"subarray",Uint32ArraySubArray, +"set",TypedArraySet +]); + +%SetCode(global.Int32Array,Int32ArrayConstructor); +%FunctionSetPrototype(global.Int32Array,new $Object()); +%AddNamedProperty(global.Int32Array,"BYTES_PER_ELEMENT",4, +1|2|4); +%AddNamedProperty(global.Int32Array.prototype, +"constructor",global.Int32Array,2); +%AddNamedProperty(global.Int32Array.prototype, +"BYTES_PER_ELEMENT",4, +1|2|4); +InstallGetter(global.Int32Array.prototype,"buffer",Int32Array_GetBuffer); +InstallGetter(global.Int32Array.prototype,"byteOffset",Int32Array_GetByteOffset, +2|4); +InstallGetter(global.Int32Array.prototype,"byteLength",Int32Array_GetByteLength, +2|4); +InstallGetter(global.Int32Array.prototype,"length",Int32Array_GetLength, +2|4); +InstallGetter(global.Int32Array.prototype,symbolToStringTag, +TypedArrayGetToStringTag); +InstallFunctions(global.Int32Array.prototype,2,[ +"subarray",Int32ArraySubArray, +"set",TypedArraySet +]); + +%SetCode(global.Float32Array,Float32ArrayConstructor); +%FunctionSetPrototype(global.Float32Array,new $Object()); +%AddNamedProperty(global.Float32Array,"BYTES_PER_ELEMENT",4, +1|2|4); +%AddNamedProperty(global.Float32Array.prototype, +"constructor",global.Float32Array,2); +%AddNamedProperty(global.Float32Array.prototype, +"BYTES_PER_ELEMENT",4, +1|2|4); +InstallGetter(global.Float32Array.prototype,"buffer",Float32Array_GetBuffer); +InstallGetter(global.Float32Array.prototype,"byteOffset",Float32Array_GetByteOffset, +2|4); +InstallGetter(global.Float32Array.prototype,"byteLength",Float32Array_GetByteLength, +2|4); +InstallGetter(global.Float32Array.prototype,"length",Float32Array_GetLength, +2|4); +InstallGetter(global.Float32Array.prototype,symbolToStringTag, +TypedArrayGetToStringTag); +InstallFunctions(global.Float32Array.prototype,2,[ +"subarray",Float32ArraySubArray, +"set",TypedArraySet +]); + +%SetCode(global.Float64Array,Float64ArrayConstructor); +%FunctionSetPrototype(global.Float64Array,new $Object()); +%AddNamedProperty(global.Float64Array,"BYTES_PER_ELEMENT",8, +1|2|4); +%AddNamedProperty(global.Float64Array.prototype, +"constructor",global.Float64Array,2); +%AddNamedProperty(global.Float64Array.prototype, +"BYTES_PER_ELEMENT",8, +1|2|4); +InstallGetter(global.Float64Array.prototype,"buffer",Float64Array_GetBuffer); +InstallGetter(global.Float64Array.prototype,"byteOffset",Float64Array_GetByteOffset, +2|4); +InstallGetter(global.Float64Array.prototype,"byteLength",Float64Array_GetByteLength, +2|4); +InstallGetter(global.Float64Array.prototype,"length",Float64Array_GetLength, +2|4); +InstallGetter(global.Float64Array.prototype,symbolToStringTag, +TypedArrayGetToStringTag); +InstallFunctions(global.Float64Array.prototype,2,[ +"subarray",Float64ArraySubArray, +"set",TypedArraySet +]); + +%SetCode(global.Uint8ClampedArray,Uint8ClampedArrayConstructor); +%FunctionSetPrototype(global.Uint8ClampedArray,new $Object()); +%AddNamedProperty(global.Uint8ClampedArray,"BYTES_PER_ELEMENT",1, +1|2|4); +%AddNamedProperty(global.Uint8ClampedArray.prototype, +"constructor",global.Uint8ClampedArray,2); +%AddNamedProperty(global.Uint8ClampedArray.prototype, +"BYTES_PER_ELEMENT",1, +1|2|4); +InstallGetter(global.Uint8ClampedArray.prototype,"buffer",Uint8ClampedArray_GetBuffer); +InstallGetter(global.Uint8ClampedArray.prototype,"byteOffset",Uint8ClampedArray_GetByteOffset, +2|4); +InstallGetter(global.Uint8ClampedArray.prototype,"byteLength",Uint8ClampedArray_GetByteLength, +2|4); +InstallGetter(global.Uint8ClampedArray.prototype,"length",Uint8ClampedArray_GetLength, +2|4); +InstallGetter(global.Uint8ClampedArray.prototype,symbolToStringTag, +TypedArrayGetToStringTag); +InstallFunctions(global.Uint8ClampedArray.prototype,2,[ +"subarray",Uint8ClampedArraySubArray, +"set",TypedArraySet +]); + + +var ab=global.DataView; +function DataViewConstructor(d,e,m){ +if(%_IsConstructCall()){ +if(!(%_ClassOf(d)==='ArrayBuffer')){ +throw MakeTypeError('data_view_not_array_buffer',[]); +} +if(!(e===(void 0))){ +e=ToPositiveInteger(e,'invalid_data_view_offset'); +} +if(!(m===(void 0))){ +m=(%_IsSmi(%IS_VAR(m))?m:%NumberToInteger(ToNumber(m))); +} +var h=%_ArrayBufferGetByteLength(d); +var i=(e===(void 0))?0:e; +if(i>h){ +throw MakeRangeError('invalid_data_view_offset'); +} +var g=(m===(void 0)) +?h-i +:m; +if(g<0||i+g>h){ +throw new MakeRangeError('invalid_data_view_length'); +} +%_DataViewInitialize(this,d,i,g); +}else{ +throw MakeTypeError('constructor_not_function',["DataView"]); +} +} +function DataViewGetBufferJS(){ +if(!(%_ClassOf(this)==='DataView')){ +throw MakeTypeError(8,'DataView.buffer',this); +} +return %DataViewGetBuffer(this); +} +function DataViewGetByteOffset(){ +if(!(%_ClassOf(this)==='DataView')){ +throw MakeTypeError(8, +'DataView.byteOffset',this); +} +return %_ArrayBufferViewGetByteOffset(this); +} +function DataViewGetByteLength(){ +if(!(%_ClassOf(this)==='DataView')){ +throw MakeTypeError(8, +'DataView.byteLength',this); +} +return %_ArrayBufferViewGetByteLength(this); +} +function ToPositiveDataViewOffset(i){ +return ToPositiveInteger(i,'invalid_data_view_accessor_offset'); +} +function DataViewGetInt8JS(i,ac){ +if(!(%_ClassOf(this)==='DataView')){ +throw MakeTypeError(8, +'DataView.getInt8',this); +} +if(%_ArgumentsLength()<1){ +throw MakeTypeError('invalid_argument'); +} +return %DataViewGetInt8(this, +ToPositiveDataViewOffset(i), +!!ac); +} +function DataViewSetInt8JS(i,ad,ac){ +if(!(%_ClassOf(this)==='DataView')){ +throw MakeTypeError(8, +'DataView.setInt8',this); +} +if(%_ArgumentsLength()<2){ +throw MakeTypeError('invalid_argument'); +} +%DataViewSetInt8(this, +ToPositiveDataViewOffset(i), +((typeof(%IS_VAR(ad))==='number')?ad:NonNumberToNumber(ad)), +!!ac); +} + +function DataViewGetUint8JS(i,ac){ +if(!(%_ClassOf(this)==='DataView')){ +throw MakeTypeError(8, +'DataView.getUint8',this); +} +if(%_ArgumentsLength()<1){ +throw MakeTypeError('invalid_argument'); +} +return %DataViewGetUint8(this, +ToPositiveDataViewOffset(i), +!!ac); +} +function DataViewSetUint8JS(i,ad,ac){ +if(!(%_ClassOf(this)==='DataView')){ +throw MakeTypeError(8, +'DataView.setUint8',this); +} +if(%_ArgumentsLength()<2){ +throw MakeTypeError('invalid_argument'); +} +%DataViewSetUint8(this, +ToPositiveDataViewOffset(i), +((typeof(%IS_VAR(ad))==='number')?ad:NonNumberToNumber(ad)), +!!ac); +} + +function DataViewGetInt16JS(i,ac){ +if(!(%_ClassOf(this)==='DataView')){ +throw MakeTypeError(8, +'DataView.getInt16',this); +} +if(%_ArgumentsLength()<1){ +throw MakeTypeError('invalid_argument'); +} +return %DataViewGetInt16(this, +ToPositiveDataViewOffset(i), +!!ac); +} +function DataViewSetInt16JS(i,ad,ac){ +if(!(%_ClassOf(this)==='DataView')){ +throw MakeTypeError(8, +'DataView.setInt16',this); +} +if(%_ArgumentsLength()<2){ +throw MakeTypeError('invalid_argument'); +} +%DataViewSetInt16(this, +ToPositiveDataViewOffset(i), +((typeof(%IS_VAR(ad))==='number')?ad:NonNumberToNumber(ad)), +!!ac); +} + +function DataViewGetUint16JS(i,ac){ +if(!(%_ClassOf(this)==='DataView')){ +throw MakeTypeError(8, +'DataView.getUint16',this); +} +if(%_ArgumentsLength()<1){ +throw MakeTypeError('invalid_argument'); +} +return %DataViewGetUint16(this, +ToPositiveDataViewOffset(i), +!!ac); +} +function DataViewSetUint16JS(i,ad,ac){ +if(!(%_ClassOf(this)==='DataView')){ +throw MakeTypeError(8, +'DataView.setUint16',this); +} +if(%_ArgumentsLength()<2){ +throw MakeTypeError('invalid_argument'); +} +%DataViewSetUint16(this, +ToPositiveDataViewOffset(i), +((typeof(%IS_VAR(ad))==='number')?ad:NonNumberToNumber(ad)), +!!ac); +} + +function DataViewGetInt32JS(i,ac){ +if(!(%_ClassOf(this)==='DataView')){ +throw MakeTypeError(8, +'DataView.getInt32',this); +} +if(%_ArgumentsLength()<1){ +throw MakeTypeError('invalid_argument'); +} +return %DataViewGetInt32(this, +ToPositiveDataViewOffset(i), +!!ac); +} +function DataViewSetInt32JS(i,ad,ac){ +if(!(%_ClassOf(this)==='DataView')){ +throw MakeTypeError(8, +'DataView.setInt32',this); +} +if(%_ArgumentsLength()<2){ +throw MakeTypeError('invalid_argument'); +} +%DataViewSetInt32(this, +ToPositiveDataViewOffset(i), +((typeof(%IS_VAR(ad))==='number')?ad:NonNumberToNumber(ad)), +!!ac); +} + +function DataViewGetUint32JS(i,ac){ +if(!(%_ClassOf(this)==='DataView')){ +throw MakeTypeError(8, +'DataView.getUint32',this); +} +if(%_ArgumentsLength()<1){ +throw MakeTypeError('invalid_argument'); +} +return %DataViewGetUint32(this, +ToPositiveDataViewOffset(i), +!!ac); +} +function DataViewSetUint32JS(i,ad,ac){ +if(!(%_ClassOf(this)==='DataView')){ +throw MakeTypeError(8, +'DataView.setUint32',this); +} +if(%_ArgumentsLength()<2){ +throw MakeTypeError('invalid_argument'); +} +%DataViewSetUint32(this, +ToPositiveDataViewOffset(i), +((typeof(%IS_VAR(ad))==='number')?ad:NonNumberToNumber(ad)), +!!ac); +} + +function DataViewGetFloat32JS(i,ac){ +if(!(%_ClassOf(this)==='DataView')){ +throw MakeTypeError(8, +'DataView.getFloat32',this); +} +if(%_ArgumentsLength()<1){ +throw MakeTypeError('invalid_argument'); +} +return %DataViewGetFloat32(this, +ToPositiveDataViewOffset(i), +!!ac); +} +function DataViewSetFloat32JS(i,ad,ac){ +if(!(%_ClassOf(this)==='DataView')){ +throw MakeTypeError(8, +'DataView.setFloat32',this); +} +if(%_ArgumentsLength()<2){ +throw MakeTypeError('invalid_argument'); +} +%DataViewSetFloat32(this, +ToPositiveDataViewOffset(i), +((typeof(%IS_VAR(ad))==='number')?ad:NonNumberToNumber(ad)), +!!ac); +} + +function DataViewGetFloat64JS(i,ac){ +if(!(%_ClassOf(this)==='DataView')){ +throw MakeTypeError(8, +'DataView.getFloat64',this); +} +if(%_ArgumentsLength()<1){ +throw MakeTypeError('invalid_argument'); +} +return %DataViewGetFloat64(this, +ToPositiveDataViewOffset(i), +!!ac); +} +function DataViewSetFloat64JS(i,ad,ac){ +if(!(%_ClassOf(this)==='DataView')){ +throw MakeTypeError(8, +'DataView.setFloat64',this); +} +if(%_ArgumentsLength()<2){ +throw MakeTypeError('invalid_argument'); +} +%DataViewSetFloat64(this, +ToPositiveDataViewOffset(i), +((typeof(%IS_VAR(ad))==='number')?ad:NonNumberToNumber(ad)), +!!ac); +} + + +%SetCode(ab,DataViewConstructor); +%FunctionSetPrototype(ab,new $Object); +%AddNamedProperty(ab.prototype,"constructor",ab,2); +%AddNamedProperty( +ab.prototype,symbolToStringTag,"DataView",1|2); +InstallGetter(ab.prototype,"buffer",DataViewGetBufferJS); +InstallGetter(ab.prototype,"byteOffset",DataViewGetByteOffset); +InstallGetter(ab.prototype,"byteLength",DataViewGetByteLength); +InstallFunctions(ab.prototype,2,[ +"getInt8",DataViewGetInt8JS, +"setInt8",DataViewSetInt8JS, +"getUint8",DataViewGetUint8JS, +"setUint8",DataViewSetUint8JS, +"getInt16",DataViewGetInt16JS, +"setInt16",DataViewSetInt16JS, +"getUint16",DataViewGetUint16JS, +"setUint16",DataViewSetUint16JS, +"getInt32",DataViewGetInt32JS, +"setInt32",DataViewSetInt32JS, +"getUint32",DataViewGetUint32JS, +"setUint32",DataViewSetUint32JS, +"getFloat32",DataViewGetFloat32JS, +"setFloat32",DataViewSetFloat32JS, +"getFloat64",DataViewGetFloat64JS, +"setFloat64",DataViewSetFloat64JS +]); +})(); + +$generator½ +(function(){ +"use strict"; +%CheckIsBootstrapping(); +var a=global.Function; +function GeneratorObjectNext(b){ +if(!(%_ClassOf(this)==='Generator')){ +throw MakeTypeError(8, +'[Generator].prototype.next',this); +} +var c=%GeneratorGetContinuation(this); +if(c>0){ +if((%_DebugIsActive()!=0))%DebugPrepareStepInIfStepping(this); +try{ +return %_GeneratorNext(this,b); +}catch(e){ +%GeneratorClose(this); +throw e; +} +}else if(c==0){ +return{value:void 0,done:true}; +}else{ +throw MakeTypeError(6); +} +} +function GeneratorObjectThrow(d){ +if(!(%_ClassOf(this)==='Generator')){ +throw MakeTypeError(8, +'[Generator].prototype.throw',this); +} +var c=%GeneratorGetContinuation(this); +if(c>0){ +try{ +return %_GeneratorThrow(this,d); +}catch(e){ +%GeneratorClose(this); +throw e; +} +}else if(c==0){ +throw d; +}else{ +throw MakeTypeError(6); +} +} +function GeneratorObjectIterator(){ +return this; +} +function GeneratorFunctionConstructor(e){ +var g=NewFunctionString(arguments,'function*'); +var h=%GlobalProxy(global); +var i=%_CallFunction(h,%CompileString(g,true)); +%FunctionMarkNameShouldPrintAsAnonymous(i); +return i; +} +%NeverOptimizeFunction(GeneratorObjectNext); +%NeverOptimizeFunction(GeneratorObjectThrow); +var j=GeneratorFunctionPrototype.prototype; +InstallFunctions(j, +2, +["next",GeneratorObjectNext, +"throw",GeneratorObjectThrow]); +%FunctionSetName(GeneratorObjectIterator,'[Symbol.iterator]'); +%AddNamedProperty(j,symbolIterator, +GeneratorObjectIterator,2|4|1); +%AddNamedProperty(j,"constructor", +GeneratorFunctionPrototype,2|1); +%AddNamedProperty(j, +symbolToStringTag,"Generator",2|1); +%InternalSetPrototype(GeneratorFunctionPrototype,a.prototype); +%AddNamedProperty(GeneratorFunctionPrototype, +symbolToStringTag,"GeneratorFunction",2|1); +%AddNamedProperty(GeneratorFunctionPrototype,"constructor", +GeneratorFunction,2|1); +%InternalSetPrototype(GeneratorFunction,a); +%SetCode(GeneratorFunction,GeneratorFunctionConstructor); +})(); + +8object-observeM² +var $observeNotifyChange; +var $observeEnqueueSpliceRecord; +var $observeBeginPerformSplice; +var $observeEndPerformSplice; +var $observeNativeObjectObserve; +var $observeNativeObjectGetNotifier; +var $observeNativeObjectNotifierPerformChange; +(function(){ +"use strict"; +%CheckIsBootstrapping(); +var a=global.Array; +var b=global.Object; +var c; +var d={}; +function GetObservationStateJS(){ +if((c===(void 0))){ +c=%GetObservationState(); +} +if((c.callbackInfoMap===(void 0))){ +c.callbackInfoMap=%ObservationWeakMapCreate(); +c.objectInfoMap=%ObservationWeakMapCreate(); +c.notifierObjectInfoMap=%ObservationWeakMapCreate(); +c.pendingObservers=null; +c.nextCallbackPriority=0; +c.lastMicrotaskId=0; +} +return c; +} +function GetPendingObservers(){ +return GetObservationStateJS().pendingObservers; +} +function SetPendingObservers(e){ +GetObservationStateJS().pendingObservers=e; +} +function GetNextCallbackPriority(){ +return GetObservationStateJS().nextCallbackPriority++; +} +function nullProtoObject(){ +return{__proto__:null}; +} +function TypeMapCreate(){ +return nullProtoObject(); +} +function TypeMapAddType(g,h,i){ +g[h]=i?1:(g[h]||0)+1; +} +function TypeMapRemoveType(g,h){ +g[h]--; +} +function TypeMapCreateFromList(j,k){ +var g=TypeMapCreate(); +for(var l=0;l0?w.performing:null; +} +function ConvertAcceptListToTypeMap(E){ +if((E===(void 0))) +return E; +if(!(%_IsSpecObject(E))) +throw MakeTypeError("observe_invalid_accept"); +var G=ToInteger(E.length); +if(G<0)G=0; +return TypeMapCreateFromList(E,G); +} +function CallbackInfoGet(r){ +return %WeakCollectionGet(GetObservationStateJS().callbackInfoMap,r); +} +function CallbackInfoSet(r,C){ +%WeakCollectionSet(GetObservationStateJS().callbackInfoMap, +r,C); +} +function CallbackInfoGetOrCreate(r){ +var C=CallbackInfoGet(r); +if(!(C===(void 0))) +return C; +var D=GetNextCallbackPriority(); +CallbackInfoSet(r,D); +return D; +} +function CallbackInfoGetPriority(C){ +if((typeof(C)==='number')) +return C; +else +return C.priority; +} +function CallbackInfoNormalize(r){ +var C=CallbackInfoGet(r); +if((typeof(C)==='number')){ +var D=C; +C=new InternalArray; +C.priority=D; +CallbackInfoSet(r,C); +} +return C; +} +function ObjectObserve(z,r,t){ +if(!(%_IsSpecObject(z))) +throw MakeTypeError("observe_non_object",["observe"]); +if(%IsJSGlobalProxy(z)) +throw MakeTypeError("observe_global_proxy",["observe"]); +if(!(%_ClassOf(r)==='Function')) +throw MakeTypeError("observe_non_function",["observe"]); +if(ObjectIsFrozen(r)) +throw MakeTypeError("observe_callback_frozen"); +var H=%GetObjectContextObjectObserve(z); +return H(z,r,t); +} +function NativeObjectObserve(z,r,t){ +var w=ObjectInfoGetOrCreate(z); +var j=ConvertAcceptListToTypeMap(t); +ObjectInfoAddObserver(w,r,j); +return z; +} +function ObjectUnobserve(z,r){ +if(!(%_IsSpecObject(z))) +throw MakeTypeError("observe_non_object",["unobserve"]); +if(%IsJSGlobalProxy(z)) +throw MakeTypeError("observe_global_proxy",["unobserve"]); +if(!(%_ClassOf(r)==='Function')) +throw MakeTypeError("observe_non_function",["unobserve"]); +var w=ObjectInfoGet(z); +if((w===(void 0))) +return z; +ObjectInfoRemoveObserver(w,r); +return z; +} +function ArrayObserve(z,r){ +return ObjectObserve(z,r,['add', +'update', +'delete', +'splice']); +} +function ArrayUnobserve(z,r){ +return ObjectUnobserve(z,r); +} +function ObserverEnqueueIfActive(u,w,I){ +if(!ObserverIsActive(u,w)|| +!TypeMapHasType(ObserverGetAcceptTypes(u),I.type)){ +return; +} +var r=ObserverGetCallback(u); +if(!%ObserverObjectAndRecordHaveSameOrigin(r,I.object, +I)){ +return; +} +var C=CallbackInfoNormalize(r); +if((GetPendingObservers()===null)){ +SetPendingObservers(nullProtoObject()); +if((%_DebugIsActive()!=0)){ +var J=++GetObservationStateJS().lastMicrotaskId; +var K="Object.observe"; +%EnqueueMicrotask(function(){ +%DebugAsyncTaskEvent({type:"willHandle",id:J,name:K}); +ObserveMicrotaskRunner(); +%DebugAsyncTaskEvent({type:"didHandle",id:J,name:K}); +}); +%DebugAsyncTaskEvent({type:"enqueue",id:J,name:K}); +}else{ +%EnqueueMicrotask(ObserveMicrotaskRunner); +} +} +GetPendingObservers()[C.priority]=r; +C.push(I); +} +function ObjectInfoEnqueueExternalChangeRecord(w,I,h){ +if(!ObjectInfoHasActiveObservers(w)) +return; +var L=!(h===(void 0)); +var M=L? +{object:w.object,type:h}: +{object:w.object}; +for(var N in I){ +if(N==='object'||(L&&N==='type'))continue; +%DefineDataPropertyUnchecked( +M,N,I[N],1+4); +} +ObjectFreezeJS(M); +ObjectInfoEnqueueInternalChangeRecord(w,M); +} +function ObjectInfoEnqueueInternalChangeRecord(w,I){ +if((typeof(I.name)==='symbol'))return; +if(ChangeObserversIsOptimized(w.changeObservers)){ +var u=w.changeObservers; +ObserverEnqueueIfActive(u,w,I); +return; +} +for(var D in w.changeObservers){ +var u=w.changeObservers[D]; +if((u===null)) +continue; +ObserverEnqueueIfActive(u,w,I); +} +} +function BeginPerformSplice(P){ +var w=ObjectInfoGet(P); +if(!(w===(void 0))) +ObjectInfoAddPerformingType(w,'splice'); +} +function EndPerformSplice(P){ +var w=ObjectInfoGet(P); +if(!(w===(void 0))) +ObjectInfoRemovePerformingType(w,'splice'); +} +function EnqueueSpliceRecord(P,Q,R,S){ +var w=ObjectInfoGet(P); +if(!ObjectInfoHasActiveObservers(w)) +return; +var I={ +type:'splice', +object:P, +index:Q, +removed:R, +addedCount:S +}; +ObjectFreezeJS(I); +ObjectFreezeJS(I.removed); +ObjectInfoEnqueueInternalChangeRecord(w,I); +} +function NotifyChange(h,z,K,T){ +var w=ObjectInfoGet(z); +if(!ObjectInfoHasActiveObservers(w)) +return; +var I; +if(arguments.length==2){ +I={type:h,object:z}; +}else if(arguments.length==3){ +I={type:h,object:z,name:K}; +}else{ +I={ +type:h, +object:z, +name:K, +oldValue:T +}; +} +ObjectFreezeJS(I); +ObjectInfoEnqueueInternalChangeRecord(w,I); +} +function ObjectNotifierNotify(I){ +if(!(%_IsSpecObject(this))) +throw MakeTypeError(3,"notify"); +var w=ObjectInfoGetFromNotifier(this); +if((w===(void 0))) +throw MakeTypeError("observe_notify_non_notifier"); +if(!(typeof(I.type)==='string')) +throw MakeTypeError("observe_type_non_string"); +ObjectInfoEnqueueExternalChangeRecord(w,I); +} +function ObjectNotifierPerformChange(U,W){ +if(!(%_IsSpecObject(this))) +throw MakeTypeError(3,"performChange"); +var w=ObjectInfoGetFromNotifier(this); +if((w===(void 0))) +throw MakeTypeError("observe_notify_non_notifier"); +if(!(typeof(U)==='string')) +throw MakeTypeError("observe_perform_non_string"); +if(!(%_ClassOf(W)==='Function')) +throw MakeTypeError("observe_perform_non_function"); +var X=%GetObjectContextNotifierPerformChange(w); +X(w,U,W); +} +function NativeObjectNotifierPerformChange(w,U,W){ +ObjectInfoAddPerformingType(w,U); +var I; +try{ +I=%_CallFunction((void 0),W); +}finally{ +ObjectInfoRemovePerformingType(w,U); +} +if((%_IsSpecObject(I))) +ObjectInfoEnqueueExternalChangeRecord(w,I,U); +} +function ObjectGetNotifier(z){ +if(!(%_IsSpecObject(z))) +throw MakeTypeError("observe_non_object",["getNotifier"]); +if(%IsJSGlobalProxy(z)) +throw MakeTypeError("observe_global_proxy",["getNotifier"]); +if(ObjectIsFrozen(z))return null; +if(!%ObjectWasCreatedInCurrentOrigin(z))return null; +var Y=%GetObjectContextObjectGetNotifier(z); +return Y(z); +} +function NativeObjectGetNotifier(z){ +var w=ObjectInfoGetOrCreate(z); +return ObjectInfoGetNotifier(w); +} +function CallbackDeliverPending(r){ +var C=CallbackInfoGet(r); +if((C===(void 0))||(typeof(C)==='number')) +return false; +var D=C.priority; +CallbackInfoSet(r,D); +var e=GetPendingObservers(); +if(!(e===null)) +delete e[D]; +var Z=[]; +%MoveArrayContents(C,Z); +%DeliverObservationChangeRecords(r,Z); +return true; +} +function ObjectDeliverChangeRecords(r){ +if(!(%_ClassOf(r)==='Function')) +throw MakeTypeError("observe_non_function",["deliverChangeRecords"]); +while(CallbackDeliverPending(r)){} +} +function ObserveMicrotaskRunner(){ +var e=GetPendingObservers(); +if(!(e===null)){ +SetPendingObservers(null); +for(var l in e){ +CallbackDeliverPending(e[l]); +} +} +} +InstallFunctions(b,2,[ +"deliverChangeRecords",ObjectDeliverChangeRecords, +"getNotifier",ObjectGetNotifier, +"observe",ObjectObserve, +"unobserve",ObjectUnobserve +]); +InstallFunctions(a,2,[ +"observe",ArrayObserve, +"unobserve",ArrayUnobserve +]); +InstallFunctions(d,2,[ +"notify",ObjectNotifierNotify, +"performChange",ObjectNotifierPerformChange +]); +$observeNotifyChange=NotifyChange; +$observeEnqueueSpliceRecord=EnqueueSpliceRecord; +$observeBeginPerformSplice=BeginPerformSplice; +$observeEndPerformSplice=EndPerformSplice; +$observeNativeObjectObserve=NativeObjectObserve; +$observeNativeObjectGetNotifier=NativeObjectGetNotifier; +$observeNativeObjectNotifierPerformChange=NativeObjectNotifierPerformChange; +})(); + +(collectionE{ +(function(){ +"use strict"; +%CheckIsBootstrapping(); +var a=global.Map; +var b=global.Object; +var c=global.Set; +function HashToEntry(d,e,g){ +var h=(e&((g)-1)); +return((%_FixedArrayGet(d,(3+(h))|0))); +} +%SetInlineBuiltinFlag(HashToEntry); +function SetFindEntry(d,g,i,e){ +var j=NumberIsNaN(i); +for(var k=HashToEntry(d,e,g); +k!==-1; +k=((%_FixedArrayGet(d,((3+(g)+((k)<<1))+1)|0)))){ +var l=((%_FixedArrayGet(d,((3+(g)+((k)<<1)))|0))); +if(i===l){ +return k; +} +if(j&&NumberIsNaN(l)){ +return k; +} +} +return-1; +} +%SetInlineBuiltinFlag(SetFindEntry); +function MapFindEntry(d,g,i,e){ +var j=NumberIsNaN(i); +for(var k=HashToEntry(d,e,g); +k!==-1; +k=((%_FixedArrayGet(d,((3+(g)+((k)*3))+2)|0)))){ +var l=((%_FixedArrayGet(d,((3+(g)+((k)*3)))|0))); +if(i===l){ +return k; +} +if(j&&NumberIsNaN(l)){ +return k; +} +} +return-1; +} +%SetInlineBuiltinFlag(MapFindEntry); +function ComputeIntegerHash(i,m){ +var e=i; +e=e^m; +e=~e+(e<<15); +e=e^(e>>>12); +e=e+(e<<2); +e=e^(e>>>4); +e=(e*2057)|0; +e=e^(e>>>16); +return e; +} +%SetInlineBuiltinFlag(ComputeIntegerHash); +function GetHash(i){ +if(%_IsSmi(i)){ +return ComputeIntegerHash(i,0); +} +if((typeof(i)==='string')){ +var n=%_StringGetRawHashField(i); +if((n&1)===0){ +return n>>>2; +} +} +return %GenericHash(i); +} +%SetInlineBuiltinFlag(GetHash); +function SetConstructor(o){ +if(!%_IsConstructCall()){ +throw MakeTypeError('constructor_not_function',['Set']); +} +%_SetInitialize(this); +if(!(o==null)){ +var q=this.add; +if(!(%_ClassOf(q)==='Function')){ +throw MakeTypeError(21,'add',this); +} +for(var r of o){ +%_CallFunction(this,r,q); +} +} +} +function SetAdd(i){ +if(!(%_ClassOf(this)==='Set')){ +throw MakeTypeError(8,'Set.prototype.add',this); +} +if(i===0){ +i=0; +} +var d=%_JSCollectionGetTable(this); +var g=((%_FixedArrayGet(d,(0)|0))); +var e=GetHash(i); +if(SetFindEntry(d,g,i,e)!==-1)return this; +var t=((%_FixedArrayGet(d,(1)|0))); +var u=((%_FixedArrayGet(d,(2)|0))); +var w=g<<1; +if((t+u)>=w){ +%SetGrow(this); +d=%_JSCollectionGetTable(this); +g=((%_FixedArrayGet(d,(0)|0))); +t=((%_FixedArrayGet(d,(1)|0))); +u=((%_FixedArrayGet(d,(2)|0))); +} +var k=t+u; +var z=(3+(g)+((k)<<1)); +var h=(e&((g)-1)); +var A=((%_FixedArrayGet(d,(3+(h))|0))); +((%_FixedArraySet(d,(3+(h))|0,k))); +(((%_FixedArraySet(d,(1)|0,(t+1)|0)))); +(%_FixedArraySet(d,(z)|0,i)); +((%_FixedArraySet(d,(z+1)|0,(A)|0))); +return this; +} +function SetHas(i){ +if(!(%_ClassOf(this)==='Set')){ +throw MakeTypeError(8,'Set.prototype.has',this); +} +var d=%_JSCollectionGetTable(this); +var g=((%_FixedArrayGet(d,(0)|0))); +var e=GetHash(i); +return SetFindEntry(d,g,i,e)!==-1; +} +function SetDelete(i){ +if(!(%_ClassOf(this)==='Set')){ +throw MakeTypeError(8, +'Set.prototype.delete',this); +} +var d=%_JSCollectionGetTable(this); +var g=((%_FixedArrayGet(d,(0)|0))); +var e=GetHash(i); +var k=SetFindEntry(d,g,i,e); +if(k===-1)return false; +var t=((%_FixedArrayGet(d,(1)|0)))-1; +var u=((%_FixedArrayGet(d,(2)|0)))+1; +var z=(3+(g)+((k)<<1)); +(%_FixedArraySet(d,(z)|0,%_TheHole())); +(((%_FixedArraySet(d,(1)|0,(t)|0)))); +(((%_FixedArraySet(d,(2)|0,(u)|0)))); +if(t<(g>>>1))%SetShrink(this); +return true; +} +function SetGetSize(){ +if(!(%_ClassOf(this)==='Set')){ +throw MakeTypeError(8, +'Set.prototype.size',this); +} +var d=%_JSCollectionGetTable(this); +return((%_FixedArrayGet(d,(1)|0))); +} +function SetClearJS(){ +if(!(%_ClassOf(this)==='Set')){ +throw MakeTypeError(8, +'Set.prototype.clear',this); +} +%_SetClear(this); +} +function SetForEach(B,C){ +if(!(%_ClassOf(this)==='Set')){ +throw MakeTypeError(8, +'Set.prototype.forEach',this); +} +if(!(%_ClassOf(B)==='Function'))throw MakeTypeError(2,B); +var D=false; +if((C==null)){ +C=%GetDefaultReceiver(B)||C; +}else{ +D=(!(%_IsSpecObject(C))&&%IsSloppyModeFunction(B)); +} +var E=new SetIterator(this,2); +var i; +var G=(%_DebugIsActive()!=0)&&%DebugCallbackSupportsStepping(B); +var H=[(void 0)]; +while(%SetIteratorNext(E,H)){ +if(G)%DebugPrepareStepInIfStepping(B); +i=H[0]; +var I=D?ToObject(C):C; +%_CallFunction(I,i,i,this,B); +} +} +%SetCode(c,SetConstructor); +%FunctionSetLength(c,0); +%FunctionSetPrototype(c,new b()); +%AddNamedProperty(c.prototype,"constructor",c,2); +%AddNamedProperty(c.prototype,symbolToStringTag,"Set", +2|1); +%FunctionSetLength(SetForEach,1); +InstallGetter(c.prototype,"size",SetGetSize); +InstallFunctions(c.prototype,2,[ +"add",SetAdd, +"has",SetHas, +"delete",SetDelete, +"clear",SetClearJS, +"forEach",SetForEach +]); +function MapConstructor(o){ +if(!%_IsConstructCall()){ +throw MakeTypeError('constructor_not_function',['Map']); +} +%_MapInitialize(this); +if(!(o==null)){ +var q=this.set; +if(!(%_ClassOf(q)==='Function')){ +throw MakeTypeError(21,'set',this); +} +for(var J of o){ +if(!(%_IsSpecObject(J))){ +throw MakeTypeError('iterator_value_not_an_object',[J]); +} +%_CallFunction(this,J[0],J[1],q); +} +} +} +function MapGet(i){ +if(!(%_ClassOf(this)==='Map')){ +throw MakeTypeError(8, +'Map.prototype.get',this); +} +var d=%_JSCollectionGetTable(this); +var g=((%_FixedArrayGet(d,(0)|0))); +var e=GetHash(i); +var k=MapFindEntry(d,g,i,e); +if(k===-1)return(void 0); +return((%_FixedArrayGet(d,((3+(g)+((k)*3))+1)|0))); +} +function MapSet(i,r){ +if(!(%_ClassOf(this)==='Map')){ +throw MakeTypeError(8, +'Map.prototype.set',this); +} +if(i===0){ +i=0; +} +var d=%_JSCollectionGetTable(this); +var g=((%_FixedArrayGet(d,(0)|0))); +var e=GetHash(i); +var k=MapFindEntry(d,g,i,e); +if(k!==-1){ +var K=(3+(g)+((k)*3)); +(%_FixedArraySet(d,(K+1)|0,r)); +return this; +} +var t=((%_FixedArrayGet(d,(1)|0))); +var u=((%_FixedArrayGet(d,(2)|0))); +var w=g<<1; +if((t+u)>=w){ +%MapGrow(this); +d=%_JSCollectionGetTable(this); +g=((%_FixedArrayGet(d,(0)|0))); +t=((%_FixedArrayGet(d,(1)|0))); +u=((%_FixedArrayGet(d,(2)|0))); +} +k=t+u; +var z=(3+(g)+((k)*3)); +var h=(e&((g)-1)); +var A=((%_FixedArrayGet(d,(3+(h))|0))); +((%_FixedArraySet(d,(3+(h))|0,k))); +(((%_FixedArraySet(d,(1)|0,(t+1)|0)))); +(%_FixedArraySet(d,(z)|0,i)); +(%_FixedArraySet(d,(z+1)|0,r)); +(%_FixedArraySet(d,(z+2)|0,A)); +return this; +} +function MapHas(i){ +if(!(%_ClassOf(this)==='Map')){ +throw MakeTypeError(8, +'Map.prototype.has',this); +} +var d=%_JSCollectionGetTable(this); +var g=((%_FixedArrayGet(d,(0)|0))); +var e=GetHash(i); +return MapFindEntry(d,g,i,e)!==-1; +} +function MapDelete(i){ +if(!(%_ClassOf(this)==='Map')){ +throw MakeTypeError(8, +'Map.prototype.delete',this); +} +var d=%_JSCollectionGetTable(this); +var g=((%_FixedArrayGet(d,(0)|0))); +var e=GetHash(i); +var k=MapFindEntry(d,g,i,e); +if(k===-1)return false; +var t=((%_FixedArrayGet(d,(1)|0)))-1; +var u=((%_FixedArrayGet(d,(2)|0)))+1; +var z=(3+(g)+((k)*3)); +(%_FixedArraySet(d,(z)|0,%_TheHole())); +(%_FixedArraySet(d,(z+1)|0,%_TheHole())); +(((%_FixedArraySet(d,(1)|0,(t)|0)))); +(((%_FixedArraySet(d,(2)|0,(u)|0)))); +if(t<(g>>>1))%MapShrink(this); +return true; +} +function MapGetSize(){ +if(!(%_ClassOf(this)==='Map')){ +throw MakeTypeError(8, +'Map.prototype.size',this); +} +var d=%_JSCollectionGetTable(this); +return((%_FixedArrayGet(d,(1)|0))); +} +function MapClearJS(){ +if(!(%_ClassOf(this)==='Map')){ +throw MakeTypeError(8, +'Map.prototype.clear',this); +} +%_MapClear(this); +} +function MapForEach(B,C){ +if(!(%_ClassOf(this)==='Map')){ +throw MakeTypeError(8, +'Map.prototype.forEach',this); +} +if(!(%_ClassOf(B)==='Function'))throw MakeTypeError(2,B); +var D=false; +if((C==null)){ +C=%GetDefaultReceiver(B)||C; +}else{ +D=(!(%_IsSpecObject(C))&&%IsSloppyModeFunction(B)); +} +var E=new MapIterator(this,3); +var G=(%_DebugIsActive()!=0)&&%DebugCallbackSupportsStepping(B); +var H=[(void 0),(void 0)]; +while(%MapIteratorNext(E,H)){ +if(G)%DebugPrepareStepInIfStepping(B); +var I=D?ToObject(C):C; +%_CallFunction(I,H[1],H[0],this,B); +} +} +%SetCode(a,MapConstructor); +%FunctionSetLength(a,0); +%FunctionSetPrototype(a,new b()); +%AddNamedProperty(a.prototype,"constructor",a,2); +%AddNamedProperty( +a.prototype,symbolToStringTag,"Map",2|1); +%FunctionSetLength(MapForEach,1); +InstallGetter(a.prototype,"size",MapGetSize); +InstallFunctions(a.prototype,2,[ +"get",MapGet, +"set",MapSet, +"has",MapHas, +"delete",MapDelete, +"clear",MapClearJS, +"forEach",MapForEach +]); +})(); + +0?"Promise.resolve":"Promise.reject"; +%DebugAsyncTaskEvent({type:"enqueue",id:D,name:E}); +} +} +function PromiseIdResolveHandler(l){return l} +function PromiseIdRejectHandler(m){throw m} +function PromiseNopResolver(){} +function IsPromise(l){ +return(%_IsSpecObject(l))&&(!(l[a]===(void 0))); +} +function PromiseCreate(){ +return new i(PromiseNopResolver) +} +function PromiseResolve(k,l){ +PromiseDone(k,+1,l,c) +} +function PromiseReject(k,m){ +if((k[a])==0){ +var I=(%_DebugIsActive()!=0); +if(I||!(!(k[g]===(void 0)))){ +%PromiseRejectEvent(k,m,I); +} +} +PromiseDone(k,-1,m,d) +} +function PromiseDeferred(){ +if(this===i){ +var k=PromiseInit(new i(e)); +return{ +promise:k, +resolve:function(l){PromiseResolve(k,l)}, +reject:function(m){PromiseReject(k,m)} +}; +}else{ +var C={}; +C.promise=new this(function(J,K){ +C.resolve=J; +C.reject=K; +}) +return C; +} +} +function PromiseResolved(l){ +if(this===i){ +return PromiseCreateAndSet(+1,l); +}else{ +return new this(function(J,K){J(l)}); +} +} +function PromiseRejected(m){ +var k; +if(this===i){ +k=PromiseCreateAndSet(-1,m); +%PromiseRejectEvent(k,m,false); +}else{ +k=new this(function(J,K){K(m)}); +} +return k; +} +function PromiseChain(q,r){ +q=(q===(void 0))?PromiseIdResolveHandler:q; +r=(r===(void 0))?PromiseIdRejectHandler:r; +var A=%_CallFunction(this.constructor,PromiseDeferred); +switch((this[a])){ +case(void 0): +throw MakeTypeError('not_a_promise',[this]); +case 0: +(this[c]).push(q,A); +(this[d]).push(r,A); +break; +case+1: +PromiseEnqueue((this[b]), +[q,A], ++1); +break; +case-1: +if(!(!(this[g]===(void 0)))){ +%PromiseRevokeReject(this); +} +PromiseEnqueue((this[b]), +[r,A], +-1); +break; +} +(this[g]=true); +if((%_DebugIsActive()!=0)){ +%DebugPromiseEvent({promise:A.promise,parentPromise:this}); +} +return A.promise; +} +function PromiseCatch(r){ +return this.then((void 0),r); +} +function PromiseThen(q,r){ +q=(%_ClassOf(q)==='Function')?q +:PromiseIdResolveHandler; +r=(%_ClassOf(r)==='Function')?r +:PromiseIdRejectHandler; +var L=this; +var w=this.constructor; +return %_CallFunction( +this, +function(l){ +l=PromiseCoerce(w,l); +if(l===L){ +if((%_DebugIsActive()!=0&&%DebugCallbackSupportsStepping(r)))%DebugPrepareStepInIfStepping(r); +return r(MakeTypeError('promise_cyclic',[l])); +}else if(IsPromise(l)){ +return l.then(q,r); +}else{ +if((%_DebugIsActive()!=0&&%DebugCallbackSupportsStepping(q)))%DebugPrepareStepInIfStepping(q); +return q(l); +} +}, +r, +PromiseChain +); +} +function PromiseCast(l){ +return IsPromise(l)?l:new this(function(J){J(l)}); +} +function PromiseAll(M){ +var A=%_CallFunction(this,PromiseDeferred); +var N=[]; +try{ +var P=0; +var H=0; +for(var o of M){ +this.resolve(o).then( +(function(H){ +return function(l){ +N[H]=l; +if(--P===0)A.resolve(N); +} +})(H), +function(m){A.reject(m);}); +++H; +++P; +} +if(P===0){ +A.resolve(N); +} +}catch(e){ +A.reject(e) +} +return A.promise; +} +function PromiseRace(M){ +var A=%_CallFunction(this,PromiseDeferred); +try{ +for(var o of M){ +this.resolve(o).then( +function(l){A.resolve(l)}, +function(m){A.reject(m)}); +} +}catch(e){ +A.reject(e) +} +return A.promise; +} +function PromiseHasUserDefinedRejectHandlerRecursive(k){ +var Q=(k[d]); +if((Q===(void 0)))return false; +for(var H=0;H>>0; +if(d<4){ +try{ +g=NoSideEffectToString(b[d]); +}catch(e){ +if(%IsJSModule(b[d])) +g="module"; +else if((%_IsSpecObject(b[d]))) +g="object"; +else +g="#"; +} +} +} +c+=g; +} +return c; +} +function NoSideEffectToString(a){ +if((typeof(a)==='string'))return a; +if((typeof(a)==='number'))return %_NumberToString(a); +if((typeof(a)==='boolean'))return a?'true':'false'; +if((a===(void 0)))return'undefined'; +if((a===null))return'null'; +if((%_IsFunction(a))){ +var b=%_CallFunction(a,FunctionToString); +if(b.length>128){ +b=%_SubString(b,0,111)+"......"+ +%_SubString(b,b.length-2,b.length); +} +return b; +} +if((typeof(a)==='symbol'))return %_CallFunction(a,$symbolToString); +if((%_IsObject(a)) +&&%GetDataProperty(a,"toString")===ObjectToString){ +var c=%GetDataProperty(a,"constructor"); +if(typeof c=="function"){ +var d=c.name; +if((typeof(d)==='string')&&d!==""){ +return"#<"+d+">"; +} +} +} +if(CanBeSafelyTreatedAsAnErrorObject(a)){ +return %_CallFunction(a,ErrorToString); +} +return %_CallFunction(a,NoSideEffectsObjectToString); +} +function CanBeSafelyTreatedAsAnErrorObject(a){ +switch(%_ClassOf(a)){ +case'Error': +case'EvalError': +case'RangeError': +case'ReferenceError': +case'SyntaxError': +case'TypeError': +case'URIError': +return true; +} +var b=%GetDataProperty(a,"toString"); +return a instanceof $Error&&b===ErrorToString; +} +function ToStringCheckErrorObject(a){ +if(CanBeSafelyTreatedAsAnErrorObject(a)){ +return %_CallFunction(a,ErrorToString); +}else{ +return ToString(a); +} +} +function ToDetailString(a){ +if(a!=null&&(%_IsObject(a))&&a.toString===ObjectToString){ +var b=a.constructor; +if(typeof b=="function"){ +var c=b.name; +if((typeof(c)==='string')&&c!==""){ +return"#<"+c+">"; +} +} +} +return ToStringCheckErrorObject(a); +} +function MakeGenericError(a,b,c,d,e){ +if((c===(void 0))&&(typeof(b)==='string'))c=[]; +return new a(FormatMessage(b,c,d,e)); +} +%FunctionSetInstanceClassName(Script,'Script'); +%AddNamedProperty(Script.prototype,'constructor',Script, +2|4|1); +%SetCode(Script,function(a){ +throw new $Error("Not supported"); +}); +function FormatMessage(a,b,c,d){ +if((typeof(a)==='number')){ +var b=NoSideEffectToString(b); +var c=NoSideEffectToString(c); +var d=NoSideEffectToString(d); +try{ +return %FormatMessageString(a,b,c,d); +}catch(e){ +return""; +} +} +var e=kMessages[a]; +if(!e)return""; +return FormatString(e,b); +} +function GetLineNumber(a){ +var b=%MessageGetStartPosition(a); +if(b==-1)return 0; +var c=%MessageGetScript(a); +var d=c.locationFromPosition(b,true); +if(d==null)return 0; +return d.line+1; +} +function GetSourceLine(a){ +var b=%MessageGetScript(a); +var c=%MessageGetStartPosition(a); +var d=b.locationFromPosition(c,true); +if(d==null)return""; +return d.sourceText(); +} +function MakeError(a,b,c,d){ +return MakeGenericError($Error,a,b,c,d); +} +function MakeTypeError(a,b,c,d){ +return MakeGenericError($TypeError,a,b,c,d); +} +function MakeRangeError(a,b,c,d){ +return MakeGenericError($RangeError,a,b,c,d); +} +function MakeSyntaxError(a,b,c,d){ +return MakeGenericError($SyntaxError,a,b,c,d); +} +function MakeReferenceError(a,b,c,d){ +return MakeGenericError($ReferenceError,a,b,c,d); +} +function MakeEvalError(a,b,c,d){ +return MakeGenericError($EvalError,a,b,c,d); +} +function MakeTypeErrorEmbedded(a,b){ +return MakeGenericError($TypeError,a,[b]); +} +function MakeSyntaxErrorEmbedded(a,b){ +return MakeGenericError($SyntaxError,a,[b]); +} +function MakeReferenceErrorEmbedded(a,b){ +return MakeGenericError($ReferenceError,a,[b]); +} +function ScriptLineFromPosition(a){ +var b=0; +var c=this.lineCount()-1; +var d=this.line_ends; +if(a>d[c]){ +return-1; +} +if(a<=d[0]){ +return 0; +} +while(c>=1){ +var e=(b+c)>>1; +if(a>d[e]){ +b=e+1; +}else if(a<=d[e-1]){ +c=e-1; +}else{ +return e; +} +} +return-1; +} +function ScriptLocationFromPosition(position, +include_resource_offset){ +var a=this.lineFromPosition(position); +if(a==-1)return null; +var b=this.line_ends; +var c=a==0?0:b[a-1]+1; +var d=b[a]; +if(d>0&&%_CallFunction(this.source,d-1,$stringCharAt)=='\r'){ +d--; +} +var e=position-c; +if(include_resource_offset){ +a+=this.line_offset; +if(a==this.line_offset){ +e+=this.column_offset; +} +} +return new SourceLocation(this,position,a,e,c,d); +} +function ScriptLocationFromLine(a,b,c){ +var d=0; +if(!(a===(void 0))){ +d=a-this.line_offset; +} +var e=b||0; +if(d==0){ +e-=this.column_offset; +} +var g=c||0; +if(d<0||e<0||g<0)return null; +if(d==0){ +return this.locationFromPosition(g+e,false); +}else{ +var h=this.lineFromPosition(g); +if(h==-1||h+d>=this.lineCount()){ +return null; +} +return this.locationFromPosition( +this.line_ends[h+d-1]+1+e); +} +} +function ScriptSourceSlice(a,b){ +var c=(a===(void 0))?this.line_offset +:a; +var d=(b===(void 0))?this.line_offset+this.lineCount() +:b; +c-=this.line_offset; +d-=this.line_offset; +if(c<0)c=0; +if(d>this.lineCount())d=this.lineCount(); +if(c>=this.lineCount()|| +d<0|| +c>d){ +return null; +} +var e=this.line_ends; +var g=c==0?0:e[c-1]+1; +var h=d==0?0:e[d-1]+1; +return new SourceSlice(this, +c+this.line_offset, +d+this.line_offset, +g,h); +} +function ScriptSourceLine(a){ +var b=0; +if(!(a===(void 0))){ +b=a-this.line_offset; +} +if(b<0||this.lineCount()<=b){ +return null; +} +var c=this.line_ends; +var d=b==0?0:c[b-1]+1; +var e=c[b]; +return %_CallFunction(this.source,d,e,$stringSubstring); +} +function ScriptLineCount(){ +return this.line_ends.length; +} +function ScriptNameOrSourceURL(){ +if(this.source_url)return this.source_url; +return this.name; +} +SetUpLockedPrototype(Script,[ +"source", +"name", +"source_url", +"source_mapping_url", +"line_ends", +"line_offset", +"column_offset" +],[ +"lineFromPosition",ScriptLineFromPosition, +"locationFromPosition",ScriptLocationFromPosition, +"locationFromLine",ScriptLocationFromLine, +"sourceSlice",ScriptSourceSlice, +"sourceLine",ScriptSourceLine, +"lineCount",ScriptLineCount, +"nameOrSourceURL",ScriptNameOrSourceURL +] +); +function SourceLocation(a,b,c,d,e,g){ +this.script=a; +this.position=b; +this.line=c; +this.column=d; +this.start=e; +this.end=g; +} +function SourceLocationSourceText(){ +return %_CallFunction(this.script.source, +this.start, +this.end, +$stringSubstring); +} +SetUpLockedPrototype(SourceLocation, +["script","position","line","column","start","end"], +["sourceText",SourceLocationSourceText] +); +function SourceSlice(a,b,c,d,e){ +this.script=a; +this.from_line=b; +this.to_line=c; +this.from_position=d; +this.to_position=e; +} +function SourceSliceSourceText(){ +return %_CallFunction(this.script.source, +this.from_position, +this.to_position, +$stringSubstring); +} +SetUpLockedPrototype(SourceSlice, +["script","from_line","to_line","from_position","to_position"], +["sourceText",SourceSliceSourceText] +); +function GetPositionInLine(a){ +var b=%MessageGetScript(a); +var c=%MessageGetStartPosition(a); +var d=b.locationFromPosition(c,false); +if(d==null)return-1; +return c-d.start; +} +function GetStackTraceLine(a,b,c,d){ +return new CallSite(a,b,c,false).toString(); +} +var CallSiteReceiverKey=(%CreatePrivateOwnSymbol("CallSite#receiver")); +var CallSiteFunctionKey=(%CreatePrivateOwnSymbol("CallSite#function")); +var CallSitePositionKey=(%CreatePrivateOwnSymbol("CallSite#position")); +var CallSiteStrictModeKey=(%CreatePrivateOwnSymbol("CallSite#strict_mode")); +function CallSite(a,b,c,d){ +(this[CallSiteReceiverKey]=a); +(this[CallSiteFunctionKey]=b); +(this[CallSitePositionKey]=c); +(this[CallSiteStrictModeKey]=d); +} +function CallSiteGetThis(){ +return(this[CallSiteStrictModeKey]) +?(void 0):(this[CallSiteReceiverKey]); +} +function CallSiteGetTypeName(){ +return GetTypeName((this[CallSiteReceiverKey]),false); +} +function CallSiteIsToplevel(){ +if((this[CallSiteReceiverKey])==null){ +return true; +} +return(%_ClassOf((this[CallSiteReceiverKey]))==='global'); +} +function CallSiteIsEval(){ +var a=%FunctionGetScript((this[CallSiteFunctionKey])); +return a&&a.compilation_type==1; +} +function CallSiteGetEvalOrigin(){ +var a=%FunctionGetScript((this[CallSiteFunctionKey])); +return FormatEvalOrigin(a); +} +function CallSiteGetScriptNameOrSourceURL(){ +var a=%FunctionGetScript((this[CallSiteFunctionKey])); +return a?a.nameOrSourceURL():null; +} +function CallSiteGetFunction(){ +return(this[CallSiteStrictModeKey]) +?(void 0):(this[CallSiteFunctionKey]); +} +function CallSiteGetFunctionName(){ +var a=(this[CallSiteFunctionKey]); +var b=%FunctionGetDebugName(a); +if(b){ +return b; +} +var c=%FunctionGetScript(a); +if(c&&c.compilation_type==1){ +return"eval"; +} +return null; +} +function CallSiteGetMethodName(){ +var a=(this[CallSiteReceiverKey]); +var b=(this[CallSiteFunctionKey]); +var c=b.name; +if(c&&a&& +(%_CallFunction(a,c,ObjectLookupGetter)===b|| +%_CallFunction(a,c,ObjectLookupSetter)===b|| +((%_IsObject(a))&&%GetDataProperty(a,c)===b))){ +return c; +} +var d=null; +for(var e in a){ +if(%_CallFunction(a,e,ObjectLookupGetter)===b|| +%_CallFunction(a,e,ObjectLookupSetter)===b|| +((%_IsObject(a))&&%GetDataProperty(a,e)===b)){ +if(d){ +return null; +} +d=e; +} +} +if(d){ +return d; +} +return null; +} +function CallSiteGetFileName(){ +var a=%FunctionGetScript((this[CallSiteFunctionKey])); +return a?a.name:null; +} +function CallSiteGetLineNumber(){ +if((this[CallSitePositionKey])==-1){ +return null; +} +var a=%FunctionGetScript((this[CallSiteFunctionKey])); +var b=null; +if(a){ +b=a.locationFromPosition( +(this[CallSitePositionKey]),true); +} +return b?b.line+1:null; +} +function CallSiteGetColumnNumber(){ +if((this[CallSitePositionKey])==-1){ +return null; +} +var a=%FunctionGetScript((this[CallSiteFunctionKey])); +var b=null; +if(a){ +b=a.locationFromPosition( +(this[CallSitePositionKey]),true); +} +return b?b.column+1:null; +} +function CallSiteIsNative(){ +var a=%FunctionGetScript((this[CallSiteFunctionKey])); +return a?(a.type==0):false; +} +function CallSiteGetPosition(){ +return(this[CallSitePositionKey]); +} +function CallSiteIsConstructor(){ +var a=(this[CallSiteReceiverKey]); +var b=(a!=null&&(%_IsObject(a))) +?%GetDataProperty(a,"constructor"):null; +if(!b)return false; +return(this[CallSiteFunctionKey])===b; +} +function CallSiteToString(){ +var a; +var b=""; +if(this.isNative()){ +b="native"; +}else{ +a=this.getScriptNameOrSourceURL(); +if(!a&&this.isEval()){ +b=this.getEvalOrigin(); +b+=", "; +} +if(a){ +b+=a; +}else{ +b+=""; +} +var c=this.getLineNumber(); +if(c!=null){ +b+=":"+c; +var d=this.getColumnNumber(); +if(d){ +b+=":"+d; +} +} +} +var e=""; +var g=this.getFunctionName(); +var h=true; +var i=this.isConstructor(); +var j=!(this.isToplevel()||i); +if(j){ +var k=GetTypeName((this[CallSiteReceiverKey]),true); +var l=this.getMethodName(); +if(g){ +if(k&& +%_CallFunction(g,k,$stringIndexOf)!=0){ +e+=k+"."; +} +e+=g; +if(l&& +(%_CallFunction(g,"."+l,$stringIndexOf)!= +g.length-l.length-1)){ +e+=" [as "+l+"]"; +} +}else{ +e+=k+"."+(l||""); +} +}else if(i){ +e+="new "+(g||""); +}else if(g){ +e+=g; +}else{ +e+=b; +h=false; +} +if(h){ +e+=" ("+b+")"; +} +return e; +} +SetUpLockedPrototype(CallSite,["receiver","fun","pos"],[ +"getThis",CallSiteGetThis, +"getTypeName",CallSiteGetTypeName, +"isToplevel",CallSiteIsToplevel, +"isEval",CallSiteIsEval, +"getEvalOrigin",CallSiteGetEvalOrigin, +"getScriptNameOrSourceURL",CallSiteGetScriptNameOrSourceURL, +"getFunction",CallSiteGetFunction, +"getFunctionName",CallSiteGetFunctionName, +"getMethodName",CallSiteGetMethodName, +"getFileName",CallSiteGetFileName, +"getLineNumber",CallSiteGetLineNumber, +"getColumnNumber",CallSiteGetColumnNumber, +"isNative",CallSiteIsNative, +"getPosition",CallSiteGetPosition, +"isConstructor",CallSiteIsConstructor, +"toString",CallSiteToString +]); +function FormatEvalOrigin(a){ +var b=a.nameOrSourceURL(); +if(b){ +return b; +} +var c="eval at "; +if(a.eval_from_function_name){ +c+=a.eval_from_function_name; +}else{ +c+=""; +} +var d=a.eval_from_script; +if(d){ +if(d.compilation_type==1){ +c+=" ("+FormatEvalOrigin(d)+")"; +}else{ +if(d.name){ +c+=" ("+d.name; +var e=d.locationFromPosition( +a.eval_from_script_position,true); +if(e){ +c+=":"+(e.line+1); +c+=":"+(e.column+1); +} +c+=")"; +}else{ +c+=" (unknown source)"; +} +} +} +return c; +} +function FormatErrorString(a){ +try{ +return %_CallFunction(a,ErrorToString); +}catch(e){ +try{ +return""; +}catch(ee){ +return""; +} +} +} +function GetStackFrames(a){ +var b=new InternalArray(); +var c=a[0]; +for(var d=1;d"; +}catch(ee){ +j=""; +} +} +g.push(" at "+j); +} +return %_CallFunction(g,"\n",$arrayJoin); +} +function GetTypeName(a,b){ +var c=a.constructor; +if(!c){ +return b?null: +%_CallFunction(a,NoSideEffectsObjectToString); +} +var d=c.name; +if(!d){ +return b?null: +%_CallFunction(a,NoSideEffectsObjectToString); +} +return d; +} +var stack_trace_symbol; +var formatted_stack_trace_symbol=(%CreatePrivateOwnSymbol("formatted stack trace")); +var StackTraceGetter=function(){ +var a=(void 0); +var b=this; +while(b){ +var a= +(b[formatted_stack_trace_symbol]); +if((a===(void 0))){ +var c=(b[stack_trace_symbol]); +if((c===(void 0))){ +b=%_GetPrototype(b); +continue; +} +a=FormatStackTrace(b,c); +(b[stack_trace_symbol]=(void 0)); +(b[formatted_stack_trace_symbol]=a); +} +return a; +} +return(void 0); +}; +var StackTraceSetter=function(a){ +if((%HasOwnProperty(this,stack_trace_symbol))){ +(this[stack_trace_symbol]=(void 0)); +(this[formatted_stack_trace_symbol]=a); +} +}; +var captureStackTrace=function captureStackTrace(a,b){ +ObjectDefineProperty(a,'stack',{get:StackTraceGetter, +set:StackTraceSetter, +configurable:true}); +%CollectStackTrace(a,b?b:captureStackTrace); +} +function SetUpError(){ +var a=function(b){ +var c=b.name; +%AddNamedProperty(global,c,b,2); +%AddNamedProperty(builtins,'$'+c,b, +2|4|1); +if(c=='Error'){ +var d=function(){}; +%FunctionSetPrototype(d,$Object.prototype); +%FunctionSetInstanceClassName(d,'Error'); +%FunctionSetPrototype(b,new d()); +}else{ +%FunctionSetPrototype(b,new $Error()); +%InternalSetPrototype(b,$Error); +} +%FunctionSetInstanceClassName(b,'Error'); +%AddNamedProperty(b.prototype,'constructor',b,2); +%AddNamedProperty(b.prototype,'name',c,2); +%SetCode(b,function(e){ +if(%_IsConstructCall()){ +try{captureStackTrace(this,b);}catch(e){} +if(!(e===(void 0))){ +%AddNamedProperty(this,'message',ToString(e),2); +} +}else{ +return new b(e); +} +}); +%SetNativeFlag(b); +}; +a(function Error(){}); +a(function TypeError(){}); +a(function RangeError(){}); +a(function SyntaxError(){}); +a(function ReferenceError(){}); +a(function EvalError(){}); +a(function URIError(){}); +} +SetUpError(); +$Error.captureStackTrace=captureStackTrace; +%AddNamedProperty($Error.prototype,'message','',2); +var visited_errors=new InternalArray(); +var cyclic_error_marker=new $Object(); +function GetPropertyWithoutInvokingMonkeyGetters(a,b){ +var c=a; +while(c&&!%HasOwnProperty(c,b)){ +c=%_GetPrototype(c); +} +if((c===null))return(void 0); +if(!(%_IsObject(c)))return a[b]; +var d=%GetOwnProperty(c,b); +if(d&&d[0]){ +var e=b==="name"; +if(c===$ReferenceError.prototype) +return e?"ReferenceError":(void 0); +if(c===$SyntaxError.prototype) +return e?"SyntaxError":(void 0); +if(c===$TypeError.prototype) +return e?"TypeError":(void 0); +} +return a[b]; +} +function ErrorToStringDetectCycle(a){ +if(!%PushIfAbsent(visited_errors,a))throw cyclic_error_marker; +try{ +var b=GetPropertyWithoutInvokingMonkeyGetters(a,"name"); +b=(b===(void 0))?"Error":((typeof(%IS_VAR(b))==='string')?b:NonStringToString(b)); +var c=GetPropertyWithoutInvokingMonkeyGetters(a,"message"); +c=(c===(void 0))?"":((typeof(%IS_VAR(c))==='string')?c:NonStringToString(c)); +if(b==="")return c; +if(c==="")return b; +return b+": "+c; +}finally{ +visited_errors.length=visited_errors.length-1; +} +} +function ErrorToString(){ +if(!(%_IsSpecObject(this))){ +throw MakeTypeError(3,"Error.prototype.toString"); +} +try{ +return ErrorToStringDetectCycle(this); +}catch(e){ +if(e===cyclic_error_marker){ +return''; +} +throw e; +} +} +InstallFunctions($Error.prototype,2,['toString',ErrorToString]); +function SetUpStackOverflowBoilerplate(){ +var a=MakeRangeError(39); +%DefineAccessorPropertyUnchecked( +a,'stack',StackTraceGetter,StackTraceSetter,2); +return a; +} +var kStackOverflowBoilerplate=SetUpStackOverflowBoilerplate(); + +json5; +var $jsonSerializeAdapter; +(function(){ +"use strict"; +%CheckIsBootstrapping(); +var a=global.JSON; +function Revive(b,c,d){ +var e=b[c]; +if((%_IsObject(e))){ +if((%_IsArray(e))){ +var g=e.length; +for(var h=0;h0){ +var B=",\n"+q; +A="[\n"+q+u.join(B)+"\n"+ +t+"]"; +}else{ +A="[]"; +} +o.pop(); +return A; +} +function SerializeObject(m,n,o,q,r){ +if(!%PushIfAbsent(o,m)){ +throw MakeTypeError('circular_structure',[]); +} +var t=q; +q+=r; +var u=new InternalArray(); +if((%_IsArray(n))){ +var g=n.length; +for(var h=0;h0){ +var B=",\n"+q; +A="{\n"+q+u.join(B)+"\n"+ +t+"}"; +}else{ +A="{}"; +} +o.pop(); +return A; +} +function JSONSerialize(D,b,n,o,q,r){ +var m=b[D]; +if((%_IsSpecObject(m))){ +var E=m.toJSON; +if((%_ClassOf(E)==='Function')){ +m=%_CallFunction(m,D,E); +} +} +if((%_ClassOf(n)==='Function')){ +m=%_CallFunction(b,D,m,n); +} +if((typeof(m)==='string')){ +return %QuoteJSONString(m); +}else if((typeof(m)==='number')){ +return((%_IsSmi(%IS_VAR(m))||m-m==0)?%_NumberToString(m):"null"); +}else if((typeof(m)==='boolean')){ +return m?"true":"false"; +}else if((m===null)){ +return"null"; +}else if((%_IsSpecObject(m))&&!(typeof m=="function")){ +if((%_IsArray(m))){ +return SerializeArray(m,n,o,q,r); +}else if((%_ClassOf(m)==='Number')){ +m=ToNumber(m); +return((%_IsSmi(%IS_VAR(m))||m-m==0)?%_NumberToString(m):"null"); +}else if((%_ClassOf(m)==='String')){ +return %QuoteJSONString(ToString(m)); +}else if((%_ClassOf(m)==='Boolean')){ +return %_ValueOf(m)?"true":"false"; +}else{ +return SerializeObject(m,n,o,q,r); +} +} +return(void 0); +} +function JSONStringify(m,n,G){ +if(%_ArgumentsLength()==1){ +return %BasicJSONStringify(m); +} +if((%_IsObject(G))){ +if((%_ClassOf(G)==='Number')){ +G=ToNumber(G); +}else if((%_ClassOf(G)==='String')){ +G=ToString(G); +} +} +var r; +if((typeof(G)==='number')){ +G=$max(0,$min(ToInteger(G),10)); +r=%_SubString(" ",0,G); +}else if((typeof(G)==='string')){ +if(G.length>10){ +r=%_SubString(G,0,10); +}else{ +r=G; +} +}else{ +r=""; +} +if((%_IsArray(n))){ +var H=new InternalArray(); +var I={__proto__:null}; +var J={}; +var g=n.length; +for(var h=0;h>>0); +if(A>=C){ +(u[m]=(void 0)); +return CreateIteratorResultObject((void 0),true); +} +(u[n]=A+1); +if(B==2){ +return CreateIteratorResultObject(q[A],false); +} +if(B==3){ +return CreateIteratorResultObject([A,q[A]],false); +} +return CreateIteratorResultObject(A,false); +} +function ArrayEntries(){ +return CreateArrayIterator(this,3); +} +function ArrayValues(){ +return CreateArrayIterator(this,2); +} +function ArrayKeys(){ +return CreateArrayIterator(this,1); +} +%FunctionSetPrototype(ArrayIterator,new b()); +%FunctionSetInstanceClassName(ArrayIterator,'Array Iterator'); +InstallFunctions(ArrayIterator.prototype,2,[ +'next',ArrayIteratorNext +]); +%FunctionSetName(ArrayIteratorIterator,'[Symbol.iterator]'); +%AddNamedProperty(ArrayIterator.prototype,symbolIterator, +ArrayIteratorIterator,2); +%AddNamedProperty(ArrayIterator.prototype,symbolToStringTag, +"Array Iterator",1|2); +InstallFunctions(a.prototype,2,[ +'entries',ArrayEntries, +'keys',ArrayKeys +]); +%AddNamedProperty(a.prototype,symbolIterator,ArrayValues, +2); +%AddNamedProperty(c.prototype,'entries',ArrayEntries,2); +%AddNamedProperty(c.prototype,'values',ArrayValues,2); +%AddNamedProperty(c.prototype,'keys',ArrayKeys,2); +%AddNamedProperty(c.prototype,symbolIterator,ArrayValues, +2); + +%AddNamedProperty(d.prototype,'entries',ArrayEntries,2); +%AddNamedProperty(d.prototype,'values',ArrayValues,2); +%AddNamedProperty(d.prototype,'keys',ArrayKeys,2); +%AddNamedProperty(d.prototype,symbolIterator,ArrayValues, +2); + +%AddNamedProperty(e.prototype,'entries',ArrayEntries,2); +%AddNamedProperty(e.prototype,'values',ArrayValues,2); +%AddNamedProperty(e.prototype,'keys',ArrayKeys,2); +%AddNamedProperty(e.prototype,symbolIterator,ArrayValues, +2); + +%AddNamedProperty(g.prototype,'entries',ArrayEntries,2); +%AddNamedProperty(g.prototype,'values',ArrayValues,2); +%AddNamedProperty(g.prototype,'keys',ArrayKeys,2); +%AddNamedProperty(g.prototype,symbolIterator,ArrayValues, +2); + +%AddNamedProperty(h.prototype,'entries',ArrayEntries,2); +%AddNamedProperty(h.prototype,'values',ArrayValues,2); +%AddNamedProperty(h.prototype,'keys',ArrayKeys,2); +%AddNamedProperty(h.prototype,symbolIterator,ArrayValues, +2); + +%AddNamedProperty(i.prototype,'entries',ArrayEntries,2); +%AddNamedProperty(i.prototype,'values',ArrayValues,2); +%AddNamedProperty(i.prototype,'keys',ArrayKeys,2); +%AddNamedProperty(i.prototype,symbolIterator,ArrayValues, +2); + +%AddNamedProperty(j.prototype,'entries',ArrayEntries,2); +%AddNamedProperty(j.prototype,'values',ArrayValues,2); +%AddNamedProperty(j.prototype,'keys',ArrayKeys,2); +%AddNamedProperty(j.prototype,symbolIterator,ArrayValues, +2); + +%AddNamedProperty(k.prototype,'entries',ArrayEntries,2); +%AddNamedProperty(k.prototype,'values',ArrayValues,2); +%AddNamedProperty(k.prototype,'keys',ArrayKeys,2); +%AddNamedProperty(k.prototype,symbolIterator,ArrayValues, +2); + +%AddNamedProperty(l.prototype,'entries',ArrayEntries,2); +%AddNamedProperty(l.prototype,'values',ArrayValues,2); +%AddNamedProperty(l.prototype,'keys',ArrayKeys,2); +%AddNamedProperty(l.prototype,symbolIterator,ArrayValues, +2); + + +$iteratorCreateResultObject=CreateIteratorResultObject; +$arrayValues=ArrayValues; +})(); + +>>0); +if(i>=j){ +(h[c]=(void 0)); +return $iteratorCreateResultObject((void 0),true); +} +var k=%_StringCharCodeAt(g,i); +var l=%_StringCharFromCode(k); +i++; +if(k>=0xD800&&k<=0xDBFF&&i=0xDC00&&m<=0xDFFF){ +l+=%_StringCharFromCode(m); +i++; +} +} +(h[d]=i); +return $iteratorCreateResultObject(l,false); +} +function StringPrototypeIterator(){ +return CreateStringIterator(this); +} +%FunctionSetPrototype(StringIterator,new a()); +%FunctionSetInstanceClassName(StringIterator,'String Iterator'); +InstallFunctions(StringIterator.prototype,2,[ +'next',StringIteratorNext +]); +%FunctionSetName(StringIteratorIterator,'[Symbol.iterator]'); +%AddNamedProperty(StringIterator.prototype,symbolIterator, +StringIteratorIterator,2); +%AddNamedProperty(StringIterator.prototype,symbolToStringTag, +"String Iterator",1|2); +%FunctionSetName(StringPrototypeIterator,'[Symbol.iterator]'); +%AddNamedProperty(b.prototype,symbolIterator, +StringPrototypeIterator,2); +})(); + +$templatesÕ +var $getTemplateCallSite; +(function(){ +"use strict"; +%CheckIsBootstrapping(); +var a=new global.Map; +var b=global.Map.prototype.get; +var c=global.Map.prototype.set; +function SameCallSiteElements(d,e){ +var g=d.length; +var e=e.raw; +if(g!==e.length)return false; +for(var h=0;h0){ +return I(L,%_Arguments(0)); +}else{ +return I(L); +} +} +} +%FunctionSetName(M,K); +%FunctionRemovePrototype(M); +%SetNativeFlag(M); +this[K]=M; +} +return this[K]; +} +%FunctionSetName(getter,H); +%FunctionRemovePrototype(getter); +%SetNativeFlag(getter); +ObjectDefineProperty(G.prototype,H,{ +get:getter, +enumerable:false, +configurable:true +}); +} +function supportedLocalesOf(Q,R,S){ +if((Q.match(GetServiceRE())===null)){ +throw new $Error('Internal error, wrong service type: '+Q); +} +if(S===g){ +S={}; +}else{ +S=ToObject(S); +} +var T=S.localeMatcher; +if(T!==g){ +T=e(T); +if(T!=='lookup'&&T!=='best fit'){ +throw new $RangeError('Illegal value for localeMatcher:'+T); +} +}else{ +T='best fit'; +} +var U=initializeLocaleList(R); +if(k[Q]===g){ +k[Q]=getAvailableLocalesOf(Q); +} +if(T==='best fit'){ +return initializeLocaleList(bestFitSupportedLocalesOf( +U,k[Q])); +} +return initializeLocaleList(lookupSupportedLocalesOf( +U,k[Q])); +} +function lookupSupportedLocalesOf(U,W){ +var X=[]; +for(var Y=0;Y=3&&J<=8&&an!==g){ +am[an]=ao; +an=g; +}else{ +return{}; +} +} +return am; +} +function setOptions(ap,am,aq,ac,ar){ +var ak=''; +var as=function updateExtension(at,ah){ +return'-'+at+'-'+e(ah); +} +var au=function updateProperty(ad,ae,ah){ +if(ae==='boolean'&&(typeof ah==='string')){ +ah=(ah==='true')?true:false; +} +if(ad!==g){ +defineWEProperty(ar,ad,ah); +} +} +for(var at in aq){ +if(aq.hasOwnProperty(at)){ +var ah=g; +var av=aq[at]; +if(av.property!==g){ +ah=ac(av.property,av.type,av.values); +} +if(ah!==g){ +au(av.property,av.type,ah); +ak+=as(at,ah); +continue; +} +if(am.hasOwnProperty(at)){ +ah=am[at]; +if(ah!==g){ +au(av.property,av.type,ah); +ak+=as(at,ah); +}else if(av.type==='boolean'){ +au(av.property,av.type,true); +ak+=as(at,true); +} +} +} +} +return ak===''?'':'-u'+ak; +} +function freezeArray(aw){ +aw.forEach(function(ao,ax){ +ObjectDefineProperty(aw,ax,{value:ao, +configurable:false, +writable:false, +enumerable:true}); +}); +ObjectDefineProperty(aw,'length',{value:aw.length, +writable:false}); +return aw; +} +function getOptimalLanguageTag(ay,ai){ +if(ay===ai){ +return ay; +} +var R=%GetLanguageTagVariants([ay,ai]); +if(R[0].maximized!==R[1].maximized){ +return ai; +} +var az=new d('^'+R[1].base); +return ai.replace(az,R[0].base); +} +function getAvailableLocalesOf(Q){ +var aA=%AvailableLocalesOf(Q); +for(var Y in aA){ +if(aA.hasOwnProperty(Y)){ +var aB=Y.match(/^([a-z]{2,3})-([A-Z][a-z]{3})-([A-Z]{2})$/); +if(aB!==null){ +aA[aB[1]+'-'+aB[3]]=null; +} +} +} +return aA; +} +function defineWEProperty(aC,ad,ah){ +ObjectDefineProperty(aC,ad, +{value:ah,writable:true,enumerable:true}); +} +function addWEPropertyIfDefined(aC,ad,ah){ +if(ah!==g){ +defineWEProperty(aC,ad,ah); +} +} +function defineWECProperty(aC,ad,ah){ +ObjectDefineProperty(aC,ad, +{value:ah, +writable:true, +enumerable:true, +configurable:true}); +} +function addWECPropertyIfDefined(aC,ad,ah){ +if(ah!==g){ +defineWECProperty(aC,ad,ah); +} +} +function toTitleCaseWord(aD){ +return aD.substr(0,1).toUpperCase()+aD.substr(1).toLowerCase(); +} +function canonicalizeLanguageTag(aE){ +if(typeof aE!=='string'&&typeof aE!=='object'|| +(aE===null)){ +throw new $TypeError('Language ID should be string or object.'); +} +var aF=e(aE); +if(isValidLanguageTag(aF)===false){ +throw new $RangeError('Invalid language tag: '+aF); +} +var aG=%CanonicalizeLanguageTag(aF); +if(aG==='invalid-tag'){ +throw new $RangeError('Invalid language tag: '+aF); +} +return aG; +} +function initializeLocaleList(R){ +var aH=[]; +if(R===g){ +aH=[]; +}else{ +if(typeof R==='string'){ +aH.push(canonicalizeLanguageTag(R)); +return freezeArray(aH); +} +var aI=ToObject(R); +var aJ=aI.length>>>0; +for(var aK=0;aKbl){ +throw new $RangeError(ad+' value is out of range.'); +} +return $floor(ah); +} +return bm; +} +function initializeNumberFormat(bn,R,S){ +if(%IsInitializedIntlObject(bn)){ +throw new $TypeError('Trying to re-initialize NumberFormat object.'); +} +if(S===g){ +S={}; +} +var ac=getGetOption(S,'numberformat'); +var Z=resolveLocale('numberformat',R,S); +var bd={}; +defineWEProperty(bd,'style',ac( +'style','string',['decimal','percent','currency'],'decimal')); +var bj=ac('currency','string'); +if(bj!==g&&!isWellFormedCurrencyCode(bj)){ +throw new $RangeError('Invalid currency code: '+bj); +} +if(bd.style==='currency'&&bj===g){ +throw new $TypeError('Currency code is required with currency style.'); +} +var bo=ac( +'currencyDisplay','string',['code','symbol','name'],'symbol'); +if(bd.style==='currency'){ +defineWEProperty(bd,'currency',bj.toUpperCase()); +defineWEProperty(bd,'currencyDisplay',bo); +} +var bp=getNumberOption(S,'minimumIntegerDigits',1,21,1); +defineWEProperty(bd,'minimumIntegerDigits',bp); +var bq=getNumberOption(S,'minimumFractionDigits',0,20,0); +defineWEProperty(bd,'minimumFractionDigits',bq); +var br=getNumberOption(S,'maximumFractionDigits',bq,20,3); +defineWEProperty(bd,'maximumFractionDigits',br); +var bs=S['minimumSignificantDigits']; +var bt=S['maximumSignificantDigits']; +if(bs!==g||bt!==g){ +bs=getNumberOption(S,'minimumSignificantDigits',1,21,0); +defineWEProperty(bd,'minimumSignificantDigits',bs); +bt=getNumberOption(S,'maximumSignificantDigits',bs,21,21); +defineWEProperty(bd,'maximumSignificantDigits',bt); +} +defineWEProperty(bd,'useGrouping',ac( +'useGrouping','boolean',g,true)); +var am=parseExtension(Z.extension); +var ak=setOptions(S,am,B, +ac,bd); +var bg=Z.locale+ak; +var ai=ObjectDefineProperties({},{ +currency:{writable:true}, +currencyDisplay:{writable:true}, +locale:{writable:true}, +maximumFractionDigits:{writable:true}, +minimumFractionDigits:{writable:true}, +minimumIntegerDigits:{writable:true}, +numberingSystem:{writable:true}, +requestedLocale:{value:bg,writable:true}, +style:{value:bd.style,writable:true}, +useGrouping:{writable:true} +}); +if(bd.hasOwnProperty('minimumSignificantDigits')){ +defineWEProperty(ai,'minimumSignificantDigits',g); +} +if(bd.hasOwnProperty('maximumSignificantDigits')){ +defineWEProperty(ai,'maximumSignificantDigits',g); +} +var bu=%CreateNumberFormat(bg, +bd, +ai); +if(bd.style==='currency'){ +ObjectDefineProperty(ai,'currencyDisplay',{value:bo, +writable:true}); +} +%MarkAsInitializedIntlObjectOfType(bn,'numberformat',bu); +ObjectDefineProperty(bn,'resolved',{value:ai}); +return bn; +} +%AddNamedProperty(h,'NumberFormat',function(){ +var R=%_Arguments(0); +var S=%_Arguments(1); +if(!this||this===h){ +return new h.NumberFormat(R,S); +} +return initializeNumberFormat(ToObject(this),R,S); +}, +2 +); +%AddNamedProperty(h.NumberFormat.prototype,'resolvedOptions',function(){ +if(%_IsConstructCall()){ +throw new $TypeError(E); +} +if(!%IsInitializedIntlObjectOfType(this,'numberformat')){ +throw new $TypeError('resolvedOptions method called on a non-object'+ +' or on a object that is not Intl.NumberFormat.'); +} +var bv=this; +var Z=getOptimalLanguageTag(bv.resolved.requestedLocale, +bv.resolved.locale); +var bw={ +locale:Z, +numberingSystem:bv.resolved.numberingSystem, +style:bv.resolved.style, +useGrouping:bv.resolved.useGrouping, +minimumIntegerDigits:bv.resolved.minimumIntegerDigits, +minimumFractionDigits:bv.resolved.minimumFractionDigits, +maximumFractionDigits:bv.resolved.maximumFractionDigits, +}; +if(bw.style==='currency'){ +defineWECProperty(bw,'currency',bv.resolved.currency); +defineWECProperty(bw,'currencyDisplay', +bv.resolved.currencyDisplay); +} +if(bv.resolved.hasOwnProperty('minimumSignificantDigits')){ +defineWECProperty(bw,'minimumSignificantDigits', +bv.resolved.minimumSignificantDigits); +} +if(bv.resolved.hasOwnProperty('maximumSignificantDigits')){ +defineWECProperty(bw,'maximumSignificantDigits', +bv.resolved.maximumSignificantDigits); +} +return bw; +}, +2 +); +%FunctionSetName(h.NumberFormat.prototype.resolvedOptions, +'resolvedOptions'); +%FunctionRemovePrototype(h.NumberFormat.prototype.resolvedOptions); +%SetNativeFlag(h.NumberFormat.prototype.resolvedOptions); +%AddNamedProperty(h.NumberFormat,'supportedLocalesOf',function(R){ +if(%_IsConstructCall()){ +throw new $TypeError(E); +} +return supportedLocalesOf('numberformat',R,%_Arguments(1)); +}, +2 +); +%FunctionSetName(h.NumberFormat.supportedLocalesOf,'supportedLocalesOf'); +%FunctionRemovePrototype(h.NumberFormat.supportedLocalesOf); +%SetNativeFlag(h.NumberFormat.supportedLocalesOf); +function formatNumber(bu,ah){ +var bx=c(ah)+0; +return %InternalNumberFormat(%GetImplFromInitializedIntlObject(bu), +bx); +} +function parseNumber(bu,ah){ +return %InternalNumberParse(%GetImplFromInitializedIntlObject(bu), +e(ah)); +} +addBoundMethod(h.NumberFormat,'format',formatNumber,1); +addBoundMethod(h.NumberFormat,'v8Parse',parseNumber,1); +function toLDMLString(S){ +var ac=getGetOption(S,'dateformat'); +var by=''; +var bz=ac('weekday','string',['narrow','short','long']); +by+=appendToLDMLString( +bz,{narrow:'EEEEE',short:'EEE',long:'EEEE'}); +bz=ac('era','string',['narrow','short','long']); +by+=appendToLDMLString( +bz,{narrow:'GGGGG',short:'GGG',long:'GGGG'}); +bz=ac('year','string',['2-digit','numeric']); +by+=appendToLDMLString(bz,{'2-digit':'yy','numeric':'y'}); +bz=ac('month','string', +['2-digit','numeric','narrow','short','long']); +by+=appendToLDMLString(bz,{'2-digit':'MM','numeric':'M', +'narrow':'MMMMM','short':'MMM','long':'MMMM'}); +bz=ac('day','string',['2-digit','numeric']); +by+=appendToLDMLString( +bz,{'2-digit':'dd','numeric':'d'}); +var bA=ac('hour12','boolean'); +bz=ac('hour','string',['2-digit','numeric']); +if(bA===g){ +by+=appendToLDMLString(bz,{'2-digit':'jj','numeric':'j'}); +}else if(bA===true){ +by+=appendToLDMLString(bz,{'2-digit':'hh','numeric':'h'}); +}else{ +by+=appendToLDMLString(bz,{'2-digit':'HH','numeric':'H'}); +} +bz=ac('minute','string',['2-digit','numeric']); +by+=appendToLDMLString(bz,{'2-digit':'mm','numeric':'m'}); +bz=ac('second','string',['2-digit','numeric']); +by+=appendToLDMLString(bz,{'2-digit':'ss','numeric':'s'}); +bz=ac('timeZoneName','string',['short','long']); +by+=appendToLDMLString(bz,{short:'z',long:'zzzz'}); +return by; +} +function appendToLDMLString(bz,bB){ +if(bz!==g){ +return bB[bz]; +}else{ +return''; +} +} +function fromLDMLString(by){ +by=by.replace(GetQuotedStringRE(),''); +var S={}; +var bC=by.match(/E{3,5}/g); +S=appendToDateTimeObject( +S,'weekday',bC,{EEEEE:'narrow',EEE:'short',EEEE:'long'}); +bC=by.match(/G{3,5}/g); +S=appendToDateTimeObject( +S,'era',bC,{GGGGG:'narrow',GGG:'short',GGGG:'long'}); +bC=by.match(/y{1,2}/g); +S=appendToDateTimeObject( +S,'year',bC,{y:'numeric',yy:'2-digit'}); +bC=by.match(/M{1,5}/g); +S=appendToDateTimeObject(S,'month',bC,{MM:'2-digit', +M:'numeric',MMMMM:'narrow',MMM:'short',MMMM:'long'}); +bC=by.match(/L{1,5}/g); +S=appendToDateTimeObject(S,'month',bC,{LL:'2-digit', +L:'numeric',LLLLL:'narrow',LLL:'short',LLLL:'long'}); +bC=by.match(/d{1,2}/g); +S=appendToDateTimeObject( +S,'day',bC,{d:'numeric',dd:'2-digit'}); +bC=by.match(/h{1,2}/g); +if(bC!==null){ +S['hour12']=true; +} +S=appendToDateTimeObject( +S,'hour',bC,{h:'numeric',hh:'2-digit'}); +bC=by.match(/H{1,2}/g); +if(bC!==null){ +S['hour12']=false; +} +S=appendToDateTimeObject( +S,'hour',bC,{H:'numeric',HH:'2-digit'}); +bC=by.match(/m{1,2}/g); +S=appendToDateTimeObject( +S,'minute',bC,{m:'numeric',mm:'2-digit'}); +bC=by.match(/s{1,2}/g); +S=appendToDateTimeObject( +S,'second',bC,{s:'numeric',ss:'2-digit'}); +bC=by.match(/z|zzzz/g); +S=appendToDateTimeObject( +S,'timeZoneName',bC,{z:'short',zzzz:'long'}); +return S; +} +function appendToDateTimeObject(S,bz,bC,bB){ +if((bC===null)){ +if(!S.hasOwnProperty(bz)){ +defineWEProperty(S,bz,g); +} +return S; +} +var ad=bC[0]; +defineWEProperty(S,bz,bB[ad]); +return S; +} +function toDateTimeOptions(S,bD,bE){ +if(S===g){ +S={}; +}else{ +S=((%_IsSpecObject(%IS_VAR(S)))?S:ToObject(S)); +} +var bF=true; +if((bD==='date'||bD==='any')&& +(S.weekday!==g||S.year!==g|| +S.month!==g||S.day!==g)){ +bF=false; +} +if((bD==='time'||bD==='any')&& +(S.hour!==g||S.minute!==g|| +S.second!==g)){ +bF=false; +} +if(bF&&(bE==='date'||bE==='all')){ +ObjectDefineProperty(S,'year',{value:'numeric', +writable:true, +enumerable:true, +configurable:true}); +ObjectDefineProperty(S,'month',{value:'numeric', +writable:true, +enumerable:true, +configurable:true}); +ObjectDefineProperty(S,'day',{value:'numeric', +writable:true, +enumerable:true, +configurable:true}); +} +if(bF&&(bE==='time'||bE==='all')){ +ObjectDefineProperty(S,'hour',{value:'numeric', +writable:true, +enumerable:true, +configurable:true}); +ObjectDefineProperty(S,'minute',{value:'numeric', +writable:true, +enumerable:true, +configurable:true}); +ObjectDefineProperty(S,'second',{value:'numeric', +writable:true, +enumerable:true, +configurable:true}); +} +return S; +} +function initializeDateTimeFormat(bG,R,S){ +if(%IsInitializedIntlObject(bG)){ +throw new $TypeError('Trying to re-initialize DateTimeFormat object.'); +} +if(S===g){ +S={}; +} +var Z=resolveLocale('dateformat',R,S); +S=toDateTimeOptions(S,'any','date'); +var ac=getGetOption(S,'dateformat'); +var T=ac('formatMatcher','string', +['basic','best fit'],'best fit'); +var by=toLDMLString(S); +var bH=canonicalizeTimeZoneID(S.timeZone); +var bd={}; +var am=parseExtension(Z.extension); +var ak=setOptions(S,am,C, +ac,bd); +var bg=Z.locale+ak; +var ai=ObjectDefineProperties({},{ +calendar:{writable:true}, +day:{writable:true}, +era:{writable:true}, +hour12:{writable:true}, +hour:{writable:true}, +locale:{writable:true}, +minute:{writable:true}, +month:{writable:true}, +numberingSystem:{writable:true}, +pattern:{writable:true}, +requestedLocale:{value:bg,writable:true}, +second:{writable:true}, +timeZone:{writable:true}, +timeZoneName:{writable:true}, +tz:{value:bH,writable:true}, +weekday:{writable:true}, +year:{writable:true} +}); +var bu=%CreateDateTimeFormat( +bg,{skeleton:by,timeZone:bH},ai); +if(bH!==g&&bH!==ai.timeZone){ +throw new $RangeError('Unsupported time zone specified '+bH); +} +%MarkAsInitializedIntlObjectOfType(bG,'dateformat',bu); +ObjectDefineProperty(bG,'resolved',{value:ai}); +return bG; +} +%AddNamedProperty(h,'DateTimeFormat',function(){ +var R=%_Arguments(0); +var S=%_Arguments(1); +if(!this||this===h){ +return new h.DateTimeFormat(R,S); +} +return initializeDateTimeFormat(ToObject(this),R,S); +}, +2 +); +%AddNamedProperty(h.DateTimeFormat.prototype,'resolvedOptions',function(){ +if(%_IsConstructCall()){ +throw new $TypeError(E); +} +if(!%IsInitializedIntlObjectOfType(this,'dateformat')){ +throw new $TypeError('resolvedOptions method called on a non-object or '+ +'on a object that is not Intl.DateTimeFormat.'); +} +var bv=this; +var bI=fromLDMLString(bv.resolved.pattern); +var bJ=z[bv.resolved.calendar]; +if(bJ===g){ +bJ=bv.resolved.calendar; +} +var Z=getOptimalLanguageTag(bv.resolved.requestedLocale, +bv.resolved.locale); +var bw={ +locale:Z, +numberingSystem:bv.resolved.numberingSystem, +calendar:bJ, +timeZone:bv.resolved.timeZone +}; +addWECPropertyIfDefined(bw,'timeZoneName',bI.timeZoneName); +addWECPropertyIfDefined(bw,'era',bI.era); +addWECPropertyIfDefined(bw,'year',bI.year); +addWECPropertyIfDefined(bw,'month',bI.month); +addWECPropertyIfDefined(bw,'day',bI.day); +addWECPropertyIfDefined(bw,'weekday',bI.weekday); +addWECPropertyIfDefined(bw,'hour12',bI.hour12); +addWECPropertyIfDefined(bw,'hour',bI.hour); +addWECPropertyIfDefined(bw,'minute',bI.minute); +addWECPropertyIfDefined(bw,'second',bI.second); +return bw; +}, +2 +); +%FunctionSetName(h.DateTimeFormat.prototype.resolvedOptions, +'resolvedOptions'); +%FunctionRemovePrototype(h.DateTimeFormat.prototype.resolvedOptions); +%SetNativeFlag(h.DateTimeFormat.prototype.resolvedOptions); +%AddNamedProperty(h.DateTimeFormat,'supportedLocalesOf',function(R){ +if(%_IsConstructCall()){ +throw new $TypeError(E); +} +return supportedLocalesOf('dateformat',R,%_Arguments(1)); +}, +2 +); +%FunctionSetName(h.DateTimeFormat.supportedLocalesOf,'supportedLocalesOf'); +%FunctionRemovePrototype(h.DateTimeFormat.supportedLocalesOf); +%SetNativeFlag(h.DateTimeFormat.supportedLocalesOf); +function formatDate(bu,bK){ +var bL; +if(bK===g){ +bL=b.now(); +}else{ +bL=c(bK); +} +if(!$isFinite(bL)){ +throw new $RangeError('Provided date is not in valid range.'); +} +return %InternalDateFormat(%GetImplFromInitializedIntlObject(bu), +new b(bL)); +} +function parseDate(bu,ah){ +return %InternalDateParse(%GetImplFromInitializedIntlObject(bu), +e(ah)); +} +addBoundMethod(h.DateTimeFormat,'format',formatDate,0); +addBoundMethod(h.DateTimeFormat,'v8Parse',parseDate,1); +function canonicalizeTimeZoneID(bM){ +if(bM===g){ +return bM; +} +var bN=bM.toUpperCase(); +if(bN==='UTC'||bN==='GMT'|| +bN==='ETC/UTC'||bN==='ETC/GMT'){ +return'UTC'; +} +var bC=GetTimezoneNameCheckRE().exec(bM); +if((bC===null)){ +throw new $RangeError('Expected Area/Location for time zone, got '+bM); +} +var bw=toTitleCaseWord(bC[1])+'/'+toTitleCaseWord(bC[2]); +var Y=3; +while(bC[Y]!==g&&Y0){ +if((%_DebugIsActive()!=0))%DebugPrepareStepInIfStepping(this); +try{ +return %_GeneratorNext(this,b); +}catch(e){ +%GeneratorClose(this); +throw e; +} +}else if(c==0){ +return{value:void 0,done:true}; +}else{ +throw MakeTypeError(6); +} +} +function GeneratorObjectThrow(d){ +if(!(%_ClassOf(this)==='Generator')){ +throw MakeTypeError(8, +'[Generator].prototype.throw',this); +} +var c=%GeneratorGetContinuation(this); +if(c>0){ +try{ +return %_GeneratorThrow(this,d); +}catch(e){ +%GeneratorClose(this); +throw e; +} +}else if(c==0){ +throw d; +}else{ +throw MakeTypeError(6); +} +} +function GeneratorObjectIterator(){ +return this; +} +function GeneratorFunctionConstructor(e){ +var f=NewFunctionString(arguments,'function*'); +var g=%GlobalProxy(global); +var h=%_CallFunction(g,%CompileString(f,true)); +%FunctionMarkNameShouldPrintAsAnonymous(h); +return h; +} +%NeverOptimizeFunction(GeneratorObjectNext); +%NeverOptimizeFunction(GeneratorObjectThrow); +var i=GeneratorFunctionPrototype.prototype; +InstallFunctions(i, +2, +["next",GeneratorObjectNext, +"throw",GeneratorObjectThrow]); +%FunctionSetName(GeneratorObjectIterator,'[Symbol.iterator]'); +%AddNamedProperty(i,symbolIterator, +GeneratorObjectIterator,2|4|1); +%AddNamedProperty(i,"constructor", +GeneratorFunctionPrototype,2|1); +%AddNamedProperty(i, +symbolToStringTag,"Generator",2|1); +%InternalSetPrototype(GeneratorFunctionPrototype,a.prototype); +%AddNamedProperty(GeneratorFunctionPrototype, +symbolToStringTag,"GeneratorFunction",2|1); +%AddNamedProperty(GeneratorFunctionPrototype,"constructor", +GeneratorFunction,2|1); +%InternalSetPrototype(GeneratorFunction,a); +%SetCode(GeneratorFunction,GeneratorFunctionConstructor); +})(); + +4harmony-arrayA2 +(function(){ +'use strict'; +%CheckIsBootstrapping(); +var a=global.Array; +var b=global.Symbol; +function ArrayFind(c){ +if((this==null)&&!(%_IsUndetectableObject(this)))throw MakeTypeError('called_on_null_or_undefined',["Array.prototype.find"]); +var d=ToObject(this); +var e=ToInteger(d.length); +if(!(%_ClassOf(c)==='Function')){ +throw MakeTypeError(2,c); +} +var f; +if(%_ArgumentsLength()>1){ +f=%_Arguments(1); +} +var g=false; +if((f==null)){ +f=%GetDefaultReceiver(c)||f; +}else{ +g=(!(%_IsSpecObject(f))&&%IsSloppyModeFunction(c)); +} +for(var h=0;h1){ +f=%_Arguments(1); +} +var g=false; +if((f==null)){ +f=%GetDefaultReceiver(c)||f; +}else{ +g=(!(%_IsSpecObject(f))&&%IsSloppyModeFunction(c)); +} +for(var h=0;h>>0); +var h=0; +var l=e; +if(%_ArgumentsLength()>1){ +h=%_Arguments(1); +h=(h===(void 0))?0:(%_IsSmi(%IS_VAR(h))?h:%NumberToInteger(ToNumber(h))); +if(%_ArgumentsLength()>2){ +l=%_Arguments(2); +l=(l===(void 0))?e:(%_IsSmi(%IS_VAR(l))?l:%NumberToInteger(ToNumber(l))); +} +} +if(h<0){ +h+=e; +if(h<0)h=0; +}else{ +if(h>e)h=e; +} +if(l<0){ +l+=e; +if(l<0)l=0; +}else{ +if(l>e)l=e; +} +if((l-h)>0&&ObjectIsFrozen(d)){ +throw MakeTypeError("array_functions_on_frozen", +["Array.prototype.fill"]); +} +for(;h=0){ +g=f; +}else{ +g=e+f; +if(g<0){ +g=0; +} +} +while(g1){ +c=%_Arguments(1); +} +var d=false; +if((c==null)){ +c=%GetDefaultReceiver(a)||c; +}else{ +d=(!(%_IsSpecObject(c))&&%IsSloppyModeFunction(a)); +} +var e=(%_DebugIsActive()!=0)&&%DebugCallbackSupportsStepping(a); +for(var f=0;f1){ +c=%_Arguments(1); +} +var d=false; +if((c==null)){ +c=%GetDefaultReceiver(a)||c; +}else{ +d=(!(%_IsSpecObject(c))&&%IsSloppyModeFunction(a)); +} +var e=(%_DebugIsActive()!=0)&&%DebugCallbackSupportsStepping(a); +for(var f=0;f1){ +c=%_Arguments(1); +} +var d=false; +if((c==null)){ +c=%GetDefaultReceiver(a)||c; +}else{ +d=(!(%_IsSpecObject(c))&&%IsSloppyModeFunction(a)); +} +var e=(%_DebugIsActive()!=0)&&%DebugCallbackSupportsStepping(a); +for(var f=0;f1){ +c=%_Arguments(1); +} +var d=false; +if((c==null)){ +c=%GetDefaultReceiver(a)||c; +}else{ +d=(!(%_IsSpecObject(c))&&%IsSloppyModeFunction(a)); +} +var e=(%_DebugIsActive()!=0)&&%DebugCallbackSupportsStepping(a); +for(var f=0;f1){ +c=%_Arguments(1); +} +var d=false; +if((c==null)){ +c=%GetDefaultReceiver(a)||c; +}else{ +d=(!(%_IsSpecObject(c))&&%IsSloppyModeFunction(a)); +} +var e=(%_DebugIsActive()!=0)&&%DebugCallbackSupportsStepping(a); +for(var f=0;f1){ +c=%_Arguments(1); +} +var d=false; +if((c==null)){ +c=%GetDefaultReceiver(a)||c; +}else{ +d=(!(%_IsSpecObject(c))&&%IsSloppyModeFunction(a)); +} +var e=(%_DebugIsActive()!=0)&&%DebugCallbackSupportsStepping(a); +for(var f=0;f1){ +c=%_Arguments(1); +} +var d=false; +if((c==null)){ +c=%GetDefaultReceiver(a)||c; +}else{ +d=(!(%_IsSpecObject(c))&&%IsSloppyModeFunction(a)); +} +var e=(%_DebugIsActive()!=0)&&%DebugCallbackSupportsStepping(a); +for(var f=0;f1){ +c=%_Arguments(1); +} +var d=false; +if((c==null)){ +c=%GetDefaultReceiver(a)||c; +}else{ +d=(!(%_IsSpecObject(c))&&%IsSloppyModeFunction(a)); +} +var e=(%_DebugIsActive()!=0)&&%DebugCallbackSupportsStepping(a); +for(var f=0;f1){ +c=%_Arguments(1); +} +var d=false; +if((c==null)){ +c=%GetDefaultReceiver(a)||c; +}else{ +d=(!(%_IsSpecObject(c))&&%IsSloppyModeFunction(a)); +} +var e=(%_DebugIsActive()!=0)&&%DebugCallbackSupportsStepping(a); +for(var f=0;f + +#include "include/base/cef_build.h" + +#if defined(OS_WIN) && defined(ARCH_CPU_64_BITS) +// windows.h #defines this (only on x64). This causes problems because the +// public API also uses MemoryBarrier at the public name for this fence. So, on +// X64, undef it, and call its documented +// (http://msdn.microsoft.com/en-us/library/windows/desktop/ms684208.aspx) +// implementation directly. +#undef MemoryBarrier +#endif + +namespace base { +namespace subtle { + +typedef int32_t Atomic32; +#ifdef ARCH_CPU_64_BITS +// We need to be able to go between Atomic64 and AtomicWord implicitly. This +// means Atomic64 and AtomicWord should be the same type on 64-bit. +#if defined(__ILP32__) || defined(OS_NACL) +// NaCl's intptr_t is not actually 64-bits on 64-bit! +// http://code.google.com/p/nativeclient/issues/detail?id=1162 +typedef int64_t Atomic64; +#else +typedef intptr_t Atomic64; +#endif +#endif + +// Use AtomicWord for a machine-sized pointer. It will use the Atomic32 or +// Atomic64 routines below, depending on your architecture. +typedef intptr_t AtomicWord; + +// Atomically execute: +// result = *ptr; +// if (*ptr == old_value) +// *ptr = new_value; +// return result; +// +// I.e., replace "*ptr" with "new_value" if "*ptr" used to be "old_value". +// Always return the old value of "*ptr" +// +// This routine implies no memory barriers. +Atomic32 NoBarrier_CompareAndSwap(volatile Atomic32* ptr, + Atomic32 old_value, + Atomic32 new_value); + +// Atomically store new_value into *ptr, returning the previous value held in +// *ptr. This routine implies no memory barriers. +Atomic32 NoBarrier_AtomicExchange(volatile Atomic32* ptr, Atomic32 new_value); + +// Atomically increment *ptr by "increment". Returns the new value of +// *ptr with the increment applied. This routine implies no memory barriers. +Atomic32 NoBarrier_AtomicIncrement(volatile Atomic32* ptr, Atomic32 increment); + +Atomic32 Barrier_AtomicIncrement(volatile Atomic32* ptr, + Atomic32 increment); + +// These following lower-level operations are typically useful only to people +// implementing higher-level synchronization operations like spinlocks, +// mutexes, and condition-variables. They combine CompareAndSwap(), a load, or +// a store with appropriate memory-ordering instructions. "Acquire" operations +// ensure that no later memory access can be reordered ahead of the operation. +// "Release" operations ensure that no previous memory access can be reordered +// after the operation. "Barrier" operations have both "Acquire" and "Release" +// semantics. A MemoryBarrier() has "Barrier" semantics, but does no memory +// access. +Atomic32 Acquire_CompareAndSwap(volatile Atomic32* ptr, + Atomic32 old_value, + Atomic32 new_value); +Atomic32 Release_CompareAndSwap(volatile Atomic32* ptr, + Atomic32 old_value, + Atomic32 new_value); + +void MemoryBarrier(); +void NoBarrier_Store(volatile Atomic32* ptr, Atomic32 value); +void Acquire_Store(volatile Atomic32* ptr, Atomic32 value); +void Release_Store(volatile Atomic32* ptr, Atomic32 value); + +Atomic32 NoBarrier_Load(volatile const Atomic32* ptr); +Atomic32 Acquire_Load(volatile const Atomic32* ptr); +Atomic32 Release_Load(volatile const Atomic32* ptr); + +// 64-bit atomic operations (only available on 64-bit processors). +#ifdef ARCH_CPU_64_BITS +Atomic64 NoBarrier_CompareAndSwap(volatile Atomic64* ptr, + Atomic64 old_value, + Atomic64 new_value); +Atomic64 NoBarrier_AtomicExchange(volatile Atomic64* ptr, Atomic64 new_value); +Atomic64 NoBarrier_AtomicIncrement(volatile Atomic64* ptr, Atomic64 increment); +Atomic64 Barrier_AtomicIncrement(volatile Atomic64* ptr, Atomic64 increment); + +Atomic64 Acquire_CompareAndSwap(volatile Atomic64* ptr, + Atomic64 old_value, + Atomic64 new_value); +Atomic64 Release_CompareAndSwap(volatile Atomic64* ptr, + Atomic64 old_value, + Atomic64 new_value); +void NoBarrier_Store(volatile Atomic64* ptr, Atomic64 value); +void Acquire_Store(volatile Atomic64* ptr, Atomic64 value); +void Release_Store(volatile Atomic64* ptr, Atomic64 value); +Atomic64 NoBarrier_Load(volatile const Atomic64* ptr); +Atomic64 Acquire_Load(volatile const Atomic64* ptr); +Atomic64 Release_Load(volatile const Atomic64* ptr); +#endif // ARCH_CPU_64_BITS + +} // namespace subtle +} // namespace base + +// Include our platform specific implementation. +#if defined(OS_WIN) && defined(COMPILER_MSVC) && defined(ARCH_CPU_X86_FAMILY) +#include "include/base/internal/cef_atomicops_x86_msvc.h" +#elif defined(OS_MACOSX) +#include "include/base/internal/cef_atomicops_mac.h" +#elif defined(COMPILER_GCC) && defined(ARCH_CPU_X86_FAMILY) +#include "include/base/internal/cef_atomicops_x86_gcc.h" +#else +#error "Atomic operations are not supported on your platform" +#endif + +// On some platforms we need additional declarations to make +// AtomicWord compatible with our other Atomic* types. +#if defined(OS_MACOSX) || defined(OS_OPENBSD) +#include "include/base/internal/cef_atomicops_atomicword_compat.h" +#endif + +#endif // !BUILDING_CEF_SHARED + +#endif // CEF_INCLUDE_BASE_CEF_ATOMICOPS_H_ diff --git a/dependencies64/cef/include/base/cef_basictypes.h b/dependencies64/cef/include/base/cef_basictypes.h new file mode 100644 index 000000000..80a684d8d --- /dev/null +++ b/dependencies64/cef/include/base/cef_basictypes.h @@ -0,0 +1,86 @@ +// Copyright (c) 2014 Marshall A. Greenblatt. Portions copyright (c) 2012 +// Google Inc. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#ifndef CEF_INCLUDE_BASE_CEF_BASICTYPES_H_ +#define CEF_INCLUDE_BASE_CEF_BASICTYPES_H_ +#pragma once + +#if defined(BUILDING_CEF_SHARED) +// When building CEF include the Chromium header directly. +#include "base/basictypes.h" +#else // !BUILDING_CEF_SHARED +// The following is substantially similar to the Chromium implementation. +// If the Chromium implementation diverges the below implementation should be +// updated to match. + +#include // For UINT_MAX +#include // For size_t + +#include "include/base/cef_build.h" + +// The NSPR system headers define 64-bit as |long| when possible, except on +// Mac OS X. In order to not have typedef mismatches, we do the same on LP64. +// +// On Mac OS X, |long long| is used for 64-bit types for compatibility with +// format macros even in the LP64 model. +#if defined(__LP64__) && !defined(OS_MACOSX) && !defined(OS_OPENBSD) +typedef long int64; // NOLINT(runtime/int) +typedef unsigned long uint64; // NOLINT(runtime/int) +#else +typedef long long int64; // NOLINT(runtime/int) +typedef unsigned long long uint64; // NOLINT(runtime/int) +#endif + +// TODO: Remove these type guards. These are to avoid conflicts with +// obsolete/protypes.h in the Gecko SDK. +#ifndef _INT32 +#define _INT32 +typedef int int32; +#endif + +// TODO: Remove these type guards. These are to avoid conflicts with +// obsolete/protypes.h in the Gecko SDK. +#ifndef _UINT32 +#define _UINT32 +typedef unsigned int uint32; +#endif + +// UTF-16 character type +#ifndef char16 +#if defined(WIN32) +typedef wchar_t char16; +#else +typedef unsigned short char16; +#endif +#endif + +#endif // !BUILDING_CEF_SHARED + +#endif // CEF_INCLUDE_BASE_CEF_BASICTYPES_H_ diff --git a/dependencies64/cef/include/base/cef_bind.h b/dependencies64/cef/include/base/cef_bind.h new file mode 100644 index 000000000..dcf86ac7e --- /dev/null +++ b/dependencies64/cef/include/base/cef_bind.h @@ -0,0 +1,548 @@ +// Copyright (c) 2014 Marshall A. Greenblatt. Portions copyright (c) 2011 +// Google Inc. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#ifndef CEF_INCLUDE_BASE_CEF_BIND_H_ +#define CEF_INCLUDE_BASE_CEF_BIND_H_ +#pragma once + +#if defined(BASE_BIND_H_) +// Do nothing if the Chromium header has already been included. +// This can happen in cases where Chromium code is used directly by the +// client application. When using Chromium code directly always include +// the Chromium header first to avoid type conflicts. +#elif defined(BUILDING_CEF_SHARED) +// When building CEF include the Chromium header directly. +#include "base/bind.h" +#else // !BUILDING_CEF_SHARED +// The following is substantially similar to the Chromium implementation. +// If the Chromium implementation diverges the below implementation should be +// updated to match. + +#include "include/base/internal/cef_bind_internal.h" +#include "include/base/internal/cef_callback_internal.h" + +// ----------------------------------------------------------------------------- +// Usage documentation +// ----------------------------------------------------------------------------- +// +// See base/cef_callback.h for documentation. +// +// +// ----------------------------------------------------------------------------- +// Implementation notes +// ----------------------------------------------------------------------------- +// +// If you're reading the implementation, before proceeding further, you should +// read the top comment of base/bind_internal.h for a definition of common +// terms and concepts. +// +// RETURN TYPES +// +// Though Bind()'s result is meant to be stored in a Callback<> type, it +// cannot actually return the exact type without requiring a large amount +// of extra template specializations. The problem is that in order to +// discern the correct specialization of Callback<>, Bind would need to +// unwrap the function signature to determine the signature's arity, and +// whether or not it is a method. +// +// Each unique combination of (arity, function_type, num_prebound) where +// function_type is one of {function, method, const_method} would require +// one specialization. We eventually have to do a similar number of +// specializations anyways in the implementation (see the Invoker<>, +// classes). However, it is avoidable in Bind if we return the result +// via an indirection like we do below. +// +// TODO(ajwong): We might be able to avoid this now, but need to test. +// +// It is possible to move most of the COMPILE_ASSERT asserts into BindState<>, +// but it feels a little nicer to have the asserts here so people do not +// need to crack open bind_internal.h. On the other hand, it makes Bind() +// harder to read. + +namespace base { + +template +base::Callback< + typename cef_internal::BindState< + typename cef_internal::FunctorTraits::RunnableType, + typename cef_internal::FunctorTraits::RunType, + void()> + ::UnboundRunType> +Bind(Functor functor) { + // Typedefs for how to store and run the functor. + typedef typename cef_internal::FunctorTraits::RunnableType RunnableType; + typedef typename cef_internal::FunctorTraits::RunType RunType; + + typedef cef_internal::BindState BindState; + + + return Callback( + new BindState(cef_internal::MakeRunnable(functor))); +} + +template +base::Callback< + typename cef_internal::BindState< + typename cef_internal::FunctorTraits::RunnableType, + typename cef_internal::FunctorTraits::RunType, + void(typename cef_internal::CallbackParamTraits::StorageType)> + ::UnboundRunType> +Bind(Functor functor, const P1& p1) { + // Typedefs for how to store and run the functor. + typedef typename cef_internal::FunctorTraits::RunnableType RunnableType; + typedef typename cef_internal::FunctorTraits::RunType RunType; + + // Use RunnableType::RunType instead of RunType above because our + // checks should below for bound references need to know what the actual + // functor is going to interpret the argument as. + typedef cef_internal::FunctionTraits + BoundFunctorTraits; + + // Do not allow binding a non-const reference parameter. Non-const reference + // parameters are disallowed by the Google style guide. Also, binding a + // non-const reference parameter can make for subtle bugs because the + // invoked function will receive a reference to the stored copy of the + // argument and not the original. + COMPILE_ASSERT( + !(is_non_const_reference::value ), + do_not_bind_functions_with_nonconst_ref); + + // For methods, we need to be careful for parameter 1. We do not require + // a scoped_refptr because BindState<> itself takes care of AddRef() for + // methods. We also disallow binding of an array as the method's target + // object. + COMPILE_ASSERT( + cef_internal::HasIsMethodTag::value || + !cef_internal::NeedsScopedRefptrButGetsRawPtr::value, + p1_is_refcounted_type_and_needs_scoped_refptr); + COMPILE_ASSERT(!cef_internal::HasIsMethodTag::value || + !is_array::value, + first_bound_argument_to_method_cannot_be_array); + typedef cef_internal::BindState::StorageType)> BindState; + + + return Callback( + new BindState(cef_internal::MakeRunnable(functor), p1)); +} + +template +base::Callback< + typename cef_internal::BindState< + typename cef_internal::FunctorTraits::RunnableType, + typename cef_internal::FunctorTraits::RunType, + void(typename cef_internal::CallbackParamTraits::StorageType, + typename cef_internal::CallbackParamTraits::StorageType)> + ::UnboundRunType> +Bind(Functor functor, const P1& p1, const P2& p2) { + // Typedefs for how to store and run the functor. + typedef typename cef_internal::FunctorTraits::RunnableType RunnableType; + typedef typename cef_internal::FunctorTraits::RunType RunType; + + // Use RunnableType::RunType instead of RunType above because our + // checks should below for bound references need to know what the actual + // functor is going to interpret the argument as. + typedef cef_internal::FunctionTraits + BoundFunctorTraits; + + // Do not allow binding a non-const reference parameter. Non-const reference + // parameters are disallowed by the Google style guide. Also, binding a + // non-const reference parameter can make for subtle bugs because the + // invoked function will receive a reference to the stored copy of the + // argument and not the original. + COMPILE_ASSERT( + !(is_non_const_reference::value || + is_non_const_reference::value ), + do_not_bind_functions_with_nonconst_ref); + + // For methods, we need to be careful for parameter 1. We do not require + // a scoped_refptr because BindState<> itself takes care of AddRef() for + // methods. We also disallow binding of an array as the method's target + // object. + COMPILE_ASSERT( + cef_internal::HasIsMethodTag::value || + !cef_internal::NeedsScopedRefptrButGetsRawPtr::value, + p1_is_refcounted_type_and_needs_scoped_refptr); + COMPILE_ASSERT(!cef_internal::HasIsMethodTag::value || + !is_array::value, + first_bound_argument_to_method_cannot_be_array); + COMPILE_ASSERT(!cef_internal::NeedsScopedRefptrButGetsRawPtr::value, + p2_is_refcounted_type_and_needs_scoped_refptr); + typedef cef_internal::BindState::StorageType, + typename cef_internal::CallbackParamTraits::StorageType)> BindState; + + + return Callback( + new BindState(cef_internal::MakeRunnable(functor), p1, p2)); +} + +template +base::Callback< + typename cef_internal::BindState< + typename cef_internal::FunctorTraits::RunnableType, + typename cef_internal::FunctorTraits::RunType, + void(typename cef_internal::CallbackParamTraits::StorageType, + typename cef_internal::CallbackParamTraits::StorageType, + typename cef_internal::CallbackParamTraits::StorageType)> + ::UnboundRunType> +Bind(Functor functor, const P1& p1, const P2& p2, const P3& p3) { + // Typedefs for how to store and run the functor. + typedef typename cef_internal::FunctorTraits::RunnableType RunnableType; + typedef typename cef_internal::FunctorTraits::RunType RunType; + + // Use RunnableType::RunType instead of RunType above because our + // checks should below for bound references need to know what the actual + // functor is going to interpret the argument as. + typedef cef_internal::FunctionTraits + BoundFunctorTraits; + + // Do not allow binding a non-const reference parameter. Non-const reference + // parameters are disallowed by the Google style guide. Also, binding a + // non-const reference parameter can make for subtle bugs because the + // invoked function will receive a reference to the stored copy of the + // argument and not the original. + COMPILE_ASSERT( + !(is_non_const_reference::value || + is_non_const_reference::value || + is_non_const_reference::value ), + do_not_bind_functions_with_nonconst_ref); + + // For methods, we need to be careful for parameter 1. We do not require + // a scoped_refptr because BindState<> itself takes care of AddRef() for + // methods. We also disallow binding of an array as the method's target + // object. + COMPILE_ASSERT( + cef_internal::HasIsMethodTag::value || + !cef_internal::NeedsScopedRefptrButGetsRawPtr::value, + p1_is_refcounted_type_and_needs_scoped_refptr); + COMPILE_ASSERT(!cef_internal::HasIsMethodTag::value || + !is_array::value, + first_bound_argument_to_method_cannot_be_array); + COMPILE_ASSERT(!cef_internal::NeedsScopedRefptrButGetsRawPtr::value, + p2_is_refcounted_type_and_needs_scoped_refptr); + COMPILE_ASSERT(!cef_internal::NeedsScopedRefptrButGetsRawPtr::value, + p3_is_refcounted_type_and_needs_scoped_refptr); + typedef cef_internal::BindState::StorageType, + typename cef_internal::CallbackParamTraits::StorageType, + typename cef_internal::CallbackParamTraits::StorageType)> BindState; + + + return Callback( + new BindState(cef_internal::MakeRunnable(functor), p1, p2, p3)); +} + +template +base::Callback< + typename cef_internal::BindState< + typename cef_internal::FunctorTraits::RunnableType, + typename cef_internal::FunctorTraits::RunType, + void(typename cef_internal::CallbackParamTraits::StorageType, + typename cef_internal::CallbackParamTraits::StorageType, + typename cef_internal::CallbackParamTraits::StorageType, + typename cef_internal::CallbackParamTraits::StorageType)> + ::UnboundRunType> +Bind(Functor functor, const P1& p1, const P2& p2, const P3& p3, const P4& p4) { + // Typedefs for how to store and run the functor. + typedef typename cef_internal::FunctorTraits::RunnableType RunnableType; + typedef typename cef_internal::FunctorTraits::RunType RunType; + + // Use RunnableType::RunType instead of RunType above because our + // checks should below for bound references need to know what the actual + // functor is going to interpret the argument as. + typedef cef_internal::FunctionTraits + BoundFunctorTraits; + + // Do not allow binding a non-const reference parameter. Non-const reference + // parameters are disallowed by the Google style guide. Also, binding a + // non-const reference parameter can make for subtle bugs because the + // invoked function will receive a reference to the stored copy of the + // argument and not the original. + COMPILE_ASSERT( + !(is_non_const_reference::value || + is_non_const_reference::value || + is_non_const_reference::value || + is_non_const_reference::value ), + do_not_bind_functions_with_nonconst_ref); + + // For methods, we need to be careful for parameter 1. We do not require + // a scoped_refptr because BindState<> itself takes care of AddRef() for + // methods. We also disallow binding of an array as the method's target + // object. + COMPILE_ASSERT( + cef_internal::HasIsMethodTag::value || + !cef_internal::NeedsScopedRefptrButGetsRawPtr::value, + p1_is_refcounted_type_and_needs_scoped_refptr); + COMPILE_ASSERT(!cef_internal::HasIsMethodTag::value || + !is_array::value, + first_bound_argument_to_method_cannot_be_array); + COMPILE_ASSERT(!cef_internal::NeedsScopedRefptrButGetsRawPtr::value, + p2_is_refcounted_type_and_needs_scoped_refptr); + COMPILE_ASSERT(!cef_internal::NeedsScopedRefptrButGetsRawPtr::value, + p3_is_refcounted_type_and_needs_scoped_refptr); + COMPILE_ASSERT(!cef_internal::NeedsScopedRefptrButGetsRawPtr::value, + p4_is_refcounted_type_and_needs_scoped_refptr); + typedef cef_internal::BindState::StorageType, + typename cef_internal::CallbackParamTraits::StorageType, + typename cef_internal::CallbackParamTraits::StorageType, + typename cef_internal::CallbackParamTraits::StorageType)> BindState; + + + return Callback( + new BindState(cef_internal::MakeRunnable(functor), p1, p2, p3, p4)); +} + +template +base::Callback< + typename cef_internal::BindState< + typename cef_internal::FunctorTraits::RunnableType, + typename cef_internal::FunctorTraits::RunType, + void(typename cef_internal::CallbackParamTraits::StorageType, + typename cef_internal::CallbackParamTraits::StorageType, + typename cef_internal::CallbackParamTraits::StorageType, + typename cef_internal::CallbackParamTraits::StorageType, + typename cef_internal::CallbackParamTraits::StorageType)> + ::UnboundRunType> +Bind(Functor functor, const P1& p1, const P2& p2, const P3& p3, const P4& p4, + const P5& p5) { + // Typedefs for how to store and run the functor. + typedef typename cef_internal::FunctorTraits::RunnableType RunnableType; + typedef typename cef_internal::FunctorTraits::RunType RunType; + + // Use RunnableType::RunType instead of RunType above because our + // checks should below for bound references need to know what the actual + // functor is going to interpret the argument as. + typedef cef_internal::FunctionTraits + BoundFunctorTraits; + + // Do not allow binding a non-const reference parameter. Non-const reference + // parameters are disallowed by the Google style guide. Also, binding a + // non-const reference parameter can make for subtle bugs because the + // invoked function will receive a reference to the stored copy of the + // argument and not the original. + COMPILE_ASSERT( + !(is_non_const_reference::value || + is_non_const_reference::value || + is_non_const_reference::value || + is_non_const_reference::value || + is_non_const_reference::value ), + do_not_bind_functions_with_nonconst_ref); + + // For methods, we need to be careful for parameter 1. We do not require + // a scoped_refptr because BindState<> itself takes care of AddRef() for + // methods. We also disallow binding of an array as the method's target + // object. + COMPILE_ASSERT( + cef_internal::HasIsMethodTag::value || + !cef_internal::NeedsScopedRefptrButGetsRawPtr::value, + p1_is_refcounted_type_and_needs_scoped_refptr); + COMPILE_ASSERT(!cef_internal::HasIsMethodTag::value || + !is_array::value, + first_bound_argument_to_method_cannot_be_array); + COMPILE_ASSERT(!cef_internal::NeedsScopedRefptrButGetsRawPtr::value, + p2_is_refcounted_type_and_needs_scoped_refptr); + COMPILE_ASSERT(!cef_internal::NeedsScopedRefptrButGetsRawPtr::value, + p3_is_refcounted_type_and_needs_scoped_refptr); + COMPILE_ASSERT(!cef_internal::NeedsScopedRefptrButGetsRawPtr::value, + p4_is_refcounted_type_and_needs_scoped_refptr); + COMPILE_ASSERT(!cef_internal::NeedsScopedRefptrButGetsRawPtr::value, + p5_is_refcounted_type_and_needs_scoped_refptr); + typedef cef_internal::BindState::StorageType, + typename cef_internal::CallbackParamTraits::StorageType, + typename cef_internal::CallbackParamTraits::StorageType, + typename cef_internal::CallbackParamTraits::StorageType, + typename cef_internal::CallbackParamTraits::StorageType)> BindState; + + + return Callback( + new BindState(cef_internal::MakeRunnable(functor), p1, p2, p3, p4, p5)); +} + +template +base::Callback< + typename cef_internal::BindState< + typename cef_internal::FunctorTraits::RunnableType, + typename cef_internal::FunctorTraits::RunType, + void(typename cef_internal::CallbackParamTraits::StorageType, + typename cef_internal::CallbackParamTraits::StorageType, + typename cef_internal::CallbackParamTraits::StorageType, + typename cef_internal::CallbackParamTraits::StorageType, + typename cef_internal::CallbackParamTraits::StorageType, + typename cef_internal::CallbackParamTraits::StorageType)> + ::UnboundRunType> +Bind(Functor functor, const P1& p1, const P2& p2, const P3& p3, const P4& p4, + const P5& p5, const P6& p6) { + // Typedefs for how to store and run the functor. + typedef typename cef_internal::FunctorTraits::RunnableType RunnableType; + typedef typename cef_internal::FunctorTraits::RunType RunType; + + // Use RunnableType::RunType instead of RunType above because our + // checks should below for bound references need to know what the actual + // functor is going to interpret the argument as. + typedef cef_internal::FunctionTraits + BoundFunctorTraits; + + // Do not allow binding a non-const reference parameter. Non-const reference + // parameters are disallowed by the Google style guide. Also, binding a + // non-const reference parameter can make for subtle bugs because the + // invoked function will receive a reference to the stored copy of the + // argument and not the original. + COMPILE_ASSERT( + !(is_non_const_reference::value || + is_non_const_reference::value || + is_non_const_reference::value || + is_non_const_reference::value || + is_non_const_reference::value || + is_non_const_reference::value ), + do_not_bind_functions_with_nonconst_ref); + + // For methods, we need to be careful for parameter 1. We do not require + // a scoped_refptr because BindState<> itself takes care of AddRef() for + // methods. We also disallow binding of an array as the method's target + // object. + COMPILE_ASSERT( + cef_internal::HasIsMethodTag::value || + !cef_internal::NeedsScopedRefptrButGetsRawPtr::value, + p1_is_refcounted_type_and_needs_scoped_refptr); + COMPILE_ASSERT(!cef_internal::HasIsMethodTag::value || + !is_array::value, + first_bound_argument_to_method_cannot_be_array); + COMPILE_ASSERT(!cef_internal::NeedsScopedRefptrButGetsRawPtr::value, + p2_is_refcounted_type_and_needs_scoped_refptr); + COMPILE_ASSERT(!cef_internal::NeedsScopedRefptrButGetsRawPtr::value, + p3_is_refcounted_type_and_needs_scoped_refptr); + COMPILE_ASSERT(!cef_internal::NeedsScopedRefptrButGetsRawPtr::value, + p4_is_refcounted_type_and_needs_scoped_refptr); + COMPILE_ASSERT(!cef_internal::NeedsScopedRefptrButGetsRawPtr::value, + p5_is_refcounted_type_and_needs_scoped_refptr); + COMPILE_ASSERT(!cef_internal::NeedsScopedRefptrButGetsRawPtr::value, + p6_is_refcounted_type_and_needs_scoped_refptr); + typedef cef_internal::BindState::StorageType, + typename cef_internal::CallbackParamTraits::StorageType, + typename cef_internal::CallbackParamTraits::StorageType, + typename cef_internal::CallbackParamTraits::StorageType, + typename cef_internal::CallbackParamTraits::StorageType, + typename cef_internal::CallbackParamTraits::StorageType)> BindState; + + + return Callback( + new BindState(cef_internal::MakeRunnable(functor), p1, p2, p3, p4, p5, p6)); +} + +template +base::Callback< + typename cef_internal::BindState< + typename cef_internal::FunctorTraits::RunnableType, + typename cef_internal::FunctorTraits::RunType, + void(typename cef_internal::CallbackParamTraits::StorageType, + typename cef_internal::CallbackParamTraits::StorageType, + typename cef_internal::CallbackParamTraits::StorageType, + typename cef_internal::CallbackParamTraits::StorageType, + typename cef_internal::CallbackParamTraits::StorageType, + typename cef_internal::CallbackParamTraits::StorageType, + typename cef_internal::CallbackParamTraits::StorageType)> + ::UnboundRunType> +Bind(Functor functor, const P1& p1, const P2& p2, const P3& p3, const P4& p4, + const P5& p5, const P6& p6, const P7& p7) { + // Typedefs for how to store and run the functor. + typedef typename cef_internal::FunctorTraits::RunnableType RunnableType; + typedef typename cef_internal::FunctorTraits::RunType RunType; + + // Use RunnableType::RunType instead of RunType above because our + // checks should below for bound references need to know what the actual + // functor is going to interpret the argument as. + typedef cef_internal::FunctionTraits + BoundFunctorTraits; + + // Do not allow binding a non-const reference parameter. Non-const reference + // parameters are disallowed by the Google style guide. Also, binding a + // non-const reference parameter can make for subtle bugs because the + // invoked function will receive a reference to the stored copy of the + // argument and not the original. + COMPILE_ASSERT( + !(is_non_const_reference::value || + is_non_const_reference::value || + is_non_const_reference::value || + is_non_const_reference::value || + is_non_const_reference::value || + is_non_const_reference::value || + is_non_const_reference::value ), + do_not_bind_functions_with_nonconst_ref); + + // For methods, we need to be careful for parameter 1. We do not require + // a scoped_refptr because BindState<> itself takes care of AddRef() for + // methods. We also disallow binding of an array as the method's target + // object. + COMPILE_ASSERT( + cef_internal::HasIsMethodTag::value || + !cef_internal::NeedsScopedRefptrButGetsRawPtr::value, + p1_is_refcounted_type_and_needs_scoped_refptr); + COMPILE_ASSERT(!cef_internal::HasIsMethodTag::value || + !is_array::value, + first_bound_argument_to_method_cannot_be_array); + COMPILE_ASSERT(!cef_internal::NeedsScopedRefptrButGetsRawPtr::value, + p2_is_refcounted_type_and_needs_scoped_refptr); + COMPILE_ASSERT(!cef_internal::NeedsScopedRefptrButGetsRawPtr::value, + p3_is_refcounted_type_and_needs_scoped_refptr); + COMPILE_ASSERT(!cef_internal::NeedsScopedRefptrButGetsRawPtr::value, + p4_is_refcounted_type_and_needs_scoped_refptr); + COMPILE_ASSERT(!cef_internal::NeedsScopedRefptrButGetsRawPtr::value, + p5_is_refcounted_type_and_needs_scoped_refptr); + COMPILE_ASSERT(!cef_internal::NeedsScopedRefptrButGetsRawPtr::value, + p6_is_refcounted_type_and_needs_scoped_refptr); + COMPILE_ASSERT(!cef_internal::NeedsScopedRefptrButGetsRawPtr::value, + p7_is_refcounted_type_and_needs_scoped_refptr); + typedef cef_internal::BindState::StorageType, + typename cef_internal::CallbackParamTraits::StorageType, + typename cef_internal::CallbackParamTraits::StorageType, + typename cef_internal::CallbackParamTraits::StorageType, + typename cef_internal::CallbackParamTraits::StorageType, + typename cef_internal::CallbackParamTraits::StorageType, + typename cef_internal::CallbackParamTraits::StorageType)> BindState; + + + return Callback( + new BindState(cef_internal::MakeRunnable(functor), p1, p2, p3, p4, p5, p6, + p7)); +} + +} // namespace base + +#endif // !BUILDING_CEF_SHARED + +#endif // CEF_INCLUDE_BASE_CEF_BIND_H_ diff --git a/dependencies64/cef/include/base/cef_bind_helpers.h b/dependencies64/cef/include/base/cef_bind_helpers.h new file mode 100644 index 000000000..e8c4cffd8 --- /dev/null +++ b/dependencies64/cef/include/base/cef_bind_helpers.h @@ -0,0 +1,586 @@ +// Copyright (c) 2014 Marshall A. Greenblatt. Portions copyright (c) 2011 +// Google Inc. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +// This defines a set of argument wrappers and related factory methods that +// can be used specify the refcounting and reference semantics of arguments +// that are bound by the Bind() function in base/bind.h. +// +// It also defines a set of simple functions and utilities that people want +// when using Callback<> and Bind(). +// +// +// ARGUMENT BINDING WRAPPERS +// +// The wrapper functions are base::Unretained(), base::Owned(), base::Passed(), +// base::ConstRef(), and base::IgnoreResult(). +// +// Unretained() allows Bind() to bind a non-refcounted class, and to disable +// refcounting on arguments that are refcounted objects. +// +// Owned() transfers ownership of an object to the Callback resulting from +// bind; the object will be deleted when the Callback is deleted. +// +// Passed() is for transferring movable-but-not-copyable types (eg. scoped_ptr) +// through a Callback. Logically, this signifies a destructive transfer of +// the state of the argument into the target function. Invoking +// Callback::Run() twice on a Callback that was created with a Passed() +// argument will CHECK() because the first invocation would have already +// transferred ownership to the target function. +// +// ConstRef() allows binding a constant reference to an argument rather +// than a copy. +// +// IgnoreResult() is used to adapt a function or Callback with a return type to +// one with a void return. This is most useful if you have a function with, +// say, a pesky ignorable bool return that you want to use with PostTask or +// something else that expect a Callback with a void return. +// +// EXAMPLE OF Unretained(): +// +// class Foo { +// public: +// void func() { cout << "Foo:f" << endl; } +// }; +// +// // In some function somewhere. +// Foo foo; +// Closure foo_callback = +// Bind(&Foo::func, Unretained(&foo)); +// foo_callback.Run(); // Prints "Foo:f". +// +// Without the Unretained() wrapper on |&foo|, the above call would fail +// to compile because Foo does not support the AddRef() and Release() methods. +// +// +// EXAMPLE OF Owned(): +// +// void foo(int* arg) { cout << *arg << endl } +// +// int* pn = new int(1); +// Closure foo_callback = Bind(&foo, Owned(pn)); +// +// foo_callback.Run(); // Prints "1" +// foo_callback.Run(); // Prints "1" +// *n = 2; +// foo_callback.Run(); // Prints "2" +// +// foo_callback.Reset(); // |pn| is deleted. Also will happen when +// // |foo_callback| goes out of scope. +// +// Without Owned(), someone would have to know to delete |pn| when the last +// reference to the Callback is deleted. +// +// +// EXAMPLE OF ConstRef(): +// +// void foo(int arg) { cout << arg << endl } +// +// int n = 1; +// Closure no_ref = Bind(&foo, n); +// Closure has_ref = Bind(&foo, ConstRef(n)); +// +// no_ref.Run(); // Prints "1" +// has_ref.Run(); // Prints "1" +// +// n = 2; +// no_ref.Run(); // Prints "1" +// has_ref.Run(); // Prints "2" +// +// Note that because ConstRef() takes a reference on |n|, |n| must outlive all +// its bound callbacks. +// +// +// EXAMPLE OF IgnoreResult(): +// +// int DoSomething(int arg) { cout << arg << endl; } +// +// // Assign to a Callback with a void return type. +// Callback cb = Bind(IgnoreResult(&DoSomething)); +// cb->Run(1); // Prints "1". +// +// // Prints "1" on |ml|. +// ml->PostTask(FROM_HERE, Bind(IgnoreResult(&DoSomething), 1); +// +// +// EXAMPLE OF Passed(): +// +// void TakesOwnership(scoped_ptr arg) { } +// scoped_ptr CreateFoo() { return scoped_ptr(new Foo()); } +// +// scoped_ptr f(new Foo()); +// +// // |cb| is given ownership of Foo(). |f| is now NULL. +// // You can use f.Pass() in place of &f, but it's more verbose. +// Closure cb = Bind(&TakesOwnership, Passed(&f)); +// +// // Run was never called so |cb| still owns Foo() and deletes +// // it on Reset(). +// cb.Reset(); +// +// // |cb| is given a new Foo created by CreateFoo(). +// cb = Bind(&TakesOwnership, Passed(CreateFoo())); +// +// // |arg| in TakesOwnership() is given ownership of Foo(). |cb| +// // no longer owns Foo() and, if reset, would not delete Foo(). +// cb.Run(); // Foo() is now transferred to |arg| and deleted. +// cb.Run(); // This CHECK()s since Foo() already been used once. +// +// Passed() is particularly useful with PostTask() when you are transferring +// ownership of an argument into a task, but don't necessarily know if the +// task will always be executed. This can happen if the task is cancellable +// or if it is posted to a MessageLoopProxy. +// +// +// SIMPLE FUNCTIONS AND UTILITIES. +// +// DoNothing() - Useful for creating a Closure that does nothing when called. +// DeletePointer() - Useful for creating a Closure that will delete a +// pointer when invoked. Only use this when necessary. +// In most cases MessageLoop::DeleteSoon() is a better +// fit. + +#ifndef CEF_INCLUDE_BASE_CEF_BIND_HELPERS_H_ +#define CEF_INCLUDE_BASE_CEF_BIND_HELPERS_H_ +#pragma once + +#if defined(BASE_BIND_HELPERS_H_) +// Do nothing if the Chromium header has already been included. +// This can happen in cases where Chromium code is used directly by the +// client application. When using Chromium code directly always include +// the Chromium header first to avoid type conflicts. +#elif defined(BUILDING_CEF_SHARED) +// When building CEF include the Chromium header directly. +#include "base/bind_helpers.h" +#else // !BUILDING_CEF_SHARED +// The following is substantially similar to the Chromium implementation. +// If the Chromium implementation diverges the below implementation should be +// updated to match. + +#include "include/base/cef_basictypes.h" +#include "include/base/cef_callback.h" +#include "include/base/cef_template_util.h" +#include "include/base/cef_weak_ptr.h" + +namespace base { +namespace cef_internal { + +// Use the Substitution Failure Is Not An Error (SFINAE) trick to inspect T +// for the existence of AddRef() and Release() functions of the correct +// signature. +// +// http://en.wikipedia.org/wiki/Substitution_failure_is_not_an_error +// http://stackoverflow.com/questions/257288/is-it-possible-to-write-a-c-template-to-check-for-a-functions-existence +// http://stackoverflow.com/questions/4358584/sfinae-approach-comparison +// http://stackoverflow.com/questions/1966362/sfinae-to-check-for-inherited-member-functions +// +// The last link in particular show the method used below. +// +// For SFINAE to work with inherited methods, we need to pull some extra tricks +// with multiple inheritance. In the more standard formulation, the overloads +// of Check would be: +// +// template +// Yes NotTheCheckWeWant(Helper<&C::TargetFunc>*); +// +// template +// No NotTheCheckWeWant(...); +// +// static const bool value = sizeof(NotTheCheckWeWant(0)) == sizeof(Yes); +// +// The problem here is that template resolution will not match +// C::TargetFunc if TargetFunc does not exist directly in C. That is, if +// TargetFunc in inherited from an ancestor, &C::TargetFunc will not match, +// |value| will be false. This formulation only checks for whether or +// not TargetFunc exist directly in the class being introspected. +// +// To get around this, we play a dirty trick with multiple inheritance. +// First, We create a class BaseMixin that declares each function that we +// want to probe for. Then we create a class Base that inherits from both T +// (the class we wish to probe) and BaseMixin. Note that the function +// signature in BaseMixin does not need to match the signature of the function +// we are probing for; thus it's easiest to just use void(void). +// +// Now, if TargetFunc exists somewhere in T, then &Base::TargetFunc has an +// ambiguous resolution between BaseMixin and T. This lets us write the +// following: +// +// template +// No GoodCheck(Helper<&C::TargetFunc>*); +// +// template +// Yes GoodCheck(...); +// +// static const bool value = sizeof(GoodCheck(0)) == sizeof(Yes); +// +// Notice here that the variadic version of GoodCheck() returns Yes here +// instead of No like the previous one. Also notice that we calculate |value| +// by specializing GoodCheck() on Base instead of T. +// +// We've reversed the roles of the variadic, and Helper overloads. +// GoodCheck(Helper<&C::TargetFunc>*), when C = Base, fails to be a valid +// substitution if T::TargetFunc exists. Thus GoodCheck(0) will resolve +// to the variadic version if T has TargetFunc. If T::TargetFunc does not +// exist, then &C::TargetFunc is not ambiguous, and the overload resolution +// will prefer GoodCheck(Helper<&C::TargetFunc>*). +// +// This method of SFINAE will correctly probe for inherited names, but it cannot +// typecheck those names. It's still a good enough sanity check though. +// +// Works on gcc-4.2, gcc-4.4, and Visual Studio 2008. +// +// TODO(ajwong): Move to ref_counted.h or template_util.h when we've vetted +// this works well. +// +// TODO(ajwong): Make this check for Release() as well. +// See http://crbug.com/82038. +template +class SupportsAddRefAndRelease { + typedef char Yes[1]; + typedef char No[2]; + + struct BaseMixin { + void AddRef(); + }; + +// MSVC warns when you try to use Base if T has a private destructor, the +// common pattern for refcounted types. It does this even though no attempt to +// instantiate Base is made. We disable the warning for this definition. +#if defined(OS_WIN) +#pragma warning(push) +#pragma warning(disable:4624) +#endif + struct Base : public T, public BaseMixin { + }; +#if defined(OS_WIN) +#pragma warning(pop) +#endif + + template struct Helper {}; + + template + static No& Check(Helper<&C::AddRef>*); + + template + static Yes& Check(...); + + public: + static const bool value = sizeof(Check(0)) == sizeof(Yes); +}; + +// Helpers to assert that arguments of a recounted type are bound with a +// scoped_refptr. +template +struct UnsafeBindtoRefCountedArgHelper : false_type { +}; + +template +struct UnsafeBindtoRefCountedArgHelper + : integral_constant::value> { +}; + +template +struct UnsafeBindtoRefCountedArg : false_type { +}; + +template +struct UnsafeBindtoRefCountedArg + : UnsafeBindtoRefCountedArgHelper::value, T> { +}; + +template +class HasIsMethodTag { + typedef char Yes[1]; + typedef char No[2]; + + template + static Yes& Check(typename U::IsMethod*); + + template + static No& Check(...); + + public: + static const bool value = sizeof(Check(0)) == sizeof(Yes); +}; + +template +class UnretainedWrapper { + public: + explicit UnretainedWrapper(T* o) : ptr_(o) {} + T* get() const { return ptr_; } + private: + T* ptr_; +}; + +template +class ConstRefWrapper { + public: + explicit ConstRefWrapper(const T& o) : ptr_(&o) {} + const T& get() const { return *ptr_; } + private: + const T* ptr_; +}; + +template +struct IgnoreResultHelper { + explicit IgnoreResultHelper(T functor) : functor_(functor) {} + + T functor_; +}; + +template +struct IgnoreResultHelper > { + explicit IgnoreResultHelper(const Callback& functor) : functor_(functor) {} + + const Callback& functor_; +}; + +// An alternate implementation is to avoid the destructive copy, and instead +// specialize ParamTraits<> for OwnedWrapper<> to change the StorageType to +// a class that is essentially a scoped_ptr<>. +// +// The current implementation has the benefit though of leaving ParamTraits<> +// fully in callback_internal.h as well as avoiding type conversions during +// storage. +template +class OwnedWrapper { + public: + explicit OwnedWrapper(T* o) : ptr_(o) {} + ~OwnedWrapper() { delete ptr_; } + T* get() const { return ptr_; } + OwnedWrapper(const OwnedWrapper& other) { + ptr_ = other.ptr_; + other.ptr_ = NULL; + } + + private: + mutable T* ptr_; +}; + +// PassedWrapper is a copyable adapter for a scoper that ignores const. +// +// It is needed to get around the fact that Bind() takes a const reference to +// all its arguments. Because Bind() takes a const reference to avoid +// unnecessary copies, it is incompatible with movable-but-not-copyable +// types; doing a destructive "move" of the type into Bind() would violate +// the const correctness. +// +// This conundrum cannot be solved without either C++11 rvalue references or +// a O(2^n) blowup of Bind() templates to handle each combination of regular +// types and movable-but-not-copyable types. Thus we introduce a wrapper type +// that is copyable to transmit the correct type information down into +// BindState<>. Ignoring const in this type makes sense because it is only +// created when we are explicitly trying to do a destructive move. +// +// Two notes: +// 1) PassedWrapper supports any type that has a "Pass()" function. +// This is intentional. The whitelisting of which specific types we +// support is maintained by CallbackParamTraits<>. +// 2) is_valid_ is distinct from NULL because it is valid to bind a "NULL" +// scoper to a Callback and allow the Callback to execute once. +template +class PassedWrapper { + public: + explicit PassedWrapper(T scoper) : is_valid_(true), scoper_(scoper.Pass()) {} + PassedWrapper(const PassedWrapper& other) + : is_valid_(other.is_valid_), scoper_(other.scoper_.Pass()) { + } + T Pass() const { + CHECK(is_valid_); + is_valid_ = false; + return scoper_.Pass(); + } + + private: + mutable bool is_valid_; + mutable T scoper_; +}; + +// Unwrap the stored parameters for the wrappers above. +template +struct UnwrapTraits { + typedef const T& ForwardType; + static ForwardType Unwrap(const T& o) { return o; } +}; + +template +struct UnwrapTraits > { + typedef T* ForwardType; + static ForwardType Unwrap(UnretainedWrapper unretained) { + return unretained.get(); + } +}; + +template +struct UnwrapTraits > { + typedef const T& ForwardType; + static ForwardType Unwrap(ConstRefWrapper const_ref) { + return const_ref.get(); + } +}; + +template +struct UnwrapTraits > { + typedef T* ForwardType; + static ForwardType Unwrap(const scoped_refptr& o) { return o.get(); } +}; + +template +struct UnwrapTraits > { + typedef const WeakPtr& ForwardType; + static ForwardType Unwrap(const WeakPtr& o) { return o; } +}; + +template +struct UnwrapTraits > { + typedef T* ForwardType; + static ForwardType Unwrap(const OwnedWrapper& o) { + return o.get(); + } +}; + +template +struct UnwrapTraits > { + typedef T ForwardType; + static T Unwrap(PassedWrapper& o) { + return o.Pass(); + } +}; + +// Utility for handling different refcounting semantics in the Bind() +// function. +template +struct MaybeRefcount; + +template +struct MaybeRefcount { + static void AddRef(const T&) {} + static void Release(const T&) {} +}; + +template +struct MaybeRefcount { + static void AddRef(const T*) {} + static void Release(const T*) {} +}; + +template +struct MaybeRefcount { + static void AddRef(const T&) {} + static void Release(const T&) {} +}; + +template +struct MaybeRefcount { + static void AddRef(T* o) { o->AddRef(); } + static void Release(T* o) { o->Release(); } +}; + +// No need to additionally AddRef() and Release() since we are storing a +// scoped_refptr<> inside the storage object already. +template +struct MaybeRefcount > { + static void AddRef(const scoped_refptr& o) {} + static void Release(const scoped_refptr& o) {} +}; + +template +struct MaybeRefcount { + static void AddRef(const T* o) { o->AddRef(); } + static void Release(const T* o) { o->Release(); } +}; + +// IsWeakMethod is a helper that determine if we are binding a WeakPtr<> to a +// method. It is used internally by Bind() to select the correct +// InvokeHelper that will no-op itself in the event the WeakPtr<> for +// the target object is invalidated. +// +// P1 should be the type of the object that will be received of the method. +template +struct IsWeakMethod : public false_type {}; + +template +struct IsWeakMethod > : public true_type {}; + +template +struct IsWeakMethod > > : public true_type {}; + +} // namespace cef_internal + +template +static inline cef_internal::UnretainedWrapper Unretained(T* o) { + return cef_internal::UnretainedWrapper(o); +} + +template +static inline cef_internal::ConstRefWrapper ConstRef(const T& o) { + return cef_internal::ConstRefWrapper(o); +} + +template +static inline cef_internal::OwnedWrapper Owned(T* o) { + return cef_internal::OwnedWrapper(o); +} + +// We offer 2 syntaxes for calling Passed(). The first takes a temporary and +// is best suited for use with the return value of a function. The second +// takes a pointer to the scoper and is just syntactic sugar to avoid having +// to write Passed(scoper.Pass()). +template +static inline cef_internal::PassedWrapper Passed(T scoper) { + return cef_internal::PassedWrapper(scoper.Pass()); +} +template +static inline cef_internal::PassedWrapper Passed(T* scoper) { + return cef_internal::PassedWrapper(scoper->Pass()); +} + +template +static inline cef_internal::IgnoreResultHelper IgnoreResult(T data) { + return cef_internal::IgnoreResultHelper(data); +} + +template +static inline cef_internal::IgnoreResultHelper > +IgnoreResult(const Callback& data) { + return cef_internal::IgnoreResultHelper >(data); +} + +void DoNothing(); + +template +void DeletePointer(T* obj) { + delete obj; +} + +} // namespace base + +#endif // !BUILDING_CEF_SHARED + +#endif // CEF_INCLUDE_BASE_CEF_BIND_HELPERS_H_ diff --git a/dependencies64/cef/include/base/cef_build.h b/dependencies64/cef/include/base/cef_build.h new file mode 100644 index 000000000..594c6ff0a --- /dev/null +++ b/dependencies64/cef/include/base/cef_build.h @@ -0,0 +1,186 @@ +// Copyright (c) 2011 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +#ifndef CEF_INCLUDE_BASE_CEF_BUILD_H_ +#define CEF_INCLUDE_BASE_CEF_BUILD_H_ +#pragma once + +#if defined(BUILDING_CEF_SHARED) +// When building CEF include the Chromium header directly. +#include "base/compiler_specific.h" +#else // !BUILDING_CEF_SHARED +// The following is substantially similar to the Chromium implementation. +// If the Chromium implementation diverges the below implementation should be +// updated to match. + +#if defined(_WIN32) +#ifndef OS_WIN +#define OS_WIN 1 +#endif +#elif defined(__APPLE__) +#ifndef OS_MACOSX +#define OS_MACOSX 1 +#endif +#elif defined(__linux__) +#ifndef OS_LINUX +#define OS_LINUX 1 +#endif +#else +#error Please add support for your platform in cef_build.h +#endif + +// For access to standard POSIXish features, use OS_POSIX instead of a +// more specific macro. +#if defined(OS_MACOSX) || defined(OS_LINUX) +#ifndef OS_POSIX +#define OS_POSIX 1 +#endif +#endif + +// Compiler detection. +#if defined(__GNUC__) +#ifndef COMPILER_GCC +#define COMPILER_GCC 1 +#endif +#elif defined(_MSC_VER) +#ifndef COMPILER_MSVC +#define COMPILER_MSVC 1 +#endif +#else +#error Please add support for your compiler in cef_build.h +#endif + +// Processor architecture detection. For more info on what's defined, see: +// http://msdn.microsoft.com/en-us/library/b0084kay.aspx +// http://www.agner.org/optimize/calling_conventions.pdf +// or with gcc, run: "echo | gcc -E -dM -" +#if defined(_M_X64) || defined(__x86_64__) +#define ARCH_CPU_X86_FAMILY 1 +#define ARCH_CPU_X86_64 1 +#define ARCH_CPU_64_BITS 1 +#define ARCH_CPU_LITTLE_ENDIAN 1 +#elif defined(_M_IX86) || defined(__i386__) +#define ARCH_CPU_X86_FAMILY 1 +#define ARCH_CPU_X86 1 +#define ARCH_CPU_32_BITS 1 +#define ARCH_CPU_LITTLE_ENDIAN 1 +#elif defined(__ARMEL__) +#define ARCH_CPU_ARM_FAMILY 1 +#define ARCH_CPU_ARMEL 1 +#define ARCH_CPU_32_BITS 1 +#define ARCH_CPU_LITTLE_ENDIAN 1 +#elif defined(__aarch64__) +#define ARCH_CPU_ARM_FAMILY 1 +#define ARCH_CPU_ARM64 1 +#define ARCH_CPU_64_BITS 1 +#define ARCH_CPU_LITTLE_ENDIAN 1 +#elif defined(__pnacl__) +#define ARCH_CPU_32_BITS 1 +#define ARCH_CPU_LITTLE_ENDIAN 1 +#elif defined(__MIPSEL__) +#define ARCH_CPU_MIPS_FAMILY 1 +#define ARCH_CPU_MIPSEL 1 +#define ARCH_CPU_32_BITS 1 +#define ARCH_CPU_LITTLE_ENDIAN 1 +#else +#error Please add support for your architecture in cef_build.h +#endif + +// Type detection for wchar_t. +#if defined(OS_WIN) +#define WCHAR_T_IS_UTF16 +#elif defined(OS_POSIX) && defined(COMPILER_GCC) && \ + defined(__WCHAR_MAX__) && \ + (__WCHAR_MAX__ == 0x7fffffff || __WCHAR_MAX__ == 0xffffffff) +#define WCHAR_T_IS_UTF32 +#elif defined(OS_POSIX) && defined(COMPILER_GCC) && \ + defined(__WCHAR_MAX__) && \ + (__WCHAR_MAX__ == 0x7fff || __WCHAR_MAX__ == 0xffff) +// On Posix, we'll detect short wchar_t, but projects aren't guaranteed to +// compile in this mode (in particular, Chrome doesn't). This is intended for +// other projects using base who manage their own dependencies and make sure +// short wchar works for them. +#define WCHAR_T_IS_UTF16 +#else +#error Please add support for your compiler in cef_build.h +#endif + +// Annotate a virtual method indicating it must be overriding a virtual +// method in the parent class. +// Use like: +// virtual void foo() OVERRIDE; +#ifndef OVERRIDE +#if defined(__clang__) || defined(COMPILER_MSVC) +#define OVERRIDE override +#elif defined(COMPILER_GCC) && __cplusplus >= 201103 && \ + (__GNUC__ * 10000 + __GNUC_MINOR__ * 100) >= 40700 +// GCC 4.7 supports explicit virtual overrides when C++11 support is enabled. +#define OVERRIDE override +#else +#define OVERRIDE +#endif +#endif // OVERRIDE + +// Annotate a function indicating the caller must examine the return value. +// Use like: +// int foo() WARN_UNUSED_RESULT; +// To explicitly ignore a result, see |ignore_result()| in . +#ifndef WARN_UNUSED_RESULT +#if defined(COMPILER_GCC) +#define WARN_UNUSED_RESULT __attribute__((warn_unused_result)) +#else +#define WARN_UNUSED_RESULT +#endif +#endif // WARN_UNUSED_RESULT + +// Annotate a typedef or function indicating it's ok if it's not used. +// Use like: +// typedef Foo Bar ALLOW_UNUSED_TYPE; +#ifndef ALLOW_UNUSED_TYPE +#if defined(COMPILER_GCC) +#define ALLOW_UNUSED_TYPE __attribute__((unused)) +#else +#define ALLOW_UNUSED_TYPE +#endif +#endif // ALLOW_UNUSED_TYPE + +// Annotate a variable indicating it's ok if the variable is not used. +// (Typically used to silence a compiler warning when the assignment +// is important for some other reason.) +// Use like: +// int x = ...; +// ALLOW_UNUSED_LOCAL(x); +#ifndef ALLOW_UNUSED_LOCAL +#define ALLOW_UNUSED_LOCAL(x) false ? (void)x : (void)0 +#endif + +#endif // !BUILDING_CEF_SHARED + +#endif // CEF_INCLUDE_BASE_CEF_BUILD_H_ diff --git a/dependencies64/cef/include/base/cef_callback.h b/dependencies64/cef/include/base/cef_callback.h new file mode 100644 index 000000000..75783271d --- /dev/null +++ b/dependencies64/cef/include/base/cef_callback.h @@ -0,0 +1,807 @@ +// Copyright (c) 2014 Marshall A. Greenblatt. Portions copyright (c) 2012 +// Google Inc. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#ifndef CEF_INCLUDE_BASE_CEF_CALLBACK_H_ +#define CEF_INCLUDE_BASE_CEF_CALLBACK_H_ +#pragma once + +#if defined(BASE_CALLBACK_H_) +// Do nothing if the Chromium header has already been included. +// This can happen in cases where Chromium code is used directly by the +// client application. When using Chromium code directly always include +// the Chromium header first to avoid type conflicts. +#elif defined(BUILDING_CEF_SHARED) +// When building CEF include the Chromium header directly. +#include "base/callback.h" +#else // !BUILDING_CEF_SHARED +// The following is substantially similar to the Chromium implementation. +// If the Chromium implementation diverges the below implementation should be +// updated to match. + +#include "include/base/internal/cef_callback_internal.h" +#include "include/base/cef_callback_forward.h" +#include "include/base/cef_template_util.h" + +// NOTE: Header files that do not require the full definition of Callback or +// Closure should #include "base/cef_callback_forward.h" instead of this file. + +// ----------------------------------------------------------------------------- +// Introduction +// ----------------------------------------------------------------------------- +// +// The templated Callback class is a generalized function object. Together +// with the Bind() function in bind.h, they provide a type-safe method for +// performing partial application of functions. +// +// Partial application (or "currying") is the process of binding a subset of +// a function's arguments to produce another function that takes fewer +// arguments. This can be used to pass around a unit of delayed execution, +// much like lexical closures are used in other languages. For example, it +// is used in Chromium code to schedule tasks on different MessageLoops. +// +// A callback with no unbound input parameters (base::Callback) +// is called a base::Closure. Note that this is NOT the same as what other +// languages refer to as a closure -- it does not retain a reference to its +// enclosing environment. +// +// MEMORY MANAGEMENT AND PASSING +// +// The Callback objects themselves should be passed by const-reference, and +// stored by copy. They internally store their state via a refcounted class +// and thus do not need to be deleted. +// +// The reason to pass via a const-reference is to avoid unnecessary +// AddRef/Release pairs to the internal state. +// +// +// ----------------------------------------------------------------------------- +// Quick reference for basic stuff +// ----------------------------------------------------------------------------- +// +// BINDING A BARE FUNCTION +// +// int Return5() { return 5; } +// base::Callback func_cb = base::Bind(&Return5); +// LOG(INFO) << func_cb.Run(); // Prints 5. +// +// BINDING A CLASS METHOD +// +// The first argument to bind is the member function to call, the second is +// the object on which to call it. +// +// class Ref : public base::RefCountedThreadSafe { +// public: +// int Foo() { return 3; } +// void PrintBye() { LOG(INFO) << "bye."; } +// }; +// scoped_refptr ref = new Ref(); +// base::Callback ref_cb = base::Bind(&Ref::Foo, ref); +// LOG(INFO) << ref_cb.Run(); // Prints out 3. +// +// By default the object must support RefCounted or you will get a compiler +// error. If you're passing between threads, be sure it's +// RefCountedThreadSafe! See "Advanced binding of member functions" below if +// you don't want to use reference counting. +// +// RUNNING A CALLBACK +// +// Callbacks can be run with their "Run" method, which has the same +// signature as the template argument to the callback. +// +// void DoSomething(const base::Callback& callback) { +// callback.Run(5, "hello"); +// } +// +// Callbacks can be run more than once (they don't get deleted or marked when +// run). However, this precludes using base::Passed (see below). +// +// void DoSomething(const base::Callback& callback) { +// double myresult = callback.Run(3.14159); +// myresult += callback.Run(2.71828); +// } +// +// PASSING UNBOUND INPUT PARAMETERS +// +// Unbound parameters are specified at the time a callback is Run(). They are +// specified in the Callback template type: +// +// void MyFunc(int i, const std::string& str) {} +// base::Callback cb = base::Bind(&MyFunc); +// cb.Run(23, "hello, world"); +// +// PASSING BOUND INPUT PARAMETERS +// +// Bound parameters are specified when you create thee callback as arguments +// to Bind(). They will be passed to the function and the Run()ner of the +// callback doesn't see those values or even know that the function it's +// calling. +// +// void MyFunc(int i, const std::string& str) {} +// base::Callback cb = base::Bind(&MyFunc, 23, "hello world"); +// cb.Run(); +// +// A callback with no unbound input parameters (base::Callback) +// is called a base::Closure. So we could have also written: +// +// base::Closure cb = base::Bind(&MyFunc, 23, "hello world"); +// +// When calling member functions, bound parameters just go after the object +// pointer. +// +// base::Closure cb = base::Bind(&MyClass::MyFunc, this, 23, "hello world"); +// +// PARTIAL BINDING OF PARAMETERS +// +// You can specify some parameters when you create the callback, and specify +// the rest when you execute the callback. +// +// void MyFunc(int i, const std::string& str) {} +// base::Callback cb = base::Bind(&MyFunc, 23); +// cb.Run("hello world"); +// +// When calling a function bound parameters are first, followed by unbound +// parameters. +// +// +// ----------------------------------------------------------------------------- +// Quick reference for advanced binding +// ----------------------------------------------------------------------------- +// +// BINDING A CLASS METHOD WITH WEAK POINTERS +// +// base::Bind(&MyClass::Foo, GetWeakPtr()); +// +// The callback will not be run if the object has already been destroyed. +// DANGER: weak pointers are not threadsafe, so don't use this +// when passing between threads! +// +// BINDING A CLASS METHOD WITH MANUAL LIFETIME MANAGEMENT +// +// base::Bind(&MyClass::Foo, base::Unretained(this)); +// +// This disables all lifetime management on the object. You're responsible +// for making sure the object is alive at the time of the call. You break it, +// you own it! +// +// BINDING A CLASS METHOD AND HAVING THE CALLBACK OWN THE CLASS +// +// MyClass* myclass = new MyClass; +// base::Bind(&MyClass::Foo, base::Owned(myclass)); +// +// The object will be deleted when the callback is destroyed, even if it's +// not run (like if you post a task during shutdown). Potentially useful for +// "fire and forget" cases. +// +// IGNORING RETURN VALUES +// +// Sometimes you want to call a function that returns a value in a callback +// that doesn't expect a return value. +// +// int DoSomething(int arg) { cout << arg << endl; } +// base::Callback) cb = +// base::Bind(base::IgnoreResult(&DoSomething)); +// +// +// ----------------------------------------------------------------------------- +// Quick reference for binding parameters to Bind() +// ----------------------------------------------------------------------------- +// +// Bound parameters are specified as arguments to Bind() and are passed to the +// function. A callback with no parameters or no unbound parameters is called a +// Closure (base::Callback and base::Closure are the same thing). +// +// PASSING PARAMETERS OWNED BY THE CALLBACK +// +// void Foo(int* arg) { cout << *arg << endl; } +// int* pn = new int(1); +// base::Closure foo_callback = base::Bind(&foo, base::Owned(pn)); +// +// The parameter will be deleted when the callback is destroyed, even if it's +// not run (like if you post a task during shutdown). +// +// PASSING PARAMETERS AS A scoped_ptr +// +// void TakesOwnership(scoped_ptr arg) {} +// scoped_ptr f(new Foo); +// // f becomes null during the following call. +// base::Closure cb = base::Bind(&TakesOwnership, base::Passed(&f)); +// +// Ownership of the parameter will be with the callback until the it is run, +// when ownership is passed to the callback function. This means the callback +// can only be run once. If the callback is never run, it will delete the +// object when it's destroyed. +// +// PASSING PARAMETERS AS A scoped_refptr +// +// void TakesOneRef(scoped_refptr arg) {} +// scoped_refptr f(new Foo) +// base::Closure cb = base::Bind(&TakesOneRef, f); +// +// This should "just work." The closure will take a reference as long as it +// is alive, and another reference will be taken for the called function. +// +// PASSING PARAMETERS BY REFERENCE +// +// Const references are *copied* unless ConstRef is used. Example: +// +// void foo(const int& arg) { printf("%d %p\n", arg, &arg); } +// int n = 1; +// base::Closure has_copy = base::Bind(&foo, n); +// base::Closure has_ref = base::Bind(&foo, base::ConstRef(n)); +// n = 2; +// foo(n); // Prints "2 0xaaaaaaaaaaaa" +// has_copy.Run(); // Prints "1 0xbbbbbbbbbbbb" +// has_ref.Run(); // Prints "2 0xaaaaaaaaaaaa" +// +// Normally parameters are copied in the closure. DANGER: ConstRef stores a +// const reference instead, referencing the original parameter. This means +// that you must ensure the object outlives the callback! +// +// +// ----------------------------------------------------------------------------- +// Implementation notes +// ----------------------------------------------------------------------------- +// +// WHERE IS THIS DESIGN FROM: +// +// The design Callback and Bind is heavily influenced by C++'s +// tr1::function/tr1::bind, and by the "Google Callback" system used inside +// Google. +// +// +// HOW THE IMPLEMENTATION WORKS: +// +// There are three main components to the system: +// 1) The Callback classes. +// 2) The Bind() functions. +// 3) The arguments wrappers (e.g., Unretained() and ConstRef()). +// +// The Callback classes represent a generic function pointer. Internally, +// it stores a refcounted piece of state that represents the target function +// and all its bound parameters. Each Callback specialization has a templated +// constructor that takes an BindState<>*. In the context of the constructor, +// the static type of this BindState<> pointer uniquely identifies the +// function it is representing, all its bound parameters, and a Run() method +// that is capable of invoking the target. +// +// Callback's constructor takes the BindState<>* that has the full static type +// and erases the target function type as well as the types of the bound +// parameters. It does this by storing a pointer to the specific Run() +// function, and upcasting the state of BindState<>* to a +// BindStateBase*. This is safe as long as this BindStateBase pointer +// is only used with the stored Run() pointer. +// +// To BindState<> objects are created inside the Bind() functions. +// These functions, along with a set of internal templates, are responsible for +// +// - Unwrapping the function signature into return type, and parameters +// - Determining the number of parameters that are bound +// - Creating the BindState storing the bound parameters +// - Performing compile-time asserts to avoid error-prone behavior +// - Returning an Callback<> with an arity matching the number of unbound +// parameters and that knows the correct refcounting semantics for the +// target object if we are binding a method. +// +// The Bind functions do the above using type-inference, and template +// specializations. +// +// By default Bind() will store copies of all bound parameters, and attempt +// to refcount a target object if the function being bound is a class method. +// These copies are created even if the function takes parameters as const +// references. (Binding to non-const references is forbidden, see bind.h.) +// +// To change this behavior, we introduce a set of argument wrappers +// (e.g., Unretained(), and ConstRef()). These are simple container templates +// that are passed by value, and wrap a pointer to argument. See the +// file-level comment in base/bind_helpers.h for more info. +// +// These types are passed to the Unwrap() functions, and the MaybeRefcount() +// functions respectively to modify the behavior of Bind(). The Unwrap() +// and MaybeRefcount() functions change behavior by doing partial +// specialization based on whether or not a parameter is a wrapper type. +// +// ConstRef() is similar to tr1::cref. Unretained() is specific to Chromium. +// +// +// WHY NOT TR1 FUNCTION/BIND? +// +// Direct use of tr1::function and tr1::bind was considered, but ultimately +// rejected because of the number of copy constructors invocations involved +// in the binding of arguments during construction, and the forwarding of +// arguments during invocation. These copies will no longer be an issue in +// C++0x because C++0x will support rvalue reference allowing for the compiler +// to avoid these copies. However, waiting for C++0x is not an option. +// +// Measured with valgrind on gcc version 4.4.3 (Ubuntu 4.4.3-4ubuntu5), the +// tr1::bind call itself will invoke a non-trivial copy constructor three times +// for each bound parameter. Also, each when passing a tr1::function, each +// bound argument will be copied again. +// +// In addition to the copies taken at binding and invocation, copying a +// tr1::function causes a copy to be made of all the bound parameters and +// state. +// +// Furthermore, in Chromium, it is desirable for the Callback to take a +// reference on a target object when representing a class method call. This +// is not supported by tr1. +// +// Lastly, tr1::function and tr1::bind has a more general and flexible API. +// This includes things like argument reordering by use of +// tr1::bind::placeholder, support for non-const reference parameters, and some +// limited amount of subtyping of the tr1::function object (e.g., +// tr1::function is convertible to tr1::function). +// +// These are not features that are required in Chromium. Some of them, such as +// allowing for reference parameters, and subtyping of functions, may actually +// become a source of errors. Removing support for these features actually +// allows for a simpler implementation, and a terser Currying API. +// +// +// WHY NOT GOOGLE CALLBACKS? +// +// The Google callback system also does not support refcounting. Furthermore, +// its implementation has a number of strange edge cases with respect to type +// conversion of its arguments. In particular, the argument's constness must +// at times match exactly the function signature, or the type-inference might +// break. Given the above, writing a custom solution was easier. +// +// +// MISSING FUNCTIONALITY +// - Invoking the return of Bind. Bind(&foo).Run() does not work; +// - Binding arrays to functions that take a non-const pointer. +// Example: +// void Foo(const char* ptr); +// void Bar(char* ptr); +// Bind(&Foo, "test"); +// Bind(&Bar, "test"); // This fails because ptr is not const. + +namespace base { + +// First, we forward declare the Callback class template. This informs the +// compiler that the template only has 1 type parameter which is the function +// signature that the Callback is representing. +// +// After this, create template specializations for 0-7 parameters. Note that +// even though the template typelist grows, the specialization still +// only has one type: the function signature. +// +// If you are thinking of forward declaring Callback in your own header file, +// please include "base/callback_forward.h" instead. +template +class Callback; + +namespace cef_internal { +template +struct BindState; +} // namespace cef_internal + +template +class Callback : public cef_internal::CallbackBase { + public: + typedef R(RunType)(); + + Callback() : CallbackBase(NULL) { } + + // Note that this constructor CANNOT be explicit, and that Bind() CANNOT + // return the exact Callback<> type. See base/bind.h for details. + template + Callback(cef_internal::BindState* bind_state) + : CallbackBase(bind_state) { + + // Force the assignment to a local variable of PolymorphicInvoke + // so the compiler will typecheck that the passed in Run() method has + // the correct type. + PolymorphicInvoke invoke_func = + &cef_internal::BindState + ::InvokerType::Run; + polymorphic_invoke_ = reinterpret_cast(invoke_func); + } + + bool Equals(const Callback& other) const { + return CallbackBase::Equals(other); + } + + R Run() const { + PolymorphicInvoke f = + reinterpret_cast(polymorphic_invoke_); + + return f(bind_state_.get()); + } + + private: + typedef R(*PolymorphicInvoke)( + cef_internal::BindStateBase*); + +}; + +template +class Callback : public cef_internal::CallbackBase { + public: + typedef R(RunType)(A1); + + Callback() : CallbackBase(NULL) { } + + // Note that this constructor CANNOT be explicit, and that Bind() CANNOT + // return the exact Callback<> type. See base/bind.h for details. + template + Callback(cef_internal::BindState* bind_state) + : CallbackBase(bind_state) { + + // Force the assignment to a local variable of PolymorphicInvoke + // so the compiler will typecheck that the passed in Run() method has + // the correct type. + PolymorphicInvoke invoke_func = + &cef_internal::BindState + ::InvokerType::Run; + polymorphic_invoke_ = reinterpret_cast(invoke_func); + } + + bool Equals(const Callback& other) const { + return CallbackBase::Equals(other); + } + + R Run(typename cef_internal::CallbackParamTraits::ForwardType a1) const { + PolymorphicInvoke f = + reinterpret_cast(polymorphic_invoke_); + + return f(bind_state_.get(), cef_internal::CallbackForward(a1)); + } + + private: + typedef R(*PolymorphicInvoke)( + cef_internal::BindStateBase*, + typename cef_internal::CallbackParamTraits::ForwardType); + +}; + +template +class Callback : public cef_internal::CallbackBase { + public: + typedef R(RunType)(A1, A2); + + Callback() : CallbackBase(NULL) { } + + // Note that this constructor CANNOT be explicit, and that Bind() CANNOT + // return the exact Callback<> type. See base/bind.h for details. + template + Callback(cef_internal::BindState* bind_state) + : CallbackBase(bind_state) { + + // Force the assignment to a local variable of PolymorphicInvoke + // so the compiler will typecheck that the passed in Run() method has + // the correct type. + PolymorphicInvoke invoke_func = + &cef_internal::BindState + ::InvokerType::Run; + polymorphic_invoke_ = reinterpret_cast(invoke_func); + } + + bool Equals(const Callback& other) const { + return CallbackBase::Equals(other); + } + + R Run(typename cef_internal::CallbackParamTraits::ForwardType a1, + typename cef_internal::CallbackParamTraits::ForwardType a2) const { + PolymorphicInvoke f = + reinterpret_cast(polymorphic_invoke_); + + return f(bind_state_.get(), cef_internal::CallbackForward(a1), + cef_internal::CallbackForward(a2)); + } + + private: + typedef R(*PolymorphicInvoke)( + cef_internal::BindStateBase*, + typename cef_internal::CallbackParamTraits::ForwardType, + typename cef_internal::CallbackParamTraits::ForwardType); + +}; + +template +class Callback : public cef_internal::CallbackBase { + public: + typedef R(RunType)(A1, A2, A3); + + Callback() : CallbackBase(NULL) { } + + // Note that this constructor CANNOT be explicit, and that Bind() CANNOT + // return the exact Callback<> type. See base/bind.h for details. + template + Callback(cef_internal::BindState* bind_state) + : CallbackBase(bind_state) { + + // Force the assignment to a local variable of PolymorphicInvoke + // so the compiler will typecheck that the passed in Run() method has + // the correct type. + PolymorphicInvoke invoke_func = + &cef_internal::BindState + ::InvokerType::Run; + polymorphic_invoke_ = reinterpret_cast(invoke_func); + } + + bool Equals(const Callback& other) const { + return CallbackBase::Equals(other); + } + + R Run(typename cef_internal::CallbackParamTraits::ForwardType a1, + typename cef_internal::CallbackParamTraits::ForwardType a2, + typename cef_internal::CallbackParamTraits::ForwardType a3) const { + PolymorphicInvoke f = + reinterpret_cast(polymorphic_invoke_); + + return f(bind_state_.get(), cef_internal::CallbackForward(a1), + cef_internal::CallbackForward(a2), + cef_internal::CallbackForward(a3)); + } + + private: + typedef R(*PolymorphicInvoke)( + cef_internal::BindStateBase*, + typename cef_internal::CallbackParamTraits::ForwardType, + typename cef_internal::CallbackParamTraits::ForwardType, + typename cef_internal::CallbackParamTraits::ForwardType); + +}; + +template +class Callback : public cef_internal::CallbackBase { + public: + typedef R(RunType)(A1, A2, A3, A4); + + Callback() : CallbackBase(NULL) { } + + // Note that this constructor CANNOT be explicit, and that Bind() CANNOT + // return the exact Callback<> type. See base/bind.h for details. + template + Callback(cef_internal::BindState* bind_state) + : CallbackBase(bind_state) { + + // Force the assignment to a local variable of PolymorphicInvoke + // so the compiler will typecheck that the passed in Run() method has + // the correct type. + PolymorphicInvoke invoke_func = + &cef_internal::BindState + ::InvokerType::Run; + polymorphic_invoke_ = reinterpret_cast(invoke_func); + } + + bool Equals(const Callback& other) const { + return CallbackBase::Equals(other); + } + + R Run(typename cef_internal::CallbackParamTraits::ForwardType a1, + typename cef_internal::CallbackParamTraits::ForwardType a2, + typename cef_internal::CallbackParamTraits::ForwardType a3, + typename cef_internal::CallbackParamTraits::ForwardType a4) const { + PolymorphicInvoke f = + reinterpret_cast(polymorphic_invoke_); + + return f(bind_state_.get(), cef_internal::CallbackForward(a1), + cef_internal::CallbackForward(a2), + cef_internal::CallbackForward(a3), + cef_internal::CallbackForward(a4)); + } + + private: + typedef R(*PolymorphicInvoke)( + cef_internal::BindStateBase*, + typename cef_internal::CallbackParamTraits::ForwardType, + typename cef_internal::CallbackParamTraits::ForwardType, + typename cef_internal::CallbackParamTraits::ForwardType, + typename cef_internal::CallbackParamTraits::ForwardType); + +}; + +template +class Callback : public cef_internal::CallbackBase { + public: + typedef R(RunType)(A1, A2, A3, A4, A5); + + Callback() : CallbackBase(NULL) { } + + // Note that this constructor CANNOT be explicit, and that Bind() CANNOT + // return the exact Callback<> type. See base/bind.h for details. + template + Callback(cef_internal::BindState* bind_state) + : CallbackBase(bind_state) { + + // Force the assignment to a local variable of PolymorphicInvoke + // so the compiler will typecheck that the passed in Run() method has + // the correct type. + PolymorphicInvoke invoke_func = + &cef_internal::BindState + ::InvokerType::Run; + polymorphic_invoke_ = reinterpret_cast(invoke_func); + } + + bool Equals(const Callback& other) const { + return CallbackBase::Equals(other); + } + + R Run(typename cef_internal::CallbackParamTraits::ForwardType a1, + typename cef_internal::CallbackParamTraits::ForwardType a2, + typename cef_internal::CallbackParamTraits::ForwardType a3, + typename cef_internal::CallbackParamTraits::ForwardType a4, + typename cef_internal::CallbackParamTraits::ForwardType a5) const { + PolymorphicInvoke f = + reinterpret_cast(polymorphic_invoke_); + + return f(bind_state_.get(), cef_internal::CallbackForward(a1), + cef_internal::CallbackForward(a2), + cef_internal::CallbackForward(a3), + cef_internal::CallbackForward(a4), + cef_internal::CallbackForward(a5)); + } + + private: + typedef R(*PolymorphicInvoke)( + cef_internal::BindStateBase*, + typename cef_internal::CallbackParamTraits::ForwardType, + typename cef_internal::CallbackParamTraits::ForwardType, + typename cef_internal::CallbackParamTraits::ForwardType, + typename cef_internal::CallbackParamTraits::ForwardType, + typename cef_internal::CallbackParamTraits::ForwardType); + +}; + +template +class Callback : public cef_internal::CallbackBase { + public: + typedef R(RunType)(A1, A2, A3, A4, A5, A6); + + Callback() : CallbackBase(NULL) { } + + // Note that this constructor CANNOT be explicit, and that Bind() CANNOT + // return the exact Callback<> type. See base/bind.h for details. + template + Callback(cef_internal::BindState* bind_state) + : CallbackBase(bind_state) { + + // Force the assignment to a local variable of PolymorphicInvoke + // so the compiler will typecheck that the passed in Run() method has + // the correct type. + PolymorphicInvoke invoke_func = + &cef_internal::BindState + ::InvokerType::Run; + polymorphic_invoke_ = reinterpret_cast(invoke_func); + } + + bool Equals(const Callback& other) const { + return CallbackBase::Equals(other); + } + + R Run(typename cef_internal::CallbackParamTraits::ForwardType a1, + typename cef_internal::CallbackParamTraits::ForwardType a2, + typename cef_internal::CallbackParamTraits::ForwardType a3, + typename cef_internal::CallbackParamTraits::ForwardType a4, + typename cef_internal::CallbackParamTraits::ForwardType a5, + typename cef_internal::CallbackParamTraits::ForwardType a6) const { + PolymorphicInvoke f = + reinterpret_cast(polymorphic_invoke_); + + return f(bind_state_.get(), cef_internal::CallbackForward(a1), + cef_internal::CallbackForward(a2), + cef_internal::CallbackForward(a3), + cef_internal::CallbackForward(a4), + cef_internal::CallbackForward(a5), + cef_internal::CallbackForward(a6)); + } + + private: + typedef R(*PolymorphicInvoke)( + cef_internal::BindStateBase*, + typename cef_internal::CallbackParamTraits::ForwardType, + typename cef_internal::CallbackParamTraits::ForwardType, + typename cef_internal::CallbackParamTraits::ForwardType, + typename cef_internal::CallbackParamTraits::ForwardType, + typename cef_internal::CallbackParamTraits::ForwardType, + typename cef_internal::CallbackParamTraits::ForwardType); + +}; + +template +class Callback : public cef_internal::CallbackBase { + public: + typedef R(RunType)(A1, A2, A3, A4, A5, A6, A7); + + Callback() : CallbackBase(NULL) { } + + // Note that this constructor CANNOT be explicit, and that Bind() CANNOT + // return the exact Callback<> type. See base/bind.h for details. + template + Callback(cef_internal::BindState* bind_state) + : CallbackBase(bind_state) { + + // Force the assignment to a local variable of PolymorphicInvoke + // so the compiler will typecheck that the passed in Run() method has + // the correct type. + PolymorphicInvoke invoke_func = + &cef_internal::BindState + ::InvokerType::Run; + polymorphic_invoke_ = reinterpret_cast(invoke_func); + } + + bool Equals(const Callback& other) const { + return CallbackBase::Equals(other); + } + + R Run(typename cef_internal::CallbackParamTraits::ForwardType a1, + typename cef_internal::CallbackParamTraits::ForwardType a2, + typename cef_internal::CallbackParamTraits::ForwardType a3, + typename cef_internal::CallbackParamTraits::ForwardType a4, + typename cef_internal::CallbackParamTraits::ForwardType a5, + typename cef_internal::CallbackParamTraits::ForwardType a6, + typename cef_internal::CallbackParamTraits::ForwardType a7) const { + PolymorphicInvoke f = + reinterpret_cast(polymorphic_invoke_); + + return f(bind_state_.get(), cef_internal::CallbackForward(a1), + cef_internal::CallbackForward(a2), + cef_internal::CallbackForward(a3), + cef_internal::CallbackForward(a4), + cef_internal::CallbackForward(a5), + cef_internal::CallbackForward(a6), + cef_internal::CallbackForward(a7)); + } + + private: + typedef R(*PolymorphicInvoke)( + cef_internal::BindStateBase*, + typename cef_internal::CallbackParamTraits::ForwardType, + typename cef_internal::CallbackParamTraits::ForwardType, + typename cef_internal::CallbackParamTraits::ForwardType, + typename cef_internal::CallbackParamTraits::ForwardType, + typename cef_internal::CallbackParamTraits::ForwardType, + typename cef_internal::CallbackParamTraits::ForwardType, + typename cef_internal::CallbackParamTraits::ForwardType); + +}; + + +// Syntactic sugar to make Callbacks easier to declare since it +// will be used in a lot of APIs with delayed execution. +typedef Callback Closure; + +} // namespace base + +#endif // !BUILDING_CEF_SHARED + +#endif // CEF_INCLUDE_BASE_CEF_CALLBACK_H_ diff --git a/dependencies64/cef/include/base/cef_callback_forward.h b/dependencies64/cef/include/base/cef_callback_forward.h new file mode 100644 index 000000000..4986b8f76 --- /dev/null +++ b/dependencies64/cef/include/base/cef_callback_forward.h @@ -0,0 +1,59 @@ +// Copyright (c) 2014 Marshall A. Greenblatt. Portions copyright (c) 2011 +// Google Inc. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#ifndef INCLUDE_BASE_CEF_CALLBACK_FORWARD_H_ +#define INCLUDE_BASE_CEF_CALLBACK_FORWARD_H_ +#pragma once + +#if defined(BASE_CALLBACK_FORWARD_H_) +// Do nothing if the Chromium header has already been included. +// This can happen in cases where Chromium code is used directly by the +// client application. When using Chromium code directly always include +// the Chromium header first to avoid type conflicts. +#elif defined(BUILDING_CEF_SHARED) +// When building CEF include the Chromium header directly. +#include "base/callback_forward.h" +#else // !BUILDING_CEF_SHARED +// The following is substantially similar to the Chromium implementation. +// If the Chromium implementation diverges the below implementation should be +// updated to match. + +namespace base { + +template +class Callback; + +typedef Callback Closure; + +} // namespace base + +#endif // !!BUILDING_CEF_SHARED + +#endif // INCLUDE_BASE_CEF_CALLBACK_FORWARD_H_ diff --git a/dependencies64/cef/include/base/cef_callback_helpers.h b/dependencies64/cef/include/base/cef_callback_helpers.h new file mode 100644 index 000000000..62a0c8752 --- /dev/null +++ b/dependencies64/cef/include/base/cef_callback_helpers.h @@ -0,0 +1,93 @@ +// Copyright (c) 2014 Marshall A. Greenblatt. Portions copyright (c) 2012 +// Google Inc. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +// This defines helpful methods for dealing with Callbacks. Because Callbacks +// are implemented using templates, with a class per callback signature, adding +// methods to Callback<> itself is unattractive (lots of extra code gets +// generated). Instead, consider adding methods here. +// +// ResetAndReturn(&cb) is like cb.Reset() but allows executing a callback (via a +// copy) after the original callback is Reset(). This can be handy if Run() +// reads/writes the variable holding the Callback. + +#ifndef CEF_INCLUDE_BASE_CEF_CALLBACK_HELPERS_H_ +#define CEF_INCLUDE_BASE_CEF_CALLBACK_HELPERS_H_ +#pragma once + +#if defined(BASE_CALLBACK_HELPERS_H_) +// Do nothing if the Chromium header has already been included. +// This can happen in cases where Chromium code is used directly by the +// client application. When using Chromium code directly always include +// the Chromium header first to avoid type conflicts. +#elif defined(BUILDING_CEF_SHARED) +// When building CEF include the Chromium header directly. +#include "base/callback_helpers.h" +#else // !BUILDING_CEF_SHARED +// The following is substantially similar to the Chromium implementation. +// If the Chromium implementation diverges the below implementation should be +// updated to match. + +#include "include/base/cef_basictypes.h" +#include "include/base/cef_build.h" +#include "include/base/cef_callback.h" +#include "include/base/cef_macros.h" + +namespace base { + +template +base::Callback ResetAndReturn(base::Callback* cb) { + base::Callback ret(*cb); + cb->Reset(); + return ret; +} + +// ScopedClosureRunner is akin to scoped_ptr for Closures. It ensures that the +// Closure is executed and deleted no matter how the current scope exits. +class ScopedClosureRunner { + public: + ScopedClosureRunner(); + explicit ScopedClosureRunner(const Closure& closure); + ~ScopedClosureRunner(); + + void Reset(); + void Reset(const Closure& closure); + Closure Release() WARN_UNUSED_RESULT; + + private: + Closure closure_; + + DISALLOW_COPY_AND_ASSIGN(ScopedClosureRunner); +}; + +} // namespace base + +#endif // !BUILDING_CEF_SHARED + +#endif // CEF_INCLUDE_BASE_CEF_CALLBACK_HELPERS_H_ diff --git a/dependencies64/cef/include/base/cef_callback_list.h b/dependencies64/cef/include/base/cef_callback_list.h new file mode 100644 index 000000000..558b36f86 --- /dev/null +++ b/dependencies64/cef/include/base/cef_callback_list.h @@ -0,0 +1,444 @@ +// Copyright (c) 2014 Marshall A. Greenblatt. Portions copyright (c) 2013 +// Google Inc. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#ifndef CEF_INCLUDE_BASE_CEF_CALLBACK_LIST_H_ +#define CEF_INCLUDE_BASE_CEF_CALLBACK_LIST_H_ +#pragma once + +#if defined(BASE_CALLBACK_LIST_H_) +// Do nothing if the Chromium header has already been included. +// This can happen in cases where Chromium code is used directly by the +// client application. When using Chromium code directly always include +// the Chromium header first to avoid type conflicts. +#elif defined(BUILDING_CEF_SHARED) +// When building CEF include the Chromium header directly. +#include "base/callback_list.h" +#else // !BUILDING_CEF_SHARED +// The following is substantially similar to the Chromium implementation. +// If the Chromium implementation diverges the below implementation should be +// updated to match. + +#include + +#include "include/base/cef_basictypes.h" +#include "include/base/cef_callback.h" +#include "include/base/internal/cef_callback_internal.h" +#include "include/base/cef_build.h" +#include "include/base/cef_logging.h" +#include "include/base/cef_macros.h" +#include "include/base/cef_scoped_ptr.h" + +// OVERVIEW: +// +// A container for a list of callbacks. Unlike a normal STL vector or list, +// this container can be modified during iteration without invalidating the +// iterator. It safely handles the case of a callback removing itself +// or another callback from the list while callbacks are being run. +// +// TYPICAL USAGE: +// +// class MyWidget { +// public: +// ... +// +// typedef base::Callback OnFooCallback; +// +// scoped_ptr::Subscription> +// RegisterCallback(const OnFooCallback& cb) { +// return callback_list_.Add(cb); +// } +// +// private: +// void NotifyFoo(const Foo& foo) { +// callback_list_.Notify(foo); +// } +// +// base::CallbackList callback_list_; +// +// DISALLOW_COPY_AND_ASSIGN(MyWidget); +// }; +// +// +// class MyWidgetListener { +// public: +// MyWidgetListener::MyWidgetListener() { +// foo_subscription_ = MyWidget::GetCurrent()->RegisterCallback( +// base::Bind(&MyWidgetListener::OnFoo, this))); +// } +// +// MyWidgetListener::~MyWidgetListener() { +// // Subscription gets deleted automatically and will deregister +// // the callback in the process. +// } +// +// private: +// void OnFoo(const Foo& foo) { +// // Do something. +// } +// +// scoped_ptr::Subscription> +// foo_subscription_; +// +// DISALLOW_COPY_AND_ASSIGN(MyWidgetListener); +// }; + +namespace base { + +namespace cef_internal { + +template +class CallbackListBase { + public: + class Subscription { + public: + Subscription(CallbackListBase* list, + typename std::list::iterator iter) + : list_(list), + iter_(iter) { + } + + ~Subscription() { + if (list_->active_iterator_count_) { + iter_->Reset(); + } else { + list_->callbacks_.erase(iter_); + if (!list_->removal_callback_.is_null()) + list_->removal_callback_.Run(); + } + } + + private: + CallbackListBase* list_; + typename std::list::iterator iter_; + + DISALLOW_COPY_AND_ASSIGN(Subscription); + }; + + // Add a callback to the list. The callback will remain registered until the + // returned Subscription is destroyed, which must occur before the + // CallbackList is destroyed. + scoped_ptr Add(const CallbackType& cb) WARN_UNUSED_RESULT { + DCHECK(!cb.is_null()); + return scoped_ptr( + new Subscription(this, callbacks_.insert(callbacks_.end(), cb))); + } + + // Sets a callback which will be run when a subscription list is changed. + void set_removal_callback(const Closure& callback) { + removal_callback_ = callback; + } + + // Returns true if there are no subscriptions. This is only valid to call when + // not looping through the list. + bool empty() { + DCHECK_EQ(0, active_iterator_count_); + return callbacks_.empty(); + } + + protected: + // An iterator class that can be used to access the list of callbacks. + class Iterator { + public: + explicit Iterator(CallbackListBase* list) + : list_(list), + list_iter_(list_->callbacks_.begin()) { + ++list_->active_iterator_count_; + } + + Iterator(const Iterator& iter) + : list_(iter.list_), + list_iter_(iter.list_iter_) { + ++list_->active_iterator_count_; + } + + ~Iterator() { + if (list_ && --list_->active_iterator_count_ == 0) { + list_->Compact(); + } + } + + CallbackType* GetNext() { + while ((list_iter_ != list_->callbacks_.end()) && list_iter_->is_null()) + ++list_iter_; + + CallbackType* cb = NULL; + if (list_iter_ != list_->callbacks_.end()) { + cb = &(*list_iter_); + ++list_iter_; + } + return cb; + } + + private: + CallbackListBase* list_; + typename std::list::iterator list_iter_; + }; + + CallbackListBase() : active_iterator_count_(0) {} + + ~CallbackListBase() { + DCHECK_EQ(0, active_iterator_count_); + DCHECK_EQ(0U, callbacks_.size()); + } + + // Returns an instance of a CallbackListBase::Iterator which can be used + // to run callbacks. + Iterator GetIterator() { + return Iterator(this); + } + + // Compact the list: remove any entries which were NULLed out during + // iteration. + void Compact() { + typename std::list::iterator it = callbacks_.begin(); + bool updated = false; + while (it != callbacks_.end()) { + if ((*it).is_null()) { + updated = true; + it = callbacks_.erase(it); + } else { + ++it; + } + + if (updated && !removal_callback_.is_null()) + removal_callback_.Run(); + } + } + + private: + std::list callbacks_; + int active_iterator_count_; + Closure removal_callback_; + + DISALLOW_COPY_AND_ASSIGN(CallbackListBase); +}; + +} // namespace cef_internal + +template class CallbackList; + +template <> +class CallbackList + : public cef_internal::CallbackListBase > { + public: + typedef Callback CallbackType; + + CallbackList() {} + + void Notify() { + cef_internal::CallbackListBase::Iterator it = + this->GetIterator(); + CallbackType* cb; + while ((cb = it.GetNext()) != NULL) { + cb->Run(); + } + } + + private: + DISALLOW_COPY_AND_ASSIGN(CallbackList); +}; + +template +class CallbackList + : public cef_internal::CallbackListBase > { + public: + typedef Callback CallbackType; + + CallbackList() {} + + void Notify(typename cef_internal::CallbackParamTraits::ForwardType a1) { + typename cef_internal::CallbackListBase::Iterator it = + this->GetIterator(); + CallbackType* cb; + while ((cb = it.GetNext()) != NULL) { + cb->Run(a1); + } + } + + private: + DISALLOW_COPY_AND_ASSIGN(CallbackList); +}; + +template +class CallbackList + : public cef_internal::CallbackListBase > { + public: + typedef Callback CallbackType; + + CallbackList() {} + + void Notify(typename cef_internal::CallbackParamTraits::ForwardType a1, + typename cef_internal::CallbackParamTraits::ForwardType a2) { + typename cef_internal::CallbackListBase::Iterator it = + this->GetIterator(); + CallbackType* cb; + while ((cb = it.GetNext()) != NULL) { + cb->Run(a1, a2); + } + } + + private: + DISALLOW_COPY_AND_ASSIGN(CallbackList); +}; + +template +class CallbackList + : public cef_internal::CallbackListBase > { + public: + typedef Callback CallbackType; + + CallbackList() {} + + void Notify(typename cef_internal::CallbackParamTraits::ForwardType a1, + typename cef_internal::CallbackParamTraits::ForwardType a2, + typename cef_internal::CallbackParamTraits::ForwardType a3) { + typename cef_internal::CallbackListBase::Iterator it = + this->GetIterator(); + CallbackType* cb; + while ((cb = it.GetNext()) != NULL) { + cb->Run(a1, a2, a3); + } + } + + private: + DISALLOW_COPY_AND_ASSIGN(CallbackList); +}; + +template +class CallbackList + : public cef_internal::CallbackListBase > { + public: + typedef Callback CallbackType; + + CallbackList() {} + + void Notify(typename cef_internal::CallbackParamTraits::ForwardType a1, + typename cef_internal::CallbackParamTraits::ForwardType a2, + typename cef_internal::CallbackParamTraits::ForwardType a3, + typename cef_internal::CallbackParamTraits::ForwardType a4) { + typename cef_internal::CallbackListBase::Iterator it = + this->GetIterator(); + CallbackType* cb; + while ((cb = it.GetNext()) != NULL) { + cb->Run(a1, a2, a3, a4); + } + } + + private: + DISALLOW_COPY_AND_ASSIGN(CallbackList); +}; + +template +class CallbackList + : public cef_internal::CallbackListBase > { + public: + typedef Callback CallbackType; + + CallbackList() {} + + void Notify(typename cef_internal::CallbackParamTraits::ForwardType a1, + typename cef_internal::CallbackParamTraits::ForwardType a2, + typename cef_internal::CallbackParamTraits::ForwardType a3, + typename cef_internal::CallbackParamTraits::ForwardType a4, + typename cef_internal::CallbackParamTraits::ForwardType a5) { + typename cef_internal::CallbackListBase::Iterator it = + this->GetIterator(); + CallbackType* cb; + while ((cb = it.GetNext()) != NULL) { + cb->Run(a1, a2, a3, a4, a5); + } + } + + private: + DISALLOW_COPY_AND_ASSIGN(CallbackList); +}; + +template +class CallbackList + : public cef_internal::CallbackListBase > { + public: + typedef Callback CallbackType; + + CallbackList() {} + + void Notify(typename cef_internal::CallbackParamTraits::ForwardType a1, + typename cef_internal::CallbackParamTraits::ForwardType a2, + typename cef_internal::CallbackParamTraits::ForwardType a3, + typename cef_internal::CallbackParamTraits::ForwardType a4, + typename cef_internal::CallbackParamTraits::ForwardType a5, + typename cef_internal::CallbackParamTraits::ForwardType a6) { + typename cef_internal::CallbackListBase::Iterator it = + this->GetIterator(); + CallbackType* cb; + while ((cb = it.GetNext()) != NULL) { + cb->Run(a1, a2, a3, a4, a5, a6); + } + } + + private: + DISALLOW_COPY_AND_ASSIGN(CallbackList); +}; + +template +class CallbackList + : public cef_internal::CallbackListBase > { + public: + typedef Callback CallbackType; + + CallbackList() {} + + void Notify(typename cef_internal::CallbackParamTraits::ForwardType a1, + typename cef_internal::CallbackParamTraits::ForwardType a2, + typename cef_internal::CallbackParamTraits::ForwardType a3, + typename cef_internal::CallbackParamTraits::ForwardType a4, + typename cef_internal::CallbackParamTraits::ForwardType a5, + typename cef_internal::CallbackParamTraits::ForwardType a6, + typename cef_internal::CallbackParamTraits::ForwardType a7) { + typename cef_internal::CallbackListBase::Iterator it = + this->GetIterator(); + CallbackType* cb; + while ((cb = it.GetNext()) != NULL) { + cb->Run(a1, a2, a3, a4, a5, a6, a7); + } + } + + private: + DISALLOW_COPY_AND_ASSIGN(CallbackList); +}; + +} // namespace base + +#endif // !BUILDING_CEF_SHARED + +#endif // CEF_INCLUDE_BASE_CEF_CALLBACK_LIST_H_ diff --git a/dependencies64/cef/include/base/cef_cancelable_callback.h b/dependencies64/cef/include/base/cef_cancelable_callback.h new file mode 100644 index 000000000..8ad3bf3bb --- /dev/null +++ b/dependencies64/cef/include/base/cef_cancelable_callback.h @@ -0,0 +1,314 @@ +// Copyright (c) 2014 Marshall A. Greenblatt. Portions copyright (c) 2011 +// Google Inc. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// CancelableCallback is a wrapper around base::Callback that allows +// cancellation of a callback. CancelableCallback takes a reference on the +// wrapped callback until this object is destroyed or Reset()/Cancel() are +// called. +// +// NOTE: +// +// Calling CancelableCallback::Cancel() brings the object back to its natural, +// default-constructed state, i.e., CancelableCallback::callback() will return +// a null callback. +// +// THREAD-SAFETY: +// +// CancelableCallback objects must be created on, posted to, cancelled on, and +// destroyed on the same thread. +// +// +// EXAMPLE USAGE: +// +// In the following example, the test is verifying that RunIntensiveTest() +// Quit()s the message loop within 4 seconds. The cancelable callback is posted +// to the message loop, the intensive test runs, the message loop is run, +// then the callback is cancelled. +// +// void TimeoutCallback(const std::string& timeout_message) { +// FAIL() << timeout_message; +// MessageLoop::current()->QuitWhenIdle(); +// } +// +// CancelableClosure timeout(base::Bind(&TimeoutCallback, "Test timed out.")); +// MessageLoop::current()->PostDelayedTask(FROM_HERE, timeout.callback(), +// 4000) // 4 seconds to run. +// RunIntensiveTest(); +// MessageLoop::current()->Run(); +// timeout.Cancel(); // Hopefully this is hit before the timeout callback runs. +// + +#ifndef CEF_INCLUDE_BASE_CEF_CANCELABLE_CALLBACK_H_ +#define CEF_INCLUDE_BASE_CEF_CANCELABLE_CALLBACK_H_ +#pragma once + +#if defined(BASE_CANCELABLE_CALLBACK_H_) +// Do nothing if the Chromium header has already been included. +// This can happen in cases where Chromium code is used directly by the +// client application. When using Chromium code directly always include +// the Chromium header first to avoid type conflicts. +#elif defined(BUILDING_CEF_SHARED) +// When building CEF include the Chromium header directly. +#include "base/cancelable_callback.h" +#else // !BUILDING_CEF_SHARED +// The following is substantially similar to the Chromium implementation. +// If the Chromium implementation diverges the below implementation should be +// updated to match. + +#include "include/base/cef_bind.h" +#include "include/base/cef_callback.h" +#include "include/base/cef_build.h" +#include "include/base/cef_logging.h" +#include "include/base/cef_macros.h" +#include "include/base/cef_weak_ptr.h" +#include "include/base/internal/cef_callback_internal.h" + +namespace base { + +template +class CancelableCallback; + +template <> +class CancelableCallback { + public: + CancelableCallback() : weak_factory_(this) {} + + // |callback| must not be null. + explicit CancelableCallback(const base::Callback& callback) + : weak_factory_(this), + callback_(callback) { + DCHECK(!callback.is_null()); + InitializeForwarder(); + } + + ~CancelableCallback() {} + + // Cancels and drops the reference to the wrapped callback. + void Cancel() { + weak_factory_.InvalidateWeakPtrs(); + forwarder_.Reset(); + callback_.Reset(); + } + + // Returns true if the wrapped callback has been cancelled. + bool IsCancelled() const { + return callback_.is_null(); + } + + // Sets |callback| as the closure that may be cancelled. |callback| may not + // be null. Outstanding and any previously wrapped callbacks are cancelled. + void Reset(const base::Callback& callback) { + DCHECK(!callback.is_null()); + + // Outstanding tasks (e.g., posted to a message loop) must not be called. + Cancel(); + + // |forwarder_| is no longer valid after Cancel(), so re-bind. + InitializeForwarder(); + + callback_ = callback; + } + + // Returns a callback that can be disabled by calling Cancel(). + const base::Callback& callback() const { + return forwarder_; + } + + private: + void Forward() { + callback_.Run(); + } + + // Helper method to bind |forwarder_| using a weak pointer from + // |weak_factory_|. + void InitializeForwarder() { + forwarder_ = base::Bind(&CancelableCallback::Forward, + weak_factory_.GetWeakPtr()); + } + + // Used to ensure Forward() is not run when this object is destroyed. + base::WeakPtrFactory > weak_factory_; + + // The wrapper closure. + base::Callback forwarder_; + + // The stored closure that may be cancelled. + base::Callback callback_; + + DISALLOW_COPY_AND_ASSIGN(CancelableCallback); +}; + +template +class CancelableCallback { + public: + CancelableCallback() : weak_factory_(this) {} + + // |callback| must not be null. + explicit CancelableCallback(const base::Callback& callback) + : weak_factory_(this), + callback_(callback) { + DCHECK(!callback.is_null()); + InitializeForwarder(); + } + + ~CancelableCallback() {} + + // Cancels and drops the reference to the wrapped callback. + void Cancel() { + weak_factory_.InvalidateWeakPtrs(); + forwarder_.Reset(); + callback_.Reset(); + } + + // Returns true if the wrapped callback has been cancelled. + bool IsCancelled() const { + return callback_.is_null(); + } + + // Sets |callback| as the closure that may be cancelled. |callback| may not + // be null. Outstanding and any previously wrapped callbacks are cancelled. + void Reset(const base::Callback& callback) { + DCHECK(!callback.is_null()); + + // Outstanding tasks (e.g., posted to a message loop) must not be called. + Cancel(); + + // |forwarder_| is no longer valid after Cancel(), so re-bind. + InitializeForwarder(); + + callback_ = callback; + } + + // Returns a callback that can be disabled by calling Cancel(). + const base::Callback& callback() const { + return forwarder_; + } + + private: + void Forward(A1 a1) const { + callback_.Run(a1); + } + + // Helper method to bind |forwarder_| using a weak pointer from + // |weak_factory_|. + void InitializeForwarder() { + forwarder_ = base::Bind(&CancelableCallback::Forward, + weak_factory_.GetWeakPtr()); + } + + // Used to ensure Forward() is not run when this object is destroyed. + base::WeakPtrFactory > weak_factory_; + + // The wrapper closure. + base::Callback forwarder_; + + // The stored closure that may be cancelled. + base::Callback callback_; + + DISALLOW_COPY_AND_ASSIGN(CancelableCallback); +}; + +template +class CancelableCallback { + public: + CancelableCallback() : weak_factory_(this) {} + + // |callback| must not be null. + explicit CancelableCallback(const base::Callback& callback) + : weak_factory_(this), + callback_(callback) { + DCHECK(!callback.is_null()); + InitializeForwarder(); + } + + ~CancelableCallback() {} + + // Cancels and drops the reference to the wrapped callback. + void Cancel() { + weak_factory_.InvalidateWeakPtrs(); + forwarder_.Reset(); + callback_.Reset(); + } + + // Returns true if the wrapped callback has been cancelled. + bool IsCancelled() const { + return callback_.is_null(); + } + + // Sets |callback| as the closure that may be cancelled. |callback| may not + // be null. Outstanding and any previously wrapped callbacks are cancelled. + void Reset(const base::Callback& callback) { + DCHECK(!callback.is_null()); + + // Outstanding tasks (e.g., posted to a message loop) must not be called. + Cancel(); + + // |forwarder_| is no longer valid after Cancel(), so re-bind. + InitializeForwarder(); + + callback_ = callback; + } + + // Returns a callback that can be disabled by calling Cancel(). + const base::Callback& callback() const { + return forwarder_; + } + + private: + void Forward(A1 a1, A2 a2) const { + callback_.Run(a1, a2); + } + + // Helper method to bind |forwarder_| using a weak pointer from + // |weak_factory_|. + void InitializeForwarder() { + forwarder_ = base::Bind(&CancelableCallback::Forward, + weak_factory_.GetWeakPtr()); + } + + // Used to ensure Forward() is not run when this object is destroyed. + base::WeakPtrFactory > weak_factory_; + + // The wrapper closure. + base::Callback forwarder_; + + // The stored closure that may be cancelled. + base::Callback callback_; + + DISALLOW_COPY_AND_ASSIGN(CancelableCallback); +}; + +typedef CancelableCallback CancelableClosure; + +} // namespace base + +#endif // !BUILDING_CEF_SHARED + +#endif // CEF_INCLUDE_BASE_CEF_CANCELABLE_CALLBACK_H_ diff --git a/dependencies64/cef/include/base/cef_lock.h b/dependencies64/cef/include/base/cef_lock.h new file mode 100644 index 000000000..febcc9a96 --- /dev/null +++ b/dependencies64/cef/include/base/cef_lock.h @@ -0,0 +1,167 @@ +// Copyright (c) 2014 Marshall A. Greenblatt. Portions copyright (c) 2011 +// Google Inc. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#ifndef CEF_INCLUDE_BASE_CEF_LOCK_H_ +#define CEF_INCLUDE_BASE_CEF_LOCK_H_ +#pragma once + +#if defined(BASE_SYNCHRONIZATION_LOCK_H_) +// Do nothing if the Chromium header has already been included. +// This can happen in cases where Chromium code is used directly by the +// client application. When using Chromium code directly always include +// the Chromium header first to avoid type conflicts. +#elif defined(BUILDING_CEF_SHARED) +// When building CEF include the Chromium header directly. +#include "base/synchronization/lock.h" +#else // !BUILDING_CEF_SHARED +// The following is substantially similar to the Chromium implementation. +// If the Chromium implementation diverges the below implementation should be +// updated to match. + +#include "include/base/cef_macros.h" +#include "include/base/cef_platform_thread.h" +#include "include/base/internal/cef_lock_impl.h" + +namespace base { + +// A convenient wrapper for an OS specific critical section. The only real +// intelligence in this class is in debug mode for the support for the +// AssertAcquired() method. +class Lock { + public: +#if defined(NDEBUG) // Optimized wrapper implementation + Lock() : lock_() {} + ~Lock() {} + void Acquire() { lock_.Lock(); } + void Release() { lock_.Unlock(); } + + // If the lock is not held, take it and return true. If the lock is already + // held by another thread, immediately return false. This must not be called + // by a thread already holding the lock (what happens is undefined and an + // assertion may fail). + bool Try() { return lock_.Try(); } + + // Null implementation if not debug. + void AssertAcquired() const {} +#else + Lock(); + ~Lock(); + + // NOTE: Although windows critical sections support recursive locks, we do not + // allow this, and we will commonly fire a DCHECK() if a thread attempts to + // acquire the lock a second time (while already holding it). + void Acquire() { + lock_.Lock(); + CheckUnheldAndMark(); + } + void Release() { + CheckHeldAndUnmark(); + lock_.Unlock(); + } + + bool Try() { + bool rv = lock_.Try(); + if (rv) { + CheckUnheldAndMark(); + } + return rv; + } + + void AssertAcquired() const; +#endif // NDEBUG + + private: +#if !defined(NDEBUG) + // Members and routines taking care of locks assertions. + // Note that this checks for recursive locks and allows them + // if the variable is set. This is allowed by the underlying implementation + // on windows but not on Posix, so we're doing unneeded checks on Posix. + // It's worth it to share the code. + void CheckHeldAndUnmark(); + void CheckUnheldAndMark(); + + // All private data is implicitly protected by lock_. + // Be VERY careful to only access members under that lock. + base::PlatformThreadRef owning_thread_ref_; +#endif // NDEBUG + + // Platform specific underlying lock implementation. + cef_internal::LockImpl lock_; + + DISALLOW_COPY_AND_ASSIGN(Lock); +}; + +// A helper class that acquires the given Lock while the AutoLock is in scope. +class AutoLock { + public: + struct AlreadyAcquired {}; + + explicit AutoLock(Lock& lock) : lock_(lock) { + lock_.Acquire(); + } + + AutoLock(Lock& lock, const AlreadyAcquired&) : lock_(lock) { + lock_.AssertAcquired(); + } + + ~AutoLock() { + lock_.AssertAcquired(); + lock_.Release(); + } + + private: + Lock& lock_; + DISALLOW_COPY_AND_ASSIGN(AutoLock); +}; + +// AutoUnlock is a helper that will Release() the |lock| argument in the +// constructor, and re-Acquire() it in the destructor. +class AutoUnlock { + public: + explicit AutoUnlock(Lock& lock) : lock_(lock) { + // We require our caller to have the lock. + lock_.AssertAcquired(); + lock_.Release(); + } + + ~AutoUnlock() { + lock_.Acquire(); + } + + private: + Lock& lock_; + DISALLOW_COPY_AND_ASSIGN(AutoUnlock); +}; + +} // namespace base + +#endif // !BUILDING_CEF_SHARED + +#endif // CEF_INCLUDE_BASE_CEF_LOCK_H_ diff --git a/dependencies64/cef/include/base/cef_logging.h b/dependencies64/cef/include/base/cef_logging.h new file mode 100644 index 000000000..b3951f12e --- /dev/null +++ b/dependencies64/cef/include/base/cef_logging.h @@ -0,0 +1,746 @@ +// Copyright (c) 2014 Marshall A. Greenblatt. Portions copyright (c) 2012 +// Google Inc. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// The contents of this file are only available to applications that link +// against the libcef_dll_wrapper target. +// +// WARNING: Logging macros should not be used in the main/browser process before +// calling CefInitialize or in sub-processes before calling CefExecuteProcess. +// +// Instructions +// ------------ +// +// Make a bunch of macros for logging. The way to log things is to stream +// things to LOG(). E.g., +// +// LOG(INFO) << "Found " << num_cookies << " cookies"; +// +// You can also do conditional logging: +// +// LOG_IF(INFO, num_cookies > 10) << "Got lots of cookies"; +// +// The CHECK(condition) macro is active in both debug and release builds and +// effectively performs a LOG(FATAL) which terminates the process and +// generates a crashdump unless a debugger is attached. +// +// There are also "debug mode" logging macros like the ones above: +// +// DLOG(INFO) << "Found cookies"; +// +// DLOG_IF(INFO, num_cookies > 10) << "Got lots of cookies"; +// +// All "debug mode" logging is compiled away to nothing for non-debug mode +// compiles. LOG_IF and development flags also work well together +// because the code can be compiled away sometimes. +// +// We also have +// +// LOG_ASSERT(assertion); +// DLOG_ASSERT(assertion); +// +// which is syntactic sugar for {,D}LOG_IF(FATAL, assert fails) << assertion; +// +// There are "verbose level" logging macros. They look like +// +// VLOG(1) << "I'm printed when you run the program with --v=1 or more"; +// VLOG(2) << "I'm printed when you run the program with --v=2 or more"; +// +// These always log at the INFO log level (when they log at all). +// The verbose logging can also be turned on module-by-module. For instance, +// --vmodule=profile=2,icon_loader=1,browser_*=3,*/chromeos/*=4 --v=0 +// will cause: +// a. VLOG(2) and lower messages to be printed from profile.{h,cc} +// b. VLOG(1) and lower messages to be printed from icon_loader.{h,cc} +// c. VLOG(3) and lower messages to be printed from files prefixed with +// "browser" +// d. VLOG(4) and lower messages to be printed from files under a +// "chromeos" directory. +// e. VLOG(0) and lower messages to be printed from elsewhere +// +// The wildcarding functionality shown by (c) supports both '*' (match +// 0 or more characters) and '?' (match any single character) +// wildcards. Any pattern containing a forward or backward slash will +// be tested against the whole pathname and not just the module. +// E.g., "*/foo/bar/*=2" would change the logging level for all code +// in source files under a "foo/bar" directory. +// +// There's also VLOG_IS_ON(n) "verbose level" condition macro. To be used as +// +// if (VLOG_IS_ON(2)) { +// // do some logging preparation and logging +// // that can't be accomplished with just VLOG(2) << ...; +// } +// +// There is also a VLOG_IF "verbose level" condition macro for sample +// cases, when some extra computation and preparation for logs is not +// needed. +// +// VLOG_IF(1, (size > 1024)) +// << "I'm printed when size is more than 1024 and when you run the " +// "program with --v=1 or more"; +// +// We also override the standard 'assert' to use 'DLOG_ASSERT'. +// +// Lastly, there is: +// +// PLOG(ERROR) << "Couldn't do foo"; +// DPLOG(ERROR) << "Couldn't do foo"; +// PLOG_IF(ERROR, cond) << "Couldn't do foo"; +// DPLOG_IF(ERROR, cond) << "Couldn't do foo"; +// PCHECK(condition) << "Couldn't do foo"; +// DPCHECK(condition) << "Couldn't do foo"; +// +// which append the last system error to the message in string form (taken from +// GetLastError() on Windows and errno on POSIX). +// +// The supported severity levels for macros that allow you to specify one +// are (in increasing order of severity) INFO, WARNING, ERROR, and FATAL. +// +// Very important: logging a message at the FATAL severity level causes +// the program to terminate (after the message is logged). +// +// There is the special severity of DFATAL, which logs FATAL in debug mode, +// ERROR in normal mode. +// + +#ifndef CEF_INCLUDE_BASE_CEF_LOGGING_H_ +#define CEF_INCLUDE_BASE_CEF_LOGGING_H_ +#pragma once + +#if defined(DCHECK) +// Do nothing if the macros provided by this header already exist. +// This can happen in cases where Chromium code is used directly by the +// client application. When using Chromium code directly always include +// the Chromium header first to avoid type conflicts. +#elif defined(BUILDING_CEF_SHARED) +// When building CEF include the Chromium header directly. +#include "base/logging.h" +#else // !BUILDING_CEF_SHARED +// The following is substantially similar to the Chromium implementation. +// If the Chromium implementation diverges the below implementation should be +// updated to match. + +#include +#include +#include +#include + +#include "include/base/cef_build.h" +#include "include/base/cef_macros.h" +#include "include/internal/cef_logging_internal.h" + +namespace cef { +namespace logging { + +// Gets the current log level. +inline int GetMinLogLevel() { + return cef_get_min_log_level(); +} + +// Gets the current vlog level for the given file (usually taken from +// __FILE__). Note that |N| is the size *with* the null terminator. +template +int GetVlogLevel(const char (&file)[N]) { + return cef_get_vlog_level(file, N); +} + +typedef int LogSeverity; +const LogSeverity LOG_VERBOSE = -1; // This is level 1 verbosity +// Note: the log severities are used to index into the array of names, +// see log_severity_names. +const LogSeverity LOG_INFO = 0; +const LogSeverity LOG_WARNING = 1; +const LogSeverity LOG_ERROR = 2; +const LogSeverity LOG_FATAL = 3; +const LogSeverity LOG_NUM_SEVERITIES = 4; + +// LOG_DFATAL is LOG_FATAL in debug mode, ERROR in normal mode +#ifdef NDEBUG +const LogSeverity LOG_DFATAL = LOG_ERROR; +#else +const LogSeverity LOG_DFATAL = LOG_FATAL; +#endif + +// A few definitions of macros that don't generate much code. These are used +// by LOG() and LOG_IF, etc. Since these are used all over our code, it's +// better to have compact code for these operations. +#define COMPACT_GOOGLE_LOG_EX_INFO(ClassName, ...) \ + cef::logging::ClassName(__FILE__, __LINE__, cef::logging::LOG_INFO , \ + ##__VA_ARGS__) +#define COMPACT_GOOGLE_LOG_EX_WARNING(ClassName, ...) \ + cef::logging::ClassName(__FILE__, __LINE__, cef::logging::LOG_WARNING , \ + ##__VA_ARGS__) +#define COMPACT_GOOGLE_LOG_EX_ERROR(ClassName, ...) \ + cef::logging::ClassName(__FILE__, __LINE__, cef::logging::LOG_ERROR , \ + ##__VA_ARGS__) +#define COMPACT_GOOGLE_LOG_EX_FATAL(ClassName, ...) \ + cef::logging::ClassName(__FILE__, __LINE__, cef::logging::LOG_FATAL , \ + ##__VA_ARGS__) +#define COMPACT_GOOGLE_LOG_EX_DFATAL(ClassName, ...) \ + cef::logging::ClassName(__FILE__, __LINE__, cef::logging::LOG_DFATAL , \ + ##__VA_ARGS__) + +#define COMPACT_GOOGLE_LOG_INFO \ + COMPACT_GOOGLE_LOG_EX_INFO(LogMessage) +#define COMPACT_GOOGLE_LOG_WARNING \ + COMPACT_GOOGLE_LOG_EX_WARNING(LogMessage) +#define COMPACT_GOOGLE_LOG_ERROR \ + COMPACT_GOOGLE_LOG_EX_ERROR(LogMessage) +#define COMPACT_GOOGLE_LOG_FATAL \ + COMPACT_GOOGLE_LOG_EX_FATAL(LogMessage) +#define COMPACT_GOOGLE_LOG_DFATAL \ + COMPACT_GOOGLE_LOG_EX_DFATAL(LogMessage) + +#if defined(OS_WIN) +// wingdi.h defines ERROR to be 0. When we call LOG(ERROR), it gets +// substituted with 0, and it expands to COMPACT_GOOGLE_LOG_0. To allow us +// to keep using this syntax, we define this macro to do the same thing +// as COMPACT_GOOGLE_LOG_ERROR, and also define ERROR the same way that +// the Windows SDK does for consistency. +#define ERROR 0 +#define COMPACT_GOOGLE_LOG_EX_0(ClassName, ...) \ + COMPACT_GOOGLE_LOG_EX_ERROR(ClassName , ##__VA_ARGS__) +#define COMPACT_GOOGLE_LOG_0 COMPACT_GOOGLE_LOG_ERROR +// Needed for LOG_IS_ON(ERROR). +const LogSeverity LOG_0 = LOG_ERROR; +#endif + +// As special cases, we can assume that LOG_IS_ON(FATAL) always holds. Also, +// LOG_IS_ON(DFATAL) always holds in debug mode. In particular, CHECK()s will +// always fire if they fail. +#define LOG_IS_ON(severity) \ + ((::cef::logging::LOG_ ## severity) >= ::cef::logging::GetMinLogLevel()) + +// We can't do any caching tricks with VLOG_IS_ON() like the +// google-glog version since it requires GCC extensions. This means +// that using the v-logging functions in conjunction with --vmodule +// may be slow. +#define VLOG_IS_ON(verboselevel) \ + ((verboselevel) <= ::cef::logging::GetVlogLevel(__FILE__)) + +// Helper macro which avoids evaluating the arguments to a stream if +// the condition doesn't hold. +#define LAZY_STREAM(stream, condition) \ + !(condition) ? (void) 0 : ::cef::logging::LogMessageVoidify() & (stream) + +// We use the preprocessor's merging operator, "##", so that, e.g., +// LOG(INFO) becomes the token COMPACT_GOOGLE_LOG_INFO. There's some funny +// subtle difference between ostream member streaming functions (e.g., +// ostream::operator<<(int) and ostream non-member streaming functions +// (e.g., ::operator<<(ostream&, string&): it turns out that it's +// impossible to stream something like a string directly to an unnamed +// ostream. We employ a neat hack by calling the stream() member +// function of LogMessage which seems to avoid the problem. +#define LOG_STREAM(severity) COMPACT_GOOGLE_LOG_ ## severity.stream() + +#define LOG(severity) LAZY_STREAM(LOG_STREAM(severity), LOG_IS_ON(severity)) +#define LOG_IF(severity, condition) \ + LAZY_STREAM(LOG_STREAM(severity), LOG_IS_ON(severity) && (condition)) + +#define SYSLOG(severity) LOG(severity) +#define SYSLOG_IF(severity, condition) LOG_IF(severity, condition) + +// The VLOG macros log with negative verbosities. +#define VLOG_STREAM(verbose_level) \ + cef::logging::LogMessage(__FILE__, __LINE__, -verbose_level).stream() + +#define VLOG(verbose_level) \ + LAZY_STREAM(VLOG_STREAM(verbose_level), VLOG_IS_ON(verbose_level)) + +#define VLOG_IF(verbose_level, condition) \ + LAZY_STREAM(VLOG_STREAM(verbose_level), \ + VLOG_IS_ON(verbose_level) && (condition)) + +#if defined (OS_WIN) +#define VPLOG_STREAM(verbose_level) \ + cef::logging::Win32ErrorLogMessage(__FILE__, __LINE__, -verbose_level, \ + ::cef::logging::GetLastSystemErrorCode()).stream() +#elif defined(OS_POSIX) +#define VPLOG_STREAM(verbose_level) \ + cef::logging::ErrnoLogMessage(__FILE__, __LINE__, -verbose_level, \ + ::cef::logging::GetLastSystemErrorCode()).stream() +#endif + +#define VPLOG(verbose_level) \ + LAZY_STREAM(VPLOG_STREAM(verbose_level), VLOG_IS_ON(verbose_level)) + +#define VPLOG_IF(verbose_level, condition) \ + LAZY_STREAM(VPLOG_STREAM(verbose_level), \ + VLOG_IS_ON(verbose_level) && (condition)) + +// TODO(akalin): Add more VLOG variants, e.g. VPLOG. + +#define LOG_ASSERT(condition) \ + LOG_IF(FATAL, !(condition)) << "Assert failed: " #condition ". " +#define SYSLOG_ASSERT(condition) \ + SYSLOG_IF(FATAL, !(condition)) << "Assert failed: " #condition ". " + +#if defined(OS_WIN) +#define PLOG_STREAM(severity) \ + COMPACT_GOOGLE_LOG_EX_ ## severity(Win32ErrorLogMessage, \ + ::cef::logging::GetLastSystemErrorCode()).stream() +#elif defined(OS_POSIX) +#define PLOG_STREAM(severity) \ + COMPACT_GOOGLE_LOG_EX_ ## severity(ErrnoLogMessage, \ + ::cef::logging::GetLastSystemErrorCode()).stream() +#endif + +#define PLOG(severity) \ + LAZY_STREAM(PLOG_STREAM(severity), LOG_IS_ON(severity)) + +#define PLOG_IF(severity, condition) \ + LAZY_STREAM(PLOG_STREAM(severity), LOG_IS_ON(severity) && (condition)) + +// The actual stream used isn't important. +#define EAT_STREAM_PARAMETERS \ + true ? (void) 0 : ::cef::logging::LogMessageVoidify() & LOG_STREAM(FATAL) + +// CHECK dies with a fatal error if condition is not true. It is *not* +// controlled by NDEBUG, so the check will be executed regardless of +// compilation mode. +// +// We make sure CHECK et al. always evaluates their arguments, as +// doing CHECK(FunctionWithSideEffect()) is a common idiom. + +#define CHECK(condition) \ + LAZY_STREAM(LOG_STREAM(FATAL), !(condition)) \ + << "Check failed: " #condition ". " + +#define PCHECK(condition) \ + LAZY_STREAM(PLOG_STREAM(FATAL), !(condition)) \ + << "Check failed: " #condition ". " + +// Helper macro for binary operators. +// Don't use this macro directly in your code, use CHECK_EQ et al below. +// +// TODO(akalin): Rewrite this so that constructs like if (...) +// CHECK_EQ(...) else { ... } work properly. +#define CHECK_OP(name, op, val1, val2) \ + if (std::string* _result = \ + cef::logging::Check##name##Impl((val1), (val2), \ + #val1 " " #op " " #val2)) \ + cef::logging::LogMessage(__FILE__, __LINE__, _result).stream() + +// Build the error message string. This is separate from the "Impl" +// function template because it is not performance critical and so can +// be out of line, while the "Impl" code should be inline. Caller +// takes ownership of the returned string. +template +std::string* MakeCheckOpString(const t1& v1, const t2& v2, const char* names) { + std::ostringstream ss; + ss << names << " (" << v1 << " vs. " << v2 << ")"; + std::string* msg = new std::string(ss.str()); + return msg; +} + +// MSVC doesn't like complex extern templates and DLLs. +#if !defined(COMPILER_MSVC) +// Commonly used instantiations of MakeCheckOpString<>. Explicitly instantiated +// in logging.cc. +extern template std::string* MakeCheckOpString( + const int&, const int&, const char* names); +extern template +std::string* MakeCheckOpString( + const unsigned long&, const unsigned long&, const char* names); +extern template +std::string* MakeCheckOpString( + const unsigned long&, const unsigned int&, const char* names); +extern template +std::string* MakeCheckOpString( + const unsigned int&, const unsigned long&, const char* names); +extern template +std::string* MakeCheckOpString( + const std::string&, const std::string&, const char* name); +#endif + +// Helper functions for CHECK_OP macro. +// The (int, int) specialization works around the issue that the compiler +// will not instantiate the template version of the function on values of +// unnamed enum type - see comment below. +#define DEFINE_CHECK_OP_IMPL(name, op) \ + template \ + inline std::string* Check##name##Impl(const t1& v1, const t2& v2, \ + const char* names) { \ + if (v1 op v2) return NULL; \ + else return MakeCheckOpString(v1, v2, names); \ + } \ + inline std::string* Check##name##Impl(int v1, int v2, const char* names) { \ + if (v1 op v2) return NULL; \ + else return MakeCheckOpString(v1, v2, names); \ + } +DEFINE_CHECK_OP_IMPL(EQ, ==) +DEFINE_CHECK_OP_IMPL(NE, !=) +DEFINE_CHECK_OP_IMPL(LE, <=) +DEFINE_CHECK_OP_IMPL(LT, < ) +DEFINE_CHECK_OP_IMPL(GE, >=) +DEFINE_CHECK_OP_IMPL(GT, > ) +#undef DEFINE_CHECK_OP_IMPL + +#define CHECK_EQ(val1, val2) CHECK_OP(EQ, ==, val1, val2) +#define CHECK_NE(val1, val2) CHECK_OP(NE, !=, val1, val2) +#define CHECK_LE(val1, val2) CHECK_OP(LE, <=, val1, val2) +#define CHECK_LT(val1, val2) CHECK_OP(LT, < , val1, val2) +#define CHECK_GE(val1, val2) CHECK_OP(GE, >=, val1, val2) +#define CHECK_GT(val1, val2) CHECK_OP(GT, > , val1, val2) + +#if defined(NDEBUG) +#define ENABLE_DLOG 0 +#else +#define ENABLE_DLOG 1 +#endif + +#if defined(NDEBUG) && !defined(DCHECK_ALWAYS_ON) +#define DCHECK_IS_ON 0 +#else +#define DCHECK_IS_ON 1 +#endif + +// Definitions for DLOG et al. + +#if ENABLE_DLOG + +#define DLOG_IS_ON(severity) LOG_IS_ON(severity) +#define DLOG_IF(severity, condition) LOG_IF(severity, condition) +#define DLOG_ASSERT(condition) LOG_ASSERT(condition) +#define DPLOG_IF(severity, condition) PLOG_IF(severity, condition) +#define DVLOG_IF(verboselevel, condition) VLOG_IF(verboselevel, condition) +#define DVPLOG_IF(verboselevel, condition) VPLOG_IF(verboselevel, condition) + +#else // ENABLE_DLOG + +// If ENABLE_DLOG is off, we want to avoid emitting any references to +// |condition| (which may reference a variable defined only if NDEBUG +// is not defined). Contrast this with DCHECK et al., which has +// different behavior. + +#define DLOG_IS_ON(severity) false +#define DLOG_IF(severity, condition) EAT_STREAM_PARAMETERS +#define DLOG_ASSERT(condition) EAT_STREAM_PARAMETERS +#define DPLOG_IF(severity, condition) EAT_STREAM_PARAMETERS +#define DVLOG_IF(verboselevel, condition) EAT_STREAM_PARAMETERS +#define DVPLOG_IF(verboselevel, condition) EAT_STREAM_PARAMETERS + +#endif // ENABLE_DLOG + +// DEBUG_MODE is for uses like +// if (DEBUG_MODE) foo.CheckThatFoo(); +// instead of +// #ifndef NDEBUG +// foo.CheckThatFoo(); +// #endif +// +// We tie its state to ENABLE_DLOG. +enum { DEBUG_MODE = ENABLE_DLOG }; + +#undef ENABLE_DLOG + +#define DLOG(severity) \ + LAZY_STREAM(LOG_STREAM(severity), DLOG_IS_ON(severity)) + +#define DPLOG(severity) \ + LAZY_STREAM(PLOG_STREAM(severity), DLOG_IS_ON(severity)) + +#define DVLOG(verboselevel) DVLOG_IF(verboselevel, VLOG_IS_ON(verboselevel)) + +#define DVPLOG(verboselevel) DVPLOG_IF(verboselevel, VLOG_IS_ON(verboselevel)) + +// Definitions for DCHECK et al. + +#if DCHECK_IS_ON + +#define COMPACT_GOOGLE_LOG_EX_DCHECK(ClassName, ...) \ + COMPACT_GOOGLE_LOG_EX_FATAL(ClassName , ##__VA_ARGS__) +#define COMPACT_GOOGLE_LOG_DCHECK COMPACT_GOOGLE_LOG_FATAL +const LogSeverity LOG_DCHECK = LOG_FATAL; + +#else // DCHECK_IS_ON + +// These are just dummy values. +#define COMPACT_GOOGLE_LOG_EX_DCHECK(ClassName, ...) \ + COMPACT_GOOGLE_LOG_EX_INFO(ClassName , ##__VA_ARGS__) +#define COMPACT_GOOGLE_LOG_DCHECK COMPACT_GOOGLE_LOG_INFO +const LogSeverity LOG_DCHECK = LOG_INFO; + +#endif // DCHECK_IS_ON + +// DCHECK et al. make sure to reference |condition| regardless of +// whether DCHECKs are enabled; this is so that we don't get unused +// variable warnings if the only use of a variable is in a DCHECK. +// This behavior is different from DLOG_IF et al. + +#define DCHECK(condition) \ + LAZY_STREAM(LOG_STREAM(DCHECK), DCHECK_IS_ON && !(condition)) \ + << "Check failed: " #condition ". " + +#define DPCHECK(condition) \ + LAZY_STREAM(PLOG_STREAM(DCHECK), DCHECK_IS_ON && !(condition)) \ + << "Check failed: " #condition ". " + +// Helper macro for binary operators. +// Don't use this macro directly in your code, use DCHECK_EQ et al below. +#define DCHECK_OP(name, op, val1, val2) \ + if (DCHECK_IS_ON) \ + if (std::string* _result = \ + cef::logging::Check##name##Impl((val1), (val2), \ + #val1 " " #op " " #val2)) \ + cef::logging::LogMessage( \ + __FILE__, __LINE__, ::cef::logging::LOG_DCHECK, \ + _result).stream() + +// Equality/Inequality checks - compare two values, and log a +// LOG_DCHECK message including the two values when the result is not +// as expected. The values must have operator<<(ostream, ...) +// defined. +// +// You may append to the error message like so: +// DCHECK_NE(1, 2) << ": The world must be ending!"; +// +// We are very careful to ensure that each argument is evaluated exactly +// once, and that anything which is legal to pass as a function argument is +// legal here. In particular, the arguments may be temporary expressions +// which will end up being destroyed at the end of the apparent statement, +// for example: +// DCHECK_EQ(string("abc")[1], 'b'); +// +// WARNING: These may not compile correctly if one of the arguments is a pointer +// and the other is NULL. To work around this, simply static_cast NULL to the +// type of the desired pointer. + +#define DCHECK_EQ(val1, val2) DCHECK_OP(EQ, ==, val1, val2) +#define DCHECK_NE(val1, val2) DCHECK_OP(NE, !=, val1, val2) +#define DCHECK_LE(val1, val2) DCHECK_OP(LE, <=, val1, val2) +#define DCHECK_LT(val1, val2) DCHECK_OP(LT, < , val1, val2) +#define DCHECK_GE(val1, val2) DCHECK_OP(GE, >=, val1, val2) +#define DCHECK_GT(val1, val2) DCHECK_OP(GT, > , val1, val2) + +#if defined(NDEBUG) && defined(OS_CHROMEOS) +#define NOTREACHED() LOG(ERROR) << "NOTREACHED() hit in " << \ + __FUNCTION__ << ". " +#else +#define NOTREACHED() DCHECK(false) +#endif + +// Redefine the standard assert to use our nice log files +#undef assert +#define assert(x) DLOG_ASSERT(x) + +// This class more or less represents a particular log message. You +// create an instance of LogMessage and then stream stuff to it. +// When you finish streaming to it, ~LogMessage is called and the +// full message gets streamed to the appropriate destination. +// +// You shouldn't actually use LogMessage's constructor to log things, +// though. You should use the LOG() macro (and variants thereof) +// above. +class LogMessage { + public: + // Used for LOG(severity). + LogMessage(const char* file, int line, LogSeverity severity); + + // Used for CHECK_EQ(), etc. Takes ownership of the given string. + // Implied severity = LOG_FATAL. + LogMessage(const char* file, int line, std::string* result); + + // Used for DCHECK_EQ(), etc. Takes ownership of the given string. + LogMessage(const char* file, int line, LogSeverity severity, + std::string* result); + + ~LogMessage(); + + std::ostream& stream() { return stream_; } + + private: + LogSeverity severity_; + std::ostringstream stream_; + + // The file and line information passed in to the constructor. + const char* file_; + const int line_; + +#if defined(OS_WIN) + // Stores the current value of GetLastError in the constructor and restores + // it in the destructor by calling SetLastError. + // This is useful since the LogMessage class uses a lot of Win32 calls + // that will lose the value of GLE and the code that called the log function + // will have lost the thread error value when the log call returns. + class SaveLastError { + public: + SaveLastError(); + ~SaveLastError(); + + unsigned long get_error() const { return last_error_; } + + protected: + unsigned long last_error_; + }; + + SaveLastError last_error_; +#endif + + DISALLOW_COPY_AND_ASSIGN(LogMessage); +}; + +// A non-macro interface to the log facility; (useful +// when the logging level is not a compile-time constant). +inline void LogAtLevel(int const log_level, std::string const &msg) { + LogMessage(__FILE__, __LINE__, log_level).stream() << msg; +} + +// This class is used to explicitly ignore values in the conditional +// logging macros. This avoids compiler warnings like "value computed +// is not used" and "statement has no effect". +class LogMessageVoidify { + public: + LogMessageVoidify() { } + // This has to be an operator with a precedence lower than << but + // higher than ?: + void operator&(std::ostream&) { } +}; + +#if defined(OS_WIN) +typedef unsigned long SystemErrorCode; +#elif defined(OS_POSIX) +typedef int SystemErrorCode; +#endif + +// Alias for ::GetLastError() on Windows and errno on POSIX. Avoids having to +// pull in windows.h just for GetLastError() and DWORD. +SystemErrorCode GetLastSystemErrorCode(); +std::string SystemErrorCodeToString(SystemErrorCode error_code); + +#if defined(OS_WIN) +// Appends a formatted system message of the GetLastError() type. +class Win32ErrorLogMessage { + public: + Win32ErrorLogMessage(const char* file, + int line, + LogSeverity severity, + SystemErrorCode err); + + // Appends the error message before destructing the encapsulated class. + ~Win32ErrorLogMessage(); + + std::ostream& stream() { return log_message_.stream(); } + + private: + SystemErrorCode err_; + LogMessage log_message_; + + DISALLOW_COPY_AND_ASSIGN(Win32ErrorLogMessage); +}; +#elif defined(OS_POSIX) +// Appends a formatted system message of the errno type +class ErrnoLogMessage { + public: + ErrnoLogMessage(const char* file, + int line, + LogSeverity severity, + SystemErrorCode err); + + // Appends the error message before destructing the encapsulated class. + ~ErrnoLogMessage(); + + std::ostream& stream() { return log_message_.stream(); } + + private: + SystemErrorCode err_; + LogMessage log_message_; + + DISALLOW_COPY_AND_ASSIGN(ErrnoLogMessage); +}; +#endif // OS_WIN + +} // namespace logging +} // namespace cef + +// These functions are provided as a convenience for logging, which is where we +// use streams (it is against Google style to use streams in other places). It +// is designed to allow you to emit non-ASCII Unicode strings to the log file, +// which is normally ASCII. It is relatively slow, so try not to use it for +// common cases. Non-ASCII characters will be converted to UTF-8 by these +// operators. +std::ostream& operator<<(std::ostream& out, const wchar_t* wstr); +inline std::ostream& operator<<(std::ostream& out, const std::wstring& wstr) { + return out << wstr.c_str(); +} + +// The NOTIMPLEMENTED() macro annotates codepaths which have +// not been implemented yet. +// +// The implementation of this macro is controlled by NOTIMPLEMENTED_POLICY: +// 0 -- Do nothing (stripped by compiler) +// 1 -- Warn at compile time +// 2 -- Fail at compile time +// 3 -- Fail at runtime (DCHECK) +// 4 -- [default] LOG(ERROR) at runtime +// 5 -- LOG(ERROR) at runtime, only once per call-site + +#ifndef NOTIMPLEMENTED_POLICY +#if defined(OS_ANDROID) && defined(OFFICIAL_BUILD) +#define NOTIMPLEMENTED_POLICY 0 +#else +// Select default policy: LOG(ERROR) +#define NOTIMPLEMENTED_POLICY 4 +#endif +#endif + +#if defined(COMPILER_GCC) +// On Linux, with GCC, we can use __PRETTY_FUNCTION__ to get the demangled name +// of the current function in the NOTIMPLEMENTED message. +#define NOTIMPLEMENTED_MSG "Not implemented reached in " << __PRETTY_FUNCTION__ +#else +#define NOTIMPLEMENTED_MSG "NOT IMPLEMENTED" +#endif + +#if NOTIMPLEMENTED_POLICY == 0 +#define NOTIMPLEMENTED() EAT_STREAM_PARAMETERS +#elif NOTIMPLEMENTED_POLICY == 1 +// TODO, figure out how to generate a warning +#define NOTIMPLEMENTED() COMPILE_ASSERT(false, NOT_IMPLEMENTED) +#elif NOTIMPLEMENTED_POLICY == 2 +#define NOTIMPLEMENTED() COMPILE_ASSERT(false, NOT_IMPLEMENTED) +#elif NOTIMPLEMENTED_POLICY == 3 +#define NOTIMPLEMENTED() NOTREACHED() +#elif NOTIMPLEMENTED_POLICY == 4 +#define NOTIMPLEMENTED() LOG(ERROR) << NOTIMPLEMENTED_MSG +#elif NOTIMPLEMENTED_POLICY == 5 +#define NOTIMPLEMENTED() do {\ + static bool logged_once = false;\ + LOG_IF(ERROR, !logged_once) << NOTIMPLEMENTED_MSG;\ + logged_once = true;\ +} while(0);\ +EAT_STREAM_PARAMETERS +#endif + +#endif // !BUILDING_CEF_SHARED + +#endif // CEF_INCLUDE_BASE_CEF_LOGGING_H_ diff --git a/dependencies64/cef/include/base/cef_macros.h b/dependencies64/cef/include/base/cef_macros.h new file mode 100644 index 000000000..83f0af941 --- /dev/null +++ b/dependencies64/cef/include/base/cef_macros.h @@ -0,0 +1,218 @@ +// Copyright (c) 2014 Marshall A. Greenblatt. Portions copyright (c) 2012 +// Google Inc. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#ifndef CEF_INCLUDE_BASE_CEF_MACROS_H_ +#define CEF_INCLUDE_BASE_CEF_MACROS_H_ +#pragma once + +#if defined(BUILDING_CEF_SHARED) +// When building CEF include the Chromium header directly. +#include "base/macros.h" +#else // !BUILDING_CEF_SHARED +// The following is substantially similar to the Chromium implementation. +// If the Chromium implementation diverges the below implementation should be +// updated to match. + +#include // For size_t. + +#if !defined(ALLOW_THIS_IN_INITIALIZER_LIST) +#if defined(COMPILER_MSVC) + +// MSVC_PUSH_DISABLE_WARNING pushes |n| onto a stack of warnings to be disabled. +// The warning remains disabled until popped by MSVC_POP_WARNING. +#define MSVC_PUSH_DISABLE_WARNING(n) __pragma(warning(push)) \ + __pragma(warning(disable:n)) + +// MSVC_PUSH_WARNING_LEVEL pushes |n| as the global warning level. The level +// remains in effect until popped by MSVC_POP_WARNING(). Use 0 to disable all +// warnings. +#define MSVC_PUSH_WARNING_LEVEL(n) __pragma(warning(push, n)) + +// Pop effects of innermost MSVC_PUSH_* macro. +#define MSVC_POP_WARNING() __pragma(warning(pop)) + +// Allows |this| to be passed as an argument in constructor initializer lists. +// This uses push/pop instead of the seemingly simpler suppress feature to avoid +// having the warning be disabled for more than just |code|. +// +// Example usage: +// Foo::Foo() : x(NULL), ALLOW_THIS_IN_INITIALIZER_LIST(y(this)), z(3) {} +// +// Compiler warning C4355: 'this': used in base member initializer list: +// http://msdn.microsoft.com/en-us/library/3c594ae3(VS.80).aspx +#define ALLOW_THIS_IN_INITIALIZER_LIST(code) MSVC_PUSH_DISABLE_WARNING(4355) \ + code \ + MSVC_POP_WARNING() +#else // !COMPILER_MSVC + +#define ALLOW_THIS_IN_INITIALIZER_LIST(code) code + +#endif // !COMPILER_MSVC +#endif // !ALLOW_THIS_IN_INITIALIZER_LIST + +#if !defined(arraysize) + +// The arraysize(arr) macro returns the # of elements in an array arr. +// The expression is a compile-time constant, and therefore can be +// used in defining new arrays, for example. If you use arraysize on +// a pointer by mistake, you will get a compile-time error. +// +// One caveat is that arraysize() doesn't accept any array of an +// anonymous type or a type defined inside a function. In these rare +// cases, you have to use the unsafe ARRAYSIZE_UNSAFE() macro below. This is +// due to a limitation in C++'s template system. The limitation might +// eventually be removed, but it hasn't happened yet. + +// This template function declaration is used in defining arraysize. +// Note that the function doesn't need an implementation, as we only +// use its type. +template +char (&ArraySizeHelper(T (&array)[N]))[N]; + +// That gcc wants both of these prototypes seems mysterious. VC, for +// its part, can't decide which to use (another mystery). Matching of +// template overloads: the final frontier. +#ifndef _MSC_VER +template +char (&ArraySizeHelper(const T (&array)[N]))[N]; +#endif + +#define arraysize(array) (sizeof(ArraySizeHelper(array))) + +#endif // !arraysize + +#if !defined(DISALLOW_COPY_AND_ASSIGN) + +// A macro to disallow the copy constructor and operator= functions +// This should be used in the private: declarations for a class +#define DISALLOW_COPY_AND_ASSIGN(TypeName) \ + TypeName(const TypeName&); \ + void operator=(const TypeName&) + +#endif // !DISALLOW_COPY_AND_ASSIGN + +#if !defined(DISALLOW_IMPLICIT_CONSTRUCTORS) + +// A macro to disallow all the implicit constructors, namely the +// default constructor, copy constructor and operator= functions. +// +// This should be used in the private: declarations for a class +// that wants to prevent anyone from instantiating it. This is +// especially useful for classes containing only static methods. +#define DISALLOW_IMPLICIT_CONSTRUCTORS(TypeName) \ + TypeName(); \ + DISALLOW_COPY_AND_ASSIGN(TypeName) + +#endif // !DISALLOW_IMPLICIT_CONSTRUCTORS + +#if !defined(COMPILE_ASSERT) + +// The COMPILE_ASSERT macro can be used to verify that a compile time +// expression is true. For example, you could use it to verify the +// size of a static array: +// +// COMPILE_ASSERT(ARRAYSIZE_UNSAFE(content_type_names) == CONTENT_NUM_TYPES, +// content_type_names_incorrect_size); +// +// or to make sure a struct is smaller than a certain size: +// +// COMPILE_ASSERT(sizeof(foo) < 128, foo_too_large); +// +// The second argument to the macro is the name of the variable. If +// the expression is false, most compilers will issue a warning/error +// containing the name of the variable. + +#if __cplusplus >= 201103L + +// Under C++11, just use static_assert. +#define COMPILE_ASSERT(expr, msg) static_assert(expr, #msg) + +#else + +namespace cef { + +template +struct CompileAssert { +}; + +} // namespace cef + +#define COMPILE_ASSERT(expr, msg) \ + typedef cef::CompileAssert<(bool(expr))> msg[bool(expr) ? 1 : -1] \ + ALLOW_UNUSED_TYPE + +// Implementation details of COMPILE_ASSERT: +// +// - COMPILE_ASSERT works by defining an array type that has -1 +// elements (and thus is invalid) when the expression is false. +// +// - The simpler definition +// +// #define COMPILE_ASSERT(expr, msg) typedef char msg[(expr) ? 1 : -1] +// +// does not work, as gcc supports variable-length arrays whose sizes +// are determined at run-time (this is gcc's extension and not part +// of the C++ standard). As a result, gcc fails to reject the +// following code with the simple definition: +// +// int foo; +// COMPILE_ASSERT(foo, msg); // not supposed to compile as foo is +// // not a compile-time constant. +// +// - By using the type CompileAssert<(bool(expr))>, we ensures that +// expr is a compile-time constant. (Template arguments must be +// determined at compile-time.) +// +// - The outer parentheses in CompileAssert<(bool(expr))> are necessary +// to work around a bug in gcc 3.4.4 and 4.0.1. If we had written +// +// CompileAssert +// +// instead, these compilers will refuse to compile +// +// COMPILE_ASSERT(5 > 0, some_message); +// +// (They seem to think the ">" in "5 > 0" marks the end of the +// template argument list.) +// +// - The array size is (bool(expr) ? 1 : -1), instead of simply +// +// ((expr) ? 1 : -1). +// +// This is to avoid running into a bug in MS VC 7.1, which +// causes ((0.0) ? 1 : -1) to incorrectly evaluate to 1. + +#endif // !(__cplusplus >= 201103L) + +#endif // !defined(COMPILE_ASSERT) + +#endif // !BUILDING_CEF_SHARED + +#endif // CEF_INCLUDE_BASE_CEF_MACROS_H_ diff --git a/dependencies64/cef/include/base/cef_move.h b/dependencies64/cef/include/base/cef_move.h new file mode 100644 index 000000000..91069297d --- /dev/null +++ b/dependencies64/cef/include/base/cef_move.h @@ -0,0 +1,259 @@ +// Copyright (c) 2014 Marshall A. Greenblatt. Portions copyright (c) 2012 +// Google Inc. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#ifndef CEF_INCLUDE_BASE_CEF_MOVE_H_ +#define CEF_INCLUDE_BASE_CEF_MOVE_H_ + +#if defined(MOVE_ONLY_TYPE_FOR_CPP_03) +// Do nothing if the macro in this header has already been defined. +// This can happen in cases where Chromium code is used directly by the +// client application. When using Chromium code directly always include +// the Chromium header first to avoid type conflicts. +#elif defined(BUILDING_CEF_SHARED) +// When building CEF include the Chromium header directly. +#include "base/move.h" +#else // !BUILDING_CEF_SHARED +// The following is substantially similar to the Chromium implementation. +// If the Chromium implementation diverges the below implementation should be +// updated to match. + +// Macro with the boilerplate that makes a type move-only in C++03. +// +// USAGE +// +// This macro should be used instead of DISALLOW_COPY_AND_ASSIGN to create +// a "move-only" type. Unlike DISALLOW_COPY_AND_ASSIGN, this macro should be +// the first line in a class declaration. +// +// A class using this macro must call .Pass() (or somehow be an r-value already) +// before it can be: +// +// * Passed as a function argument +// * Used as the right-hand side of an assignment +// * Returned from a function +// +// Each class will still need to define their own "move constructor" and "move +// operator=" to make this useful. Here's an example of the macro, the move +// constructor, and the move operator= from the scoped_ptr class: +// +// template +// class scoped_ptr { +// MOVE_ONLY_TYPE_FOR_CPP_03(scoped_ptr, RValue) +// public: +// scoped_ptr(RValue& other) : ptr_(other.release()) { } +// scoped_ptr& operator=(RValue& other) { +// swap(other); +// return *this; +// } +// }; +// +// Note that the constructor must NOT be marked explicit. +// +// For consistency, the second parameter to the macro should always be RValue +// unless you have a strong reason to do otherwise. It is only exposed as a +// macro parameter so that the move constructor and move operator= don't look +// like they're using a phantom type. +// +// +// HOW THIS WORKS +// +// For a thorough explanation of this technique, see: +// +// http://en.wikibooks.org/wiki/More_C%2B%2B_Idioms/Move_Constructor +// +// The summary is that we take advantage of 2 properties: +// +// 1) non-const references will not bind to r-values. +// 2) C++ can apply one user-defined conversion when initializing a +// variable. +// +// The first lets us disable the copy constructor and assignment operator +// by declaring private version of them with a non-const reference parameter. +// +// For l-values, direct initialization still fails like in +// DISALLOW_COPY_AND_ASSIGN because the copy constructor and assignment +// operators are private. +// +// For r-values, the situation is different. The copy constructor and +// assignment operator are not viable due to (1), so we are trying to call +// a non-existent constructor and non-existing operator= rather than a private +// one. Since we have not committed an error quite yet, we can provide an +// alternate conversion sequence and a constructor. We add +// +// * a private struct named "RValue" +// * a user-defined conversion "operator RValue()" +// * a "move constructor" and "move operator=" that take the RValue& as +// their sole parameter. +// +// Only r-values will trigger this sequence and execute our "move constructor" +// or "move operator=." L-values will match the private copy constructor and +// operator= first giving a "private in this context" error. This combination +// gives us a move-only type. +// +// For signaling a destructive transfer of data from an l-value, we provide a +// method named Pass() which creates an r-value for the current instance +// triggering the move constructor or move operator=. +// +// Other ways to get r-values is to use the result of an expression like a +// function call. +// +// Here's an example with comments explaining what gets triggered where: +// +// class Foo { +// MOVE_ONLY_TYPE_FOR_CPP_03(Foo, RValue); +// +// public: +// ... API ... +// Foo(RValue other); // Move constructor. +// Foo& operator=(RValue rhs); // Move operator= +// }; +// +// Foo MakeFoo(); // Function that returns a Foo. +// +// Foo f; +// Foo f_copy(f); // ERROR: Foo(Foo&) is private in this context. +// Foo f_assign; +// f_assign = f; // ERROR: operator=(Foo&) is private in this context. +// +// +// Foo f(MakeFoo()); // R-value so alternate conversion executed. +// Foo f_copy(f.Pass()); // R-value so alternate conversion executed. +// f = f_copy.Pass(); // R-value so alternate conversion executed. +// +// +// IMPLEMENTATION SUBTLETIES WITH RValue +// +// The RValue struct is just a container for a pointer back to the original +// object. It should only ever be created as a temporary, and no external +// class should ever declare it or use it in a parameter. +// +// It is tempting to want to use the RValue type in function parameters, but +// excluding the limited usage here for the move constructor and move +// operator=, doing so would mean that the function could take both r-values +// and l-values equially which is unexpected. See COMPARED To Boost.Move for +// more details. +// +// An alternate, and incorrect, implementation of the RValue class used by +// Boost.Move makes RValue a fieldless child of the move-only type. RValue& +// is then used in place of RValue in the various operators. The RValue& is +// "created" by doing *reinterpret_cast(this). This has the appeal +// of never creating a temporary RValue struct even with optimizations +// disabled. Also, by virtue of inheritance you can treat the RValue +// reference as if it were the move-only type itself. Unfortunately, +// using the result of this reinterpret_cast<> is actually undefined behavior +// due to C++98 5.2.10.7. In certain compilers (e.g., NaCl) the optimizer +// will generate non-working code. +// +// In optimized builds, both implementations generate the same assembly so we +// choose the one that adheres to the standard. +// +// +// WHY HAVE typedef void MoveOnlyTypeForCPP03 +// +// Callback<>/Bind() needs to understand movable-but-not-copyable semantics +// to call .Pass() appropriately when it is expected to transfer the value. +// The cryptic typedef MoveOnlyTypeForCPP03 is added to make this check +// easy and automatic in helper templates for Callback<>/Bind(). +// See IsMoveOnlyType template and its usage in base/callback_internal.h +// for more details. +// +// +// COMPARED TO C++11 +// +// In C++11, you would implement this functionality using an r-value reference +// and our .Pass() method would be replaced with a call to std::move(). +// +// This emulation also has a deficiency where it uses up the single +// user-defined conversion allowed by C++ during initialization. This can +// cause problems in some API edge cases. For instance, in scoped_ptr, it is +// impossible to make a function "void Foo(scoped_ptr p)" accept a +// value of type scoped_ptr even if you add a constructor to +// scoped_ptr<> that would make it look like it should work. C++11 does not +// have this deficiency. +// +// +// COMPARED TO Boost.Move +// +// Our implementation similar to Boost.Move, but we keep the RValue struct +// private to the move-only type, and we don't use the reinterpret_cast<> hack. +// +// In Boost.Move, RValue is the boost::rv<> template. This type can be used +// when writing APIs like: +// +// void MyFunc(boost::rv& f) +// +// that can take advantage of rv<> to avoid extra copies of a type. However you +// would still be able to call this version of MyFunc with an l-value: +// +// Foo f; +// MyFunc(f); // Uh oh, we probably just destroyed |f| w/o calling Pass(). +// +// unless someone is very careful to also declare a parallel override like: +// +// void MyFunc(const Foo& f) +// +// that would catch the l-values first. This was declared unsafe in C++11 and +// a C++11 compiler will explicitly fail MyFunc(f). Unfortunately, we cannot +// ensure this in C++03. +// +// Since we have no need for writing such APIs yet, our implementation keeps +// RValue private and uses a .Pass() method to do the conversion instead of +// trying to write a version of "std::move()." Writing an API like std::move() +// would require the RValue struct to be public. +// +// +// CAVEATS +// +// If you include a move-only type as a field inside a class that does not +// explicitly declare a copy constructor, the containing class's implicit +// copy constructor will change from Containing(const Containing&) to +// Containing(Containing&). This can cause some unexpected errors. +// +// http://llvm.org/bugs/show_bug.cgi?id=11528 +// +// The workaround is to explicitly declare your copy constructor. +// +#define MOVE_ONLY_TYPE_FOR_CPP_03(type, rvalue_type) \ + private: \ + struct rvalue_type { \ + explicit rvalue_type(type* object) : object(object) {} \ + type* object; \ + }; \ + type(type&); \ + void operator=(type&); \ + public: \ + operator rvalue_type() { return rvalue_type(this); } \ + type Pass() { return type(rvalue_type(this)); } \ + typedef void MoveOnlyTypeForCPP03; \ + private: + +#endif // !BUILDING_CEF_SHARED + +#endif // CEF_INCLUDE_BASE_CEF_MOVE_H_ diff --git a/dependencies64/cef/include/base/cef_platform_thread.h b/dependencies64/cef/include/base/cef_platform_thread.h new file mode 100644 index 000000000..cda1dc45b --- /dev/null +++ b/dependencies64/cef/include/base/cef_platform_thread.h @@ -0,0 +1,113 @@ +// Copyright (c) 2014 Marshall A. Greenblatt. Portions copyright (c) 2011 +// Google Inc. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +// WARNING: You should *NOT* be using this class directly. PlatformThread is +// the low-level platform-specific abstraction to the OS's threading interface. +// You should instead be using a message-loop driven Thread, see thread.h. + +#ifndef CEF_INCLUDE_BASE_PLATFORM_THREAD_H_ +#define CEF_INCLUDE_BASE_PLATFORM_THREAD_H_ + +#if defined(BASE_THREADING_PLATFORM_THREAD_H_) +// Do nothing if the Chromium header has already been included. +// This can happen in cases where Chromium code is used directly by the +// client application. When using Chromium code directly always include +// the Chromium header first to avoid type conflicts. +#elif defined(BUILDING_CEF_SHARED) +// When building CEF include the Chromium header directly. +#include "base/threading/platform_thread.h" +#else // !BUILDING_CEF_SHARED +// The following is substantially similar to the Chromium implementation. +// If the Chromium implementation diverges the below implementation should be +// updated to match. + +#include "include/base/cef_basictypes.h" +#include "include/base/cef_build.h" +#include "include/internal/cef_thread_internal.h" + +namespace base { + +// Used for logging. Always an integer value. +typedef cef_platform_thread_id_t PlatformThreadId; + +// Used for thread checking and debugging. +// Meant to be as fast as possible. +// These are produced by PlatformThread::CurrentRef(), and used to later +// check if we are on the same thread or not by using ==. These are safe +// to copy between threads, but can't be copied to another process as they +// have no meaning there. Also, the internal identifier can be re-used +// after a thread dies, so a PlatformThreadRef cannot be reliably used +// to distinguish a new thread from an old, dead thread. +class PlatformThreadRef { + public: + typedef cef_platform_thread_handle_t RefType; + + PlatformThreadRef() + : id_(0) { + } + + explicit PlatformThreadRef(RefType id) + : id_(id) { + } + + bool operator==(PlatformThreadRef other) const { + return id_ == other.id_; + } + + bool is_null() const { + return id_ == 0; + } + private: + RefType id_; +}; + +// A namespace for low-level thread functions. +// Chromium uses a class with static methods but CEF uses an actual namespace +// to avoid linker problems with the sandbox libaries on Windows. +namespace PlatformThread { + +// Gets the current thread id, which may be useful for logging purposes. +inline PlatformThreadId CurrentId() { + return cef_get_current_platform_thread_id(); +} + +// Gets the current thread reference, which can be used to check if +// we're on the right thread quickly. +inline PlatformThreadRef CurrentRef() { + return PlatformThreadRef(cef_get_current_platform_thread_handle()); +} + +} // namespace PlatformThread + +} // namespace base + +#endif // !BUILDING_CEF_SHARED + +#endif // CEF_INCLUDE_BASE_PLATFORM_THREAD_H_ diff --git a/dependencies64/cef/include/base/cef_ref_counted.h b/dependencies64/cef/include/base/cef_ref_counted.h new file mode 100644 index 000000000..55d41e1b4 --- /dev/null +++ b/dependencies64/cef/include/base/cef_ref_counted.h @@ -0,0 +1,386 @@ +// Copyright (c) 2014 Marshall A. Greenblatt. Portions copyright (c) 2012 +// Google Inc. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// + +#ifndef CEF_INCLUDE_BASE_CEF_REF_COUNTED_H_ +#define CEF_INCLUDE_BASE_CEF_REF_COUNTED_H_ +#pragma once + +#if defined(BASE_MEMORY_REF_COUNTED_H_) +// Do nothing if the Chromium header has already been included. +// This can happen in cases where Chromium code is used directly by the +// client application. When using Chromium code directly always include +// the Chromium header first to avoid type conflicts. +#elif defined(BUILDING_CEF_SHARED) +// When building CEF include the Chromium header directly. +#include "base/memory/ref_counted.h" +#else // !BUILDING_CEF_SHARED +// The following is substantially similar to the Chromium implementation. +// If the Chromium implementation diverges the below implementation should be +// updated to match. + +#include + +#include "include/base/cef_atomic_ref_count.h" +#include "include/base/cef_build.h" +#ifndef NDEBUG +#include "include/base/cef_logging.h" +#endif +#include "include/base/cef_thread_collision_warner.h" + +namespace base { + +namespace subtle { + +class RefCountedBase { + public: + bool HasOneRef() const { return ref_count_ == 1; } + + protected: + RefCountedBase() + : ref_count_(0) + #ifndef NDEBUG + , in_dtor_(false) + #endif + { + } + + ~RefCountedBase() { + #ifndef NDEBUG + DCHECK(in_dtor_) << "RefCounted object deleted without calling Release()"; + #endif + } + + + void AddRef() const { + // TODO(maruel): Add back once it doesn't assert 500 times/sec. + // Current thread books the critical section "AddRelease" + // without release it. + // DFAKE_SCOPED_LOCK_THREAD_LOCKED(add_release_); + #ifndef NDEBUG + DCHECK(!in_dtor_); + #endif + ++ref_count_; + } + + // Returns true if the object should self-delete. + bool Release() const { + // TODO(maruel): Add back once it doesn't assert 500 times/sec. + // Current thread books the critical section "AddRelease" + // without release it. + // DFAKE_SCOPED_LOCK_THREAD_LOCKED(add_release_); + #ifndef NDEBUG + DCHECK(!in_dtor_); + #endif + if (--ref_count_ == 0) { + #ifndef NDEBUG + in_dtor_ = true; + #endif + return true; + } + return false; + } + + private: + mutable int ref_count_; +#ifndef NDEBUG + mutable bool in_dtor_; +#endif + + DFAKE_MUTEX(add_release_); + + DISALLOW_COPY_AND_ASSIGN(RefCountedBase); +}; + +class RefCountedThreadSafeBase { + public: + bool HasOneRef() const; + + protected: + RefCountedThreadSafeBase(); + ~RefCountedThreadSafeBase(); + + void AddRef() const; + + // Returns true if the object should self-delete. + bool Release() const; + + private: + mutable AtomicRefCount ref_count_; +#ifndef NDEBUG + mutable bool in_dtor_; +#endif + + DISALLOW_COPY_AND_ASSIGN(RefCountedThreadSafeBase); +}; + +} // namespace subtle + +// +// A base class for reference counted classes. Otherwise, known as a cheap +// knock-off of WebKit's RefCounted class. To use this guy just extend your +// class from it like so: +// +// class MyFoo : public base::RefCounted { +// ... +// private: +// friend class base::RefCounted; +// ~MyFoo(); +// }; +// +// You should always make your destructor private, to avoid any code deleting +// the object accidently while there are references to it. +template +class RefCounted : public subtle::RefCountedBase { + public: + RefCounted() {} + + void AddRef() const { + subtle::RefCountedBase::AddRef(); + } + + void Release() const { + if (subtle::RefCountedBase::Release()) { + delete static_cast(this); + } + } + + protected: + ~RefCounted() {} + + private: + DISALLOW_COPY_AND_ASSIGN(RefCounted); +}; + +// Forward declaration. +template class RefCountedThreadSafe; + +// Default traits for RefCountedThreadSafe. Deletes the object when its ref +// count reaches 0. Overload to delete it on a different thread etc. +template +struct DefaultRefCountedThreadSafeTraits { + static void Destruct(const T* x) { + // Delete through RefCountedThreadSafe to make child classes only need to be + // friend with RefCountedThreadSafe instead of this struct, which is an + // implementation detail. + RefCountedThreadSafe::DeleteInternal(x); + } +}; + +// +// A thread-safe variant of RefCounted +// +// class MyFoo : public base::RefCountedThreadSafe { +// ... +// }; +// +// If you're using the default trait, then you should add compile time +// asserts that no one else is deleting your object. i.e. +// private: +// friend class base::RefCountedThreadSafe; +// ~MyFoo(); +template > +class RefCountedThreadSafe : public subtle::RefCountedThreadSafeBase { + public: + RefCountedThreadSafe() {} + + void AddRef() const { + subtle::RefCountedThreadSafeBase::AddRef(); + } + + void Release() const { + if (subtle::RefCountedThreadSafeBase::Release()) { + Traits::Destruct(static_cast(this)); + } + } + + protected: + ~RefCountedThreadSafe() {} + + private: + friend struct DefaultRefCountedThreadSafeTraits; + static void DeleteInternal(const T* x) { delete x; } + + DISALLOW_COPY_AND_ASSIGN(RefCountedThreadSafe); +}; + +// +// A thread-safe wrapper for some piece of data so we can place other +// things in scoped_refptrs<>. +// +template +class RefCountedData + : public base::RefCountedThreadSafe< base::RefCountedData > { + public: + RefCountedData() : data() {} + RefCountedData(const T& in_value) : data(in_value) {} + + T data; + + private: + friend class base::RefCountedThreadSafe >; + ~RefCountedData() {} +}; + +} // namespace base + +// +// A smart pointer class for reference counted objects. Use this class instead +// of calling AddRef and Release manually on a reference counted object to +// avoid common memory leaks caused by forgetting to Release an object +// reference. Sample usage: +// +// class MyFoo : public RefCounted { +// ... +// }; +// +// void some_function() { +// scoped_refptr foo = new MyFoo(); +// foo->Method(param); +// // |foo| is released when this function returns +// } +// +// void some_other_function() { +// scoped_refptr foo = new MyFoo(); +// ... +// foo = NULL; // explicitly releases |foo| +// ... +// if (foo) +// foo->Method(param); +// } +// +// The above examples show how scoped_refptr acts like a pointer to T. +// Given two scoped_refptr classes, it is also possible to exchange +// references between the two objects, like so: +// +// { +// scoped_refptr a = new MyFoo(); +// scoped_refptr b; +// +// b.swap(a); +// // now, |b| references the MyFoo object, and |a| references NULL. +// } +// +// To make both |a| and |b| in the above example reference the same MyFoo +// object, simply use the assignment operator: +// +// { +// scoped_refptr a = new MyFoo(); +// scoped_refptr b; +// +// b = a; +// // now, |a| and |b| each own a reference to the same MyFoo object. +// } +// +template +class scoped_refptr { + public: + typedef T element_type; + + scoped_refptr() : ptr_(NULL) { + } + + scoped_refptr(T* p) : ptr_(p) { + if (ptr_) + ptr_->AddRef(); + } + + scoped_refptr(const scoped_refptr& r) : ptr_(r.ptr_) { + if (ptr_) + ptr_->AddRef(); + } + + template + scoped_refptr(const scoped_refptr& r) : ptr_(r.get()) { + if (ptr_) + ptr_->AddRef(); + } + + ~scoped_refptr() { + if (ptr_) + ptr_->Release(); + } + + T* get() const { return ptr_; } + + // Allow scoped_refptr to be used in boolean expression + // and comparison operations. + operator T*() const { return ptr_; } + + T* operator->() const { + assert(ptr_ != NULL); + return ptr_; + } + + scoped_refptr& operator=(T* p) { + // AddRef first so that self assignment should work + if (p) + p->AddRef(); + T* old_ptr = ptr_; + ptr_ = p; + if (old_ptr) + old_ptr->Release(); + return *this; + } + + scoped_refptr& operator=(const scoped_refptr& r) { + return *this = r.ptr_; + } + + template + scoped_refptr& operator=(const scoped_refptr& r) { + return *this = r.get(); + } + + void swap(T** pp) { + T* p = ptr_; + ptr_ = *pp; + *pp = p; + } + + void swap(scoped_refptr& r) { + swap(&r.ptr_); + } + + protected: + T* ptr_; +}; + +// Handy utility for creating a scoped_refptr out of a T* explicitly without +// having to retype all the template arguments +template +scoped_refptr make_scoped_refptr(T* t) { + return scoped_refptr(t); +} + +#endif // !BUILDING_CEF_SHARED + +#endif // CEF_INCLUDE_BASE_CEF_REF_COUNTED_H_ diff --git a/dependencies64/cef/include/base/cef_scoped_ptr.h b/dependencies64/cef/include/base/cef_scoped_ptr.h new file mode 100644 index 000000000..ed6c706f7 --- /dev/null +++ b/dependencies64/cef/include/base/cef_scoped_ptr.h @@ -0,0 +1,624 @@ +// Copyright (c) 2014 Marshall A. Greenblatt. Portions copyright (c) 2012 +// Google Inc. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +// Scopers help you manage ownership of a pointer, helping you easily manage a +// pointer within a scope, and automatically destroying the pointer at the end +// of a scope. There are two main classes you will use, which correspond to the +// operators new/delete and new[]/delete[]. +// +// Example usage (scoped_ptr): +// { +// scoped_ptr foo(new Foo("wee")); +// } // foo goes out of scope, releasing the pointer with it. +// +// { +// scoped_ptr foo; // No pointer managed. +// foo.reset(new Foo("wee")); // Now a pointer is managed. +// foo.reset(new Foo("wee2")); // Foo("wee") was destroyed. +// foo.reset(new Foo("wee3")); // Foo("wee2") was destroyed. +// foo->Method(); // Foo::Method() called. +// foo.get()->Method(); // Foo::Method() called. +// SomeFunc(foo.release()); // SomeFunc takes ownership, foo no longer +// // manages a pointer. +// foo.reset(new Foo("wee4")); // foo manages a pointer again. +// foo.reset(); // Foo("wee4") destroyed, foo no longer +// // manages a pointer. +// } // foo wasn't managing a pointer, so nothing was destroyed. +// +// Example usage (scoped_ptr): +// { +// scoped_ptr foo(new Foo[100]); +// foo.get()->Method(); // Foo::Method on the 0th element. +// foo[10].Method(); // Foo::Method on the 10th element. +// } +// +// These scopers also implement part of the functionality of C++11 unique_ptr +// in that they are "movable but not copyable." You can use the scopers in +// the parameter and return types of functions to signify ownership transfer +// in to and out of a function. When calling a function that has a scoper +// as the argument type, it must be called with the result of an analogous +// scoper's Pass() function or another function that generates a temporary; +// passing by copy will NOT work. Here is an example using scoped_ptr: +// +// void TakesOwnership(scoped_ptr arg) { +// // Do something with arg +// } +// scoped_ptr CreateFoo() { +// // No need for calling Pass() because we are constructing a temporary +// // for the return value. +// return scoped_ptr(new Foo("new")); +// } +// scoped_ptr PassThru(scoped_ptr arg) { +// return arg.Pass(); +// } +// +// { +// scoped_ptr ptr(new Foo("yay")); // ptr manages Foo("yay"). +// TakesOwnership(ptr.Pass()); // ptr no longer owns Foo("yay"). +// scoped_ptr ptr2 = CreateFoo(); // ptr2 owns the return Foo. +// scoped_ptr ptr3 = // ptr3 now owns what was in ptr2. +// PassThru(ptr2.Pass()); // ptr2 is correspondingly NULL. +// } +// +// Notice that if you do not call Pass() when returning from PassThru(), or +// when invoking TakesOwnership(), the code will not compile because scopers +// are not copyable; they only implement move semantics which require calling +// the Pass() function to signify a destructive transfer of state. CreateFoo() +// is different though because we are constructing a temporary on the return +// line and thus can avoid needing to call Pass(). +// +// Pass() properly handles upcast in initialization, i.e. you can use a +// scoped_ptr to initialize a scoped_ptr: +// +// scoped_ptr foo(new Foo()); +// scoped_ptr parent(foo.Pass()); +// +// PassAs<>() should be used to upcast return value in return statement: +// +// scoped_ptr CreateFoo() { +// scoped_ptr result(new FooChild()); +// return result.PassAs(); +// } +// +// Note that PassAs<>() is implemented only for scoped_ptr, but not for +// scoped_ptr. This is because casting array pointers may not be safe. + +#ifndef CEF_INCLUDE_BASE_CEF_MEMORY_SCOPED_PTR_H_ +#define CEF_INCLUDE_BASE_CEF_MEMORY_SCOPED_PTR_H_ +#pragma once + +#if defined(BASE_MEMORY_SCOPED_PTR_H_) +// Do nothing if the Chromium header has already been included. +// This can happen in cases where Chromium code is used directly by the +// client application. When using Chromium code directly always include +// the Chromium header first to avoid type conflicts. +#elif defined(BUILDING_CEF_SHARED) +// When building CEF include the Chromium header directly. +#include "base/memory/scoped_ptr.h" +#else // !BUILDING_CEF_SHARED +// The following is substantially similar to the Chromium implementation. +// If the Chromium implementation diverges the below implementation should be +// updated to match. + +// This is an implementation designed to match the anticipated future TR2 +// implementation of the scoped_ptr class. + +#include +#include +#include + +#include // For std::swap(). + +#include "include/base/cef_basictypes.h" +#include "include/base/cef_build.h" +#include "include/base/cef_macros.h" +#include "include/base/cef_move.h" +#include "include/base/cef_template_util.h" + +namespace base { + +namespace subtle { +class RefCountedBase; +class RefCountedThreadSafeBase; +} // namespace subtle + +// Function object which deletes its parameter, which must be a pointer. +// If C is an array type, invokes 'delete[]' on the parameter; otherwise, +// invokes 'delete'. The default deleter for scoped_ptr. +template +struct DefaultDeleter { + DefaultDeleter() {} + template DefaultDeleter(const DefaultDeleter& other) { + // IMPLEMENTATION NOTE: C++11 20.7.1.1.2p2 only provides this constructor + // if U* is implicitly convertible to T* and U is not an array type. + // + // Correct implementation should use SFINAE to disable this + // constructor. However, since there are no other 1-argument constructors, + // using a COMPILE_ASSERT() based on is_convertible<> and requiring + // complete types is simpler and will cause compile failures for equivalent + // misuses. + // + // Note, the is_convertible check also ensures that U is not an + // array. T is guaranteed to be a non-array, so any U* where U is an array + // cannot convert to T*. + enum { T_must_be_complete = sizeof(T) }; + enum { U_must_be_complete = sizeof(U) }; + COMPILE_ASSERT((base::is_convertible::value), + U_ptr_must_implicitly_convert_to_T_ptr); + } + inline void operator()(T* ptr) const { + enum { type_must_be_complete = sizeof(T) }; + delete ptr; + } +}; + +// Specialization of DefaultDeleter for array types. +template +struct DefaultDeleter { + inline void operator()(T* ptr) const { + enum { type_must_be_complete = sizeof(T) }; + delete[] ptr; + } + + private: + // Disable this operator for any U != T because it is undefined to execute + // an array delete when the static type of the array mismatches the dynamic + // type. + // + // References: + // C++98 [expr.delete]p3 + // http://cplusplus.github.com/LWG/lwg-defects.html#938 + template void operator()(U* array) const; +}; + +template +struct DefaultDeleter { + // Never allow someone to declare something like scoped_ptr. + COMPILE_ASSERT(sizeof(T) == -1, do_not_use_array_with_size_as_type); +}; + +// Function object which invokes 'free' on its parameter, which must be +// a pointer. Can be used to store malloc-allocated pointers in scoped_ptr: +// +// scoped_ptr foo_ptr( +// static_cast(malloc(sizeof(int)))); +struct FreeDeleter { + inline void operator()(void* ptr) const { + free(ptr); + } +}; + +namespace cef_internal { + +template struct IsNotRefCounted { + enum { + value = !base::is_convertible::value && + !base::is_convertible:: + value + }; +}; + +// Minimal implementation of the core logic of scoped_ptr, suitable for +// reuse in both scoped_ptr and its specializations. +template +class scoped_ptr_impl { + public: + explicit scoped_ptr_impl(T* p) : data_(p) { } + + // Initializer for deleters that have data parameters. + scoped_ptr_impl(T* p, const D& d) : data_(p, d) {} + + // Templated constructor that destructively takes the value from another + // scoped_ptr_impl. + template + scoped_ptr_impl(scoped_ptr_impl* other) + : data_(other->release(), other->get_deleter()) { + // We do not support move-only deleters. We could modify our move + // emulation to have base::subtle::move() and base::subtle::forward() + // functions that are imperfect emulations of their C++11 equivalents, + // but until there's a requirement, just assume deleters are copyable. + } + + template + void TakeState(scoped_ptr_impl* other) { + // See comment in templated constructor above regarding lack of support + // for move-only deleters. + reset(other->release()); + get_deleter() = other->get_deleter(); + } + + ~scoped_ptr_impl() { + if (data_.ptr != NULL) { + // Not using get_deleter() saves one function call in non-optimized + // builds. + static_cast(data_)(data_.ptr); + } + } + + void reset(T* p) { + // This is a self-reset, which is no longer allowed: http://crbug.com/162971 + if (p != NULL && p == data_.ptr) + abort(); + + // Note that running data_.ptr = p can lead to undefined behavior if + // get_deleter()(get()) deletes this. In order to prevent this, reset() + // should update the stored pointer before deleting its old value. + // + // However, changing reset() to use that behavior may cause current code to + // break in unexpected ways. If the destruction of the owned object + // dereferences the scoped_ptr when it is destroyed by a call to reset(), + // then it will incorrectly dispatch calls to |p| rather than the original + // value of |data_.ptr|. + // + // During the transition period, set the stored pointer to NULL while + // deleting the object. Eventually, this safety check will be removed to + // prevent the scenario initially described from occuring and + // http://crbug.com/176091 can be closed. + T* old = data_.ptr; + data_.ptr = NULL; + if (old != NULL) + static_cast(data_)(old); + data_.ptr = p; + } + + T* get() const { return data_.ptr; } + + D& get_deleter() { return data_; } + const D& get_deleter() const { return data_; } + + void swap(scoped_ptr_impl& p2) { + // Standard swap idiom: 'using std::swap' ensures that std::swap is + // present in the overload set, but we call swap unqualified so that + // any more-specific overloads can be used, if available. + using std::swap; + swap(static_cast(data_), static_cast(p2.data_)); + swap(data_.ptr, p2.data_.ptr); + } + + T* release() { + T* old_ptr = data_.ptr; + data_.ptr = NULL; + return old_ptr; + } + + private: + // Needed to allow type-converting constructor. + template friend class scoped_ptr_impl; + + // Use the empty base class optimization to allow us to have a D + // member, while avoiding any space overhead for it when D is an + // empty class. See e.g. http://www.cantrip.org/emptyopt.html for a good + // discussion of this technique. + struct Data : public D { + explicit Data(T* ptr_in) : ptr(ptr_in) {} + Data(T* ptr_in, const D& other) : D(other), ptr(ptr_in) {} + T* ptr; + }; + + Data data_; + + DISALLOW_COPY_AND_ASSIGN(scoped_ptr_impl); +}; + +} // namespace cef_internal + +} // namespace base + +// A scoped_ptr is like a T*, except that the destructor of scoped_ptr +// automatically deletes the pointer it holds (if any). +// That is, scoped_ptr owns the T object that it points to. +// Like a T*, a scoped_ptr may hold either NULL or a pointer to a T object. +// Also like T*, scoped_ptr is thread-compatible, and once you +// dereference it, you get the thread safety guarantees of T. +// +// The size of scoped_ptr is small. On most compilers, when using the +// DefaultDeleter, sizeof(scoped_ptr) == sizeof(T*). Custom deleters will +// increase the size proportional to whatever state they need to have. See +// comments inside scoped_ptr_impl<> for details. +// +// Current implementation targets having a strict subset of C++11's +// unique_ptr<> features. Known deficiencies include not supporting move-only +// deleteres, function pointers as deleters, and deleters with reference +// types. +template > +class scoped_ptr { + MOVE_ONLY_TYPE_FOR_CPP_03(scoped_ptr, RValue) + + COMPILE_ASSERT(base::cef_internal::IsNotRefCounted::value, + T_is_refcounted_type_and_needs_scoped_refptr); + + public: + // The element and deleter types. + typedef T element_type; + typedef D deleter_type; + + // Constructor. Defaults to initializing with NULL. + scoped_ptr() : impl_(NULL) { } + + // Constructor. Takes ownership of p. + explicit scoped_ptr(element_type* p) : impl_(p) { } + + // Constructor. Allows initialization of a stateful deleter. + scoped_ptr(element_type* p, const D& d) : impl_(p, d) { } + + // Constructor. Allows construction from a scoped_ptr rvalue for a + // convertible type and deleter. + // + // IMPLEMENTATION NOTE: C++11 unique_ptr<> keeps this constructor distinct + // from the normal move constructor. By C++11 20.7.1.2.1.21, this constructor + // has different post-conditions if D is a reference type. Since this + // implementation does not support deleters with reference type, + // we do not need a separate move constructor allowing us to avoid one + // use of SFINAE. You only need to care about this if you modify the + // implementation of scoped_ptr. + template + scoped_ptr(scoped_ptr other) : impl_(&other.impl_) { + COMPILE_ASSERT(!base::is_array::value, U_cannot_be_an_array); + } + + // Constructor. Move constructor for C++03 move emulation of this type. + scoped_ptr(RValue rvalue) : impl_(&rvalue.object->impl_) { } + + // operator=. Allows assignment from a scoped_ptr rvalue for a convertible + // type and deleter. + // + // IMPLEMENTATION NOTE: C++11 unique_ptr<> keeps this operator= distinct from + // the normal move assignment operator. By C++11 20.7.1.2.3.4, this templated + // form has different requirements on for move-only Deleters. Since this + // implementation does not support move-only Deleters, we do not need a + // separate move assignment operator allowing us to avoid one use of SFINAE. + // You only need to care about this if you modify the implementation of + // scoped_ptr. + template + scoped_ptr& operator=(scoped_ptr rhs) { + COMPILE_ASSERT(!base::is_array::value, U_cannot_be_an_array); + impl_.TakeState(&rhs.impl_); + return *this; + } + + // Reset. Deletes the currently owned object, if any. + // Then takes ownership of a new object, if given. + void reset(element_type* p = NULL) { impl_.reset(p); } + + // Accessors to get the owned object. + // operator* and operator-> will assert() if there is no current object. + element_type& operator*() const { + assert(impl_.get() != NULL); + return *impl_.get(); + } + element_type* operator->() const { + assert(impl_.get() != NULL); + return impl_.get(); + } + element_type* get() const { return impl_.get(); } + + // Access to the deleter. + deleter_type& get_deleter() { return impl_.get_deleter(); } + const deleter_type& get_deleter() const { return impl_.get_deleter(); } + + // Allow scoped_ptr to be used in boolean expressions, but not + // implicitly convertible to a real bool (which is dangerous). + // + // Note that this trick is only safe when the == and != operators + // are declared explicitly, as otherwise "scoped_ptr1 == + // scoped_ptr2" will compile but do the wrong thing (i.e., convert + // to Testable and then do the comparison). + private: + typedef base::cef_internal::scoped_ptr_impl + scoped_ptr::*Testable; + + public: + operator Testable() const { return impl_.get() ? &scoped_ptr::impl_ : NULL; } + + // Comparison operators. + // These return whether two scoped_ptr refer to the same object, not just to + // two different but equal objects. + bool operator==(const element_type* p) const { return impl_.get() == p; } + bool operator!=(const element_type* p) const { return impl_.get() != p; } + + // Swap two scoped pointers. + void swap(scoped_ptr& p2) { + impl_.swap(p2.impl_); + } + + // Release a pointer. + // The return value is the current pointer held by this object. + // If this object holds a NULL pointer, the return value is NULL. + // After this operation, this object will hold a NULL pointer, + // and will not own the object any more. + element_type* release() WARN_UNUSED_RESULT { + return impl_.release(); + } + + // C++98 doesn't support functions templates with default parameters which + // makes it hard to write a PassAs() that understands converting the deleter + // while preserving simple calling semantics. + // + // Until there is a use case for PassAs() with custom deleters, just ignore + // the custom deleter. + template + scoped_ptr PassAs() { + return scoped_ptr(Pass()); + } + + private: + // Needed to reach into |impl_| in the constructor. + template friend class scoped_ptr; + base::cef_internal::scoped_ptr_impl impl_; + + // Forbidden for API compatibility with std::unique_ptr. + explicit scoped_ptr(int disallow_construction_from_null); + + // Forbid comparison of scoped_ptr types. If U != T, it totally + // doesn't make sense, and if U == T, it still doesn't make sense + // because you should never have the same object owned by two different + // scoped_ptrs. + template bool operator==(scoped_ptr const& p2) const; + template bool operator!=(scoped_ptr const& p2) const; +}; + +template +class scoped_ptr { + MOVE_ONLY_TYPE_FOR_CPP_03(scoped_ptr, RValue) + + public: + // The element and deleter types. + typedef T element_type; + typedef D deleter_type; + + // Constructor. Defaults to initializing with NULL. + scoped_ptr() : impl_(NULL) { } + + // Constructor. Stores the given array. Note that the argument's type + // must exactly match T*. In particular: + // - it cannot be a pointer to a type derived from T, because it is + // inherently unsafe in the general case to access an array through a + // pointer whose dynamic type does not match its static type (eg., if + // T and the derived types had different sizes access would be + // incorrectly calculated). Deletion is also always undefined + // (C++98 [expr.delete]p3). If you're doing this, fix your code. + // - it cannot be NULL, because NULL is an integral expression, not a + // pointer to T. Use the no-argument version instead of explicitly + // passing NULL. + // - it cannot be const-qualified differently from T per unique_ptr spec + // (http://cplusplus.github.com/LWG/lwg-active.html#2118). Users wanting + // to work around this may use implicit_cast(). + // However, because of the first bullet in this comment, users MUST + // NOT use implicit_cast() to upcast the static type of the array. + explicit scoped_ptr(element_type* array) : impl_(array) { } + + // Constructor. Move constructor for C++03 move emulation of this type. + scoped_ptr(RValue rvalue) : impl_(&rvalue.object->impl_) { } + + // operator=. Move operator= for C++03 move emulation of this type. + scoped_ptr& operator=(RValue rhs) { + impl_.TakeState(&rhs.object->impl_); + return *this; + } + + // Reset. Deletes the currently owned array, if any. + // Then takes ownership of a new object, if given. + void reset(element_type* array = NULL) { impl_.reset(array); } + + // Accessors to get the owned array. + element_type& operator[](size_t i) const { + assert(impl_.get() != NULL); + return impl_.get()[i]; + } + element_type* get() const { return impl_.get(); } + + // Access to the deleter. + deleter_type& get_deleter() { return impl_.get_deleter(); } + const deleter_type& get_deleter() const { return impl_.get_deleter(); } + + // Allow scoped_ptr to be used in boolean expressions, but not + // implicitly convertible to a real bool (which is dangerous). + private: + typedef base::cef_internal::scoped_ptr_impl + scoped_ptr::*Testable; + + public: + operator Testable() const { return impl_.get() ? &scoped_ptr::impl_ : NULL; } + + // Comparison operators. + // These return whether two scoped_ptr refer to the same object, not just to + // two different but equal objects. + bool operator==(element_type* array) const { return impl_.get() == array; } + bool operator!=(element_type* array) const { return impl_.get() != array; } + + // Swap two scoped pointers. + void swap(scoped_ptr& p2) { + impl_.swap(p2.impl_); + } + + // Release a pointer. + // The return value is the current pointer held by this object. + // If this object holds a NULL pointer, the return value is NULL. + // After this operation, this object will hold a NULL pointer, + // and will not own the object any more. + element_type* release() WARN_UNUSED_RESULT { + return impl_.release(); + } + + private: + // Force element_type to be a complete type. + enum { type_must_be_complete = sizeof(element_type) }; + + // Actually hold the data. + base::cef_internal::scoped_ptr_impl impl_; + + // Disable initialization from any type other than element_type*, by + // providing a constructor that matches such an initialization, but is + // private and has no definition. This is disabled because it is not safe to + // call delete[] on an array whose static type does not match its dynamic + // type. + template explicit scoped_ptr(U* array); + explicit scoped_ptr(int disallow_construction_from_null); + + // Disable reset() from any type other than element_type*, for the same + // reasons as the constructor above. + template void reset(U* array); + void reset(int disallow_reset_from_null); + + // Forbid comparison of scoped_ptr types. If U != T, it totally + // doesn't make sense, and if U == T, it still doesn't make sense + // because you should never have the same object owned by two different + // scoped_ptrs. + template bool operator==(scoped_ptr const& p2) const; + template bool operator!=(scoped_ptr const& p2) const; +}; + +// Free functions +template +void swap(scoped_ptr& p1, scoped_ptr& p2) { + p1.swap(p2); +} + +template +bool operator==(T* p1, const scoped_ptr& p2) { + return p1 == p2.get(); +} + +template +bool operator!=(T* p1, const scoped_ptr& p2) { + return p1 != p2.get(); +} + +// A function to convert T* into scoped_ptr +// Doing e.g. make_scoped_ptr(new FooBarBaz(arg)) is a shorter notation +// for scoped_ptr >(new FooBarBaz(arg)) +template +scoped_ptr make_scoped_ptr(T* ptr) { + return scoped_ptr(ptr); +} + +#endif // !BUILDING_CEF_SHARED + +#endif // CEF_INCLUDE_BASE_CEF_MEMORY_SCOPED_PTR_H_ diff --git a/dependencies64/cef/include/base/cef_string16.h b/dependencies64/cef/include/base/cef_string16.h new file mode 100644 index 000000000..0d642b2df --- /dev/null +++ b/dependencies64/cef/include/base/cef_string16.h @@ -0,0 +1,227 @@ +// Copyright (c) 2014 Marshall A. Greenblatt. Portions copyright (c) 2013 +// Google Inc. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#ifndef CEF_INCLUDE_BASE_CEF_STRING16_H_ +#define CEF_INCLUDE_BASE_CEF_STRING16_H_ +#pragma once + +#if defined(BASE_STRINGS_STRING16_H_) +// Do nothing if the Chromium header has already been included. +// This can happen in cases where Chromium code is used directly by the +// client application. When using Chromium code directly always include +// the Chromium header first to avoid type conflicts. +#elif defined(BUILDING_CEF_SHARED) +// When building CEF include the Chromium header directly. +#include "base/strings/string16.h" +#else // !BUILDING_CEF_SHARED +// The following is substantially similar to the Chromium implementation. +// If the Chromium implementation diverges the below implementation should be +// updated to match. +// WHAT: +// A version of std::basic_string that provides 2-byte characters even when +// wchar_t is not implemented as a 2-byte type. You can access this class as +// string16. We also define char16, which string16 is based upon. +// +// WHY: +// On Windows, wchar_t is 2 bytes, and it can conveniently handle UTF-16/UCS-2 +// data. Plenty of existing code operates on strings encoded as UTF-16. +// +// On many other platforms, sizeof(wchar_t) is 4 bytes by default. We can make +// it 2 bytes by using the GCC flag -fshort-wchar. But then std::wstring fails +// at run time, because it calls some functions (like wcslen) that come from +// the system's native C library -- which was built with a 4-byte wchar_t! +// It's wasteful to use 4-byte wchar_t strings to carry UTF-16 data, and it's +// entirely improper on those systems where the encoding of wchar_t is defined +// as UTF-32. +// +// Here, we define string16, which is similar to std::wstring but replaces all +// libc functions with custom, 2-byte-char compatible routines. It is capable +// of carrying UTF-16-encoded data. + +#include +#include + +#include "include/base/cef_basictypes.h" + +#if defined(WCHAR_T_IS_UTF16) + +namespace base { + +typedef wchar_t char16; +typedef std::wstring string16; +typedef std::char_traits string16_char_traits; + +} // namespace base + +#elif defined(WCHAR_T_IS_UTF32) + +#include // For uint16_t + +#include "include/base/cef_macros.h" + +namespace base { + +typedef uint16_t char16; + +// char16 versions of the functions required by string16_char_traits; these +// are based on the wide character functions of similar names ("w" or "wcs" +// instead of "c16"). +int c16memcmp(const char16* s1, const char16* s2, size_t n); +size_t c16len(const char16* s); +const char16* c16memchr(const char16* s, char16 c, size_t n); +char16* c16memmove(char16* s1, const char16* s2, size_t n); +char16* c16memcpy(char16* s1, const char16* s2, size_t n); +char16* c16memset(char16* s, char16 c, size_t n); + +struct string16_char_traits { + typedef char16 char_type; + typedef int int_type; + + // int_type needs to be able to hold each possible value of char_type, and in + // addition, the distinct value of eof(). + COMPILE_ASSERT(sizeof(int_type) > sizeof(char_type), unexpected_type_width); + + typedef std::streamoff off_type; + typedef mbstate_t state_type; + typedef std::fpos pos_type; + + static void assign(char_type& c1, const char_type& c2) { + c1 = c2; + } + + static bool eq(const char_type& c1, const char_type& c2) { + return c1 == c2; + } + static bool lt(const char_type& c1, const char_type& c2) { + return c1 < c2; + } + + static int compare(const char_type* s1, const char_type* s2, size_t n) { + return c16memcmp(s1, s2, n); + } + + static size_t length(const char_type* s) { + return c16len(s); + } + + static const char_type* find(const char_type* s, size_t n, + const char_type& a) { + return c16memchr(s, a, n); + } + + static char_type* move(char_type* s1, const char_type* s2, int_type n) { + return c16memmove(s1, s2, n); + } + + static char_type* copy(char_type* s1, const char_type* s2, size_t n) { + return c16memcpy(s1, s2, n); + } + + static char_type* assign(char_type* s, size_t n, char_type a) { + return c16memset(s, a, n); + } + + static int_type not_eof(const int_type& c) { + return eq_int_type(c, eof()) ? 0 : c; + } + + static char_type to_char_type(const int_type& c) { + return char_type(c); + } + + static int_type to_int_type(const char_type& c) { + return int_type(c); + } + + static bool eq_int_type(const int_type& c1, const int_type& c2) { + return c1 == c2; + } + + static int_type eof() { + return static_cast(EOF); + } +}; + +typedef std::basic_string string16; + +extern std::ostream& operator<<(std::ostream& out, const string16& str); + +// This is required by googletest to print a readable output on test failures. +extern void PrintTo(const string16& str, std::ostream* out); + +} // namespace base + +// The string class will be explicitly instantiated only once, in string16.cc. +// +// std::basic_string<> in GNU libstdc++ contains a static data member, +// _S_empty_rep_storage, to represent empty strings. When an operation such +// as assignment or destruction is performed on a string, causing its existing +// data member to be invalidated, it must not be freed if this static data +// member is being used. Otherwise, it counts as an attempt to free static +// (and not allocated) data, which is a memory error. +// +// Generally, due to C++ template magic, _S_empty_rep_storage will be marked +// as a coalesced symbol, meaning that the linker will combine multiple +// instances into a single one when generating output. +// +// If a string class is used by multiple shared libraries, a problem occurs. +// Each library will get its own copy of _S_empty_rep_storage. When strings +// are passed across a library boundary for alteration or destruction, memory +// errors will result. GNU libstdc++ contains a configuration option, +// --enable-fully-dynamic-string (_GLIBCXX_FULLY_DYNAMIC_STRING), which +// disables the static data member optimization, but it's a good optimization +// and non-STL code is generally at the mercy of the system's STL +// configuration. Fully-dynamic strings are not the default for GNU libstdc++ +// libstdc++ itself or for the libstdc++ installations on the systems we care +// about, such as Mac OS X and relevant flavors of Linux. +// +// See also http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24196 . +// +// To avoid problems, string classes need to be explicitly instantiated only +// once, in exactly one library. All other string users see it via an "extern" +// declaration. This is precisely how GNU libstdc++ handles +// std::basic_string (string) and std::basic_string (wstring). +// +// This also works around a Mac OS X linker bug in ld64-85.2.1 (Xcode 3.1.2), +// in which the linker does not fully coalesce symbols when dead code +// stripping is enabled. This bug causes the memory errors described above +// to occur even when a std::basic_string<> does not cross shared library +// boundaries, such as in statically-linked executables. +// +// TODO(mark): File this bug with Apple and update this note with a bug number. + +extern template +class std::basic_string; + +#endif // WCHAR_T_IS_UTF32 + +#endif // !BUILDING_CEF_SHARED + +#endif // CEF_INCLUDE_BASE_CEF_STRING16_H_ diff --git a/dependencies64/cef/include/base/cef_template_util.h b/dependencies64/cef/include/base/cef_template_util.h new file mode 100644 index 000000000..5fa228b5f --- /dev/null +++ b/dependencies64/cef/include/base/cef_template_util.h @@ -0,0 +1,192 @@ +// Copyright (c) 2014 Marshall A. Greenblatt. Portions copyright (c) 2011 +// Google Inc. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#ifndef CEF_INCLUDE_BASE_CEF_TEMPLATE_UTIL_H_ +#define CEF_INCLUDE_BASE_CEF_TEMPLATE_UTIL_H_ +#pragma once + +#if defined(BASE_TEMPLATE_UTIL_H_) +// Do nothing if the Chromium header has already been included. +// This can happen in cases where Chromium code is used directly by the +// client application. When using Chromium code directly always include +// the Chromium header first to avoid type conflicts. +#elif defined(BUILDING_CEF_SHARED) +// When building CEF include the Chromium header directly. +#include "base/template_util.h" +#else // !BUILDING_CEF_SHARED +// The following is substantially similar to the Chromium implementation. +// If the Chromium implementation diverges the below implementation should be +// updated to match. + +#include // For size_t. + +#include "include/base/cef_build.h" + +namespace base { + +// template definitions from tr1 + +template +struct integral_constant { + static const T value = v; + typedef T value_type; + typedef integral_constant type; +}; + +template const T integral_constant::value; + +typedef integral_constant true_type; +typedef integral_constant false_type; + +template struct is_pointer : false_type {}; +template struct is_pointer : true_type {}; + +// Member function pointer detection up to four params. Add more as needed +// below. This is built-in to C++ 11, and we can remove this when we switch. +template +struct is_member_function_pointer : false_type {}; + +template +struct is_member_function_pointer : true_type {}; +template +struct is_member_function_pointer : true_type {}; + +template +struct is_member_function_pointer : true_type {}; +template +struct is_member_function_pointer : true_type {}; + +template +struct is_member_function_pointer : true_type {}; +template +struct is_member_function_pointer : true_type {}; + +template +struct is_member_function_pointer : true_type {}; +template +struct is_member_function_pointer : true_type {}; + +template +struct is_member_function_pointer : true_type {}; +template +struct is_member_function_pointer : true_type {}; + + +template struct is_same : public false_type {}; +template struct is_same : true_type {}; + +template struct is_array : public false_type {}; +template struct is_array : public true_type {}; +template struct is_array : public true_type {}; + +template struct is_non_const_reference : false_type {}; +template struct is_non_const_reference : true_type {}; +template struct is_non_const_reference : false_type {}; + +template struct is_const : false_type {}; +template struct is_const : true_type {}; + +template struct is_void : false_type {}; +template <> struct is_void : true_type {}; + +namespace cef_internal { + +// Types YesType and NoType are guaranteed such that sizeof(YesType) < +// sizeof(NoType). +typedef char YesType; + +struct NoType { + YesType dummy[2]; +}; + +// This class is an implementation detail for is_convertible, and you +// don't need to know how it works to use is_convertible. For those +// who care: we declare two different functions, one whose argument is +// of type To and one with a variadic argument list. We give them +// return types of different size, so we can use sizeof to trick the +// compiler into telling us which function it would have chosen if we +// had called it with an argument of type From. See Alexandrescu's +// _Modern C++ Design_ for more details on this sort of trick. + +struct ConvertHelper { + template + static YesType Test(To); + + template + static NoType Test(...); + + template + static From& Create(); +}; + +// Used to determine if a type is a struct/union/class. Inspired by Boost's +// is_class type_trait implementation. +struct IsClassHelper { + template + static YesType Test(void(C::*)(void)); + + template + static NoType Test(...); +}; + +} // namespace cef_internal + +// Inherits from true_type if From is convertible to To, false_type otherwise. +// +// Note that if the type is convertible, this will be a true_type REGARDLESS +// of whether or not the conversion would emit a warning. +template +struct is_convertible + : integral_constant( + cef_internal::ConvertHelper::Create())) == + sizeof(cef_internal::YesType)> { +}; + +template +struct is_class + : integral_constant(0)) == + sizeof(cef_internal::YesType)> { +}; + +template +struct enable_if {}; + +template +struct enable_if { typedef T type; }; + +} // namespace base + +#endif // !BUILDING_CEF_SHARED + +#endif // CEF_INCLUDE_BASE_CEF_TEMPLATE_UTIL_H_ diff --git a/dependencies64/cef/include/base/cef_thread_checker.h b/dependencies64/cef/include/base/cef_thread_checker.h new file mode 100644 index 000000000..2fd4f271a --- /dev/null +++ b/dependencies64/cef/include/base/cef_thread_checker.h @@ -0,0 +1,125 @@ +// Copyright (c) 2014 Marshall A. Greenblatt. Portions copyright (c) 2012 +// Google Inc. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#ifndef CEF_INCLUDE_BASE_THREAD_CHECKER_H_ +#define CEF_INCLUDE_BASE_THREAD_CHECKER_H_ +#pragma once + +#if defined(BASE_THREADING_THREAD_CHECKER_H_) +// Do nothing if the Chromium header has already been included. +// This can happen in cases where Chromium code is used directly by the +// client application. When using Chromium code directly always include +// the Chromium header first to avoid type conflicts. +#elif defined(BUILDING_CEF_SHARED) +// When building CEF include the Chromium header directly. +#include "base/threading/thread_checker.h" +#else // !BUILDING_CEF_SHARED +// The following is substantially similar to the Chromium implementation. +// If the Chromium implementation diverges the below implementation should be +// updated to match. + +// Apart from debug builds, we also enable the thread checker in +// builds with DCHECK_ALWAYS_ON so that trybots and waterfall bots +// with this define will get the same level of thread checking as +// debug bots. +// +// Note that this does not perfectly match situations where DCHECK is +// enabled. For example a non-official release build may have +// DCHECK_ALWAYS_ON undefined (and therefore ThreadChecker would be +// disabled) but have DCHECKs enabled at runtime. +#if (!defined(NDEBUG) || defined(DCHECK_ALWAYS_ON)) +#define ENABLE_THREAD_CHECKER 1 +#else +#define ENABLE_THREAD_CHECKER 0 +#endif + +#include "include/base/internal/cef_thread_checker_impl.h" + +namespace base { + +// Do nothing implementation, for use in release mode. +// +// Note: You should almost always use the ThreadChecker class to get the +// right version for your build configuration. +class ThreadCheckerDoNothing { + public: + bool CalledOnValidThread() const { + return true; + } + + void DetachFromThread() {} +}; + +// ThreadChecker is a helper class used to help verify that some methods of a +// class are called from the same thread. It provides identical functionality to +// base::NonThreadSafe, but it is meant to be held as a member variable, rather +// than inherited from base::NonThreadSafe. +// +// While inheriting from base::NonThreadSafe may give a clear indication about +// the thread-safety of a class, it may also lead to violations of the style +// guide with regard to multiple inheritance. The choice between having a +// ThreadChecker member and inheriting from base::NonThreadSafe should be based +// on whether: +// - Derived classes need to know the thread they belong to, as opposed to +// having that functionality fully encapsulated in the base class. +// - Derived classes should be able to reassign the base class to another +// thread, via DetachFromThread. +// +// If neither of these are true, then having a ThreadChecker member and calling +// CalledOnValidThread is the preferable solution. +// +// Example: +// class MyClass { +// public: +// void Foo() { +// DCHECK(thread_checker_.CalledOnValidThread()); +// ... (do stuff) ... +// } +// +// private: +// ThreadChecker thread_checker_; +// } +// +// In Release mode, CalledOnValidThread will always return true. +#if ENABLE_THREAD_CHECKER +class ThreadChecker : public ThreadCheckerImpl { +}; +#else +class ThreadChecker : public ThreadCheckerDoNothing { +}; +#endif // ENABLE_THREAD_CHECKER + +#undef ENABLE_THREAD_CHECKER + +} // namespace base + +#endif // !BUILDING_CEF_SHARED + +#endif // CEF_INCLUDE_BASE_THREAD_CHECKER_H_ diff --git a/dependencies64/cef/include/base/cef_thread_collision_warner.h b/dependencies64/cef/include/base/cef_thread_collision_warner.h new file mode 100644 index 000000000..bbc88759c --- /dev/null +++ b/dependencies64/cef/include/base/cef_thread_collision_warner.h @@ -0,0 +1,287 @@ +// Copyright (c) 2014 Marshall A. Greenblatt. Portions copyright (c) 2012 +// Google Inc. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#ifndef CEF_INCLUDE_BASE_CEF_THREAD_COLLISION_WARNER_H_ +#define CEF_INCLUDE_BASE_CEF_THREAD_COLLISION_WARNER_H_ +#pragma once + +#if defined(BASE_THREADING_THREAD_COLLISION_WARNER_H_) +// Do nothing if the Chromium header has already been included. +// This can happen in cases where Chromium code is used directly by the +// client application. When using Chromium code directly always include +// the Chromium header first to avoid type conflicts. +#elif defined(BUILDING_CEF_SHARED) +// When building CEF include the Chromium header directly. +#include "base/threading/thread_collision_warner.h" +#else // !BUILDING_CEF_SHARED +// The following is substantially similar to the Chromium implementation. +// If the Chromium implementation diverges the below implementation should be +// updated to match. + +#include + +#include "include/base/cef_atomicops.h" +#include "include/base/cef_basictypes.h" +#include "include/base/cef_build.h" +#include "include/base/cef_macros.h" + +// A helper class alongside macros to be used to verify assumptions about thread +// safety of a class. +// +// Example: Queue implementation non thread-safe but still usable if clients +// are synchronized somehow. +// +// In this case the macro DFAKE_SCOPED_LOCK has to be +// used, it checks that if a thread is inside the push/pop then +// noone else is still inside the pop/push +// +// class NonThreadSafeQueue { +// public: +// ... +// void push(int) { DFAKE_SCOPED_LOCK(push_pop_); ... } +// int pop() { DFAKE_SCOPED_LOCK(push_pop_); ... } +// ... +// private: +// DFAKE_MUTEX(push_pop_); +// }; +// +// +// Example: Queue implementation non thread-safe but still usable if clients +// are synchronized somehow, it calls a method to "protect" from +// a "protected" method +// +// In this case the macro DFAKE_SCOPED_RECURSIVE_LOCK +// has to be used, it checks that if a thread is inside the push/pop +// then noone else is still inside the pop/push +// +// class NonThreadSafeQueue { +// public: +// void push(int) { +// DFAKE_SCOPED_LOCK(push_pop_); +// ... +// } +// int pop() { +// DFAKE_SCOPED_RECURSIVE_LOCK(push_pop_); +// bar(); +// ... +// } +// void bar() { DFAKE_SCOPED_RECURSIVE_LOCK(push_pop_); ... } +// ... +// private: +// DFAKE_MUTEX(push_pop_); +// }; +// +// +// Example: Queue implementation not usable even if clients are synchronized, +// so only one thread in the class life cycle can use the two members +// push/pop. +// +// In this case the macro DFAKE_SCOPED_LOCK_THREAD_LOCKED pins the +// specified +// critical section the first time a thread enters push or pop, from +// that time on only that thread is allowed to execute push or pop. +// +// class NonThreadSafeQueue { +// public: +// ... +// void push(int) { DFAKE_SCOPED_LOCK_THREAD_LOCKED(push_pop_); ... } +// int pop() { DFAKE_SCOPED_LOCK_THREAD_LOCKED(push_pop_); ... } +// ... +// private: +// DFAKE_MUTEX(push_pop_); +// }; +// +// +// Example: Class that has to be contructed/destroyed on same thread, it has +// a "shareable" method (with external synchronization) and a not +// shareable method (even with external synchronization). +// +// In this case 3 Critical sections have to be defined +// +// class ExoticClass { +// public: +// ExoticClass() { DFAKE_SCOPED_LOCK_THREAD_LOCKED(ctor_dtor_); ... } +// ~ExoticClass() { DFAKE_SCOPED_LOCK_THREAD_LOCKED(ctor_dtor_); ... } +// +// void Shareable() { DFAKE_SCOPED_LOCK(shareable_section_); ... } +// void NotShareable() { DFAKE_SCOPED_LOCK_THREAD_LOCKED(ctor_dtor_); ... } +// ... +// private: +// DFAKE_MUTEX(ctor_dtor_); +// DFAKE_MUTEX(shareable_section_); +// }; + + +#if !defined(NDEBUG) + +// Defines a class member that acts like a mutex. It is used only as a +// verification tool. +#define DFAKE_MUTEX(obj) \ + mutable base::ThreadCollisionWarner obj +// Asserts the call is never called simultaneously in two threads. Used at +// member function scope. +#define DFAKE_SCOPED_LOCK(obj) \ + base::ThreadCollisionWarner::ScopedCheck s_check_##obj(&obj) +// Asserts the call is never called simultaneously in two threads. Used at +// member function scope. Same as DFAKE_SCOPED_LOCK but allows recursive locks. +#define DFAKE_SCOPED_RECURSIVE_LOCK(obj) \ + base::ThreadCollisionWarner::ScopedRecursiveCheck sr_check_##obj(&obj) +// Asserts the code is always executed in the same thread. +#define DFAKE_SCOPED_LOCK_THREAD_LOCKED(obj) \ + base::ThreadCollisionWarner::Check check_##obj(&obj) + +#else + +#define DFAKE_MUTEX(obj) typedef void InternalFakeMutexType##obj +#define DFAKE_SCOPED_LOCK(obj) ((void)0) +#define DFAKE_SCOPED_RECURSIVE_LOCK(obj) ((void)0) +#define DFAKE_SCOPED_LOCK_THREAD_LOCKED(obj) ((void)0) + +#endif + +namespace base { + +// The class ThreadCollisionWarner uses an Asserter to notify the collision +// AsserterBase is the interfaces and DCheckAsserter is the default asserter +// used. During the unit tests is used another class that doesn't "DCHECK" +// in case of collision (check thread_collision_warner_unittests.cc) +struct AsserterBase { + virtual ~AsserterBase() {} + virtual void warn() = 0; +}; + +struct DCheckAsserter : public AsserterBase { + virtual ~DCheckAsserter() {} + virtual void warn() OVERRIDE; +}; + +class ThreadCollisionWarner { + public: + // The parameter asserter is there only for test purpose + explicit ThreadCollisionWarner(AsserterBase* asserter = new DCheckAsserter()) + : valid_thread_id_(0), + counter_(0), + asserter_(asserter) {} + + ~ThreadCollisionWarner() { + delete asserter_; + } + + // This class is meant to be used through the macro + // DFAKE_SCOPED_LOCK_THREAD_LOCKED + // it doesn't leave the critical section, as opposed to ScopedCheck, + // because the critical section being pinned is allowed to be used only + // from one thread + class Check { + public: + explicit Check(ThreadCollisionWarner* warner) + : warner_(warner) { + warner_->EnterSelf(); + } + + ~Check() {} + + private: + ThreadCollisionWarner* warner_; + + DISALLOW_COPY_AND_ASSIGN(Check); + }; + + // This class is meant to be used through the macro + // DFAKE_SCOPED_LOCK + class ScopedCheck { + public: + explicit ScopedCheck(ThreadCollisionWarner* warner) + : warner_(warner) { + warner_->Enter(); + } + + ~ScopedCheck() { + warner_->Leave(); + } + + private: + ThreadCollisionWarner* warner_; + + DISALLOW_COPY_AND_ASSIGN(ScopedCheck); + }; + + // This class is meant to be used through the macro + // DFAKE_SCOPED_RECURSIVE_LOCK + class ScopedRecursiveCheck { + public: + explicit ScopedRecursiveCheck(ThreadCollisionWarner* warner) + : warner_(warner) { + warner_->EnterSelf(); + } + + ~ScopedRecursiveCheck() { + warner_->Leave(); + } + + private: + ThreadCollisionWarner* warner_; + + DISALLOW_COPY_AND_ASSIGN(ScopedRecursiveCheck); + }; + + private: + // This method stores the current thread identifier and does a DCHECK + // if a another thread has already done it, it is safe if same thread + // calls this multiple time (recursion allowed). + void EnterSelf(); + + // Same as EnterSelf but recursion is not allowed. + void Enter(); + + // Removes the thread_id stored in order to allow other threads to + // call EnterSelf or Enter. + void Leave(); + + // This stores the thread id that is inside the critical section, if the + // value is 0 then no thread is inside. + volatile subtle::Atomic32 valid_thread_id_; + + // Counter to trace how many time a critical section was "pinned" + // (when allowed) in order to unpin it when counter_ reaches 0. + volatile subtle::Atomic32 counter_; + + // Here only for class unit tests purpose, during the test I need to not + // DCHECK but notify the collision with something else. + AsserterBase* asserter_; + + DISALLOW_COPY_AND_ASSIGN(ThreadCollisionWarner); +}; + +} // namespace base + +#endif // !BUILDING_CEF_SHARED + +#endif // CEF_INCLUDE_BASE_CEF_THREAD_COLLISION_WARNER_H_ diff --git a/dependencies64/cef/include/base/cef_trace_event.h b/dependencies64/cef/include/base/cef_trace_event.h new file mode 100644 index 000000000..a24146cd0 --- /dev/null +++ b/dependencies64/cef/include/base/cef_trace_event.h @@ -0,0 +1,427 @@ +// Copyright (c) 2014 Marshall A. Greenblatt. Portions copyright (c) 2012 +// Google Inc. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/// +// Trace events are for tracking application performance and resource usage. +// Macros are provided to track: +// Begin and end of function calls +// Counters +// +// Events are issued against categories. Whereas LOG's categories are statically +// defined, TRACE categories are created implicitly with a string. For example: +// TRACE_EVENT_INSTANT0("MY_SUBSYSTEM", "SomeImportantEvent") +// +// Events can be INSTANT, or can be pairs of BEGIN and END in the same scope: +// TRACE_EVENT_BEGIN0("MY_SUBSYSTEM", "SomethingCostly") +// doSomethingCostly() +// TRACE_EVENT_END0("MY_SUBSYSTEM", "SomethingCostly") +// Note: Our tools can't always determine the correct BEGIN/END pairs unless +// these are used in the same scope. Use ASYNC_BEGIN/ASYNC_END macros if you +// need them to be in separate scopes. +// +// A common use case is to trace entire function scopes. This issues a trace +// BEGIN and END automatically: +// void doSomethingCostly() { +// TRACE_EVENT0("MY_SUBSYSTEM", "doSomethingCostly"); +// ... +// } +// +// Additional parameters can be associated with an event: +// void doSomethingCostly2(int howMuch) { +// TRACE_EVENT1("MY_SUBSYSTEM", "doSomethingCostly", +// "howMuch", howMuch); +// ... +// } +// +// The trace system will automatically add to this information the current +// process id, thread id, and a timestamp in microseconds. +// +// To trace an asynchronous procedure such as an IPC send/receive, use +// ASYNC_BEGIN and ASYNC_END: +// [single threaded sender code] +// static int send_count = 0; +// ++send_count; +// TRACE_EVENT_ASYNC_BEGIN0("ipc", "message", send_count); +// Send(new MyMessage(send_count)); +// [receive code] +// void OnMyMessage(send_count) { +// TRACE_EVENT_ASYNC_END0("ipc", "message", send_count); +// } +// The third parameter is a unique ID to match ASYNC_BEGIN/ASYNC_END pairs. +// ASYNC_BEGIN and ASYNC_END can occur on any thread of any traced process. +// Pointers can be used for the ID parameter, and they will be mangled +// internally so that the same pointer on two different processes will not +// match. For example: +// class MyTracedClass { +// public: +// MyTracedClass() { +// TRACE_EVENT_ASYNC_BEGIN0("category", "MyTracedClass", this); +// } +// ~MyTracedClass() { +// TRACE_EVENT_ASYNC_END0("category", "MyTracedClass", this); +// } +// } +// +// The trace event also supports counters, which is a way to track a quantity +// as it varies over time. Counters are created with the following macro: +// TRACE_COUNTER1("MY_SUBSYSTEM", "myCounter", g_myCounterValue); +// +// Counters are process-specific. The macro itself can be issued from any +// thread, however. +// +// Sometimes, you want to track two counters at once. You can do this with two +// counter macros: +// TRACE_COUNTER1("MY_SUBSYSTEM", "myCounter0", g_myCounterValue[0]); +// TRACE_COUNTER1("MY_SUBSYSTEM", "myCounter1", g_myCounterValue[1]); +// Or you can do it with a combined macro: +// TRACE_COUNTER2("MY_SUBSYSTEM", "myCounter", +// "bytesPinned", g_myCounterValue[0], +// "bytesAllocated", g_myCounterValue[1]); +// This indicates to the tracing UI that these counters should be displayed +// in a single graph, as a summed area chart. +// +// Since counters are in a global namespace, you may want to disembiguate with a +// unique ID, by using the TRACE_COUNTER_ID* variations. +// +// By default, trace collection is compiled in, but turned off at runtime. +// Collecting trace data is the responsibility of the embedding application. In +// CEF's case, calling BeginTracing will turn on tracing on all active +// processes. +// +// +// Memory scoping note: +// Tracing copies the pointers, not the string content, of the strings passed +// in for category, name, and arg_names. Thus, the following code will cause +// problems: +// char* str = strdup("impprtantName"); +// TRACE_EVENT_INSTANT0("SUBSYSTEM", str); // BAD! +// free(str); // Trace system now has dangling pointer +// +// To avoid this issue with the |name| and |arg_name| parameters, use the +// TRACE_EVENT_COPY_XXX overloads of the macros at additional runtime +// overhead. +// Notes: The category must always be in a long-lived char* (i.e. static const). +// The |arg_values|, when used, are always deep copied with the _COPY +// macros. +// +// +// Thread Safety: +// All macros are thread safe and can be used from any process. +/// + +#ifndef CEF_INCLUDE_BASE_CEF_TRACE_EVENT_H_ +#define CEF_INCLUDE_BASE_CEF_TRACE_EVENT_H_ +#pragma once + +#if defined(TRACE_EVENT0) +// Do nothing if the macros provided by this header already exist. +// This can happen in cases where Chromium code is used directly by the +// client application. When using Chromium code directly always include +// the Chromium header first to avoid type conflicts. +#elif defined(BUILDING_CEF_SHARED) +// When building CEF include the Chromium header directly. +#include "base/debug/trace_event.h" +#else // !BUILDING_CEF_SHARED +// The following is substantially similar to the Chromium implementation. +// If the Chromium implementation diverges the below implementation should be +// updated to match. + +#include "include/internal/cef_trace_event_internal.h" + +// Records a pair of begin and end events called "name" for the current +// scope, with 0, 1 or 2 associated arguments. If the category is not +// enabled, then this does nothing. +// - category and name strings must have application lifetime (statics or +// literals). They may not include " chars. +#define TRACE_EVENT0(category, name) \ + cef_trace_event_begin(category, name, NULL, 0, NULL, 0, false); \ + CEF_INTERNAL_TRACE_END_ON_SCOPE_CLOSE(category, name) +#define TRACE_EVENT1(category, name, arg1_name, arg1_val) \ + cef_trace_event_begin(category, name, arg1_name, arg1_val, NULL, 0, false); \ + CEF_INTERNAL_TRACE_END_ON_SCOPE_CLOSE(category, name) +#define TRACE_EVENT2(category, name, arg1_name, arg1_val, arg2_name, \ + arg2_val) \ + cef_trace_event_begin(category, name, arg1_name, arg1_val, \ + arg2_name, arg2_val, false); \ + CEF_INTERNAL_TRACE_END_ON_SCOPE_CLOSE(category, name) + +// Implementation detail: trace event macros create temporary variable names. +// These macros give each temporary variable a unique name based on the line +// number to prevent name collisions. +#define CEF_INTERNAL_TRACE_EVENT_UID3(a,b) \ + cef_trace_event_unique_##a##b +#define CEF_INTERNAL_TRACE_EVENT_UID2(a,b) \ + CEF_INTERNAL_TRACE_EVENT_UID3(a,b) +#define CEF_INTERNAL_TRACE_EVENT_UID(name_prefix) \ + CEF_INTERNAL_TRACE_EVENT_UID2(name_prefix, __LINE__) + +// Implementation detail: internal macro to end end event when the scope ends. +#define CEF_INTERNAL_TRACE_END_ON_SCOPE_CLOSE(category, name) \ + cef_trace_event::CefTraceEndOnScopeClose \ + CEF_INTERNAL_TRACE_EVENT_UID(profileScope)(category, name) + +// Records a single event called "name" immediately, with 0, 1 or 2 +// associated arguments. If the category is not enabled, then this +// does nothing. +// - category and name strings must have application lifetime (statics or +// literals). They may not include " chars. +#define TRACE_EVENT_INSTANT0(category, name) \ + cef_trace_event_instant(category, name, NULL, 0, NULL, 0, false) +#define TRACE_EVENT_INSTANT1(category, name, arg1_name, arg1_val) \ + cef_trace_event_instant(category, name, arg1_name, arg1_val, NULL, 0, false) +#define TRACE_EVENT_INSTANT2(category, name, arg1_name, arg1_val, \ + arg2_name, arg2_val) \ + cef_trace_event_instant(category, name, arg1_name, arg1_val, arg2_name, \ + arg2_val, false) +#define TRACE_EVENT_COPY_INSTANT0(category, name) \ + cef_trace_event_instant(category, name, NULL, 0, NULL, 0, true) +#define TRACE_EVENT_COPY_INSTANT1(category, name, arg1_name, arg1_val) \ + cef_trace_event_instant(category, name, arg1_name, arg1_val, NULL, 0, true) +#define TRACE_EVENT_COPY_INSTANT2(category, name, arg1_name, arg1_val, \ + arg2_name, arg2_val) \ + cef_trace_event_instant(category, name, arg1_name, arg1_val, arg2_name, \ + arg2_val, true) + +// Records a single BEGIN event called "name" immediately, with 0, 1 or 2 +// associated arguments. If the category is not enabled, then this +// does nothing. +// - category and name strings must have application lifetime (statics or +// literals). They may not include " chars. +#define TRACE_EVENT_BEGIN0(category, name) \ + cef_trace_event_begin(category, name, NULL, 0, NULL, 0, false) +#define TRACE_EVENT_BEGIN1(category, name, arg1_name, arg1_val) \ + cef_trace_event_begin(category, name, arg1_name, arg1_val, NULL, 0, false) +#define TRACE_EVENT_BEGIN2(category, name, arg1_name, arg1_val, \ + arg2_name, arg2_val) \ + cef_trace_event_begin(category, name, arg1_name, arg1_val, arg2_name, \ + arg2_val, false) +#define TRACE_EVENT_COPY_BEGIN0(category, name) \ + cef_trace_event_begin(category, name, NULL, 0, NULL, 0, true) +#define TRACE_EVENT_COPY_BEGIN1(category, name, arg1_name, arg1_val) \ + cef_trace_event_begin(category, name, arg1_name, arg1_val, NULL, 0, true) +#define TRACE_EVENT_COPY_BEGIN2(category, name, arg1_name, arg1_val, \ + arg2_name, arg2_val) \ + cef_trace_event_begin(category, name, arg1_name, arg1_val, arg2_name, \ + arg2_val, true) + +// Records a single END event for "name" immediately. If the category +// is not enabled, then this does nothing. +// - category and name strings must have application lifetime (statics or +// literals). They may not include " chars. +#define TRACE_EVENT_END0(category, name) \ + cef_trace_event_end(category, name, NULL, 0, NULL, 0, false) +#define TRACE_EVENT_END1(category, name, arg1_name, arg1_val) \ + cef_trace_event_end(category, name, arg1_name, arg1_val, NULL, 0, false) +#define TRACE_EVENT_END2(category, name, arg1_name, arg1_val, \ + arg2_name, arg2_val) \ + cef_trace_event_end(category, name, arg1_name, arg1_val, arg2_name, \ + arg2_val, false) +#define TRACE_EVENT_COPY_END0(category, name) \ + cef_trace_event_end(category, name, NULL, 0, NULL, 0, true) +#define TRACE_EVENT_COPY_END1(category, name, arg1_name, arg1_val) \ + cef_trace_event_end(category, name, arg1_name, arg1_val, NULL, 0, true) +#define TRACE_EVENT_COPY_END2(category, name, arg1_name, arg1_val, \ + arg2_name, arg2_val) \ + cef_trace_event_end(category, name, arg1_name, arg1_val, arg2_name, \ + arg2_val, true) + +// Records the value of a counter called "name" immediately. Value +// must be representable as a 32 bit integer. +// - category and name strings must have application lifetime (statics or +// literals). They may not include " chars. +#define TRACE_COUNTER1(category, name, value) \ + cef_trace_counter(category, name, NULL, value, NULL, 0, false) +#define TRACE_COPY_COUNTER1(category, name, value) \ + cef_trace_counter(category, name, NULL, value, NULL, 0, true) + +// Records the values of a multi-parted counter called "name" immediately. +// The UI will treat value1 and value2 as parts of a whole, displaying their +// values as a stacked-bar chart. +// - category and name strings must have application lifetime (statics or +// literals). They may not include " chars. +#define TRACE_COUNTER2(category, name, value1_name, value1_val, \ + value2_name, value2_val) \ + cef_trace_counter(category, name, value1_name, value1_val, value2_name, \ + value2_val, false) +#define TRACE_COPY_COUNTER2(category, name, value1_name, value1_val, \ + value2_name, value2_val) \ + cef_trace_counter(category, name, value1_name, value1_val, value2_name, \ + value2_val, true) + +// Records the value of a counter called "name" immediately. Value +// must be representable as a 32 bit integer. +// - category and name strings must have application lifetime (statics or +// literals). They may not include " chars. +// - |id| is used to disambiguate counters with the same name. It must either +// be a pointer or an integer value up to 64 bits. If it's a pointer, the +// bits will be xored with a hash of the process ID so that the same pointer +// on two different processes will not collide. +#define TRACE_COUNTER_ID1(category, name, id, value) \ + cef_trace_counter_id(category, name, id, NULL, value, NULL, 0, false) +#define TRACE_COPY_COUNTER_ID1(category, name, id, value) \ + cef_trace_counter_id(category, name, id, NULL, value, NULL, 0, true) + +// Records the values of a multi-parted counter called "name" immediately. +// The UI will treat value1 and value2 as parts of a whole, displaying their +// values as a stacked-bar chart. +// - category and name strings must have application lifetime (statics or +// literals). They may not include " chars. +// - |id| is used to disambiguate counters with the same name. It must either +// be a pointer or an integer value up to 64 bits. If it's a pointer, the +// bits will be xored with a hash of the process ID so that the same pointer +// on two different processes will not collide. +#define TRACE_COUNTER_ID2(category, name, id, value1_name, value1_val, \ + value2_name, value2_val) \ + cef_trace_counter_id(category, name, id, value1_name, value1_val, \ + value2_name, value2_val, false) +#define TRACE_COPY_COUNTER_ID2(category, name, id, value1_name, \ + value1_val, value2_name, value2_val) \ + cef_trace_counter_id(category, name, id, value1_name, value1_val, \ + value2_name, value2_val, true) + + +// Records a single ASYNC_BEGIN event called "name" immediately, with 0, 1 or 2 +// associated arguments. If the category is not enabled, then this +// does nothing. +// - category and name strings must have application lifetime (statics or +// literals). They may not include " chars. +// - |id| is used to match the ASYNC_BEGIN event with the ASYNC_END event. +// ASYNC events are considered to match if their category, name and id values +// all match. |id| must either be a pointer or an integer value up to 64 +// bits. If it's a pointer, the bits will be xored with a hash of the process +// ID sothat the same pointer on two different processes will not collide. +// An asynchronous operation can consist of multiple phases. The first phase is +// defined by the ASYNC_BEGIN calls. Additional phases can be defined using the +// ASYNC_STEP_BEGIN macros. When the operation completes, call ASYNC_END. +// An async operation can span threads and processes, but all events in that +// operation must use the same |name| and |id|. Each event can have its own +// args. +#define TRACE_EVENT_ASYNC_BEGIN0(category, name, id) \ + cef_trace_event_async_begin(category, name, id, NULL, 0, NULL, 0, false) +#define TRACE_EVENT_ASYNC_BEGIN1(category, name, id, arg1_name, arg1_val) \ + cef_trace_event_async_begin(category, name, id, arg1_name, arg1_val, NULL, \ + 0, false) +#define TRACE_EVENT_ASYNC_BEGIN2(category, name, id, arg1_name, arg1_val, \ + arg2_name, arg2_val) \ + cef_trace_event_async_begin(category, name, id, arg1_name, arg1_val, \ + arg2_name, arg2_val, false) +#define TRACE_EVENT_COPY_ASYNC_BEGIN0(category, name, id) \ + cef_trace_event_async_begin(category, name, id, NULL, 0, NULL, 0, true) +#define TRACE_EVENT_COPY_ASYNC_BEGIN1(category, name, id, arg1_name, \ + arg1_val) \ + cef_trace_event_async_begin(category, name, id, arg1_name, arg1_val, NULL, \ + 0, true) +#define TRACE_EVENT_COPY_ASYNC_BEGIN2(category, name, id, arg1_name, \ + arg1_val, arg2_name, arg2_val) \ + cef_trace_event_async_begin(category, name, id, arg1_name, arg1_val, \ + arg2_name, arg2_val, true) + +// Records a single ASYNC_STEP_INTO event for |step| immediately. If the +// category is not enabled, then this does nothing. The |name| and |id| must +// match the ASYNC_BEGIN event above. The |step| param identifies this step +// within the async event. This should be called at the beginning of the next +// phase of an asynchronous operation. The ASYNC_BEGIN event must not have any +// ASYNC_STEP_PAST events. +#define TRACE_EVENT_ASYNC_STEP_INTO0(category, name, id, step) \ + cef_trace_event_async_step_into(category, name, id, step, NULL, 0, false) +#define TRACE_EVENT_ASYNC_STEP_INTO1(category, name, id, step, \ + arg1_name, arg1_val) \ + cef_trace_event_async_step_into(category, name, id, step, arg1_name, \ + arg1_val, false) +#define TRACE_EVENT_COPY_ASYNC_STEP_INTO0(category, name, id, step) \ + cef_trace_event_async_step_into(category, name, id, step, NULL, 0, true) +#define TRACE_EVENT_COPY_ASYNC_STEP_INTO1(category, name, id, step, \ + arg1_name, arg1_val) \ + cef_trace_event_async_step_into(category, name, id, step, arg1_name, \ + arg1_val, true) + +// Records a single ASYNC_STEP_PAST event for |step| immediately. If the +// category is not enabled, then this does nothing. The |name| and |id| must +// match the ASYNC_BEGIN event above. The |step| param identifies this step +// within the async event. This should be called at the beginning of the next +// phase of an asynchronous operation. The ASYNC_BEGIN event must not have any +// ASYNC_STEP_INTO events. +#define TRACE_EVENT_ASYNC_STEP_PAST0(category, name, id, step) \ + cef_trace_event_async_step_past(category, name, id, step, NULL, 0, false) +#define TRACE_EVENT_ASYNC_STEP_PAST1(category, name, id, step, \ + arg1_name, arg1_val) \ + cef_trace_event_async_step_past(category, name, id, step, arg1_name, \ + arg1_val, false) +#define TRACE_EVENT_COPY_ASYNC_STEP_PAST0(category, name, id, step) \ + cef_trace_event_async_step_past(category, name, id, step, NULL, 0, true) +#define TRACE_EVENT_COPY_ASYNC_STEP_PAST1(category, name, id, step, \ + arg1_name, arg1_val) \ + cef_trace_event_async_step_past(category, name, id, step, arg1_name, \ + arg1_val, true) + +// Records a single ASYNC_END event for "name" immediately. If the category +// is not enabled, then this does nothing. +#define TRACE_EVENT_ASYNC_END0(category, name, id) \ + cef_trace_event_async_end(category, name, id, NULL, 0, NULL, 0, false) +#define TRACE_EVENT_ASYNC_END1(category, name, id, arg1_name, arg1_val) \ + cef_trace_event_async_end(category, name, id, arg1_name, arg1_val, NULL, 0, \ + false) +#define TRACE_EVENT_ASYNC_END2(category, name, id, arg1_name, arg1_val, \ + arg2_name, arg2_val) \ + cef_trace_event_async_end(category, name, id, arg1_name, arg1_val, \ + arg2_name, arg2_val, false) +#define TRACE_EVENT_COPY_ASYNC_END0(category, name, id) \ + cef_trace_event_async_end(category, name, id, NULL, 0, NULL, 0, true) +#define TRACE_EVENT_COPY_ASYNC_END1(category, name, id, arg1_name, \ + arg1_val) \ + cef_trace_event_async_end(category, name, id, arg1_name, arg1_val, NULL, 0, \ + true) +#define TRACE_EVENT_COPY_ASYNC_END2(category, name, id, arg1_name, \ + arg1_val, arg2_name, arg2_val) \ + cef_trace_event_async_end(category, name, id, arg1_name, arg1_val, \ + arg2_name, arg2_val, true) + +namespace cef_trace_event { + +// Used by TRACE_EVENTx macro. Do not use directly. +class CefTraceEndOnScopeClose { + public: + CefTraceEndOnScopeClose(const char* category, const char* name) + : category_(category), name_(name) { + } + ~CefTraceEndOnScopeClose() { + cef_trace_event_end(category_, name_, NULL, 0, NULL, 0, false); + } + + private: + const char* category_; + const char* name_; +}; + +} // cef_trace_event + +#endif // !BUILDING_CEF_SHARED + +#endif // CEF_INCLUDE_BASE_CEF_TRACE_EVENT_H_ diff --git a/dependencies64/cef/include/base/cef_tuple.h b/dependencies64/cef/include/base/cef_tuple.h new file mode 100644 index 000000000..7f4b2b156 --- /dev/null +++ b/dependencies64/cef/include/base/cef_tuple.h @@ -0,0 +1,1399 @@ +// Copyright (c) 2014 Marshall A. Greenblatt. Portions copyright (c) 2011 +// Google Inc. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +// A Tuple is a generic templatized container, similar in concept to std::pair. +// There are classes Tuple0 to Tuple6, cooresponding to the number of elements +// it contains. The convenient MakeTuple() function takes 0 to 6 arguments, +// and will construct and return the appropriate Tuple object. The functions +// DispatchToMethod and DispatchToFunction take a function pointer or instance +// and method pointer, and unpack a tuple into arguments to the call. +// +// Tuple elements are copied by value, and stored in the tuple. See the unit +// tests for more details of how/when the values are copied. +// +// Example usage: +// // These two methods of creating a Tuple are identical. +// Tuple2 tuple_a(1, "wee"); +// Tuple2 tuple_b = MakeTuple(1, "wee"); +// +// void SomeFunc(int a, const char* b) { } +// DispatchToFunction(&SomeFunc, tuple_a); // SomeFunc(1, "wee") +// DispatchToFunction( +// &SomeFunc, MakeTuple(10, "foo")); // SomeFunc(10, "foo") +// +// struct { void SomeMeth(int a, int b, int c) { } } foo; +// DispatchToMethod(&foo, &Foo::SomeMeth, MakeTuple(1, 2, 3)); +// // foo->SomeMeth(1, 2, 3); + +#ifndef CEF_INCLUDE_BASE_CEF_TUPLE_H_ +#define CEF_INCLUDE_BASE_CEF_TUPLE_H_ +#pragma once + +#if defined(BASE_TUPLE_H__) +// The Chromium header has already been included. +// This can happen in cases where Chromium code is used directly by the +// client application. When using Chromium code directly always include +// the Chromium header first to avoid type conflicts. + +// For legacy compatibility, we name the first 8 tuple elements "a", "b", ... +// TODO(cef): Remove this code when cef_runnable.h is deleted. + +#define DEFINE_TUPLE_LEAF(N, x) \ + template \ + struct TupleLeaf { \ + TupleLeaf() {} \ + explicit TupleLeaf(typename TupleTraits::ParamType x) : x(x) {} \ + \ + T& get() { return x; } \ + const T& get() const { return x; } \ + \ + T x; \ + } + +DEFINE_TUPLE_LEAF(0, a); +DEFINE_TUPLE_LEAF(1, b); +DEFINE_TUPLE_LEAF(2, c); +DEFINE_TUPLE_LEAF(3, d); +DEFINE_TUPLE_LEAF(4, e); +DEFINE_TUPLE_LEAF(5, f); +DEFINE_TUPLE_LEAF(6, g); +DEFINE_TUPLE_LEAF(7, h); + +#undef DEFINE_TUPLE_LEAF + +// Deprecated compat aliases +// TODO(cef): Remove this code when cef_runnable.h is deleted. + +using Tuple0 = Tuple<>; +template +using Tuple1 = Tuple; +template +using Tuple2 = Tuple; +template +using Tuple3 = Tuple; +template +using Tuple4 = Tuple; +template +using Tuple5 = Tuple; +template +using Tuple6 = Tuple; +template +using Tuple7 = Tuple; +template +using Tuple8 = Tuple; + +#elif defined(BUILDING_CEF_SHARED) +// When building CEF include the Chromium header directly. +#include "base/tuple.h" +#else // !BUILDING_CEF_SHARED +// The following is substantially similar to the Chromium implementation. +// If the Chromium implementation diverges the below implementation should be +// updated to match. + +#include "include/base/cef_bind_helpers.h" + +// Traits ---------------------------------------------------------------------- +// +// A simple traits class for tuple arguments. +// +// ValueType: the bare, nonref version of a type (same as the type for nonrefs). +// RefType: the ref version of a type (same as the type for refs). +// ParamType: what type to pass to functions (refs should not be constified). + +template +struct TupleTraits { + typedef P ValueType; + typedef P& RefType; + typedef const P& ParamType; +}; + +template +struct TupleTraits { + typedef P ValueType; + typedef P& RefType; + typedef P& ParamType; +}; + +template +struct TupleTypes { }; + +// Tuple ----------------------------------------------------------------------- +// +// This set of classes is useful for bundling 0 or more heterogeneous data types +// into a single variable. The advantage of this is that it greatly simplifies +// function objects that need to take an arbitrary number of parameters; see +// RunnableMethod and IPC::MessageWithTuple. +// +// Tuple0 is supplied to act as a 'void' type. It can be used, for example, +// when dispatching to a function that accepts no arguments (see the +// Dispatchers below). +// Tuple1 is rarely useful. One such use is when A is non-const ref that you +// want filled by the dispatchee, and the tuple is merely a container for that +// output (a "tier"). See MakeRefTuple and its usages. + +struct Tuple0 { + typedef Tuple0 ValueTuple; + typedef Tuple0 RefTuple; + typedef Tuple0 ParamTuple; +}; + +template +struct Tuple1 { + public: + typedef A TypeA; + + Tuple1() {} + explicit Tuple1(typename TupleTraits::ParamType a) : a(a) {} + + A a; +}; + +template +struct Tuple2 { + public: + typedef A TypeA; + typedef B TypeB; + + Tuple2() {} + Tuple2(typename TupleTraits::ParamType a, + typename TupleTraits::ParamType b) + : a(a), b(b) { + } + + A a; + B b; +}; + +template +struct Tuple3 { + public: + typedef A TypeA; + typedef B TypeB; + typedef C TypeC; + + Tuple3() {} + Tuple3(typename TupleTraits::ParamType a, + typename TupleTraits::ParamType b, + typename TupleTraits::ParamType c) + : a(a), b(b), c(c){ + } + + A a; + B b; + C c; +}; + +template +struct Tuple4 { + public: + typedef A TypeA; + typedef B TypeB; + typedef C TypeC; + typedef D TypeD; + + Tuple4() {} + Tuple4(typename TupleTraits::ParamType a, + typename TupleTraits::ParamType b, + typename TupleTraits::ParamType c, + typename TupleTraits::ParamType d) + : a(a), b(b), c(c), d(d) { + } + + A a; + B b; + C c; + D d; +}; + +template +struct Tuple5 { + public: + typedef A TypeA; + typedef B TypeB; + typedef C TypeC; + typedef D TypeD; + typedef E TypeE; + + Tuple5() {} + Tuple5(typename TupleTraits::ParamType a, + typename TupleTraits::ParamType b, + typename TupleTraits::ParamType c, + typename TupleTraits::ParamType d, + typename TupleTraits::ParamType e) + : a(a), b(b), c(c), d(d), e(e) { + } + + A a; + B b; + C c; + D d; + E e; +}; + +template +struct Tuple6 { + public: + typedef A TypeA; + typedef B TypeB; + typedef C TypeC; + typedef D TypeD; + typedef E TypeE; + typedef F TypeF; + + Tuple6() {} + Tuple6(typename TupleTraits::ParamType a, + typename TupleTraits::ParamType b, + typename TupleTraits::ParamType c, + typename TupleTraits::ParamType d, + typename TupleTraits::ParamType e, + typename TupleTraits::ParamType f) + : a(a), b(b), c(c), d(d), e(e), f(f) { + } + + A a; + B b; + C c; + D d; + E e; + F f; +}; + +template +struct Tuple7 { + public: + typedef A TypeA; + typedef B TypeB; + typedef C TypeC; + typedef D TypeD; + typedef E TypeE; + typedef F TypeF; + typedef G TypeG; + + Tuple7() {} + Tuple7(typename TupleTraits::ParamType a, + typename TupleTraits::ParamType b, + typename TupleTraits::ParamType c, + typename TupleTraits::ParamType d, + typename TupleTraits::ParamType e, + typename TupleTraits::ParamType f, + typename TupleTraits::ParamType g) + : a(a), b(b), c(c), d(d), e(e), f(f), g(g) { + } + + A a; + B b; + C c; + D d; + E e; + F f; + G g; +}; + +template +struct Tuple8 { + public: + typedef A TypeA; + typedef B TypeB; + typedef C TypeC; + typedef D TypeD; + typedef E TypeE; + typedef F TypeF; + typedef G TypeG; + typedef H TypeH; + + Tuple8() {} + Tuple8(typename TupleTraits::ParamType a, + typename TupleTraits::ParamType b, + typename TupleTraits::ParamType c, + typename TupleTraits::ParamType d, + typename TupleTraits::ParamType e, + typename TupleTraits::ParamType f, + typename TupleTraits::ParamType g, + typename TupleTraits::ParamType h) + : a(a), b(b), c(c), d(d), e(e), f(f), g(g), h(h) { + } + + A a; + B b; + C c; + D d; + E e; + F f; + G g; + H h; +}; + +// Tuple types ---------------------------------------------------------------- +// +// Allows for selection of ValueTuple/RefTuple/ParamTuple without needing the +// definitions of class types the tuple takes as parameters. + +template <> +struct TupleTypes< Tuple0 > { + typedef Tuple0 ValueTuple; + typedef Tuple0 RefTuple; + typedef Tuple0 ParamTuple; +}; + +template +struct TupleTypes< Tuple1 > { + typedef Tuple1::ValueType> ValueTuple; + typedef Tuple1::RefType> RefTuple; + typedef Tuple1::ParamType> ParamTuple; +}; + +template +struct TupleTypes< Tuple2 > { + typedef Tuple2::ValueType, + typename TupleTraits::ValueType> ValueTuple; +typedef Tuple2::RefType, + typename TupleTraits::RefType> RefTuple; + typedef Tuple2::ParamType, + typename TupleTraits::ParamType> ParamTuple; +}; + +template +struct TupleTypes< Tuple3 > { + typedef Tuple3::ValueType, + typename TupleTraits::ValueType, + typename TupleTraits::ValueType> ValueTuple; +typedef Tuple3::RefType, + typename TupleTraits::RefType, + typename TupleTraits::RefType> RefTuple; + typedef Tuple3::ParamType, + typename TupleTraits::ParamType, + typename TupleTraits::ParamType> ParamTuple; +}; + +template +struct TupleTypes< Tuple4 > { + typedef Tuple4::ValueType, + typename TupleTraits::ValueType, + typename TupleTraits::ValueType, + typename TupleTraits::ValueType> ValueTuple; +typedef Tuple4::RefType, + typename TupleTraits::RefType, + typename TupleTraits::RefType, + typename TupleTraits::RefType> RefTuple; + typedef Tuple4::ParamType, + typename TupleTraits::ParamType, + typename TupleTraits::ParamType, + typename TupleTraits::ParamType> ParamTuple; +}; + +template +struct TupleTypes< Tuple5 > { + typedef Tuple5::ValueType, + typename TupleTraits::ValueType, + typename TupleTraits::ValueType, + typename TupleTraits::ValueType, + typename TupleTraits::ValueType> ValueTuple; +typedef Tuple5::RefType, + typename TupleTraits::RefType, + typename TupleTraits::RefType, + typename TupleTraits::RefType, + typename TupleTraits::RefType> RefTuple; + typedef Tuple5::ParamType, + typename TupleTraits::ParamType, + typename TupleTraits::ParamType, + typename TupleTraits::ParamType, + typename TupleTraits::ParamType> ParamTuple; +}; + +template +struct TupleTypes< Tuple6 > { + typedef Tuple6::ValueType, + typename TupleTraits::ValueType, + typename TupleTraits::ValueType, + typename TupleTraits::ValueType, + typename TupleTraits::ValueType, + typename TupleTraits::ValueType> ValueTuple; +typedef Tuple6::RefType, + typename TupleTraits::RefType, + typename TupleTraits::RefType, + typename TupleTraits::RefType, + typename TupleTraits::RefType, + typename TupleTraits::RefType> RefTuple; + typedef Tuple6::ParamType, + typename TupleTraits::ParamType, + typename TupleTraits::ParamType, + typename TupleTraits::ParamType, + typename TupleTraits::ParamType, + typename TupleTraits::ParamType> ParamTuple; +}; + +template +struct TupleTypes< Tuple7 > { + typedef Tuple7::ValueType, + typename TupleTraits::ValueType, + typename TupleTraits::ValueType, + typename TupleTraits::ValueType, + typename TupleTraits::ValueType, + typename TupleTraits::ValueType, + typename TupleTraits::ValueType> ValueTuple; +typedef Tuple7::RefType, + typename TupleTraits::RefType, + typename TupleTraits::RefType, + typename TupleTraits::RefType, + typename TupleTraits::RefType, + typename TupleTraits::RefType, + typename TupleTraits::RefType> RefTuple; + typedef Tuple7::ParamType, + typename TupleTraits::ParamType, + typename TupleTraits::ParamType, + typename TupleTraits::ParamType, + typename TupleTraits::ParamType, + typename TupleTraits::ParamType, + typename TupleTraits::ParamType> ParamTuple; +}; + +template +struct TupleTypes< Tuple8 > { + typedef Tuple8::ValueType, + typename TupleTraits::ValueType, + typename TupleTraits::ValueType, + typename TupleTraits::ValueType, + typename TupleTraits::ValueType, + typename TupleTraits::ValueType, + typename TupleTraits::ValueType, + typename TupleTraits::ValueType> ValueTuple; +typedef Tuple8::RefType, + typename TupleTraits::RefType, + typename TupleTraits::RefType, + typename TupleTraits::RefType, + typename TupleTraits::RefType, + typename TupleTraits::RefType, + typename TupleTraits::RefType, + typename TupleTraits::RefType> RefTuple; + typedef Tuple8::ParamType, + typename TupleTraits::ParamType, + typename TupleTraits::ParamType, + typename TupleTraits::ParamType, + typename TupleTraits::ParamType, + typename TupleTraits::ParamType, + typename TupleTraits::ParamType, + typename TupleTraits::ParamType> ParamTuple; +}; + +// Tuple creators ------------------------------------------------------------- +// +// Helper functions for constructing tuples while inferring the template +// argument types. + +inline Tuple0 MakeTuple() { + return Tuple0(); +} + +template +inline Tuple1 MakeTuple(const A& a) { + return Tuple1(a); +} + +template +inline Tuple2 MakeTuple(const A& a, const B& b) { + return Tuple2(a, b); +} + +template +inline Tuple3 MakeTuple(const A& a, const B& b, const C& c) { + return Tuple3(a, b, c); +} + +template +inline Tuple4 MakeTuple(const A& a, const B& b, const C& c, + const D& d) { + return Tuple4(a, b, c, d); +} + +template +inline Tuple5 MakeTuple(const A& a, const B& b, const C& c, + const D& d, const E& e) { + return Tuple5(a, b, c, d, e); +} + +template +inline Tuple6 MakeTuple(const A& a, const B& b, const C& c, + const D& d, const E& e, const F& f) { + return Tuple6(a, b, c, d, e, f); +} + +template +inline Tuple7 MakeTuple(const A& a, const B& b, const C& c, + const D& d, const E& e, const F& f, + const G& g) { + return Tuple7(a, b, c, d, e, f, g); +} + +template +inline Tuple8 MakeTuple(const A& a, const B& b, + const C& c, const D& d, + const E& e, const F& f, + const G& g, const H& h) { + return Tuple8(a, b, c, d, e, f, g, h); +} + +// The following set of helpers make what Boost refers to as "Tiers" - a tuple +// of references. + +template +inline Tuple1 MakeRefTuple(A& a) { + return Tuple1(a); +} + +template +inline Tuple2 MakeRefTuple(A& a, B& b) { + return Tuple2(a, b); +} + +template +inline Tuple3 MakeRefTuple(A& a, B& b, C& c) { + return Tuple3(a, b, c); +} + +template +inline Tuple4 MakeRefTuple(A& a, B& b, C& c, D& d) { + return Tuple4(a, b, c, d); +} + +template +inline Tuple5 MakeRefTuple(A& a, B& b, C& c, D& d, E& e) { + return Tuple5(a, b, c, d, e); +} + +template +inline Tuple6 MakeRefTuple(A& a, B& b, C& c, D& d, E& e, + F& f) { + return Tuple6(a, b, c, d, e, f); +} + +template +inline Tuple7 MakeRefTuple(A& a, B& b, C& c, D& d, + E& e, F& f, G& g) { + return Tuple7(a, b, c, d, e, f, g); +} + +template +inline Tuple8 MakeRefTuple(A& a, B& b, C& c, + D& d, E& e, F& f, + G& g, H& h) { + return Tuple8(a, b, c, d, e, f, g, h); +} + +// Dispatchers ---------------------------------------------------------------- +// +// Helper functions that call the given method on an object, with the unpacked +// tuple arguments. Notice that they all have the same number of arguments, +// so you need only write: +// DispatchToMethod(object, &Object::method, args); +// This is very useful for templated dispatchers, since they don't need to know +// what type |args| is. + +// Non-Static Dispatchers with no out params. + +template +inline void DispatchToMethod(ObjT* obj, Method method, const Tuple0& arg) { + (obj->*method)(); +} + +template +inline void DispatchToMethod(ObjT* obj, Method method, const A& arg) { + (obj->*method)(base::cef_internal::UnwrapTraits::Unwrap(arg)); +} + +template +inline void DispatchToMethod(ObjT* obj, Method method, const Tuple1& arg) { + (obj->*method)(base::cef_internal::UnwrapTraits::Unwrap(arg.a)); +} + +template +inline void DispatchToMethod(ObjT* obj, + Method method, + const Tuple2& arg) { + (obj->*method)(base::cef_internal::UnwrapTraits::Unwrap(arg.a), + base::cef_internal::UnwrapTraits::Unwrap(arg.b)); +} + +template +inline void DispatchToMethod(ObjT* obj, Method method, + const Tuple3& arg) { + (obj->*method)(base::cef_internal::UnwrapTraits::Unwrap(arg.a), + base::cef_internal::UnwrapTraits::Unwrap(arg.b), + base::cef_internal::UnwrapTraits::Unwrap(arg.c)); +} + +template +inline void DispatchToMethod(ObjT* obj, Method method, + const Tuple4& arg) { + (obj->*method)(base::cef_internal::UnwrapTraits::Unwrap(arg.a), + base::cef_internal::UnwrapTraits::Unwrap(arg.b), + base::cef_internal::UnwrapTraits::Unwrap(arg.c), + base::cef_internal::UnwrapTraits::Unwrap(arg.d)); +} + +template +inline void DispatchToMethod(ObjT* obj, Method method, + const Tuple5& arg) { + (obj->*method)(base::cef_internal::UnwrapTraits::Unwrap(arg.a), + base::cef_internal::UnwrapTraits::Unwrap(arg.b), + base::cef_internal::UnwrapTraits::Unwrap(arg.c), + base::cef_internal::UnwrapTraits::Unwrap(arg.d), + base::cef_internal::UnwrapTraits::Unwrap(arg.e)); +} + +template +inline void DispatchToMethod(ObjT* obj, Method method, + const Tuple6& arg) { + (obj->*method)(base::cef_internal::UnwrapTraits::Unwrap(arg.a), + base::cef_internal::UnwrapTraits::Unwrap(arg.b), + base::cef_internal::UnwrapTraits::Unwrap(arg.c), + base::cef_internal::UnwrapTraits::Unwrap(arg.d), + base::cef_internal::UnwrapTraits::Unwrap(arg.e), + base::cef_internal::UnwrapTraits::Unwrap(arg.f)); +} + +template +inline void DispatchToMethod(ObjT* obj, Method method, + const Tuple7& arg) { + (obj->*method)(base::cef_internal::UnwrapTraits::Unwrap(arg.a), + base::cef_internal::UnwrapTraits::Unwrap(arg.b), + base::cef_internal::UnwrapTraits::Unwrap(arg.c), + base::cef_internal::UnwrapTraits::Unwrap(arg.d), + base::cef_internal::UnwrapTraits::Unwrap(arg.e), + base::cef_internal::UnwrapTraits::Unwrap(arg.f), + base::cef_internal::UnwrapTraits::Unwrap(arg.g)); +} + +template +inline void DispatchToMethod(ObjT* obj, Method method, + const Tuple8& arg) { + (obj->*method)(base::cef_internal::UnwrapTraits::Unwrap(arg.a), + base::cef_internal::UnwrapTraits::Unwrap(arg.b), + base::cef_internal::UnwrapTraits::Unwrap(arg.c), + base::cef_internal::UnwrapTraits::Unwrap(arg.d), + base::cef_internal::UnwrapTraits::Unwrap(arg.e), + base::cef_internal::UnwrapTraits::Unwrap(arg.f), + base::cef_internal::UnwrapTraits::Unwrap(arg.g), + base::cef_internal::UnwrapTraits::Unwrap(arg.h)); +} + +// Static Dispatchers with no out params. + +template +inline void DispatchToFunction(Function function, const Tuple0& arg) { + (*function)(); +} + +template +inline void DispatchToFunction(Function function, const A& arg) { + (*function)(arg); +} + +template +inline void DispatchToFunction(Function function, const Tuple1& arg) { + (*function)(base::cef_internal::UnwrapTraits::Unwrap(arg.a)); +} + +template +inline void DispatchToFunction(Function function, const Tuple2& arg) { + (*function)(base::cef_internal::UnwrapTraits::Unwrap(arg.a), + base::cef_internal::UnwrapTraits::Unwrap(arg.b)); +} + +template +inline void DispatchToFunction(Function function, const Tuple3& arg) { + (*function)(base::cef_internal::UnwrapTraits::Unwrap(arg.a), + base::cef_internal::UnwrapTraits::Unwrap(arg.b), + base::cef_internal::UnwrapTraits::Unwrap(arg.c)); +} + +template +inline void DispatchToFunction(Function function, + const Tuple4& arg) { + (*function)(base::cef_internal::UnwrapTraits::Unwrap(arg.a), + base::cef_internal::UnwrapTraits::Unwrap(arg.b), + base::cef_internal::UnwrapTraits::Unwrap(arg.c), + base::cef_internal::UnwrapTraits::Unwrap(arg.d)); +} + +template +inline void DispatchToFunction(Function function, + const Tuple5& arg) { + (*function)(base::cef_internal::UnwrapTraits::Unwrap(arg.a), + base::cef_internal::UnwrapTraits::Unwrap(arg.b), + base::cef_internal::UnwrapTraits::Unwrap(arg.c), + base::cef_internal::UnwrapTraits::Unwrap(arg.d), + base::cef_internal::UnwrapTraits::Unwrap(arg.e)); +} + +template +inline void DispatchToFunction(Function function, + const Tuple6& arg) { + (*function)(base::cef_internal::UnwrapTraits::Unwrap(arg.a), + base::cef_internal::UnwrapTraits::Unwrap(arg.b), + base::cef_internal::UnwrapTraits::Unwrap(arg.c), + base::cef_internal::UnwrapTraits::Unwrap(arg.d), + base::cef_internal::UnwrapTraits::Unwrap(arg.e), + base::cef_internal::UnwrapTraits::Unwrap(arg.f)); +} + +template +inline void DispatchToFunction(Function function, + const Tuple7& arg) { + (*function)(base::cef_internal::UnwrapTraits::Unwrap(arg.a), + base::cef_internal::UnwrapTraits::Unwrap(arg.b), + base::cef_internal::UnwrapTraits::Unwrap(arg.c), + base::cef_internal::UnwrapTraits::Unwrap(arg.d), + base::cef_internal::UnwrapTraits::Unwrap(arg.e), + base::cef_internal::UnwrapTraits::Unwrap(arg.f), + base::cef_internal::UnwrapTraits::Unwrap(arg.g)); +} + +template +inline void DispatchToFunction(Function function, + const Tuple8& arg) { + (*function)(base::cef_internal::UnwrapTraits::Unwrap(arg.a), + base::cef_internal::UnwrapTraits::Unwrap(arg.b), + base::cef_internal::UnwrapTraits::Unwrap(arg.c), + base::cef_internal::UnwrapTraits::Unwrap(arg.d), + base::cef_internal::UnwrapTraits::Unwrap(arg.e), + base::cef_internal::UnwrapTraits::Unwrap(arg.f), + base::cef_internal::UnwrapTraits::Unwrap(arg.g), + base::cef_internal::UnwrapTraits::Unwrap(arg.h)); +} + +// Dispatchers with 0 out param (as a Tuple0). + +template +inline void DispatchToMethod(ObjT* obj, + Method method, + const Tuple0& arg, Tuple0*) { + (obj->*method)(); +} + +template +inline void DispatchToMethod(ObjT* obj, Method method, const A& arg, Tuple0*) { + (obj->*method)(base::cef_internal::UnwrapTraits::Unwrap(arg)); +} + +template +inline void DispatchToMethod(ObjT* obj, + Method method, + const Tuple1& arg, Tuple0*) { + (obj->*method)(base::cef_internal::UnwrapTraits::Unwrap(arg.a)); +} + +template +inline void DispatchToMethod(ObjT* obj, + Method method, + const Tuple2& arg, Tuple0*) { + (obj->*method)(base::cef_internal::UnwrapTraits::Unwrap(arg.a), + base::cef_internal::UnwrapTraits::Unwrap(arg.b)); +} + +template +inline void DispatchToMethod(ObjT* obj, Method method, + const Tuple3& arg, Tuple0*) { + (obj->*method)(base::cef_internal::UnwrapTraits::Unwrap(arg.a), + base::cef_internal::UnwrapTraits::Unwrap(arg.b), + base::cef_internal::UnwrapTraits::Unwrap(arg.c)); +} + +template +inline void DispatchToMethod(ObjT* obj, Method method, + const Tuple4& arg, Tuple0*) { + (obj->*method)(base::cef_internal::UnwrapTraits::Unwrap(arg.a), + base::cef_internal::UnwrapTraits::Unwrap(arg.b), + base::cef_internal::UnwrapTraits::Unwrap(arg.c), + base::cef_internal::UnwrapTraits::Unwrap(arg.d)); +} + +template +inline void DispatchToMethod(ObjT* obj, Method method, + const Tuple5& arg, Tuple0*) { + (obj->*method)(base::cef_internal::UnwrapTraits::Unwrap(arg.a), + base::cef_internal::UnwrapTraits::Unwrap(arg.b), + base::cef_internal::UnwrapTraits::Unwrap(arg.c), + base::cef_internal::UnwrapTraits::Unwrap(arg.d), + base::cef_internal::UnwrapTraits::Unwrap(arg.e)); +} + +template +inline void DispatchToMethod(ObjT* obj, Method method, + const Tuple6& arg, Tuple0*) { + (obj->*method)(base::cef_internal::UnwrapTraits::Unwrap(arg.a), + base::cef_internal::UnwrapTraits::Unwrap(arg.b), + base::cef_internal::UnwrapTraits::Unwrap(arg.c), + base::cef_internal::UnwrapTraits::Unwrap(arg.d), + base::cef_internal::UnwrapTraits::Unwrap(arg.e), + base::cef_internal::UnwrapTraits::Unwrap(arg.f)); +} + +// Dispatchers with 1 out param. + +template +inline void DispatchToMethod(ObjT* obj, Method method, + const Tuple0& in, + Tuple1* out) { + (obj->*method)(&out->a); +} + +template +inline void DispatchToMethod(ObjT* obj, Method method, + const InA& in, + Tuple1* out) { + (obj->*method)(in, &out->a); +} + +template +inline void DispatchToMethod(ObjT* obj, Method method, + const Tuple1& in, + Tuple1* out) { + (obj->*method)(base::cef_internal::UnwrapTraits::Unwrap(in.a), &out->a); +} + +template +inline void DispatchToMethod(ObjT* obj, Method method, + const Tuple2& in, + Tuple1* out) { + (obj->*method)(base::cef_internal::UnwrapTraits::Unwrap(in.a), + base::cef_internal::UnwrapTraits::Unwrap(in.b), + &out->a); +} + +template +inline void DispatchToMethod(ObjT* obj, Method method, + const Tuple3& in, + Tuple1* out) { + (obj->*method)(base::cef_internal::UnwrapTraits::Unwrap(in.a), + base::cef_internal::UnwrapTraits::Unwrap(in.b), + base::cef_internal::UnwrapTraits::Unwrap(in.c), + &out->a); +} + +template +inline void DispatchToMethod(ObjT* obj, Method method, + const Tuple4& in, + Tuple1* out) { + (obj->*method)(base::cef_internal::UnwrapTraits::Unwrap(in.a), + base::cef_internal::UnwrapTraits::Unwrap(in.b), + base::cef_internal::UnwrapTraits::Unwrap(in.c), + base::cef_internal::UnwrapTraits::Unwrap(in.d), + &out->a); +} + +template +inline void DispatchToMethod(ObjT* obj, Method method, + const Tuple5& in, + Tuple1* out) { + (obj->*method)(base::cef_internal::UnwrapTraits::Unwrap(in.a), + base::cef_internal::UnwrapTraits::Unwrap(in.b), + base::cef_internal::UnwrapTraits::Unwrap(in.c), + base::cef_internal::UnwrapTraits::Unwrap(in.d), + base::cef_internal::UnwrapTraits::Unwrap(in.e), + &out->a); +} + +template +inline void DispatchToMethod(ObjT* obj, Method method, + const Tuple6& in, + Tuple1* out) { + (obj->*method)(base::cef_internal::UnwrapTraits::Unwrap(in.a), + base::cef_internal::UnwrapTraits::Unwrap(in.b), + base::cef_internal::UnwrapTraits::Unwrap(in.c), + base::cef_internal::UnwrapTraits::Unwrap(in.d), + base::cef_internal::UnwrapTraits::Unwrap(in.e), + base::cef_internal::UnwrapTraits::Unwrap(in.f), + &out->a); +} + +// Dispatchers with 2 out params. + +template +inline void DispatchToMethod(ObjT* obj, Method method, + const Tuple0& in, + Tuple2* out) { + (obj->*method)(&out->a, &out->b); +} + +template +inline void DispatchToMethod(ObjT* obj, Method method, + const InA& in, + Tuple2* out) { + (obj->*method)(in, &out->a, &out->b); +} + +template +inline void DispatchToMethod(ObjT* obj, Method method, + const Tuple1& in, + Tuple2* out) { + (obj->*method)( + base::cef_internal::UnwrapTraits::Unwrap(in.a), &out->a, &out->b); +} + +template +inline void DispatchToMethod(ObjT* obj, Method method, + const Tuple2& in, + Tuple2* out) { + (obj->*method)(base::cef_internal::UnwrapTraits::Unwrap(in.a), + base::cef_internal::UnwrapTraits::Unwrap(in.b), + &out->a, + &out->b); +} + +template +inline void DispatchToMethod(ObjT* obj, Method method, + const Tuple3& in, + Tuple2* out) { + (obj->*method)(base::cef_internal::UnwrapTraits::Unwrap(in.a), + base::cef_internal::UnwrapTraits::Unwrap(in.b), + base::cef_internal::UnwrapTraits::Unwrap(in.c), + &out->a, + &out->b); +} + +template +inline void DispatchToMethod(ObjT* obj, Method method, + const Tuple4& in, + Tuple2* out) { + (obj->*method)(base::cef_internal::UnwrapTraits::Unwrap(in.a), + base::cef_internal::UnwrapTraits::Unwrap(in.b), + base::cef_internal::UnwrapTraits::Unwrap(in.c), + base::cef_internal::UnwrapTraits::Unwrap(in.d), + &out->a, + &out->b); +} + +template +inline void DispatchToMethod(ObjT* obj, Method method, + const Tuple5& in, + Tuple2* out) { + (obj->*method)(base::cef_internal::UnwrapTraits::Unwrap(in.a), + base::cef_internal::UnwrapTraits::Unwrap(in.b), + base::cef_internal::UnwrapTraits::Unwrap(in.c), + base::cef_internal::UnwrapTraits::Unwrap(in.d), + base::cef_internal::UnwrapTraits::Unwrap(in.e), + &out->a, + &out->b); +} + +template +inline void DispatchToMethod(ObjT* obj, Method method, + const Tuple6& in, + Tuple2* out) { + (obj->*method)(base::cef_internal::UnwrapTraits::Unwrap(in.a), + base::cef_internal::UnwrapTraits::Unwrap(in.b), + base::cef_internal::UnwrapTraits::Unwrap(in.c), + base::cef_internal::UnwrapTraits::Unwrap(in.d), + base::cef_internal::UnwrapTraits::Unwrap(in.e), + base::cef_internal::UnwrapTraits::Unwrap(in.f), + &out->a, + &out->b); +} + +// Dispatchers with 3 out params. + +template +inline void DispatchToMethod(ObjT* obj, Method method, + const Tuple0& in, + Tuple3* out) { + (obj->*method)(&out->a, &out->b, &out->c); +} + +template +inline void DispatchToMethod(ObjT* obj, Method method, + const InA& in, + Tuple3* out) { + (obj->*method)(in, &out->a, &out->b, &out->c); +} + +template +inline void DispatchToMethod(ObjT* obj, Method method, + const Tuple1& in, + Tuple3* out) { + (obj->*method)(base::cef_internal::UnwrapTraits::Unwrap(in.a), + &out->a, + &out->b, + &out->c); +} + +template +inline void DispatchToMethod(ObjT* obj, Method method, + const Tuple2& in, + Tuple3* out) { + (obj->*method)(base::cef_internal::UnwrapTraits::Unwrap(in.a), + base::cef_internal::UnwrapTraits::Unwrap(in.b), + &out->a, + &out->b, + &out->c); +} + +template +inline void DispatchToMethod(ObjT* obj, Method method, + const Tuple3& in, + Tuple3* out) { + (obj->*method)(base::cef_internal::UnwrapTraits::Unwrap(in.a), + base::cef_internal::UnwrapTraits::Unwrap(in.b), + base::cef_internal::UnwrapTraits::Unwrap(in.c), + &out->a, + &out->b, + &out->c); +} + +template +inline void DispatchToMethod(ObjT* obj, Method method, + const Tuple4& in, + Tuple3* out) { + (obj->*method)(base::cef_internal::UnwrapTraits::Unwrap(in.a), + base::cef_internal::UnwrapTraits::Unwrap(in.b), + base::cef_internal::UnwrapTraits::Unwrap(in.c), + base::cef_internal::UnwrapTraits::Unwrap(in.d), + &out->a, + &out->b, + &out->c); +} + +template +inline void DispatchToMethod(ObjT* obj, Method method, + const Tuple5& in, + Tuple3* out) { + (obj->*method)(base::cef_internal::UnwrapTraits::Unwrap(in.a), + base::cef_internal::UnwrapTraits::Unwrap(in.b), + base::cef_internal::UnwrapTraits::Unwrap(in.c), + base::cef_internal::UnwrapTraits::Unwrap(in.d), + base::cef_internal::UnwrapTraits::Unwrap(in.e), + &out->a, + &out->b, + &out->c); +} + +template +inline void DispatchToMethod(ObjT* obj, Method method, + const Tuple6& in, + Tuple3* out) { + (obj->*method)(base::cef_internal::UnwrapTraits::Unwrap(in.a), + base::cef_internal::UnwrapTraits::Unwrap(in.b), + base::cef_internal::UnwrapTraits::Unwrap(in.c), + base::cef_internal::UnwrapTraits::Unwrap(in.d), + base::cef_internal::UnwrapTraits::Unwrap(in.e), + base::cef_internal::UnwrapTraits::Unwrap(in.f), + &out->a, + &out->b, + &out->c); +} + +// Dispatchers with 4 out params. + +template +inline void DispatchToMethod(ObjT* obj, Method method, + const Tuple0& in, + Tuple4* out) { + (obj->*method)(&out->a, &out->b, &out->c, &out->d); +} + +template +inline void DispatchToMethod(ObjT* obj, Method method, + const InA& in, + Tuple4* out) { + (obj->*method)(base::cef_internal::UnwrapTraits::Unwrap(in), + &out->a, + &out->b, + &out->c, + &out->d); +} + +template +inline void DispatchToMethod(ObjT* obj, Method method, + const Tuple1& in, + Tuple4* out) { + (obj->*method)(base::cef_internal::UnwrapTraits::Unwrap(in.a), + &out->a, + &out->b, + &out->c, + &out->d); +} + +template +inline void DispatchToMethod(ObjT* obj, Method method, + const Tuple2& in, + Tuple4* out) { + (obj->*method)(base::cef_internal::UnwrapTraits::Unwrap(in.a), + base::cef_internal::UnwrapTraits::Unwrap(in.b), + &out->a, + &out->b, + &out->c, + &out->d); +} + +template +inline void DispatchToMethod(ObjT* obj, Method method, + const Tuple3& in, + Tuple4* out) { + (obj->*method)(base::cef_internal::UnwrapTraits::Unwrap(in.a), + base::cef_internal::UnwrapTraits::Unwrap(in.b), + base::cef_internal::UnwrapTraits::Unwrap(in.c), + &out->a, + &out->b, + &out->c, + &out->d); +} + +template +inline void DispatchToMethod(ObjT* obj, Method method, + const Tuple4& in, + Tuple4* out) { + (obj->*method)(base::cef_internal::UnwrapTraits::Unwrap(in.a), + base::cef_internal::UnwrapTraits::Unwrap(in.b), + base::cef_internal::UnwrapTraits::Unwrap(in.c), + base::cef_internal::UnwrapTraits::Unwrap(in.d), + &out->a, + &out->b, + &out->c, + &out->d); +} + +template +inline void DispatchToMethod(ObjT* obj, Method method, + const Tuple5& in, + Tuple4* out) { + (obj->*method)(base::cef_internal::UnwrapTraits::Unwrap(in.a), + base::cef_internal::UnwrapTraits::Unwrap(in.b), + base::cef_internal::UnwrapTraits::Unwrap(in.c), + base::cef_internal::UnwrapTraits::Unwrap(in.d), + base::cef_internal::UnwrapTraits::Unwrap(in.e), + &out->a, + &out->b, + &out->c, + &out->d); +} + +template +inline void DispatchToMethod(ObjT* obj, Method method, + const Tuple6& in, + Tuple4* out) { + (obj->*method)(base::cef_internal::UnwrapTraits::Unwrap(in.a), + base::cef_internal::UnwrapTraits::Unwrap(in.b), + base::cef_internal::UnwrapTraits::Unwrap(in.c), + base::cef_internal::UnwrapTraits::Unwrap(in.d), + base::cef_internal::UnwrapTraits::Unwrap(in.e), + base::cef_internal::UnwrapTraits::Unwrap(in.f), + &out->a, + &out->b, + &out->c, + &out->d); +} + +// Dispatchers with 5 out params. + +template +inline void DispatchToMethod(ObjT* obj, Method method, + const Tuple0& in, + Tuple5* out) { + (obj->*method)(&out->a, &out->b, &out->c, &out->d, &out->e); +} + +template +inline void DispatchToMethod(ObjT* obj, Method method, + const InA& in, + Tuple5* out) { + (obj->*method)(base::cef_internal::UnwrapTraits::Unwrap(in), + &out->a, + &out->b, + &out->c, + &out->d, + &out->e); +} + +template +inline void DispatchToMethod(ObjT* obj, Method method, + const Tuple1& in, + Tuple5* out) { + (obj->*method)(base::cef_internal::UnwrapTraits::Unwrap(in.a), + &out->a, + &out->b, + &out->c, + &out->d, + &out->e); +} + +template +inline void DispatchToMethod(ObjT* obj, Method method, + const Tuple2& in, + Tuple5* out) { + (obj->*method)(base::cef_internal::UnwrapTraits::Unwrap(in.a), + base::cef_internal::UnwrapTraits::Unwrap(in.b), + &out->a, + &out->b, + &out->c, + &out->d, + &out->e); +} + +template +inline void DispatchToMethod(ObjT* obj, Method method, + const Tuple3& in, + Tuple5* out) { + (obj->*method)(base::cef_internal::UnwrapTraits::Unwrap(in.a), + base::cef_internal::UnwrapTraits::Unwrap(in.b), + base::cef_internal::UnwrapTraits::Unwrap(in.c), + &out->a, + &out->b, + &out->c, + &out->d, + &out->e); +} + +template +inline void DispatchToMethod(ObjT* obj, Method method, + const Tuple4& in, + Tuple5* out) { + (obj->*method)(base::cef_internal::UnwrapTraits::Unwrap(in.a), + base::cef_internal::UnwrapTraits::Unwrap(in.b), + base::cef_internal::UnwrapTraits::Unwrap(in.c), + base::cef_internal::UnwrapTraits::Unwrap(in.d), + &out->a, + &out->b, + &out->c, + &out->d, + &out->e); +} + +template +inline void DispatchToMethod(ObjT* obj, Method method, + const Tuple5& in, + Tuple5* out) { + (obj->*method)(base::cef_internal::UnwrapTraits::Unwrap(in.a), + base::cef_internal::UnwrapTraits::Unwrap(in.b), + base::cef_internal::UnwrapTraits::Unwrap(in.c), + base::cef_internal::UnwrapTraits::Unwrap(in.d), + base::cef_internal::UnwrapTraits::Unwrap(in.e), + &out->a, + &out->b, + &out->c, + &out->d, + &out->e); +} + +template +inline void DispatchToMethod(ObjT* obj, Method method, + const Tuple6& in, + Tuple5* out) { + (obj->*method)(base::cef_internal::UnwrapTraits::Unwrap(in.a), + base::cef_internal::UnwrapTraits::Unwrap(in.b), + base::cef_internal::UnwrapTraits::Unwrap(in.c), + base::cef_internal::UnwrapTraits::Unwrap(in.d), + base::cef_internal::UnwrapTraits::Unwrap(in.e), + base::cef_internal::UnwrapTraits::Unwrap(in.f), + &out->a, + &out->b, + &out->c, + &out->d, + &out->e); +} + +#endif // !BUILDING_CEF_SHARED + +#endif // CEF_INCLUDE_BASE_CEF_TUPLE_H_ diff --git a/dependencies64/cef/include/base/cef_weak_ptr.h b/dependencies64/cef/include/base/cef_weak_ptr.h new file mode 100644 index 000000000..f2a50fc66 --- /dev/null +++ b/dependencies64/cef/include/base/cef_weak_ptr.h @@ -0,0 +1,382 @@ +// Copyright (c) 2014 Marshall A. Greenblatt. Portions copyright (c) 2012 +// Google Inc. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +// Weak pointers are pointers to an object that do not affect its lifetime, +// and which may be invalidated (i.e. reset to NULL) by the object, or its +// owner, at any time, most commonly when the object is about to be deleted. + +// Weak pointers are useful when an object needs to be accessed safely by one +// or more objects other than its owner, and those callers can cope with the +// object vanishing and e.g. tasks posted to it being silently dropped. +// Reference-counting such an object would complicate the ownership graph and +// make it harder to reason about the object's lifetime. + +// EXAMPLE: +// +// class Controller { +// public: +// void SpawnWorker() { Worker::StartNew(weak_factory_.GetWeakPtr()); } +// void WorkComplete(const Result& result) { ... } +// private: +// // Member variables should appear before the WeakPtrFactory, to ensure +// // that any WeakPtrs to Controller are invalidated before its members +// // variable's destructors are executed, rendering them invalid. +// WeakPtrFactory weak_factory_; +// }; +// +// class Worker { +// public: +// static void StartNew(const WeakPtr& controller) { +// Worker* worker = new Worker(controller); +// // Kick off asynchronous processing... +// } +// private: +// Worker(const WeakPtr& controller) +// : controller_(controller) {} +// void DidCompleteAsynchronousProcessing(const Result& result) { +// if (controller_) +// controller_->WorkComplete(result); +// } +// WeakPtr controller_; +// }; +// +// With this implementation a caller may use SpawnWorker() to dispatch multiple +// Workers and subsequently delete the Controller, without waiting for all +// Workers to have completed. + +// ------------------------- IMPORTANT: Thread-safety ------------------------- + +// Weak pointers may be passed safely between threads, but must always be +// dereferenced and invalidated on the same thread otherwise checking the +// pointer would be racey. +// +// To ensure correct use, the first time a WeakPtr issued by a WeakPtrFactory +// is dereferenced, the factory and its WeakPtrs become bound to the calling +// thread, and cannot be dereferenced or invalidated on any other thread. Bound +// WeakPtrs can still be handed off to other threads, e.g. to use to post tasks +// back to object on the bound thread. +// +// Invalidating the factory's WeakPtrs un-binds it from the thread, allowing it +// to be passed for a different thread to use or delete it. + +#ifndef CEF_INCLUDE_BASE_CEF_WEAK_PTR_H_ +#define CEF_INCLUDE_BASE_CEF_WEAK_PTR_H_ +#pragma once + +#if defined(BASE_MEMORY_WEAK_PTR_H_) +// Do nothing if the Chromium header has already been included. +// This can happen in cases where Chromium code is used directly by the +// client application. When using Chromium code directly always include +// the Chromium header first to avoid type conflicts. +#elif defined(BUILDING_CEF_SHARED) +// When building CEF include the Chromium header directly. +#include "base/memory/weak_ptr.h" +#else // !BUILDING_CEF_SHARED +// The following is substantially similar to the Chromium implementation. +// If the Chromium implementation diverges the below implementation should be +// updated to match. + +#include "include/base/cef_basictypes.h" +#include "include/base/cef_logging.h" +#include "include/base/cef_ref_counted.h" +#include "include/base/cef_template_util.h" +#include "include/base/cef_thread_checker.h" + +namespace base { + +template class SupportsWeakPtr; +template class WeakPtr; + +namespace cef_internal { +// These classes are part of the WeakPtr implementation. +// DO NOT USE THESE CLASSES DIRECTLY YOURSELF. + +class WeakReference { + public: + // Although Flag is bound to a specific thread, it may be deleted from another + // via base::WeakPtr::~WeakPtr(). + class Flag : public RefCountedThreadSafe { + public: + Flag(); + + void Invalidate(); + bool IsValid() const; + + private: + friend class base::RefCountedThreadSafe; + + ~Flag(); + + // The current Chromium implementation uses SequenceChecker instead of + // ThreadChecker to support SequencedWorkerPools. CEF does not yet expose + // the concept of SequencedWorkerPools. + ThreadChecker thread_checker_; + bool is_valid_; + }; + + WeakReference(); + explicit WeakReference(const Flag* flag); + ~WeakReference(); + + bool is_valid() const; + + private: + scoped_refptr flag_; +}; + +class WeakReferenceOwner { + public: + WeakReferenceOwner(); + ~WeakReferenceOwner(); + + WeakReference GetRef() const; + + bool HasRefs() const { + return flag_.get() && !flag_->HasOneRef(); + } + + void Invalidate(); + + private: + mutable scoped_refptr flag_; +}; + +// This class simplifies the implementation of WeakPtr's type conversion +// constructor by avoiding the need for a public accessor for ref_. A +// WeakPtr cannot access the private members of WeakPtr, so this +// base class gives us a way to access ref_ in a protected fashion. +class WeakPtrBase { + public: + WeakPtrBase(); + ~WeakPtrBase(); + + protected: + explicit WeakPtrBase(const WeakReference& ref); + + WeakReference ref_; +}; + +// This class provides a common implementation of common functions that would +// otherwise get instantiated separately for each distinct instantiation of +// SupportsWeakPtr<>. +class SupportsWeakPtrBase { + public: + // A safe static downcast of a WeakPtr to WeakPtr. This + // conversion will only compile if there is exists a Base which inherits + // from SupportsWeakPtr. See base::AsWeakPtr() below for a helper + // function that makes calling this easier. + template + static WeakPtr StaticAsWeakPtr(Derived* t) { + typedef + is_convertible convertible; + COMPILE_ASSERT(convertible::value, + AsWeakPtr_argument_inherits_from_SupportsWeakPtr); + return AsWeakPtrImpl(t, *t); + } + + private: + // This template function uses type inference to find a Base of Derived + // which is an instance of SupportsWeakPtr. We can then safely + // static_cast the Base* to a Derived*. + template + static WeakPtr AsWeakPtrImpl( + Derived* t, const SupportsWeakPtr&) { + WeakPtr ptr = t->Base::AsWeakPtr(); + return WeakPtr(ptr.ref_, static_cast(ptr.ptr_)); + } +}; + +} // namespace cef_internal + +template class WeakPtrFactory; + +// The WeakPtr class holds a weak reference to |T*|. +// +// This class is designed to be used like a normal pointer. You should always +// null-test an object of this class before using it or invoking a method that +// may result in the underlying object being destroyed. +// +// EXAMPLE: +// +// class Foo { ... }; +// WeakPtr foo; +// if (foo) +// foo->method(); +// +template +class WeakPtr : public cef_internal::WeakPtrBase { + public: + WeakPtr() : ptr_(NULL) { + } + + // Allow conversion from U to T provided U "is a" T. Note that this + // is separate from the (implicit) copy constructor. + template + WeakPtr(const WeakPtr& other) : WeakPtrBase(other), ptr_(other.ptr_) { + } + + T* get() const { return ref_.is_valid() ? ptr_ : NULL; } + + T& operator*() const { + DCHECK(get() != NULL); + return *get(); + } + T* operator->() const { + DCHECK(get() != NULL); + return get(); + } + + // Allow WeakPtr to be used in boolean expressions, but not + // implicitly convertible to a real bool (which is dangerous). + // + // Note that this trick is only safe when the == and != operators + // are declared explicitly, as otherwise "weak_ptr1 == weak_ptr2" + // will compile but do the wrong thing (i.e., convert to Testable + // and then do the comparison). + private: + typedef T* WeakPtr::*Testable; + + public: + operator Testable() const { return get() ? &WeakPtr::ptr_ : NULL; } + + void reset() { + ref_ = cef_internal::WeakReference(); + ptr_ = NULL; + } + + private: + // Explicitly declare comparison operators as required by the bool + // trick, but keep them private. + template bool operator==(WeakPtr const&) const; + template bool operator!=(WeakPtr const&) const; + + friend class cef_internal::SupportsWeakPtrBase; + template friend class WeakPtr; + friend class SupportsWeakPtr; + friend class WeakPtrFactory; + + WeakPtr(const cef_internal::WeakReference& ref, T* ptr) + : WeakPtrBase(ref), + ptr_(ptr) { + } + + // This pointer is only valid when ref_.is_valid() is true. Otherwise, its + // value is undefined (as opposed to NULL). + T* ptr_; +}; + +// A class may be composed of a WeakPtrFactory and thereby +// control how it exposes weak pointers to itself. This is helpful if you only +// need weak pointers within the implementation of a class. This class is also +// useful when working with primitive types. For example, you could have a +// WeakPtrFactory that is used to pass around a weak reference to a bool. +template +class WeakPtrFactory { + public: + explicit WeakPtrFactory(T* ptr) : ptr_(ptr) { + } + + ~WeakPtrFactory() { + ptr_ = NULL; + } + + WeakPtr GetWeakPtr() { + DCHECK(ptr_); + return WeakPtr(weak_reference_owner_.GetRef(), ptr_); + } + + // Call this method to invalidate all existing weak pointers. + void InvalidateWeakPtrs() { + DCHECK(ptr_); + weak_reference_owner_.Invalidate(); + } + + // Call this method to determine if any weak pointers exist. + bool HasWeakPtrs() const { + DCHECK(ptr_); + return weak_reference_owner_.HasRefs(); + } + + private: + cef_internal::WeakReferenceOwner weak_reference_owner_; + T* ptr_; + DISALLOW_IMPLICIT_CONSTRUCTORS(WeakPtrFactory); +}; + +// A class may extend from SupportsWeakPtr to let others take weak pointers to +// it. This avoids the class itself implementing boilerplate to dispense weak +// pointers. However, since SupportsWeakPtr's destructor won't invalidate +// weak pointers to the class until after the derived class' members have been +// destroyed, its use can lead to subtle use-after-destroy issues. +template +class SupportsWeakPtr : public cef_internal::SupportsWeakPtrBase { + public: + SupportsWeakPtr() {} + + WeakPtr AsWeakPtr() { + return WeakPtr(weak_reference_owner_.GetRef(), static_cast(this)); + } + + protected: + ~SupportsWeakPtr() {} + + private: + cef_internal::WeakReferenceOwner weak_reference_owner_; + DISALLOW_COPY_AND_ASSIGN(SupportsWeakPtr); +}; + +// Helper function that uses type deduction to safely return a WeakPtr +// when Derived doesn't directly extend SupportsWeakPtr, instead it +// extends a Base that extends SupportsWeakPtr. +// +// EXAMPLE: +// class Base : public base::SupportsWeakPtr {}; +// class Derived : public Base {}; +// +// Derived derived; +// base::WeakPtr ptr = base::AsWeakPtr(&derived); +// +// Note that the following doesn't work (invalid type conversion) since +// Derived::AsWeakPtr() is WeakPtr SupportsWeakPtr::AsWeakPtr(), +// and there's no way to safely cast WeakPtr to WeakPtr at +// the caller. +// +// base::WeakPtr ptr = derived.AsWeakPtr(); // Fails. + +template +WeakPtr AsWeakPtr(Derived* t) { + return cef_internal::SupportsWeakPtrBase::StaticAsWeakPtr(t); +} + +} // namespace base + +#endif // !BUILDING_CEF_SHARED + +#endif // CEF_INCLUDE_BASE_CEF_WEAK_PTR_H_ diff --git a/dependencies64/cef/include/base/internal/cef_atomicops_x86_msvc.h b/dependencies64/cef/include/base/internal/cef_atomicops_x86_msvc.h new file mode 100644 index 000000000..12bb0f468 --- /dev/null +++ b/dependencies64/cef/include/base/internal/cef_atomicops_x86_msvc.h @@ -0,0 +1,224 @@ +// Copyright (c) 2008 Google Inc. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +// Do not include this header file directly. Use base/cef_atomicops.h +// instead. + +#ifndef CEF_INCLUDE_BASE_INTERNAL_CEF_ATOMICOPS_X86_MSVC_H_ +#define CEF_INCLUDE_BASE_INTERNAL_CEF_ATOMICOPS_X86_MSVC_H_ + +#include + +#include + +#include "include/base/cef_macros.h" + +#if defined(ARCH_CPU_64_BITS) +// windows.h #defines this (only on x64). This causes problems because the +// public API also uses MemoryBarrier at the public name for this fence. So, on +// X64, undef it, and call its documented +// (http://msdn.microsoft.com/en-us/library/windows/desktop/ms684208.aspx) +// implementation directly. +#undef MemoryBarrier +#endif + +namespace base { +namespace subtle { + +inline Atomic32 NoBarrier_CompareAndSwap(volatile Atomic32* ptr, + Atomic32 old_value, + Atomic32 new_value) { + LONG result = _InterlockedCompareExchange( + reinterpret_cast(ptr), + static_cast(new_value), + static_cast(old_value)); + return static_cast(result); +} + +inline Atomic32 NoBarrier_AtomicExchange(volatile Atomic32* ptr, + Atomic32 new_value) { + LONG result = _InterlockedExchange( + reinterpret_cast(ptr), + static_cast(new_value)); + return static_cast(result); +} + +inline Atomic32 Barrier_AtomicIncrement(volatile Atomic32* ptr, + Atomic32 increment) { + return _InterlockedExchangeAdd( + reinterpret_cast(ptr), + static_cast(increment)) + increment; +} + +inline Atomic32 NoBarrier_AtomicIncrement(volatile Atomic32* ptr, + Atomic32 increment) { + return Barrier_AtomicIncrement(ptr, increment); +} + +#if !(defined(_MSC_VER) && _MSC_VER >= 1400) +#error "We require at least vs2005 for MemoryBarrier" +#endif +inline void MemoryBarrier() { +#if defined(ARCH_CPU_64_BITS) + // See #undef and note at the top of this file. + __faststorefence(); +#else + // We use MemoryBarrier from WinNT.h + ::MemoryBarrier(); +#endif +} + +inline Atomic32 Acquire_CompareAndSwap(volatile Atomic32* ptr, + Atomic32 old_value, + Atomic32 new_value) { + return NoBarrier_CompareAndSwap(ptr, old_value, new_value); +} + +inline Atomic32 Release_CompareAndSwap(volatile Atomic32* ptr, + Atomic32 old_value, + Atomic32 new_value) { + return NoBarrier_CompareAndSwap(ptr, old_value, new_value); +} + +inline void NoBarrier_Store(volatile Atomic32* ptr, Atomic32 value) { + *ptr = value; +} + +inline void Acquire_Store(volatile Atomic32* ptr, Atomic32 value) { + NoBarrier_AtomicExchange(ptr, value); + // acts as a barrier in this implementation +} + +inline void Release_Store(volatile Atomic32* ptr, Atomic32 value) { + *ptr = value; // works w/o barrier for current Intel chips as of June 2005 + // See comments in Atomic64 version of Release_Store() below. +} + +inline Atomic32 NoBarrier_Load(volatile const Atomic32* ptr) { + return *ptr; +} + +inline Atomic32 Acquire_Load(volatile const Atomic32* ptr) { + Atomic32 value = *ptr; + return value; +} + +inline Atomic32 Release_Load(volatile const Atomic32* ptr) { + MemoryBarrier(); + return *ptr; +} + +#if defined(_WIN64) + +// 64-bit low-level operations on 64-bit platform. + +COMPILE_ASSERT(sizeof(Atomic64) == sizeof(PVOID), atomic_word_is_atomic); + +inline Atomic64 NoBarrier_CompareAndSwap(volatile Atomic64* ptr, + Atomic64 old_value, + Atomic64 new_value) { + PVOID result = InterlockedCompareExchangePointer( + reinterpret_cast(ptr), + reinterpret_cast(new_value), reinterpret_cast(old_value)); + return reinterpret_cast(result); +} + +inline Atomic64 NoBarrier_AtomicExchange(volatile Atomic64* ptr, + Atomic64 new_value) { + PVOID result = InterlockedExchangePointer( + reinterpret_cast(ptr), + reinterpret_cast(new_value)); + return reinterpret_cast(result); +} + +inline Atomic64 Barrier_AtomicIncrement(volatile Atomic64* ptr, + Atomic64 increment) { + return InterlockedExchangeAdd64( + reinterpret_cast(ptr), + static_cast(increment)) + increment; +} + +inline Atomic64 NoBarrier_AtomicIncrement(volatile Atomic64* ptr, + Atomic64 increment) { + return Barrier_AtomicIncrement(ptr, increment); +} + +inline void NoBarrier_Store(volatile Atomic64* ptr, Atomic64 value) { + *ptr = value; +} + +inline void Acquire_Store(volatile Atomic64* ptr, Atomic64 value) { + NoBarrier_AtomicExchange(ptr, value); + // acts as a barrier in this implementation +} + +inline void Release_Store(volatile Atomic64* ptr, Atomic64 value) { + *ptr = value; // works w/o barrier for current Intel chips as of June 2005 + + // When new chips come out, check: + // IA-32 Intel Architecture Software Developer's Manual, Volume 3: + // System Programming Guide, Chatper 7: Multiple-processor management, + // Section 7.2, Memory Ordering. + // Last seen at: + // http://developer.intel.com/design/pentium4/manuals/index_new.htm +} + +inline Atomic64 NoBarrier_Load(volatile const Atomic64* ptr) { + return *ptr; +} + +inline Atomic64 Acquire_Load(volatile const Atomic64* ptr) { + Atomic64 value = *ptr; + return value; +} + +inline Atomic64 Release_Load(volatile const Atomic64* ptr) { + MemoryBarrier(); + return *ptr; +} + +inline Atomic64 Acquire_CompareAndSwap(volatile Atomic64* ptr, + Atomic64 old_value, + Atomic64 new_value) { + return NoBarrier_CompareAndSwap(ptr, old_value, new_value); +} + +inline Atomic64 Release_CompareAndSwap(volatile Atomic64* ptr, + Atomic64 old_value, + Atomic64 new_value) { + return NoBarrier_CompareAndSwap(ptr, old_value, new_value); +} + + +#endif // defined(_WIN64) + +} // namespace base::subtle +} // namespace base + +#endif // CEF_INCLUDE_BASE_INTERNAL_CEF_ATOMICOPS_X86_MSVC_H_ diff --git a/dependencies64/cef/include/base/internal/cef_bind_internal.h b/dependencies64/cef/include/base/internal/cef_bind_internal.h new file mode 100644 index 000000000..cd32d256d --- /dev/null +++ b/dependencies64/cef/include/base/internal/cef_bind_internal.h @@ -0,0 +1,2811 @@ +// Copyright (c) 2011 Google Inc. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +// Do not include this header file directly. Use base/cef_bind.h instead. + +#ifndef CEF_INCLUDE_BASE_INTERNAL_CEF_BIND_INTERNAL_H_ +#define CEF_INCLUDE_BASE_INTERNAL_CEF_BIND_INTERNAL_H_ + +#include "include/base/cef_bind_helpers.h" +#include "include/base/cef_build.h" +#include "include/base/cef_template_util.h" +#include "include/base/cef_weak_ptr.h" +#include "include/base/internal/cef_callback_internal.h" +#include "include/base/internal/cef_raw_scoped_refptr_mismatch_checker.h" + +#if defined(OS_WIN) +#include "include/base/internal/cef_bind_internal_win.h" +#endif + +namespace base { +namespace cef_internal { + +// See base/callback.h for user documentation. +// +// +// CONCEPTS: +// Runnable -- A type (really a type class) that has a single Run() method +// and a RunType typedef that corresponds to the type of Run(). +// A Runnable can declare that it should treated like a method +// call by including a typedef named IsMethod. The value of +// this typedef is NOT inspected, only the existence. When a +// Runnable declares itself a method, Bind() will enforce special +// refcounting + WeakPtr handling semantics for the first +// parameter which is expected to be an object. +// Functor -- A copyable type representing something that should be called. +// All function pointers, Callback<>, and Runnables are functors +// even if the invocation syntax differs. +// RunType -- A function type (as opposed to function _pointer_ type) for +// a Run() function. Usually just a convenience typedef. +// (Bound)ArgsType -- A function type that is being (ab)used to store the +// types of set of arguments. The "return" type is always +// void here. We use this hack so that we do not need +// a new type name for each arity of type. (eg., +// BindState1, BindState2). This makes forward +// declarations and friending much much easier. +// +// Types: +// RunnableAdapter<> -- Wraps the various "function" pointer types into an +// object that adheres to the Runnable interface. +// There are |3*ARITY| RunnableAdapter types. +// FunctionTraits<> -- Type traits that unwrap a function signature into a +// a set of easier to use typedefs. Used mainly for +// compile time asserts. +// There are |ARITY| FunctionTraits types. +// ForceVoidReturn<> -- Helper class for translating function signatures to +// equivalent forms with a "void" return type. +// There are |ARITY| ForceVoidReturn types. +// FunctorTraits<> -- Type traits used determine the correct RunType and +// RunnableType for a Functor. This is where function +// signature adapters are applied. +// There are |ARITY| ForceVoidReturn types. +// MakeRunnable<> -- Takes a Functor and returns an object in the Runnable +// type class that represents the underlying Functor. +// There are |O(1)| MakeRunnable types. +// InvokeHelper<> -- Take a Runnable + arguments and actully invokes it. +// Handle the differing syntaxes needed for WeakPtr<> support, +// and for ignoring return values. This is separate from +// Invoker to avoid creating multiple version of Invoker<> +// which grows at O(n^2) with the arity. +// There are |k*ARITY| InvokeHelper types. +// Invoker<> -- Unwraps the curried parameters and executes the Runnable. +// There are |(ARITY^2 + ARITY)/2| Invoketypes. +// BindState<> -- Stores the curried parameters, and is the main entry point +// into the Bind() system, doing most of the type resolution. +// There are ARITY BindState types. + +// RunnableAdapter<> +// +// The RunnableAdapter<> templates provide a uniform interface for invoking +// a function pointer, method pointer, or const method pointer. The adapter +// exposes a Run() method with an appropriate signature. Using this wrapper +// allows for writing code that supports all three pointer types without +// undue repetition. Without it, a lot of code would need to be repeated 3 +// times. +// +// For method pointers and const method pointers the first argument to Run() +// is considered to be the received of the method. This is similar to STL's +// mem_fun(). +// +// This class also exposes a RunType typedef that is the function type of the +// Run() function. +// +// If and only if the wrapper contains a method or const method pointer, an +// IsMethod typedef is exposed. The existence of this typedef (NOT the value) +// marks that the wrapper should be considered a method wrapper. + +template +class RunnableAdapter; + +// Function: Arity 0. +template +class RunnableAdapter { + public: + typedef R (RunType)(); + + explicit RunnableAdapter(R(*function)()) + : function_(function) { + } + + R Run() { + return function_(); + } + + private: + R (*function_)(); +}; + +// Method: Arity 0. +template +class RunnableAdapter { + public: + typedef R (RunType)(T*); + typedef true_type IsMethod; + + explicit RunnableAdapter(R(T::*method)()) + : method_(method) { + } + + R Run(T* object) { + return (object->*method_)(); + } + + private: + R (T::*method_)(); +}; + +// Const Method: Arity 0. +template +class RunnableAdapter { + public: + typedef R (RunType)(const T*); + typedef true_type IsMethod; + + explicit RunnableAdapter(R(T::*method)() const) + : method_(method) { + } + + R Run(const T* object) { + return (object->*method_)(); + } + + private: + R (T::*method_)() const; +}; + +// Function: Arity 1. +template +class RunnableAdapter { + public: + typedef R (RunType)(A1); + + explicit RunnableAdapter(R(*function)(A1)) + : function_(function) { + } + + R Run(typename CallbackParamTraits::ForwardType a1) { + return function_(CallbackForward(a1)); + } + + private: + R (*function_)(A1); +}; + +// Method: Arity 1. +template +class RunnableAdapter { + public: + typedef R (RunType)(T*, A1); + typedef true_type IsMethod; + + explicit RunnableAdapter(R(T::*method)(A1)) + : method_(method) { + } + + R Run(T* object, typename CallbackParamTraits::ForwardType a1) { + return (object->*method_)(CallbackForward(a1)); + } + + private: + R (T::*method_)(A1); +}; + +// Const Method: Arity 1. +template +class RunnableAdapter { + public: + typedef R (RunType)(const T*, A1); + typedef true_type IsMethod; + + explicit RunnableAdapter(R(T::*method)(A1) const) + : method_(method) { + } + + R Run(const T* object, typename CallbackParamTraits::ForwardType a1) { + return (object->*method_)(CallbackForward(a1)); + } + + private: + R (T::*method_)(A1) const; +}; + +// Function: Arity 2. +template +class RunnableAdapter { + public: + typedef R (RunType)(A1, A2); + + explicit RunnableAdapter(R(*function)(A1, A2)) + : function_(function) { + } + + R Run(typename CallbackParamTraits::ForwardType a1, + typename CallbackParamTraits::ForwardType a2) { + return function_(CallbackForward(a1), CallbackForward(a2)); + } + + private: + R (*function_)(A1, A2); +}; + +// Method: Arity 2. +template +class RunnableAdapter { + public: + typedef R (RunType)(T*, A1, A2); + typedef true_type IsMethod; + + explicit RunnableAdapter(R(T::*method)(A1, A2)) + : method_(method) { + } + + R Run(T* object, typename CallbackParamTraits::ForwardType a1, + typename CallbackParamTraits::ForwardType a2) { + return (object->*method_)(CallbackForward(a1), CallbackForward(a2)); + } + + private: + R (T::*method_)(A1, A2); +}; + +// Const Method: Arity 2. +template +class RunnableAdapter { + public: + typedef R (RunType)(const T*, A1, A2); + typedef true_type IsMethod; + + explicit RunnableAdapter(R(T::*method)(A1, A2) const) + : method_(method) { + } + + R Run(const T* object, typename CallbackParamTraits::ForwardType a1, + typename CallbackParamTraits::ForwardType a2) { + return (object->*method_)(CallbackForward(a1), CallbackForward(a2)); + } + + private: + R (T::*method_)(A1, A2) const; +}; + +// Function: Arity 3. +template +class RunnableAdapter { + public: + typedef R (RunType)(A1, A2, A3); + + explicit RunnableAdapter(R(*function)(A1, A2, A3)) + : function_(function) { + } + + R Run(typename CallbackParamTraits::ForwardType a1, + typename CallbackParamTraits::ForwardType a2, + typename CallbackParamTraits::ForwardType a3) { + return function_(CallbackForward(a1), CallbackForward(a2), + CallbackForward(a3)); + } + + private: + R (*function_)(A1, A2, A3); +}; + +// Method: Arity 3. +template +class RunnableAdapter { + public: + typedef R (RunType)(T*, A1, A2, A3); + typedef true_type IsMethod; + + explicit RunnableAdapter(R(T::*method)(A1, A2, A3)) + : method_(method) { + } + + R Run(T* object, typename CallbackParamTraits::ForwardType a1, + typename CallbackParamTraits::ForwardType a2, + typename CallbackParamTraits::ForwardType a3) { + return (object->*method_)(CallbackForward(a1), CallbackForward(a2), + CallbackForward(a3)); + } + + private: + R (T::*method_)(A1, A2, A3); +}; + +// Const Method: Arity 3. +template +class RunnableAdapter { + public: + typedef R (RunType)(const T*, A1, A2, A3); + typedef true_type IsMethod; + + explicit RunnableAdapter(R(T::*method)(A1, A2, A3) const) + : method_(method) { + } + + R Run(const T* object, typename CallbackParamTraits::ForwardType a1, + typename CallbackParamTraits::ForwardType a2, + typename CallbackParamTraits::ForwardType a3) { + return (object->*method_)(CallbackForward(a1), CallbackForward(a2), + CallbackForward(a3)); + } + + private: + R (T::*method_)(A1, A2, A3) const; +}; + +// Function: Arity 4. +template +class RunnableAdapter { + public: + typedef R (RunType)(A1, A2, A3, A4); + + explicit RunnableAdapter(R(*function)(A1, A2, A3, A4)) + : function_(function) { + } + + R Run(typename CallbackParamTraits::ForwardType a1, + typename CallbackParamTraits::ForwardType a2, + typename CallbackParamTraits::ForwardType a3, + typename CallbackParamTraits::ForwardType a4) { + return function_(CallbackForward(a1), CallbackForward(a2), + CallbackForward(a3), CallbackForward(a4)); + } + + private: + R (*function_)(A1, A2, A3, A4); +}; + +// Method: Arity 4. +template +class RunnableAdapter { + public: + typedef R (RunType)(T*, A1, A2, A3, A4); + typedef true_type IsMethod; + + explicit RunnableAdapter(R(T::*method)(A1, A2, A3, A4)) + : method_(method) { + } + + R Run(T* object, typename CallbackParamTraits::ForwardType a1, + typename CallbackParamTraits::ForwardType a2, + typename CallbackParamTraits::ForwardType a3, + typename CallbackParamTraits::ForwardType a4) { + return (object->*method_)(CallbackForward(a1), CallbackForward(a2), + CallbackForward(a3), CallbackForward(a4)); + } + + private: + R (T::*method_)(A1, A2, A3, A4); +}; + +// Const Method: Arity 4. +template +class RunnableAdapter { + public: + typedef R (RunType)(const T*, A1, A2, A3, A4); + typedef true_type IsMethod; + + explicit RunnableAdapter(R(T::*method)(A1, A2, A3, A4) const) + : method_(method) { + } + + R Run(const T* object, typename CallbackParamTraits::ForwardType a1, + typename CallbackParamTraits::ForwardType a2, + typename CallbackParamTraits::ForwardType a3, + typename CallbackParamTraits::ForwardType a4) { + return (object->*method_)(CallbackForward(a1), CallbackForward(a2), + CallbackForward(a3), CallbackForward(a4)); + } + + private: + R (T::*method_)(A1, A2, A3, A4) const; +}; + +// Function: Arity 5. +template +class RunnableAdapter { + public: + typedef R (RunType)(A1, A2, A3, A4, A5); + + explicit RunnableAdapter(R(*function)(A1, A2, A3, A4, A5)) + : function_(function) { + } + + R Run(typename CallbackParamTraits::ForwardType a1, + typename CallbackParamTraits::ForwardType a2, + typename CallbackParamTraits::ForwardType a3, + typename CallbackParamTraits::ForwardType a4, + typename CallbackParamTraits::ForwardType a5) { + return function_(CallbackForward(a1), CallbackForward(a2), + CallbackForward(a3), CallbackForward(a4), CallbackForward(a5)); + } + + private: + R (*function_)(A1, A2, A3, A4, A5); +}; + +// Method: Arity 5. +template +class RunnableAdapter { + public: + typedef R (RunType)(T*, A1, A2, A3, A4, A5); + typedef true_type IsMethod; + + explicit RunnableAdapter(R(T::*method)(A1, A2, A3, A4, A5)) + : method_(method) { + } + + R Run(T* object, typename CallbackParamTraits::ForwardType a1, + typename CallbackParamTraits::ForwardType a2, + typename CallbackParamTraits::ForwardType a3, + typename CallbackParamTraits::ForwardType a4, + typename CallbackParamTraits::ForwardType a5) { + return (object->*method_)(CallbackForward(a1), CallbackForward(a2), + CallbackForward(a3), CallbackForward(a4), CallbackForward(a5)); + } + + private: + R (T::*method_)(A1, A2, A3, A4, A5); +}; + +// Const Method: Arity 5. +template +class RunnableAdapter { + public: + typedef R (RunType)(const T*, A1, A2, A3, A4, A5); + typedef true_type IsMethod; + + explicit RunnableAdapter(R(T::*method)(A1, A2, A3, A4, A5) const) + : method_(method) { + } + + R Run(const T* object, typename CallbackParamTraits::ForwardType a1, + typename CallbackParamTraits::ForwardType a2, + typename CallbackParamTraits::ForwardType a3, + typename CallbackParamTraits::ForwardType a4, + typename CallbackParamTraits::ForwardType a5) { + return (object->*method_)(CallbackForward(a1), CallbackForward(a2), + CallbackForward(a3), CallbackForward(a4), CallbackForward(a5)); + } + + private: + R (T::*method_)(A1, A2, A3, A4, A5) const; +}; + +// Function: Arity 6. +template +class RunnableAdapter { + public: + typedef R (RunType)(A1, A2, A3, A4, A5, A6); + + explicit RunnableAdapter(R(*function)(A1, A2, A3, A4, A5, A6)) + : function_(function) { + } + + R Run(typename CallbackParamTraits::ForwardType a1, + typename CallbackParamTraits::ForwardType a2, + typename CallbackParamTraits::ForwardType a3, + typename CallbackParamTraits::ForwardType a4, + typename CallbackParamTraits::ForwardType a5, + typename CallbackParamTraits::ForwardType a6) { + return function_(CallbackForward(a1), CallbackForward(a2), + CallbackForward(a3), CallbackForward(a4), CallbackForward(a5), + CallbackForward(a6)); + } + + private: + R (*function_)(A1, A2, A3, A4, A5, A6); +}; + +// Method: Arity 6. +template +class RunnableAdapter { + public: + typedef R (RunType)(T*, A1, A2, A3, A4, A5, A6); + typedef true_type IsMethod; + + explicit RunnableAdapter(R(T::*method)(A1, A2, A3, A4, A5, A6)) + : method_(method) { + } + + R Run(T* object, typename CallbackParamTraits::ForwardType a1, + typename CallbackParamTraits::ForwardType a2, + typename CallbackParamTraits::ForwardType a3, + typename CallbackParamTraits::ForwardType a4, + typename CallbackParamTraits::ForwardType a5, + typename CallbackParamTraits::ForwardType a6) { + return (object->*method_)(CallbackForward(a1), CallbackForward(a2), + CallbackForward(a3), CallbackForward(a4), CallbackForward(a5), + CallbackForward(a6)); + } + + private: + R (T::*method_)(A1, A2, A3, A4, A5, A6); +}; + +// Const Method: Arity 6. +template +class RunnableAdapter { + public: + typedef R (RunType)(const T*, A1, A2, A3, A4, A5, A6); + typedef true_type IsMethod; + + explicit RunnableAdapter(R(T::*method)(A1, A2, A3, A4, A5, A6) const) + : method_(method) { + } + + R Run(const T* object, typename CallbackParamTraits::ForwardType a1, + typename CallbackParamTraits::ForwardType a2, + typename CallbackParamTraits::ForwardType a3, + typename CallbackParamTraits::ForwardType a4, + typename CallbackParamTraits::ForwardType a5, + typename CallbackParamTraits::ForwardType a6) { + return (object->*method_)(CallbackForward(a1), CallbackForward(a2), + CallbackForward(a3), CallbackForward(a4), CallbackForward(a5), + CallbackForward(a6)); + } + + private: + R (T::*method_)(A1, A2, A3, A4, A5, A6) const; +}; + +// Function: Arity 7. +template +class RunnableAdapter { + public: + typedef R (RunType)(A1, A2, A3, A4, A5, A6, A7); + + explicit RunnableAdapter(R(*function)(A1, A2, A3, A4, A5, A6, A7)) + : function_(function) { + } + + R Run(typename CallbackParamTraits::ForwardType a1, + typename CallbackParamTraits::ForwardType a2, + typename CallbackParamTraits::ForwardType a3, + typename CallbackParamTraits::ForwardType a4, + typename CallbackParamTraits::ForwardType a5, + typename CallbackParamTraits::ForwardType a6, + typename CallbackParamTraits::ForwardType a7) { + return function_(CallbackForward(a1), CallbackForward(a2), + CallbackForward(a3), CallbackForward(a4), CallbackForward(a5), + CallbackForward(a6), CallbackForward(a7)); + } + + private: + R (*function_)(A1, A2, A3, A4, A5, A6, A7); +}; + +// Method: Arity 7. +template +class RunnableAdapter { + public: + typedef R (RunType)(T*, A1, A2, A3, A4, A5, A6, A7); + typedef true_type IsMethod; + + explicit RunnableAdapter(R(T::*method)(A1, A2, A3, A4, A5, A6, A7)) + : method_(method) { + } + + R Run(T* object, typename CallbackParamTraits::ForwardType a1, + typename CallbackParamTraits::ForwardType a2, + typename CallbackParamTraits::ForwardType a3, + typename CallbackParamTraits::ForwardType a4, + typename CallbackParamTraits::ForwardType a5, + typename CallbackParamTraits::ForwardType a6, + typename CallbackParamTraits::ForwardType a7) { + return (object->*method_)(CallbackForward(a1), CallbackForward(a2), + CallbackForward(a3), CallbackForward(a4), CallbackForward(a5), + CallbackForward(a6), CallbackForward(a7)); + } + + private: + R (T::*method_)(A1, A2, A3, A4, A5, A6, A7); +}; + +// Const Method: Arity 7. +template +class RunnableAdapter { + public: + typedef R (RunType)(const T*, A1, A2, A3, A4, A5, A6, A7); + typedef true_type IsMethod; + + explicit RunnableAdapter(R(T::*method)(A1, A2, A3, A4, A5, A6, A7) const) + : method_(method) { + } + + R Run(const T* object, typename CallbackParamTraits::ForwardType a1, + typename CallbackParamTraits::ForwardType a2, + typename CallbackParamTraits::ForwardType a3, + typename CallbackParamTraits::ForwardType a4, + typename CallbackParamTraits::ForwardType a5, + typename CallbackParamTraits::ForwardType a6, + typename CallbackParamTraits::ForwardType a7) { + return (object->*method_)(CallbackForward(a1), CallbackForward(a2), + CallbackForward(a3), CallbackForward(a4), CallbackForward(a5), + CallbackForward(a6), CallbackForward(a7)); + } + + private: + R (T::*method_)(A1, A2, A3, A4, A5, A6, A7) const; +}; + + +// FunctionTraits<> +// +// Breaks a function signature apart into typedefs for easier introspection. +template +struct FunctionTraits; + +template +struct FunctionTraits { + typedef R ReturnType; +}; + +template +struct FunctionTraits { + typedef R ReturnType; + typedef A1 A1Type; +}; + +template +struct FunctionTraits { + typedef R ReturnType; + typedef A1 A1Type; + typedef A2 A2Type; +}; + +template +struct FunctionTraits { + typedef R ReturnType; + typedef A1 A1Type; + typedef A2 A2Type; + typedef A3 A3Type; +}; + +template +struct FunctionTraits { + typedef R ReturnType; + typedef A1 A1Type; + typedef A2 A2Type; + typedef A3 A3Type; + typedef A4 A4Type; +}; + +template +struct FunctionTraits { + typedef R ReturnType; + typedef A1 A1Type; + typedef A2 A2Type; + typedef A3 A3Type; + typedef A4 A4Type; + typedef A5 A5Type; +}; + +template +struct FunctionTraits { + typedef R ReturnType; + typedef A1 A1Type; + typedef A2 A2Type; + typedef A3 A3Type; + typedef A4 A4Type; + typedef A5 A5Type; + typedef A6 A6Type; +}; + +template +struct FunctionTraits { + typedef R ReturnType; + typedef A1 A1Type; + typedef A2 A2Type; + typedef A3 A3Type; + typedef A4 A4Type; + typedef A5 A5Type; + typedef A6 A6Type; + typedef A7 A7Type; +}; + + +// ForceVoidReturn<> +// +// Set of templates that support forcing the function return type to void. +template +struct ForceVoidReturn; + +template +struct ForceVoidReturn { + typedef void(RunType)(); +}; + +template +struct ForceVoidReturn { + typedef void(RunType)(A1); +}; + +template +struct ForceVoidReturn { + typedef void(RunType)(A1, A2); +}; + +template +struct ForceVoidReturn { + typedef void(RunType)(A1, A2, A3); +}; + +template +struct ForceVoidReturn { + typedef void(RunType)(A1, A2, A3, A4); +}; + +template +struct ForceVoidReturn { + typedef void(RunType)(A1, A2, A3, A4, A5); +}; + +template +struct ForceVoidReturn { + typedef void(RunType)(A1, A2, A3, A4, A5, A6); +}; + +template +struct ForceVoidReturn { + typedef void(RunType)(A1, A2, A3, A4, A5, A6, A7); +}; + + +// FunctorTraits<> +// +// See description at top of file. +template +struct FunctorTraits { + typedef RunnableAdapter RunnableType; + typedef typename RunnableType::RunType RunType; +}; + +template +struct FunctorTraits > { + typedef typename FunctorTraits::RunnableType RunnableType; + typedef typename ForceVoidReturn< + typename RunnableType::RunType>::RunType RunType; +}; + +template +struct FunctorTraits > { + typedef Callback RunnableType; + typedef typename Callback::RunType RunType; +}; + + +// MakeRunnable<> +// +// Converts a passed in functor to a RunnableType using type inference. + +template +typename FunctorTraits::RunnableType MakeRunnable(const T& t) { + return RunnableAdapter(t); +} + +template +typename FunctorTraits::RunnableType +MakeRunnable(const IgnoreResultHelper& t) { + return MakeRunnable(t.functor_); +} + +template +const typename FunctorTraits >::RunnableType& +MakeRunnable(const Callback& t) { + DCHECK(!t.is_null()); + return t; +} + + +// InvokeHelper<> +// +// There are 3 logical InvokeHelper<> specializations: normal, void-return, +// WeakCalls. +// +// The normal type just calls the underlying runnable. +// +// We need a InvokeHelper to handle void return types in order to support +// IgnoreResult(). Normally, if the Runnable's RunType had a void return, +// the template system would just accept "return functor.Run()" ignoring +// the fact that a void function is being used with return. This piece of +// sugar breaks though when the Runnable's RunType is not void. Thus, we +// need a partial specialization to change the syntax to drop the "return" +// from the invocation call. +// +// WeakCalls similarly need special syntax that is applied to the first +// argument to check if they should no-op themselves. +template +struct InvokeHelper; + +template +struct InvokeHelper { + static ReturnType MakeItSo(Runnable runnable) { + return runnable.Run(); + } +}; + +template +struct InvokeHelper { + static void MakeItSo(Runnable runnable) { + runnable.Run(); + } +}; + +template +struct InvokeHelper { + static ReturnType MakeItSo(Runnable runnable, A1 a1) { + return runnable.Run(CallbackForward(a1)); + } +}; + +template +struct InvokeHelper { + static void MakeItSo(Runnable runnable, A1 a1) { + runnable.Run(CallbackForward(a1)); + } +}; + +template +struct InvokeHelper { + static void MakeItSo(Runnable runnable, BoundWeakPtr weak_ptr) { + if (!weak_ptr.get()) { + return; + } + runnable.Run(weak_ptr.get()); + } +}; + +template +struct InvokeHelper { + static ReturnType MakeItSo(Runnable runnable, A1 a1, A2 a2) { + return runnable.Run(CallbackForward(a1), CallbackForward(a2)); + } +}; + +template +struct InvokeHelper { + static void MakeItSo(Runnable runnable, A1 a1, A2 a2) { + runnable.Run(CallbackForward(a1), CallbackForward(a2)); + } +}; + +template +struct InvokeHelper { + static void MakeItSo(Runnable runnable, BoundWeakPtr weak_ptr, A2 a2) { + if (!weak_ptr.get()) { + return; + } + runnable.Run(weak_ptr.get(), CallbackForward(a2)); + } +}; + +template +struct InvokeHelper { + static ReturnType MakeItSo(Runnable runnable, A1 a1, A2 a2, A3 a3) { + return runnable.Run(CallbackForward(a1), CallbackForward(a2), + CallbackForward(a3)); + } +}; + +template +struct InvokeHelper { + static void MakeItSo(Runnable runnable, A1 a1, A2 a2, A3 a3) { + runnable.Run(CallbackForward(a1), CallbackForward(a2), CallbackForward(a3)); + } +}; + +template +struct InvokeHelper { + static void MakeItSo(Runnable runnable, BoundWeakPtr weak_ptr, A2 a2, A3 a3) { + if (!weak_ptr.get()) { + return; + } + runnable.Run(weak_ptr.get(), CallbackForward(a2), CallbackForward(a3)); + } +}; + +template +struct InvokeHelper { + static ReturnType MakeItSo(Runnable runnable, A1 a1, A2 a2, A3 a3, A4 a4) { + return runnable.Run(CallbackForward(a1), CallbackForward(a2), + CallbackForward(a3), CallbackForward(a4)); + } +}; + +template +struct InvokeHelper { + static void MakeItSo(Runnable runnable, A1 a1, A2 a2, A3 a3, A4 a4) { + runnable.Run(CallbackForward(a1), CallbackForward(a2), CallbackForward(a3), + CallbackForward(a4)); + } +}; + +template +struct InvokeHelper { + static void MakeItSo(Runnable runnable, BoundWeakPtr weak_ptr, A2 a2, A3 a3, + A4 a4) { + if (!weak_ptr.get()) { + return; + } + runnable.Run(weak_ptr.get(), CallbackForward(a2), CallbackForward(a3), + CallbackForward(a4)); + } +}; + +template +struct InvokeHelper { + static ReturnType MakeItSo(Runnable runnable, A1 a1, A2 a2, A3 a3, A4 a4, + A5 a5) { + return runnable.Run(CallbackForward(a1), CallbackForward(a2), + CallbackForward(a3), CallbackForward(a4), CallbackForward(a5)); + } +}; + +template +struct InvokeHelper { + static void MakeItSo(Runnable runnable, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5) { + runnable.Run(CallbackForward(a1), CallbackForward(a2), CallbackForward(a3), + CallbackForward(a4), CallbackForward(a5)); + } +}; + +template +struct InvokeHelper { + static void MakeItSo(Runnable runnable, BoundWeakPtr weak_ptr, A2 a2, A3 a3, + A4 a4, A5 a5) { + if (!weak_ptr.get()) { + return; + } + runnable.Run(weak_ptr.get(), CallbackForward(a2), CallbackForward(a3), + CallbackForward(a4), CallbackForward(a5)); + } +}; + +template +struct InvokeHelper { + static ReturnType MakeItSo(Runnable runnable, A1 a1, A2 a2, A3 a3, A4 a4, + A5 a5, A6 a6) { + return runnable.Run(CallbackForward(a1), CallbackForward(a2), + CallbackForward(a3), CallbackForward(a4), CallbackForward(a5), + CallbackForward(a6)); + } +}; + +template +struct InvokeHelper { + static void MakeItSo(Runnable runnable, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, + A6 a6) { + runnable.Run(CallbackForward(a1), CallbackForward(a2), CallbackForward(a3), + CallbackForward(a4), CallbackForward(a5), CallbackForward(a6)); + } +}; + +template +struct InvokeHelper { + static void MakeItSo(Runnable runnable, BoundWeakPtr weak_ptr, A2 a2, A3 a3, + A4 a4, A5 a5, A6 a6) { + if (!weak_ptr.get()) { + return; + } + runnable.Run(weak_ptr.get(), CallbackForward(a2), CallbackForward(a3), + CallbackForward(a4), CallbackForward(a5), CallbackForward(a6)); + } +}; + +template +struct InvokeHelper { + static ReturnType MakeItSo(Runnable runnable, A1 a1, A2 a2, A3 a3, A4 a4, + A5 a5, A6 a6, A7 a7) { + return runnable.Run(CallbackForward(a1), CallbackForward(a2), + CallbackForward(a3), CallbackForward(a4), CallbackForward(a5), + CallbackForward(a6), CallbackForward(a7)); + } +}; + +template +struct InvokeHelper { + static void MakeItSo(Runnable runnable, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, + A6 a6, A7 a7) { + runnable.Run(CallbackForward(a1), CallbackForward(a2), CallbackForward(a3), + CallbackForward(a4), CallbackForward(a5), CallbackForward(a6), + CallbackForward(a7)); + } +}; + +template +struct InvokeHelper { + static void MakeItSo(Runnable runnable, BoundWeakPtr weak_ptr, A2 a2, A3 a3, + A4 a4, A5 a5, A6 a6, A7 a7) { + if (!weak_ptr.get()) { + return; + } + runnable.Run(weak_ptr.get(), CallbackForward(a2), CallbackForward(a3), + CallbackForward(a4), CallbackForward(a5), CallbackForward(a6), + CallbackForward(a7)); + } +}; + +#if !defined(_MSC_VER) + +template +struct InvokeHelper { + // WeakCalls are only supported for functions with a void return type. + // Otherwise, the function result would be undefined if the the WeakPtr<> + // is invalidated. + COMPILE_ASSERT(is_void::value, + weak_ptrs_can_only_bind_to_methods_without_return_values); +}; + +#endif + +// Invoker<> +// +// See description at the top of the file. +template +struct Invoker; + +// Arity 0 -> 0. +template +struct Invoker<0, StorageType, R()> { + typedef R(RunType)(BindStateBase*); + + typedef R(UnboundRunType)(); + + static R Run(BindStateBase* base) { + StorageType* storage = static_cast(base); + + // Local references to make debugger stepping easier. If in a debugger, + // you really want to warp ahead and step through the + // InvokeHelper<>::MakeItSo() call below. + + return InvokeHelper + ::MakeItSo(storage->runnable_); + } +}; + +// Arity 1 -> 1. +template +struct Invoker<0, StorageType, R(X1)> { + typedef R(RunType)(BindStateBase*, + typename CallbackParamTraits::ForwardType); + + typedef R(UnboundRunType)(X1); + + static R Run(BindStateBase* base, + typename CallbackParamTraits::ForwardType x1) { + StorageType* storage = static_cast(base); + + // Local references to make debugger stepping easier. If in a debugger, + // you really want to warp ahead and step through the + // InvokeHelper<>::MakeItSo() call below. + + return InvokeHelper::ForwardType x1)> + ::MakeItSo(storage->runnable_, CallbackForward(x1)); + } +}; + +// Arity 1 -> 0. +template +struct Invoker<1, StorageType, R(X1)> { + typedef R(RunType)(BindStateBase*); + + typedef R(UnboundRunType)(); + + static R Run(BindStateBase* base) { + StorageType* storage = static_cast(base); + + // Local references to make debugger stepping easier. If in a debugger, + // you really want to warp ahead and step through the + // InvokeHelper<>::MakeItSo() call below. + typedef typename StorageType::Bound1UnwrapTraits Bound1UnwrapTraits; + + typename Bound1UnwrapTraits::ForwardType x1 = + Bound1UnwrapTraits::Unwrap(storage->p1_); + return InvokeHelper + ::MakeItSo(storage->runnable_, CallbackForward(x1)); + } +}; + +// Arity 2 -> 2. +template +struct Invoker<0, StorageType, R(X1, X2)> { + typedef R(RunType)(BindStateBase*, + typename CallbackParamTraits::ForwardType, + typename CallbackParamTraits::ForwardType); + + typedef R(UnboundRunType)(X1, X2); + + static R Run(BindStateBase* base, + typename CallbackParamTraits::ForwardType x1, + typename CallbackParamTraits::ForwardType x2) { + StorageType* storage = static_cast(base); + + // Local references to make debugger stepping easier. If in a debugger, + // you really want to warp ahead and step through the + // InvokeHelper<>::MakeItSo() call below. + + return InvokeHelper::ForwardType x1, + typename CallbackParamTraits::ForwardType x2)> + ::MakeItSo(storage->runnable_, CallbackForward(x1), + CallbackForward(x2)); + } +}; + +// Arity 2 -> 1. +template +struct Invoker<1, StorageType, R(X1, X2)> { + typedef R(RunType)(BindStateBase*, + typename CallbackParamTraits::ForwardType); + + typedef R(UnboundRunType)(X2); + + static R Run(BindStateBase* base, + typename CallbackParamTraits::ForwardType x2) { + StorageType* storage = static_cast(base); + + // Local references to make debugger stepping easier. If in a debugger, + // you really want to warp ahead and step through the + // InvokeHelper<>::MakeItSo() call below. + typedef typename StorageType::Bound1UnwrapTraits Bound1UnwrapTraits; + + typename Bound1UnwrapTraits::ForwardType x1 = + Bound1UnwrapTraits::Unwrap(storage->p1_); + return InvokeHelper::ForwardType x2)> + ::MakeItSo(storage->runnable_, CallbackForward(x1), + CallbackForward(x2)); + } +}; + +// Arity 2 -> 0. +template +struct Invoker<2, StorageType, R(X1, X2)> { + typedef R(RunType)(BindStateBase*); + + typedef R(UnboundRunType)(); + + static R Run(BindStateBase* base) { + StorageType* storage = static_cast(base); + + // Local references to make debugger stepping easier. If in a debugger, + // you really want to warp ahead and step through the + // InvokeHelper<>::MakeItSo() call below. + typedef typename StorageType::Bound1UnwrapTraits Bound1UnwrapTraits; + typedef typename StorageType::Bound2UnwrapTraits Bound2UnwrapTraits; + + typename Bound1UnwrapTraits::ForwardType x1 = + Bound1UnwrapTraits::Unwrap(storage->p1_); + typename Bound2UnwrapTraits::ForwardType x2 = + Bound2UnwrapTraits::Unwrap(storage->p2_); + return InvokeHelper + ::MakeItSo(storage->runnable_, CallbackForward(x1), + CallbackForward(x2)); + } +}; + +// Arity 3 -> 3. +template +struct Invoker<0, StorageType, R(X1, X2, X3)> { + typedef R(RunType)(BindStateBase*, + typename CallbackParamTraits::ForwardType, + typename CallbackParamTraits::ForwardType, + typename CallbackParamTraits::ForwardType); + + typedef R(UnboundRunType)(X1, X2, X3); + + static R Run(BindStateBase* base, + typename CallbackParamTraits::ForwardType x1, + typename CallbackParamTraits::ForwardType x2, + typename CallbackParamTraits::ForwardType x3) { + StorageType* storage = static_cast(base); + + // Local references to make debugger stepping easier. If in a debugger, + // you really want to warp ahead and step through the + // InvokeHelper<>::MakeItSo() call below. + + return InvokeHelper::ForwardType x1, + typename CallbackParamTraits::ForwardType x2, + typename CallbackParamTraits::ForwardType x3)> + ::MakeItSo(storage->runnable_, CallbackForward(x1), + CallbackForward(x2), CallbackForward(x3)); + } +}; + +// Arity 3 -> 2. +template +struct Invoker<1, StorageType, R(X1, X2, X3)> { + typedef R(RunType)(BindStateBase*, + typename CallbackParamTraits::ForwardType, + typename CallbackParamTraits::ForwardType); + + typedef R(UnboundRunType)(X2, X3); + + static R Run(BindStateBase* base, + typename CallbackParamTraits::ForwardType x2, + typename CallbackParamTraits::ForwardType x3) { + StorageType* storage = static_cast(base); + + // Local references to make debugger stepping easier. If in a debugger, + // you really want to warp ahead and step through the + // InvokeHelper<>::MakeItSo() call below. + typedef typename StorageType::Bound1UnwrapTraits Bound1UnwrapTraits; + + typename Bound1UnwrapTraits::ForwardType x1 = + Bound1UnwrapTraits::Unwrap(storage->p1_); + return InvokeHelper::ForwardType x2, + typename CallbackParamTraits::ForwardType x3)> + ::MakeItSo(storage->runnable_, CallbackForward(x1), + CallbackForward(x2), CallbackForward(x3)); + } +}; + +// Arity 3 -> 1. +template +struct Invoker<2, StorageType, R(X1, X2, X3)> { + typedef R(RunType)(BindStateBase*, + typename CallbackParamTraits::ForwardType); + + typedef R(UnboundRunType)(X3); + + static R Run(BindStateBase* base, + typename CallbackParamTraits::ForwardType x3) { + StorageType* storage = static_cast(base); + + // Local references to make debugger stepping easier. If in a debugger, + // you really want to warp ahead and step through the + // InvokeHelper<>::MakeItSo() call below. + typedef typename StorageType::Bound1UnwrapTraits Bound1UnwrapTraits; + typedef typename StorageType::Bound2UnwrapTraits Bound2UnwrapTraits; + + typename Bound1UnwrapTraits::ForwardType x1 = + Bound1UnwrapTraits::Unwrap(storage->p1_); + typename Bound2UnwrapTraits::ForwardType x2 = + Bound2UnwrapTraits::Unwrap(storage->p2_); + return InvokeHelper::ForwardType x3)> + ::MakeItSo(storage->runnable_, CallbackForward(x1), + CallbackForward(x2), CallbackForward(x3)); + } +}; + +// Arity 3 -> 0. +template +struct Invoker<3, StorageType, R(X1, X2, X3)> { + typedef R(RunType)(BindStateBase*); + + typedef R(UnboundRunType)(); + + static R Run(BindStateBase* base) { + StorageType* storage = static_cast(base); + + // Local references to make debugger stepping easier. If in a debugger, + // you really want to warp ahead and step through the + // InvokeHelper<>::MakeItSo() call below. + typedef typename StorageType::Bound1UnwrapTraits Bound1UnwrapTraits; + typedef typename StorageType::Bound2UnwrapTraits Bound2UnwrapTraits; + typedef typename StorageType::Bound3UnwrapTraits Bound3UnwrapTraits; + + typename Bound1UnwrapTraits::ForwardType x1 = + Bound1UnwrapTraits::Unwrap(storage->p1_); + typename Bound2UnwrapTraits::ForwardType x2 = + Bound2UnwrapTraits::Unwrap(storage->p2_); + typename Bound3UnwrapTraits::ForwardType x3 = + Bound3UnwrapTraits::Unwrap(storage->p3_); + return InvokeHelper + ::MakeItSo(storage->runnable_, CallbackForward(x1), + CallbackForward(x2), CallbackForward(x3)); + } +}; + +// Arity 4 -> 4. +template +struct Invoker<0, StorageType, R(X1, X2, X3, X4)> { + typedef R(RunType)(BindStateBase*, + typename CallbackParamTraits::ForwardType, + typename CallbackParamTraits::ForwardType, + typename CallbackParamTraits::ForwardType, + typename CallbackParamTraits::ForwardType); + + typedef R(UnboundRunType)(X1, X2, X3, X4); + + static R Run(BindStateBase* base, + typename CallbackParamTraits::ForwardType x1, + typename CallbackParamTraits::ForwardType x2, + typename CallbackParamTraits::ForwardType x3, + typename CallbackParamTraits::ForwardType x4) { + StorageType* storage = static_cast(base); + + // Local references to make debugger stepping easier. If in a debugger, + // you really want to warp ahead and step through the + // InvokeHelper<>::MakeItSo() call below. + + return InvokeHelper::ForwardType x1, + typename CallbackParamTraits::ForwardType x2, + typename CallbackParamTraits::ForwardType x3, + typename CallbackParamTraits::ForwardType x4)> + ::MakeItSo(storage->runnable_, CallbackForward(x1), + CallbackForward(x2), CallbackForward(x3), + CallbackForward(x4)); + } +}; + +// Arity 4 -> 3. +template +struct Invoker<1, StorageType, R(X1, X2, X3, X4)> { + typedef R(RunType)(BindStateBase*, + typename CallbackParamTraits::ForwardType, + typename CallbackParamTraits::ForwardType, + typename CallbackParamTraits::ForwardType); + + typedef R(UnboundRunType)(X2, X3, X4); + + static R Run(BindStateBase* base, + typename CallbackParamTraits::ForwardType x2, + typename CallbackParamTraits::ForwardType x3, + typename CallbackParamTraits::ForwardType x4) { + StorageType* storage = static_cast(base); + + // Local references to make debugger stepping easier. If in a debugger, + // you really want to warp ahead and step through the + // InvokeHelper<>::MakeItSo() call below. + typedef typename StorageType::Bound1UnwrapTraits Bound1UnwrapTraits; + + typename Bound1UnwrapTraits::ForwardType x1 = + Bound1UnwrapTraits::Unwrap(storage->p1_); + return InvokeHelper::ForwardType x2, + typename CallbackParamTraits::ForwardType x3, + typename CallbackParamTraits::ForwardType x4)> + ::MakeItSo(storage->runnable_, CallbackForward(x1), + CallbackForward(x2), CallbackForward(x3), + CallbackForward(x4)); + } +}; + +// Arity 4 -> 2. +template +struct Invoker<2, StorageType, R(X1, X2, X3, X4)> { + typedef R(RunType)(BindStateBase*, + typename CallbackParamTraits::ForwardType, + typename CallbackParamTraits::ForwardType); + + typedef R(UnboundRunType)(X3, X4); + + static R Run(BindStateBase* base, + typename CallbackParamTraits::ForwardType x3, + typename CallbackParamTraits::ForwardType x4) { + StorageType* storage = static_cast(base); + + // Local references to make debugger stepping easier. If in a debugger, + // you really want to warp ahead and step through the + // InvokeHelper<>::MakeItSo() call below. + typedef typename StorageType::Bound1UnwrapTraits Bound1UnwrapTraits; + typedef typename StorageType::Bound2UnwrapTraits Bound2UnwrapTraits; + + typename Bound1UnwrapTraits::ForwardType x1 = + Bound1UnwrapTraits::Unwrap(storage->p1_); + typename Bound2UnwrapTraits::ForwardType x2 = + Bound2UnwrapTraits::Unwrap(storage->p2_); + return InvokeHelper::ForwardType x3, + typename CallbackParamTraits::ForwardType x4)> + ::MakeItSo(storage->runnable_, CallbackForward(x1), + CallbackForward(x2), CallbackForward(x3), + CallbackForward(x4)); + } +}; + +// Arity 4 -> 1. +template +struct Invoker<3, StorageType, R(X1, X2, X3, X4)> { + typedef R(RunType)(BindStateBase*, + typename CallbackParamTraits::ForwardType); + + typedef R(UnboundRunType)(X4); + + static R Run(BindStateBase* base, + typename CallbackParamTraits::ForwardType x4) { + StorageType* storage = static_cast(base); + + // Local references to make debugger stepping easier. If in a debugger, + // you really want to warp ahead and step through the + // InvokeHelper<>::MakeItSo() call below. + typedef typename StorageType::Bound1UnwrapTraits Bound1UnwrapTraits; + typedef typename StorageType::Bound2UnwrapTraits Bound2UnwrapTraits; + typedef typename StorageType::Bound3UnwrapTraits Bound3UnwrapTraits; + + typename Bound1UnwrapTraits::ForwardType x1 = + Bound1UnwrapTraits::Unwrap(storage->p1_); + typename Bound2UnwrapTraits::ForwardType x2 = + Bound2UnwrapTraits::Unwrap(storage->p2_); + typename Bound3UnwrapTraits::ForwardType x3 = + Bound3UnwrapTraits::Unwrap(storage->p3_); + return InvokeHelper::ForwardType x4)> + ::MakeItSo(storage->runnable_, CallbackForward(x1), + CallbackForward(x2), CallbackForward(x3), + CallbackForward(x4)); + } +}; + +// Arity 4 -> 0. +template +struct Invoker<4, StorageType, R(X1, X2, X3, X4)> { + typedef R(RunType)(BindStateBase*); + + typedef R(UnboundRunType)(); + + static R Run(BindStateBase* base) { + StorageType* storage = static_cast(base); + + // Local references to make debugger stepping easier. If in a debugger, + // you really want to warp ahead and step through the + // InvokeHelper<>::MakeItSo() call below. + typedef typename StorageType::Bound1UnwrapTraits Bound1UnwrapTraits; + typedef typename StorageType::Bound2UnwrapTraits Bound2UnwrapTraits; + typedef typename StorageType::Bound3UnwrapTraits Bound3UnwrapTraits; + typedef typename StorageType::Bound4UnwrapTraits Bound4UnwrapTraits; + + typename Bound1UnwrapTraits::ForwardType x1 = + Bound1UnwrapTraits::Unwrap(storage->p1_); + typename Bound2UnwrapTraits::ForwardType x2 = + Bound2UnwrapTraits::Unwrap(storage->p2_); + typename Bound3UnwrapTraits::ForwardType x3 = + Bound3UnwrapTraits::Unwrap(storage->p3_); + typename Bound4UnwrapTraits::ForwardType x4 = + Bound4UnwrapTraits::Unwrap(storage->p4_); + return InvokeHelper + ::MakeItSo(storage->runnable_, CallbackForward(x1), + CallbackForward(x2), CallbackForward(x3), + CallbackForward(x4)); + } +}; + +// Arity 5 -> 5. +template +struct Invoker<0, StorageType, R(X1, X2, X3, X4, X5)> { + typedef R(RunType)(BindStateBase*, + typename CallbackParamTraits::ForwardType, + typename CallbackParamTraits::ForwardType, + typename CallbackParamTraits::ForwardType, + typename CallbackParamTraits::ForwardType, + typename CallbackParamTraits::ForwardType); + + typedef R(UnboundRunType)(X1, X2, X3, X4, X5); + + static R Run(BindStateBase* base, + typename CallbackParamTraits::ForwardType x1, + typename CallbackParamTraits::ForwardType x2, + typename CallbackParamTraits::ForwardType x3, + typename CallbackParamTraits::ForwardType x4, + typename CallbackParamTraits::ForwardType x5) { + StorageType* storage = static_cast(base); + + // Local references to make debugger stepping easier. If in a debugger, + // you really want to warp ahead and step through the + // InvokeHelper<>::MakeItSo() call below. + + return InvokeHelper::ForwardType x1, + typename CallbackParamTraits::ForwardType x2, + typename CallbackParamTraits::ForwardType x3, + typename CallbackParamTraits::ForwardType x4, + typename CallbackParamTraits::ForwardType x5)> + ::MakeItSo(storage->runnable_, CallbackForward(x1), + CallbackForward(x2), CallbackForward(x3), + CallbackForward(x4), CallbackForward(x5)); + } +}; + +// Arity 5 -> 4. +template +struct Invoker<1, StorageType, R(X1, X2, X3, X4, X5)> { + typedef R(RunType)(BindStateBase*, + typename CallbackParamTraits::ForwardType, + typename CallbackParamTraits::ForwardType, + typename CallbackParamTraits::ForwardType, + typename CallbackParamTraits::ForwardType); + + typedef R(UnboundRunType)(X2, X3, X4, X5); + + static R Run(BindStateBase* base, + typename CallbackParamTraits::ForwardType x2, + typename CallbackParamTraits::ForwardType x3, + typename CallbackParamTraits::ForwardType x4, + typename CallbackParamTraits::ForwardType x5) { + StorageType* storage = static_cast(base); + + // Local references to make debugger stepping easier. If in a debugger, + // you really want to warp ahead and step through the + // InvokeHelper<>::MakeItSo() call below. + typedef typename StorageType::Bound1UnwrapTraits Bound1UnwrapTraits; + + typename Bound1UnwrapTraits::ForwardType x1 = + Bound1UnwrapTraits::Unwrap(storage->p1_); + return InvokeHelper::ForwardType x2, + typename CallbackParamTraits::ForwardType x3, + typename CallbackParamTraits::ForwardType x4, + typename CallbackParamTraits::ForwardType x5)> + ::MakeItSo(storage->runnable_, CallbackForward(x1), + CallbackForward(x2), CallbackForward(x3), + CallbackForward(x4), CallbackForward(x5)); + } +}; + +// Arity 5 -> 3. +template +struct Invoker<2, StorageType, R(X1, X2, X3, X4, X5)> { + typedef R(RunType)(BindStateBase*, + typename CallbackParamTraits::ForwardType, + typename CallbackParamTraits::ForwardType, + typename CallbackParamTraits::ForwardType); + + typedef R(UnboundRunType)(X3, X4, X5); + + static R Run(BindStateBase* base, + typename CallbackParamTraits::ForwardType x3, + typename CallbackParamTraits::ForwardType x4, + typename CallbackParamTraits::ForwardType x5) { + StorageType* storage = static_cast(base); + + // Local references to make debugger stepping easier. If in a debugger, + // you really want to warp ahead and step through the + // InvokeHelper<>::MakeItSo() call below. + typedef typename StorageType::Bound1UnwrapTraits Bound1UnwrapTraits; + typedef typename StorageType::Bound2UnwrapTraits Bound2UnwrapTraits; + + typename Bound1UnwrapTraits::ForwardType x1 = + Bound1UnwrapTraits::Unwrap(storage->p1_); + typename Bound2UnwrapTraits::ForwardType x2 = + Bound2UnwrapTraits::Unwrap(storage->p2_); + return InvokeHelper::ForwardType x3, + typename CallbackParamTraits::ForwardType x4, + typename CallbackParamTraits::ForwardType x5)> + ::MakeItSo(storage->runnable_, CallbackForward(x1), + CallbackForward(x2), CallbackForward(x3), + CallbackForward(x4), CallbackForward(x5)); + } +}; + +// Arity 5 -> 2. +template +struct Invoker<3, StorageType, R(X1, X2, X3, X4, X5)> { + typedef R(RunType)(BindStateBase*, + typename CallbackParamTraits::ForwardType, + typename CallbackParamTraits::ForwardType); + + typedef R(UnboundRunType)(X4, X5); + + static R Run(BindStateBase* base, + typename CallbackParamTraits::ForwardType x4, + typename CallbackParamTraits::ForwardType x5) { + StorageType* storage = static_cast(base); + + // Local references to make debugger stepping easier. If in a debugger, + // you really want to warp ahead and step through the + // InvokeHelper<>::MakeItSo() call below. + typedef typename StorageType::Bound1UnwrapTraits Bound1UnwrapTraits; + typedef typename StorageType::Bound2UnwrapTraits Bound2UnwrapTraits; + typedef typename StorageType::Bound3UnwrapTraits Bound3UnwrapTraits; + + typename Bound1UnwrapTraits::ForwardType x1 = + Bound1UnwrapTraits::Unwrap(storage->p1_); + typename Bound2UnwrapTraits::ForwardType x2 = + Bound2UnwrapTraits::Unwrap(storage->p2_); + typename Bound3UnwrapTraits::ForwardType x3 = + Bound3UnwrapTraits::Unwrap(storage->p3_); + return InvokeHelper::ForwardType x4, + typename CallbackParamTraits::ForwardType x5)> + ::MakeItSo(storage->runnable_, CallbackForward(x1), + CallbackForward(x2), CallbackForward(x3), + CallbackForward(x4), CallbackForward(x5)); + } +}; + +// Arity 5 -> 1. +template +struct Invoker<4, StorageType, R(X1, X2, X3, X4, X5)> { + typedef R(RunType)(BindStateBase*, + typename CallbackParamTraits::ForwardType); + + typedef R(UnboundRunType)(X5); + + static R Run(BindStateBase* base, + typename CallbackParamTraits::ForwardType x5) { + StorageType* storage = static_cast(base); + + // Local references to make debugger stepping easier. If in a debugger, + // you really want to warp ahead and step through the + // InvokeHelper<>::MakeItSo() call below. + typedef typename StorageType::Bound1UnwrapTraits Bound1UnwrapTraits; + typedef typename StorageType::Bound2UnwrapTraits Bound2UnwrapTraits; + typedef typename StorageType::Bound3UnwrapTraits Bound3UnwrapTraits; + typedef typename StorageType::Bound4UnwrapTraits Bound4UnwrapTraits; + + typename Bound1UnwrapTraits::ForwardType x1 = + Bound1UnwrapTraits::Unwrap(storage->p1_); + typename Bound2UnwrapTraits::ForwardType x2 = + Bound2UnwrapTraits::Unwrap(storage->p2_); + typename Bound3UnwrapTraits::ForwardType x3 = + Bound3UnwrapTraits::Unwrap(storage->p3_); + typename Bound4UnwrapTraits::ForwardType x4 = + Bound4UnwrapTraits::Unwrap(storage->p4_); + return InvokeHelper::ForwardType x5)> + ::MakeItSo(storage->runnable_, CallbackForward(x1), + CallbackForward(x2), CallbackForward(x3), + CallbackForward(x4), CallbackForward(x5)); + } +}; + +// Arity 5 -> 0. +template +struct Invoker<5, StorageType, R(X1, X2, X3, X4, X5)> { + typedef R(RunType)(BindStateBase*); + + typedef R(UnboundRunType)(); + + static R Run(BindStateBase* base) { + StorageType* storage = static_cast(base); + + // Local references to make debugger stepping easier. If in a debugger, + // you really want to warp ahead and step through the + // InvokeHelper<>::MakeItSo() call below. + typedef typename StorageType::Bound1UnwrapTraits Bound1UnwrapTraits; + typedef typename StorageType::Bound2UnwrapTraits Bound2UnwrapTraits; + typedef typename StorageType::Bound3UnwrapTraits Bound3UnwrapTraits; + typedef typename StorageType::Bound4UnwrapTraits Bound4UnwrapTraits; + typedef typename StorageType::Bound5UnwrapTraits Bound5UnwrapTraits; + + typename Bound1UnwrapTraits::ForwardType x1 = + Bound1UnwrapTraits::Unwrap(storage->p1_); + typename Bound2UnwrapTraits::ForwardType x2 = + Bound2UnwrapTraits::Unwrap(storage->p2_); + typename Bound3UnwrapTraits::ForwardType x3 = + Bound3UnwrapTraits::Unwrap(storage->p3_); + typename Bound4UnwrapTraits::ForwardType x4 = + Bound4UnwrapTraits::Unwrap(storage->p4_); + typename Bound5UnwrapTraits::ForwardType x5 = + Bound5UnwrapTraits::Unwrap(storage->p5_); + return InvokeHelper + ::MakeItSo(storage->runnable_, CallbackForward(x1), + CallbackForward(x2), CallbackForward(x3), + CallbackForward(x4), CallbackForward(x5)); + } +}; + +// Arity 6 -> 6. +template +struct Invoker<0, StorageType, R(X1, X2, X3, X4, X5, X6)> { + typedef R(RunType)(BindStateBase*, + typename CallbackParamTraits::ForwardType, + typename CallbackParamTraits::ForwardType, + typename CallbackParamTraits::ForwardType, + typename CallbackParamTraits::ForwardType, + typename CallbackParamTraits::ForwardType, + typename CallbackParamTraits::ForwardType); + + typedef R(UnboundRunType)(X1, X2, X3, X4, X5, X6); + + static R Run(BindStateBase* base, + typename CallbackParamTraits::ForwardType x1, + typename CallbackParamTraits::ForwardType x2, + typename CallbackParamTraits::ForwardType x3, + typename CallbackParamTraits::ForwardType x4, + typename CallbackParamTraits::ForwardType x5, + typename CallbackParamTraits::ForwardType x6) { + StorageType* storage = static_cast(base); + + // Local references to make debugger stepping easier. If in a debugger, + // you really want to warp ahead and step through the + // InvokeHelper<>::MakeItSo() call below. + + return InvokeHelper::ForwardType x1, + typename CallbackParamTraits::ForwardType x2, + typename CallbackParamTraits::ForwardType x3, + typename CallbackParamTraits::ForwardType x4, + typename CallbackParamTraits::ForwardType x5, + typename CallbackParamTraits::ForwardType x6)> + ::MakeItSo(storage->runnable_, CallbackForward(x1), + CallbackForward(x2), CallbackForward(x3), + CallbackForward(x4), CallbackForward(x5), + CallbackForward(x6)); + } +}; + +// Arity 6 -> 5. +template +struct Invoker<1, StorageType, R(X1, X2, X3, X4, X5, X6)> { + typedef R(RunType)(BindStateBase*, + typename CallbackParamTraits::ForwardType, + typename CallbackParamTraits::ForwardType, + typename CallbackParamTraits::ForwardType, + typename CallbackParamTraits::ForwardType, + typename CallbackParamTraits::ForwardType); + + typedef R(UnboundRunType)(X2, X3, X4, X5, X6); + + static R Run(BindStateBase* base, + typename CallbackParamTraits::ForwardType x2, + typename CallbackParamTraits::ForwardType x3, + typename CallbackParamTraits::ForwardType x4, + typename CallbackParamTraits::ForwardType x5, + typename CallbackParamTraits::ForwardType x6) { + StorageType* storage = static_cast(base); + + // Local references to make debugger stepping easier. If in a debugger, + // you really want to warp ahead and step through the + // InvokeHelper<>::MakeItSo() call below. + typedef typename StorageType::Bound1UnwrapTraits Bound1UnwrapTraits; + + typename Bound1UnwrapTraits::ForwardType x1 = + Bound1UnwrapTraits::Unwrap(storage->p1_); + return InvokeHelper::ForwardType x2, + typename CallbackParamTraits::ForwardType x3, + typename CallbackParamTraits::ForwardType x4, + typename CallbackParamTraits::ForwardType x5, + typename CallbackParamTraits::ForwardType x6)> + ::MakeItSo(storage->runnable_, CallbackForward(x1), + CallbackForward(x2), CallbackForward(x3), + CallbackForward(x4), CallbackForward(x5), + CallbackForward(x6)); + } +}; + +// Arity 6 -> 4. +template +struct Invoker<2, StorageType, R(X1, X2, X3, X4, X5, X6)> { + typedef R(RunType)(BindStateBase*, + typename CallbackParamTraits::ForwardType, + typename CallbackParamTraits::ForwardType, + typename CallbackParamTraits::ForwardType, + typename CallbackParamTraits::ForwardType); + + typedef R(UnboundRunType)(X3, X4, X5, X6); + + static R Run(BindStateBase* base, + typename CallbackParamTraits::ForwardType x3, + typename CallbackParamTraits::ForwardType x4, + typename CallbackParamTraits::ForwardType x5, + typename CallbackParamTraits::ForwardType x6) { + StorageType* storage = static_cast(base); + + // Local references to make debugger stepping easier. If in a debugger, + // you really want to warp ahead and step through the + // InvokeHelper<>::MakeItSo() call below. + typedef typename StorageType::Bound1UnwrapTraits Bound1UnwrapTraits; + typedef typename StorageType::Bound2UnwrapTraits Bound2UnwrapTraits; + + typename Bound1UnwrapTraits::ForwardType x1 = + Bound1UnwrapTraits::Unwrap(storage->p1_); + typename Bound2UnwrapTraits::ForwardType x2 = + Bound2UnwrapTraits::Unwrap(storage->p2_); + return InvokeHelper::ForwardType x3, + typename CallbackParamTraits::ForwardType x4, + typename CallbackParamTraits::ForwardType x5, + typename CallbackParamTraits::ForwardType x6)> + ::MakeItSo(storage->runnable_, CallbackForward(x1), + CallbackForward(x2), CallbackForward(x3), + CallbackForward(x4), CallbackForward(x5), + CallbackForward(x6)); + } +}; + +// Arity 6 -> 3. +template +struct Invoker<3, StorageType, R(X1, X2, X3, X4, X5, X6)> { + typedef R(RunType)(BindStateBase*, + typename CallbackParamTraits::ForwardType, + typename CallbackParamTraits::ForwardType, + typename CallbackParamTraits::ForwardType); + + typedef R(UnboundRunType)(X4, X5, X6); + + static R Run(BindStateBase* base, + typename CallbackParamTraits::ForwardType x4, + typename CallbackParamTraits::ForwardType x5, + typename CallbackParamTraits::ForwardType x6) { + StorageType* storage = static_cast(base); + + // Local references to make debugger stepping easier. If in a debugger, + // you really want to warp ahead and step through the + // InvokeHelper<>::MakeItSo() call below. + typedef typename StorageType::Bound1UnwrapTraits Bound1UnwrapTraits; + typedef typename StorageType::Bound2UnwrapTraits Bound2UnwrapTraits; + typedef typename StorageType::Bound3UnwrapTraits Bound3UnwrapTraits; + + typename Bound1UnwrapTraits::ForwardType x1 = + Bound1UnwrapTraits::Unwrap(storage->p1_); + typename Bound2UnwrapTraits::ForwardType x2 = + Bound2UnwrapTraits::Unwrap(storage->p2_); + typename Bound3UnwrapTraits::ForwardType x3 = + Bound3UnwrapTraits::Unwrap(storage->p3_); + return InvokeHelper::ForwardType x4, + typename CallbackParamTraits::ForwardType x5, + typename CallbackParamTraits::ForwardType x6)> + ::MakeItSo(storage->runnable_, CallbackForward(x1), + CallbackForward(x2), CallbackForward(x3), + CallbackForward(x4), CallbackForward(x5), + CallbackForward(x6)); + } +}; + +// Arity 6 -> 2. +template +struct Invoker<4, StorageType, R(X1, X2, X3, X4, X5, X6)> { + typedef R(RunType)(BindStateBase*, + typename CallbackParamTraits::ForwardType, + typename CallbackParamTraits::ForwardType); + + typedef R(UnboundRunType)(X5, X6); + + static R Run(BindStateBase* base, + typename CallbackParamTraits::ForwardType x5, + typename CallbackParamTraits::ForwardType x6) { + StorageType* storage = static_cast(base); + + // Local references to make debugger stepping easier. If in a debugger, + // you really want to warp ahead and step through the + // InvokeHelper<>::MakeItSo() call below. + typedef typename StorageType::Bound1UnwrapTraits Bound1UnwrapTraits; + typedef typename StorageType::Bound2UnwrapTraits Bound2UnwrapTraits; + typedef typename StorageType::Bound3UnwrapTraits Bound3UnwrapTraits; + typedef typename StorageType::Bound4UnwrapTraits Bound4UnwrapTraits; + + typename Bound1UnwrapTraits::ForwardType x1 = + Bound1UnwrapTraits::Unwrap(storage->p1_); + typename Bound2UnwrapTraits::ForwardType x2 = + Bound2UnwrapTraits::Unwrap(storage->p2_); + typename Bound3UnwrapTraits::ForwardType x3 = + Bound3UnwrapTraits::Unwrap(storage->p3_); + typename Bound4UnwrapTraits::ForwardType x4 = + Bound4UnwrapTraits::Unwrap(storage->p4_); + return InvokeHelper::ForwardType x5, + typename CallbackParamTraits::ForwardType x6)> + ::MakeItSo(storage->runnable_, CallbackForward(x1), + CallbackForward(x2), CallbackForward(x3), + CallbackForward(x4), CallbackForward(x5), + CallbackForward(x6)); + } +}; + +// Arity 6 -> 1. +template +struct Invoker<5, StorageType, R(X1, X2, X3, X4, X5, X6)> { + typedef R(RunType)(BindStateBase*, + typename CallbackParamTraits::ForwardType); + + typedef R(UnboundRunType)(X6); + + static R Run(BindStateBase* base, + typename CallbackParamTraits::ForwardType x6) { + StorageType* storage = static_cast(base); + + // Local references to make debugger stepping easier. If in a debugger, + // you really want to warp ahead and step through the + // InvokeHelper<>::MakeItSo() call below. + typedef typename StorageType::Bound1UnwrapTraits Bound1UnwrapTraits; + typedef typename StorageType::Bound2UnwrapTraits Bound2UnwrapTraits; + typedef typename StorageType::Bound3UnwrapTraits Bound3UnwrapTraits; + typedef typename StorageType::Bound4UnwrapTraits Bound4UnwrapTraits; + typedef typename StorageType::Bound5UnwrapTraits Bound5UnwrapTraits; + + typename Bound1UnwrapTraits::ForwardType x1 = + Bound1UnwrapTraits::Unwrap(storage->p1_); + typename Bound2UnwrapTraits::ForwardType x2 = + Bound2UnwrapTraits::Unwrap(storage->p2_); + typename Bound3UnwrapTraits::ForwardType x3 = + Bound3UnwrapTraits::Unwrap(storage->p3_); + typename Bound4UnwrapTraits::ForwardType x4 = + Bound4UnwrapTraits::Unwrap(storage->p4_); + typename Bound5UnwrapTraits::ForwardType x5 = + Bound5UnwrapTraits::Unwrap(storage->p5_); + return InvokeHelper::ForwardType x6)> + ::MakeItSo(storage->runnable_, CallbackForward(x1), + CallbackForward(x2), CallbackForward(x3), + CallbackForward(x4), CallbackForward(x5), + CallbackForward(x6)); + } +}; + +// Arity 6 -> 0. +template +struct Invoker<6, StorageType, R(X1, X2, X3, X4, X5, X6)> { + typedef R(RunType)(BindStateBase*); + + typedef R(UnboundRunType)(); + + static R Run(BindStateBase* base) { + StorageType* storage = static_cast(base); + + // Local references to make debugger stepping easier. If in a debugger, + // you really want to warp ahead and step through the + // InvokeHelper<>::MakeItSo() call below. + typedef typename StorageType::Bound1UnwrapTraits Bound1UnwrapTraits; + typedef typename StorageType::Bound2UnwrapTraits Bound2UnwrapTraits; + typedef typename StorageType::Bound3UnwrapTraits Bound3UnwrapTraits; + typedef typename StorageType::Bound4UnwrapTraits Bound4UnwrapTraits; + typedef typename StorageType::Bound5UnwrapTraits Bound5UnwrapTraits; + typedef typename StorageType::Bound6UnwrapTraits Bound6UnwrapTraits; + + typename Bound1UnwrapTraits::ForwardType x1 = + Bound1UnwrapTraits::Unwrap(storage->p1_); + typename Bound2UnwrapTraits::ForwardType x2 = + Bound2UnwrapTraits::Unwrap(storage->p2_); + typename Bound3UnwrapTraits::ForwardType x3 = + Bound3UnwrapTraits::Unwrap(storage->p3_); + typename Bound4UnwrapTraits::ForwardType x4 = + Bound4UnwrapTraits::Unwrap(storage->p4_); + typename Bound5UnwrapTraits::ForwardType x5 = + Bound5UnwrapTraits::Unwrap(storage->p5_); + typename Bound6UnwrapTraits::ForwardType x6 = + Bound6UnwrapTraits::Unwrap(storage->p6_); + return InvokeHelper + ::MakeItSo(storage->runnable_, CallbackForward(x1), + CallbackForward(x2), CallbackForward(x3), + CallbackForward(x4), CallbackForward(x5), + CallbackForward(x6)); + } +}; + +// Arity 7 -> 7. +template +struct Invoker<0, StorageType, R(X1, X2, X3, X4, X5, X6, X7)> { + typedef R(RunType)(BindStateBase*, + typename CallbackParamTraits::ForwardType, + typename CallbackParamTraits::ForwardType, + typename CallbackParamTraits::ForwardType, + typename CallbackParamTraits::ForwardType, + typename CallbackParamTraits::ForwardType, + typename CallbackParamTraits::ForwardType, + typename CallbackParamTraits::ForwardType); + + typedef R(UnboundRunType)(X1, X2, X3, X4, X5, X6, X7); + + static R Run(BindStateBase* base, + typename CallbackParamTraits::ForwardType x1, + typename CallbackParamTraits::ForwardType x2, + typename CallbackParamTraits::ForwardType x3, + typename CallbackParamTraits::ForwardType x4, + typename CallbackParamTraits::ForwardType x5, + typename CallbackParamTraits::ForwardType x6, + typename CallbackParamTraits::ForwardType x7) { + StorageType* storage = static_cast(base); + + // Local references to make debugger stepping easier. If in a debugger, + // you really want to warp ahead and step through the + // InvokeHelper<>::MakeItSo() call below. + + return InvokeHelper::ForwardType x1, + typename CallbackParamTraits::ForwardType x2, + typename CallbackParamTraits::ForwardType x3, + typename CallbackParamTraits::ForwardType x4, + typename CallbackParamTraits::ForwardType x5, + typename CallbackParamTraits::ForwardType x6, + typename CallbackParamTraits::ForwardType x7)> + ::MakeItSo(storage->runnable_, CallbackForward(x1), + CallbackForward(x2), CallbackForward(x3), + CallbackForward(x4), CallbackForward(x5), + CallbackForward(x6), CallbackForward(x7)); + } +}; + +// Arity 7 -> 6. +template +struct Invoker<1, StorageType, R(X1, X2, X3, X4, X5, X6, X7)> { + typedef R(RunType)(BindStateBase*, + typename CallbackParamTraits::ForwardType, + typename CallbackParamTraits::ForwardType, + typename CallbackParamTraits::ForwardType, + typename CallbackParamTraits::ForwardType, + typename CallbackParamTraits::ForwardType, + typename CallbackParamTraits::ForwardType); + + typedef R(UnboundRunType)(X2, X3, X4, X5, X6, X7); + + static R Run(BindStateBase* base, + typename CallbackParamTraits::ForwardType x2, + typename CallbackParamTraits::ForwardType x3, + typename CallbackParamTraits::ForwardType x4, + typename CallbackParamTraits::ForwardType x5, + typename CallbackParamTraits::ForwardType x6, + typename CallbackParamTraits::ForwardType x7) { + StorageType* storage = static_cast(base); + + // Local references to make debugger stepping easier. If in a debugger, + // you really want to warp ahead and step through the + // InvokeHelper<>::MakeItSo() call below. + typedef typename StorageType::Bound1UnwrapTraits Bound1UnwrapTraits; + + typename Bound1UnwrapTraits::ForwardType x1 = + Bound1UnwrapTraits::Unwrap(storage->p1_); + return InvokeHelper::ForwardType x2, + typename CallbackParamTraits::ForwardType x3, + typename CallbackParamTraits::ForwardType x4, + typename CallbackParamTraits::ForwardType x5, + typename CallbackParamTraits::ForwardType x6, + typename CallbackParamTraits::ForwardType x7)> + ::MakeItSo(storage->runnable_, CallbackForward(x1), + CallbackForward(x2), CallbackForward(x3), + CallbackForward(x4), CallbackForward(x5), + CallbackForward(x6), CallbackForward(x7)); + } +}; + +// Arity 7 -> 5. +template +struct Invoker<2, StorageType, R(X1, X2, X3, X4, X5, X6, X7)> { + typedef R(RunType)(BindStateBase*, + typename CallbackParamTraits::ForwardType, + typename CallbackParamTraits::ForwardType, + typename CallbackParamTraits::ForwardType, + typename CallbackParamTraits::ForwardType, + typename CallbackParamTraits::ForwardType); + + typedef R(UnboundRunType)(X3, X4, X5, X6, X7); + + static R Run(BindStateBase* base, + typename CallbackParamTraits::ForwardType x3, + typename CallbackParamTraits::ForwardType x4, + typename CallbackParamTraits::ForwardType x5, + typename CallbackParamTraits::ForwardType x6, + typename CallbackParamTraits::ForwardType x7) { + StorageType* storage = static_cast(base); + + // Local references to make debugger stepping easier. If in a debugger, + // you really want to warp ahead and step through the + // InvokeHelper<>::MakeItSo() call below. + typedef typename StorageType::Bound1UnwrapTraits Bound1UnwrapTraits; + typedef typename StorageType::Bound2UnwrapTraits Bound2UnwrapTraits; + + typename Bound1UnwrapTraits::ForwardType x1 = + Bound1UnwrapTraits::Unwrap(storage->p1_); + typename Bound2UnwrapTraits::ForwardType x2 = + Bound2UnwrapTraits::Unwrap(storage->p2_); + return InvokeHelper::ForwardType x3, + typename CallbackParamTraits::ForwardType x4, + typename CallbackParamTraits::ForwardType x5, + typename CallbackParamTraits::ForwardType x6, + typename CallbackParamTraits::ForwardType x7)> + ::MakeItSo(storage->runnable_, CallbackForward(x1), + CallbackForward(x2), CallbackForward(x3), + CallbackForward(x4), CallbackForward(x5), + CallbackForward(x6), CallbackForward(x7)); + } +}; + +// Arity 7 -> 4. +template +struct Invoker<3, StorageType, R(X1, X2, X3, X4, X5, X6, X7)> { + typedef R(RunType)(BindStateBase*, + typename CallbackParamTraits::ForwardType, + typename CallbackParamTraits::ForwardType, + typename CallbackParamTraits::ForwardType, + typename CallbackParamTraits::ForwardType); + + typedef R(UnboundRunType)(X4, X5, X6, X7); + + static R Run(BindStateBase* base, + typename CallbackParamTraits::ForwardType x4, + typename CallbackParamTraits::ForwardType x5, + typename CallbackParamTraits::ForwardType x6, + typename CallbackParamTraits::ForwardType x7) { + StorageType* storage = static_cast(base); + + // Local references to make debugger stepping easier. If in a debugger, + // you really want to warp ahead and step through the + // InvokeHelper<>::MakeItSo() call below. + typedef typename StorageType::Bound1UnwrapTraits Bound1UnwrapTraits; + typedef typename StorageType::Bound2UnwrapTraits Bound2UnwrapTraits; + typedef typename StorageType::Bound3UnwrapTraits Bound3UnwrapTraits; + + typename Bound1UnwrapTraits::ForwardType x1 = + Bound1UnwrapTraits::Unwrap(storage->p1_); + typename Bound2UnwrapTraits::ForwardType x2 = + Bound2UnwrapTraits::Unwrap(storage->p2_); + typename Bound3UnwrapTraits::ForwardType x3 = + Bound3UnwrapTraits::Unwrap(storage->p3_); + return InvokeHelper::ForwardType x4, + typename CallbackParamTraits::ForwardType x5, + typename CallbackParamTraits::ForwardType x6, + typename CallbackParamTraits::ForwardType x7)> + ::MakeItSo(storage->runnable_, CallbackForward(x1), + CallbackForward(x2), CallbackForward(x3), + CallbackForward(x4), CallbackForward(x5), + CallbackForward(x6), CallbackForward(x7)); + } +}; + +// Arity 7 -> 3. +template +struct Invoker<4, StorageType, R(X1, X2, X3, X4, X5, X6, X7)> { + typedef R(RunType)(BindStateBase*, + typename CallbackParamTraits::ForwardType, + typename CallbackParamTraits::ForwardType, + typename CallbackParamTraits::ForwardType); + + typedef R(UnboundRunType)(X5, X6, X7); + + static R Run(BindStateBase* base, + typename CallbackParamTraits::ForwardType x5, + typename CallbackParamTraits::ForwardType x6, + typename CallbackParamTraits::ForwardType x7) { + StorageType* storage = static_cast(base); + + // Local references to make debugger stepping easier. If in a debugger, + // you really want to warp ahead and step through the + // InvokeHelper<>::MakeItSo() call below. + typedef typename StorageType::Bound1UnwrapTraits Bound1UnwrapTraits; + typedef typename StorageType::Bound2UnwrapTraits Bound2UnwrapTraits; + typedef typename StorageType::Bound3UnwrapTraits Bound3UnwrapTraits; + typedef typename StorageType::Bound4UnwrapTraits Bound4UnwrapTraits; + + typename Bound1UnwrapTraits::ForwardType x1 = + Bound1UnwrapTraits::Unwrap(storage->p1_); + typename Bound2UnwrapTraits::ForwardType x2 = + Bound2UnwrapTraits::Unwrap(storage->p2_); + typename Bound3UnwrapTraits::ForwardType x3 = + Bound3UnwrapTraits::Unwrap(storage->p3_); + typename Bound4UnwrapTraits::ForwardType x4 = + Bound4UnwrapTraits::Unwrap(storage->p4_); + return InvokeHelper::ForwardType x5, + typename CallbackParamTraits::ForwardType x6, + typename CallbackParamTraits::ForwardType x7)> + ::MakeItSo(storage->runnable_, CallbackForward(x1), + CallbackForward(x2), CallbackForward(x3), + CallbackForward(x4), CallbackForward(x5), + CallbackForward(x6), CallbackForward(x7)); + } +}; + +// Arity 7 -> 2. +template +struct Invoker<5, StorageType, R(X1, X2, X3, X4, X5, X6, X7)> { + typedef R(RunType)(BindStateBase*, + typename CallbackParamTraits::ForwardType, + typename CallbackParamTraits::ForwardType); + + typedef R(UnboundRunType)(X6, X7); + + static R Run(BindStateBase* base, + typename CallbackParamTraits::ForwardType x6, + typename CallbackParamTraits::ForwardType x7) { + StorageType* storage = static_cast(base); + + // Local references to make debugger stepping easier. If in a debugger, + // you really want to warp ahead and step through the + // InvokeHelper<>::MakeItSo() call below. + typedef typename StorageType::Bound1UnwrapTraits Bound1UnwrapTraits; + typedef typename StorageType::Bound2UnwrapTraits Bound2UnwrapTraits; + typedef typename StorageType::Bound3UnwrapTraits Bound3UnwrapTraits; + typedef typename StorageType::Bound4UnwrapTraits Bound4UnwrapTraits; + typedef typename StorageType::Bound5UnwrapTraits Bound5UnwrapTraits; + + typename Bound1UnwrapTraits::ForwardType x1 = + Bound1UnwrapTraits::Unwrap(storage->p1_); + typename Bound2UnwrapTraits::ForwardType x2 = + Bound2UnwrapTraits::Unwrap(storage->p2_); + typename Bound3UnwrapTraits::ForwardType x3 = + Bound3UnwrapTraits::Unwrap(storage->p3_); + typename Bound4UnwrapTraits::ForwardType x4 = + Bound4UnwrapTraits::Unwrap(storage->p4_); + typename Bound5UnwrapTraits::ForwardType x5 = + Bound5UnwrapTraits::Unwrap(storage->p5_); + return InvokeHelper::ForwardType x6, + typename CallbackParamTraits::ForwardType x7)> + ::MakeItSo(storage->runnable_, CallbackForward(x1), + CallbackForward(x2), CallbackForward(x3), + CallbackForward(x4), CallbackForward(x5), + CallbackForward(x6), CallbackForward(x7)); + } +}; + +// Arity 7 -> 1. +template +struct Invoker<6, StorageType, R(X1, X2, X3, X4, X5, X6, X7)> { + typedef R(RunType)(BindStateBase*, + typename CallbackParamTraits::ForwardType); + + typedef R(UnboundRunType)(X7); + + static R Run(BindStateBase* base, + typename CallbackParamTraits::ForwardType x7) { + StorageType* storage = static_cast(base); + + // Local references to make debugger stepping easier. If in a debugger, + // you really want to warp ahead and step through the + // InvokeHelper<>::MakeItSo() call below. + typedef typename StorageType::Bound1UnwrapTraits Bound1UnwrapTraits; + typedef typename StorageType::Bound2UnwrapTraits Bound2UnwrapTraits; + typedef typename StorageType::Bound3UnwrapTraits Bound3UnwrapTraits; + typedef typename StorageType::Bound4UnwrapTraits Bound4UnwrapTraits; + typedef typename StorageType::Bound5UnwrapTraits Bound5UnwrapTraits; + typedef typename StorageType::Bound6UnwrapTraits Bound6UnwrapTraits; + + typename Bound1UnwrapTraits::ForwardType x1 = + Bound1UnwrapTraits::Unwrap(storage->p1_); + typename Bound2UnwrapTraits::ForwardType x2 = + Bound2UnwrapTraits::Unwrap(storage->p2_); + typename Bound3UnwrapTraits::ForwardType x3 = + Bound3UnwrapTraits::Unwrap(storage->p3_); + typename Bound4UnwrapTraits::ForwardType x4 = + Bound4UnwrapTraits::Unwrap(storage->p4_); + typename Bound5UnwrapTraits::ForwardType x5 = + Bound5UnwrapTraits::Unwrap(storage->p5_); + typename Bound6UnwrapTraits::ForwardType x6 = + Bound6UnwrapTraits::Unwrap(storage->p6_); + return InvokeHelper::ForwardType x7)> + ::MakeItSo(storage->runnable_, CallbackForward(x1), + CallbackForward(x2), CallbackForward(x3), + CallbackForward(x4), CallbackForward(x5), + CallbackForward(x6), CallbackForward(x7)); + } +}; + +// Arity 7 -> 0. +template +struct Invoker<7, StorageType, R(X1, X2, X3, X4, X5, X6, X7)> { + typedef R(RunType)(BindStateBase*); + + typedef R(UnboundRunType)(); + + static R Run(BindStateBase* base) { + StorageType* storage = static_cast(base); + + // Local references to make debugger stepping easier. If in a debugger, + // you really want to warp ahead and step through the + // InvokeHelper<>::MakeItSo() call below. + typedef typename StorageType::Bound1UnwrapTraits Bound1UnwrapTraits; + typedef typename StorageType::Bound2UnwrapTraits Bound2UnwrapTraits; + typedef typename StorageType::Bound3UnwrapTraits Bound3UnwrapTraits; + typedef typename StorageType::Bound4UnwrapTraits Bound4UnwrapTraits; + typedef typename StorageType::Bound5UnwrapTraits Bound5UnwrapTraits; + typedef typename StorageType::Bound6UnwrapTraits Bound6UnwrapTraits; + typedef typename StorageType::Bound7UnwrapTraits Bound7UnwrapTraits; + + typename Bound1UnwrapTraits::ForwardType x1 = + Bound1UnwrapTraits::Unwrap(storage->p1_); + typename Bound2UnwrapTraits::ForwardType x2 = + Bound2UnwrapTraits::Unwrap(storage->p2_); + typename Bound3UnwrapTraits::ForwardType x3 = + Bound3UnwrapTraits::Unwrap(storage->p3_); + typename Bound4UnwrapTraits::ForwardType x4 = + Bound4UnwrapTraits::Unwrap(storage->p4_); + typename Bound5UnwrapTraits::ForwardType x5 = + Bound5UnwrapTraits::Unwrap(storage->p5_); + typename Bound6UnwrapTraits::ForwardType x6 = + Bound6UnwrapTraits::Unwrap(storage->p6_); + typename Bound7UnwrapTraits::ForwardType x7 = + Bound7UnwrapTraits::Unwrap(storage->p7_); + return InvokeHelper + ::MakeItSo(storage->runnable_, CallbackForward(x1), + CallbackForward(x2), CallbackForward(x3), + CallbackForward(x4), CallbackForward(x5), + CallbackForward(x6), CallbackForward(x7)); + } +}; + + +// BindState<> +// +// This stores all the state passed into Bind() and is also where most +// of the template resolution magic occurs. +// +// Runnable is the functor we are binding arguments to. +// RunType is type of the Run() function that the Invoker<> should use. +// Normally, this is the same as the RunType of the Runnable, but it can +// be different if an adapter like IgnoreResult() has been used. +// +// BoundArgsType contains the storage type for all the bound arguments by +// (ab)using a function type. +template +struct BindState; + +template +struct BindState : public BindStateBase { + typedef Runnable RunnableType; + typedef false_type IsWeakCall; + typedef Invoker<0, BindState, RunType> InvokerType; + typedef typename InvokerType::UnboundRunType UnboundRunType; + explicit BindState(const Runnable& runnable) + : runnable_(runnable) { + } + + virtual ~BindState() { } + + RunnableType runnable_; +}; + +template +struct BindState : public BindStateBase { + typedef Runnable RunnableType; + typedef IsWeakMethod::value, P1> IsWeakCall; + typedef Invoker<1, BindState, RunType> InvokerType; + typedef typename InvokerType::UnboundRunType UnboundRunType; + + // Convenience typedefs for bound argument types. + typedef UnwrapTraits Bound1UnwrapTraits; + + BindState(const Runnable& runnable, const P1& p1) + : runnable_(runnable), + p1_(p1) { + MaybeRefcount::value, P1>::AddRef(p1_); + } + + virtual ~BindState() { MaybeRefcount::value, + P1>::Release(p1_); } + + RunnableType runnable_; + P1 p1_; +}; + +template +struct BindState : public BindStateBase { + typedef Runnable RunnableType; + typedef IsWeakMethod::value, P1> IsWeakCall; + typedef Invoker<2, BindState, RunType> InvokerType; + typedef typename InvokerType::UnboundRunType UnboundRunType; + + // Convenience typedefs for bound argument types. + typedef UnwrapTraits Bound1UnwrapTraits; + typedef UnwrapTraits Bound2UnwrapTraits; + + BindState(const Runnable& runnable, const P1& p1, const P2& p2) + : runnable_(runnable), + p1_(p1), + p2_(p2) { + MaybeRefcount::value, P1>::AddRef(p1_); + } + + virtual ~BindState() { MaybeRefcount::value, + P1>::Release(p1_); } + + RunnableType runnable_; + P1 p1_; + P2 p2_; +}; + +template +struct BindState : public BindStateBase { + typedef Runnable RunnableType; + typedef IsWeakMethod::value, P1> IsWeakCall; + typedef Invoker<3, BindState, RunType> InvokerType; + typedef typename InvokerType::UnboundRunType UnboundRunType; + + // Convenience typedefs for bound argument types. + typedef UnwrapTraits Bound1UnwrapTraits; + typedef UnwrapTraits Bound2UnwrapTraits; + typedef UnwrapTraits Bound3UnwrapTraits; + + BindState(const Runnable& runnable, const P1& p1, const P2& p2, const P3& p3) + : runnable_(runnable), + p1_(p1), + p2_(p2), + p3_(p3) { + MaybeRefcount::value, P1>::AddRef(p1_); + } + + virtual ~BindState() { MaybeRefcount::value, + P1>::Release(p1_); } + + RunnableType runnable_; + P1 p1_; + P2 p2_; + P3 p3_; +}; + +template +struct BindState : public BindStateBase { + typedef Runnable RunnableType; + typedef IsWeakMethod::value, P1> IsWeakCall; + typedef Invoker<4, BindState, RunType> InvokerType; + typedef typename InvokerType::UnboundRunType UnboundRunType; + + // Convenience typedefs for bound argument types. + typedef UnwrapTraits Bound1UnwrapTraits; + typedef UnwrapTraits Bound2UnwrapTraits; + typedef UnwrapTraits Bound3UnwrapTraits; + typedef UnwrapTraits Bound4UnwrapTraits; + + BindState(const Runnable& runnable, const P1& p1, const P2& p2, const P3& p3, + const P4& p4) + : runnable_(runnable), + p1_(p1), + p2_(p2), + p3_(p3), + p4_(p4) { + MaybeRefcount::value, P1>::AddRef(p1_); + } + + virtual ~BindState() { MaybeRefcount::value, + P1>::Release(p1_); } + + RunnableType runnable_; + P1 p1_; + P2 p2_; + P3 p3_; + P4 p4_; +}; + +template +struct BindState : public BindStateBase { + typedef Runnable RunnableType; + typedef IsWeakMethod::value, P1> IsWeakCall; + typedef Invoker<5, BindState, RunType> InvokerType; + typedef typename InvokerType::UnboundRunType UnboundRunType; + + // Convenience typedefs for bound argument types. + typedef UnwrapTraits Bound1UnwrapTraits; + typedef UnwrapTraits Bound2UnwrapTraits; + typedef UnwrapTraits Bound3UnwrapTraits; + typedef UnwrapTraits Bound4UnwrapTraits; + typedef UnwrapTraits Bound5UnwrapTraits; + + BindState(const Runnable& runnable, const P1& p1, const P2& p2, const P3& p3, + const P4& p4, const P5& p5) + : runnable_(runnable), + p1_(p1), + p2_(p2), + p3_(p3), + p4_(p4), + p5_(p5) { + MaybeRefcount::value, P1>::AddRef(p1_); + } + + virtual ~BindState() { MaybeRefcount::value, + P1>::Release(p1_); } + + RunnableType runnable_; + P1 p1_; + P2 p2_; + P3 p3_; + P4 p4_; + P5 p5_; +}; + +template +struct BindState : public BindStateBase { + typedef Runnable RunnableType; + typedef IsWeakMethod::value, P1> IsWeakCall; + typedef Invoker<6, BindState, RunType> InvokerType; + typedef typename InvokerType::UnboundRunType UnboundRunType; + + // Convenience typedefs for bound argument types. + typedef UnwrapTraits Bound1UnwrapTraits; + typedef UnwrapTraits Bound2UnwrapTraits; + typedef UnwrapTraits Bound3UnwrapTraits; + typedef UnwrapTraits Bound4UnwrapTraits; + typedef UnwrapTraits Bound5UnwrapTraits; + typedef UnwrapTraits Bound6UnwrapTraits; + + BindState(const Runnable& runnable, const P1& p1, const P2& p2, const P3& p3, + const P4& p4, const P5& p5, const P6& p6) + : runnable_(runnable), + p1_(p1), + p2_(p2), + p3_(p3), + p4_(p4), + p5_(p5), + p6_(p6) { + MaybeRefcount::value, P1>::AddRef(p1_); + } + + virtual ~BindState() { MaybeRefcount::value, + P1>::Release(p1_); } + + RunnableType runnable_; + P1 p1_; + P2 p2_; + P3 p3_; + P4 p4_; + P5 p5_; + P6 p6_; +}; + +template +struct BindState : public BindStateBase { + typedef Runnable RunnableType; + typedef IsWeakMethod::value, P1> IsWeakCall; + typedef Invoker<7, BindState, RunType> InvokerType; + typedef typename InvokerType::UnboundRunType UnboundRunType; + + // Convenience typedefs for bound argument types. + typedef UnwrapTraits Bound1UnwrapTraits; + typedef UnwrapTraits Bound2UnwrapTraits; + typedef UnwrapTraits Bound3UnwrapTraits; + typedef UnwrapTraits Bound4UnwrapTraits; + typedef UnwrapTraits Bound5UnwrapTraits; + typedef UnwrapTraits Bound6UnwrapTraits; + typedef UnwrapTraits Bound7UnwrapTraits; + + BindState(const Runnable& runnable, const P1& p1, const P2& p2, const P3& p3, + const P4& p4, const P5& p5, const P6& p6, const P7& p7) + : runnable_(runnable), + p1_(p1), + p2_(p2), + p3_(p3), + p4_(p4), + p5_(p5), + p6_(p6), + p7_(p7) { + MaybeRefcount::value, P1>::AddRef(p1_); + } + + virtual ~BindState() { MaybeRefcount::value, + P1>::Release(p1_); } + + RunnableType runnable_; + P1 p1_; + P2 p2_; + P3 p3_; + P4 p4_; + P5 p5_; + P6 p6_; + P7 p7_; +}; + +} // namespace cef_internal +} // namespace base + +#endif // CEF_INCLUDE_BASE_INTERNAL_CEF_BIND_INTERNAL_H_ diff --git a/dependencies64/cef/include/base/internal/cef_bind_internal_win.h b/dependencies64/cef/include/base/internal/cef_bind_internal_win.h new file mode 100644 index 000000000..1b061ccd0 --- /dev/null +++ b/dependencies64/cef/include/base/internal/cef_bind_internal_win.h @@ -0,0 +1,390 @@ +// Copyright (c) 2011 Google Inc. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +// Do not include this header file directly. Use base/cef_bind.h instead. + +// Specializations of RunnableAdapter<> for Windows specific calling +// conventions. Please see base/bind_internal.h for more info. + +#ifndef CEF_INCLUDE_BASE_INTERNAL_CEF_BIND_INTERNAL_WIN_H_ +#define CEF_INCLUDE_BASE_INTERNAL_CEF_BIND_INTERNAL_WIN_H_ + +// In the x64 architecture in Windows, __fastcall, __stdcall, etc, are all +// the same as __cdecl which would turn the following specializations into +// multiple definitions. +#if !defined(ARCH_CPU_X86_64) + +namespace base { +namespace cef_internal { + +template +class RunnableAdapter; + +// __stdcall Function: Arity 0. +template +class RunnableAdapter { + public: + typedef R (RunType)(); + + explicit RunnableAdapter(R(__stdcall *function)()) + : function_(function) { + } + + R Run() { + return function_(); + } + + private: + R (__stdcall *function_)(); +}; + +// __fastcall Function: Arity 0. +template +class RunnableAdapter { + public: + typedef R (RunType)(); + + explicit RunnableAdapter(R(__fastcall *function)()) + : function_(function) { + } + + R Run() { + return function_(); + } + + private: + R (__fastcall *function_)(); +}; + +// __stdcall Function: Arity 1. +template +class RunnableAdapter { + public: + typedef R (RunType)(A1); + + explicit RunnableAdapter(R(__stdcall *function)(A1)) + : function_(function) { + } + + R Run(typename CallbackParamTraits::ForwardType a1) { + return function_(a1); + } + + private: + R (__stdcall *function_)(A1); +}; + +// __fastcall Function: Arity 1. +template +class RunnableAdapter { + public: + typedef R (RunType)(A1); + + explicit RunnableAdapter(R(__fastcall *function)(A1)) + : function_(function) { + } + + R Run(typename CallbackParamTraits::ForwardType a1) { + return function_(a1); + } + + private: + R (__fastcall *function_)(A1); +}; + +// __stdcall Function: Arity 2. +template +class RunnableAdapter { + public: + typedef R (RunType)(A1, A2); + + explicit RunnableAdapter(R(__stdcall *function)(A1, A2)) + : function_(function) { + } + + R Run(typename CallbackParamTraits::ForwardType a1, + typename CallbackParamTraits::ForwardType a2) { + return function_(a1, a2); + } + + private: + R (__stdcall *function_)(A1, A2); +}; + +// __fastcall Function: Arity 2. +template +class RunnableAdapter { + public: + typedef R (RunType)(A1, A2); + + explicit RunnableAdapter(R(__fastcall *function)(A1, A2)) + : function_(function) { + } + + R Run(typename CallbackParamTraits::ForwardType a1, + typename CallbackParamTraits::ForwardType a2) { + return function_(a1, a2); + } + + private: + R (__fastcall *function_)(A1, A2); +}; + +// __stdcall Function: Arity 3. +template +class RunnableAdapter { + public: + typedef R (RunType)(A1, A2, A3); + + explicit RunnableAdapter(R(__stdcall *function)(A1, A2, A3)) + : function_(function) { + } + + R Run(typename CallbackParamTraits::ForwardType a1, + typename CallbackParamTraits::ForwardType a2, + typename CallbackParamTraits::ForwardType a3) { + return function_(a1, a2, a3); + } + + private: + R (__stdcall *function_)(A1, A2, A3); +}; + +// __fastcall Function: Arity 3. +template +class RunnableAdapter { + public: + typedef R (RunType)(A1, A2, A3); + + explicit RunnableAdapter(R(__fastcall *function)(A1, A2, A3)) + : function_(function) { + } + + R Run(typename CallbackParamTraits::ForwardType a1, + typename CallbackParamTraits::ForwardType a2, + typename CallbackParamTraits::ForwardType a3) { + return function_(a1, a2, a3); + } + + private: + R (__fastcall *function_)(A1, A2, A3); +}; + +// __stdcall Function: Arity 4. +template +class RunnableAdapter { + public: + typedef R (RunType)(A1, A2, A3, A4); + + explicit RunnableAdapter(R(__stdcall *function)(A1, A2, A3, A4)) + : function_(function) { + } + + R Run(typename CallbackParamTraits::ForwardType a1, + typename CallbackParamTraits::ForwardType a2, + typename CallbackParamTraits::ForwardType a3, + typename CallbackParamTraits::ForwardType a4) { + return function_(a1, a2, a3, a4); + } + + private: + R (__stdcall *function_)(A1, A2, A3, A4); +}; + +// __fastcall Function: Arity 4. +template +class RunnableAdapter { + public: + typedef R (RunType)(A1, A2, A3, A4); + + explicit RunnableAdapter(R(__fastcall *function)(A1, A2, A3, A4)) + : function_(function) { + } + + R Run(typename CallbackParamTraits::ForwardType a1, + typename CallbackParamTraits::ForwardType a2, + typename CallbackParamTraits::ForwardType a3, + typename CallbackParamTraits::ForwardType a4) { + return function_(a1, a2, a3, a4); + } + + private: + R (__fastcall *function_)(A1, A2, A3, A4); +}; + +// __stdcall Function: Arity 5. +template +class RunnableAdapter { + public: + typedef R (RunType)(A1, A2, A3, A4, A5); + + explicit RunnableAdapter(R(__stdcall *function)(A1, A2, A3, A4, A5)) + : function_(function) { + } + + R Run(typename CallbackParamTraits::ForwardType a1, + typename CallbackParamTraits::ForwardType a2, + typename CallbackParamTraits::ForwardType a3, + typename CallbackParamTraits::ForwardType a4, + typename CallbackParamTraits::ForwardType a5) { + return function_(a1, a2, a3, a4, a5); + } + + private: + R (__stdcall *function_)(A1, A2, A3, A4, A5); +}; + +// __fastcall Function: Arity 5. +template +class RunnableAdapter { + public: + typedef R (RunType)(A1, A2, A3, A4, A5); + + explicit RunnableAdapter(R(__fastcall *function)(A1, A2, A3, A4, A5)) + : function_(function) { + } + + R Run(typename CallbackParamTraits::ForwardType a1, + typename CallbackParamTraits::ForwardType a2, + typename CallbackParamTraits::ForwardType a3, + typename CallbackParamTraits::ForwardType a4, + typename CallbackParamTraits::ForwardType a5) { + return function_(a1, a2, a3, a4, a5); + } + + private: + R (__fastcall *function_)(A1, A2, A3, A4, A5); +}; + +// __stdcall Function: Arity 6. +template +class RunnableAdapter { + public: + typedef R (RunType)(A1, A2, A3, A4, A5, A6); + + explicit RunnableAdapter(R(__stdcall *function)(A1, A2, A3, A4, A5, A6)) + : function_(function) { + } + + R Run(typename CallbackParamTraits::ForwardType a1, + typename CallbackParamTraits::ForwardType a2, + typename CallbackParamTraits::ForwardType a3, + typename CallbackParamTraits::ForwardType a4, + typename CallbackParamTraits::ForwardType a5, + typename CallbackParamTraits::ForwardType a6) { + return function_(a1, a2, a3, a4, a5, a6); + } + + private: + R (__stdcall *function_)(A1, A2, A3, A4, A5, A6); +}; + +// __fastcall Function: Arity 6. +template +class RunnableAdapter { + public: + typedef R (RunType)(A1, A2, A3, A4, A5, A6); + + explicit RunnableAdapter(R(__fastcall *function)(A1, A2, A3, A4, A5, A6)) + : function_(function) { + } + + R Run(typename CallbackParamTraits::ForwardType a1, + typename CallbackParamTraits::ForwardType a2, + typename CallbackParamTraits::ForwardType a3, + typename CallbackParamTraits::ForwardType a4, + typename CallbackParamTraits::ForwardType a5, + typename CallbackParamTraits::ForwardType a6) { + return function_(a1, a2, a3, a4, a5, a6); + } + + private: + R (__fastcall *function_)(A1, A2, A3, A4, A5, A6); +}; + +// __stdcall Function: Arity 7. +template +class RunnableAdapter { + public: + typedef R (RunType)(A1, A2, A3, A4, A5, A6, A7); + + explicit RunnableAdapter(R(__stdcall *function)(A1, A2, A3, A4, A5, A6, A7)) + : function_(function) { + } + + R Run(typename CallbackParamTraits::ForwardType a1, + typename CallbackParamTraits::ForwardType a2, + typename CallbackParamTraits::ForwardType a3, + typename CallbackParamTraits::ForwardType a4, + typename CallbackParamTraits::ForwardType a5, + typename CallbackParamTraits::ForwardType a6, + typename CallbackParamTraits::ForwardType a7) { + return function_(a1, a2, a3, a4, a5, a6, a7); + } + + private: + R (__stdcall *function_)(A1, A2, A3, A4, A5, A6, A7); +}; + +// __fastcall Function: Arity 7. +template +class RunnableAdapter { + public: + typedef R (RunType)(A1, A2, A3, A4, A5, A6, A7); + + explicit RunnableAdapter(R(__fastcall *function)(A1, A2, A3, A4, A5, A6, A7)) + : function_(function) { + } + + R Run(typename CallbackParamTraits::ForwardType a1, + typename CallbackParamTraits::ForwardType a2, + typename CallbackParamTraits::ForwardType a3, + typename CallbackParamTraits::ForwardType a4, + typename CallbackParamTraits::ForwardType a5, + typename CallbackParamTraits::ForwardType a6, + typename CallbackParamTraits::ForwardType a7) { + return function_(a1, a2, a3, a4, a5, a6, a7); + } + + private: + R (__fastcall *function_)(A1, A2, A3, A4, A5, A6, A7); +}; + +} // namespace cef_internal +} // namespace base + +#endif // !defined(ARCH_CPU_X86_64) + +#endif // CEF_INCLUDE_BASE_INTERNAL_CEF_BIND_INTERNAL_WIN_H_ diff --git a/dependencies64/cef/include/base/internal/cef_callback_internal.h b/dependencies64/cef/include/base/internal/cef_callback_internal.h new file mode 100644 index 000000000..8ed3af4ea --- /dev/null +++ b/dependencies64/cef/include/base/internal/cef_callback_internal.h @@ -0,0 +1,205 @@ +// Copyright (c) 2012 Google Inc. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +// Do not include this header file directly. Use base/cef_bind.h or +// base/cef_callback.h instead. + +// This file contains utility functions and classes that help the +// implementation, and management of the Callback objects. + +#ifndef CEF_INCLUDE_BASE_INTERNAL_CEF_CALLBACK_INTERNAL_H_ +#define CEF_INCLUDE_BASE_INTERNAL_CEF_CALLBACK_INTERNAL_H_ + +#include + +#include "include/base/cef_ref_counted.h" +#include "include/base/cef_scoped_ptr.h" + +template +class ScopedVector; + +namespace base { +namespace cef_internal { + +// BindStateBase is used to provide an opaque handle that the Callback +// class can use to represent a function object with bound arguments. It +// behaves as an existential type that is used by a corresponding +// DoInvoke function to perform the function execution. This allows +// us to shield the Callback class from the types of the bound argument via +// "type erasure." +class BindStateBase : public RefCountedThreadSafe { + protected: + friend class RefCountedThreadSafe; + virtual ~BindStateBase() {} +}; + +// Holds the Callback methods that don't require specialization to reduce +// template bloat. +class CallbackBase { + public: + // Returns true if Callback is null (doesn't refer to anything). + bool is_null() const { return bind_state_.get() == NULL; } + + // Returns the Callback into an uninitialized state. + void Reset(); + + protected: + // In C++, it is safe to cast function pointers to function pointers of + // another type. It is not okay to use void*. We create a InvokeFuncStorage + // that that can store our function pointer, and then cast it back to + // the original type on usage. + typedef void(*InvokeFuncStorage)(void); + + // Returns true if this callback equals |other|. |other| may be null. + bool Equals(const CallbackBase& other) const; + + // Allow initializing of |bind_state_| via the constructor to avoid default + // initialization of the scoped_refptr. We do not also initialize + // |polymorphic_invoke_| here because doing a normal assignment in the + // derived Callback templates makes for much nicer compiler errors. + explicit CallbackBase(BindStateBase* bind_state); + + // Force the destructor to be instantiated inside this translation unit so + // that our subclasses will not get inlined versions. Avoids more template + // bloat. + ~CallbackBase(); + + scoped_refptr bind_state_; + InvokeFuncStorage polymorphic_invoke_; +}; + +// A helper template to determine if given type is non-const move-only-type, +// i.e. if a value of the given type should be passed via .Pass() in a +// destructive way. +template struct IsMoveOnlyType { + template + static YesType Test(const typename U::MoveOnlyTypeForCPP03*); + + template + static NoType Test(...); + + static const bool value = sizeof(Test(0)) == sizeof(YesType) && + !is_const::value; +}; + +// This is a typetraits object that's used to take an argument type, and +// extract a suitable type for storing and forwarding arguments. +// +// In particular, it strips off references, and converts arrays to +// pointers for storage; and it avoids accidentally trying to create a +// "reference of a reference" if the argument is a reference type. +// +// This array type becomes an issue for storage because we are passing bound +// parameters by const reference. In this case, we end up passing an actual +// array type in the initializer list which C++ does not allow. This will +// break passing of C-string literals. +template ::value> +struct CallbackParamTraits { + typedef const T& ForwardType; + typedef T StorageType; +}; + +// The Storage should almost be impossible to trigger unless someone manually +// specifies type of the bind parameters. However, in case they do, +// this will guard against us accidentally storing a reference parameter. +// +// The ForwardType should only be used for unbound arguments. +template +struct CallbackParamTraits { + typedef T& ForwardType; + typedef T StorageType; +}; + +// Note that for array types, we implicitly add a const in the conversion. This +// means that it is not possible to bind array arguments to functions that take +// a non-const pointer. Trying to specialize the template based on a "const +// T[n]" does not seem to match correctly, so we are stuck with this +// restriction. +template +struct CallbackParamTraits { + typedef const T* ForwardType; + typedef const T* StorageType; +}; + +// See comment for CallbackParamTraits. +template +struct CallbackParamTraits { + typedef const T* ForwardType; + typedef const T* StorageType; +}; + +// Parameter traits for movable-but-not-copyable scopers. +// +// Callback<>/Bind() understands movable-but-not-copyable semantics where +// the type cannot be copied but can still have its state destructively +// transferred (aka. moved) to another instance of the same type by calling a +// helper function. When used with Bind(), this signifies transferal of the +// object's state to the target function. +// +// For these types, the ForwardType must not be a const reference, or a +// reference. A const reference is inappropriate, and would break const +// correctness, because we are implementing a destructive move. A non-const +// reference cannot be used with temporaries which means the result of a +// function or a cast would not be usable with Callback<> or Bind(). +template +struct CallbackParamTraits { + typedef T ForwardType; + typedef T StorageType; +}; + +// CallbackForward() is a very limited simulation of C++11's std::forward() +// used by the Callback/Bind system for a set of movable-but-not-copyable +// types. It is needed because forwarding a movable-but-not-copyable +// argument to another function requires us to invoke the proper move +// operator to create a rvalue version of the type. The supported types are +// whitelisted below as overloads of the CallbackForward() function. The +// default template compiles out to be a no-op. +// +// In C++11, std::forward would replace all uses of this function. However, it +// is impossible to implement a general std::forward with C++11 due to a lack +// of rvalue references. +// +// In addition to Callback/Bind, this is used by PostTaskAndReplyWithResult to +// simulate std::forward() and forward the result of one Callback as a +// parameter to another callback. This is to support Callbacks that return +// the movable-but-not-copyable types whitelisted above. +template +typename enable_if::value, T>::type& CallbackForward(T& t) { + return t; +} + +template +typename enable_if::value, T>::type CallbackForward(T& t) { + return t.Pass(); +} + +} // namespace cef_internal +} // namespace base + +#endif // CEF_INCLUDE_BASE_INTERNAL_CEF_CALLBACK_INTERNAL_H_ diff --git a/dependencies64/cef/include/base/internal/cef_lock_impl.h b/dependencies64/cef/include/base/internal/cef_lock_impl.h new file mode 100644 index 000000000..470547fe0 --- /dev/null +++ b/dependencies64/cef/include/base/internal/cef_lock_impl.h @@ -0,0 +1,87 @@ +// Copyright (c) 2011 Google Inc. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +// Do not include this header file directly. Use base/cef_lock.h instead. + +#ifndef CEF_INCLUDE_BASE_INTERNAL_CEF_LOCK_IMPL_H_ +#define CEF_INCLUDE_BASE_INTERNAL_CEF_LOCK_IMPL_H_ + +#include "include/base/cef_build.h" + +#if defined(OS_WIN) +#include +#elif defined(OS_POSIX) +#include +#endif + +#include "include/base/cef_macros.h" + +namespace base { +namespace cef_internal { + +// This class implements the underlying platform-specific spin-lock mechanism +// used for the Lock class. Most users should not use LockImpl directly, but +// should instead use Lock. +class LockImpl { + public: +#if defined(OS_WIN) + typedef CRITICAL_SECTION NativeHandle; +#elif defined(OS_POSIX) + typedef pthread_mutex_t NativeHandle; +#endif + + LockImpl(); + ~LockImpl(); + + // If the lock is not held, take it and return true. If the lock is already + // held by something else, immediately return false. + bool Try(); + + // Take the lock, blocking until it is available if necessary. + void Lock(); + + // Release the lock. This must only be called by the lock's holder: after + // a successful call to Try, or a call to Lock. + void Unlock(); + + // Return the native underlying lock. + // TODO(awalker): refactor lock and condition variables so that this is + // unnecessary. + NativeHandle* native_handle() { return &native_handle_; } + + private: + NativeHandle native_handle_; + + DISALLOW_COPY_AND_ASSIGN(LockImpl); +}; + +} // namespace cef_internal +} // namespace base + +#endif // CEF_INCLUDE_BASE_INTERNAL_CEF_LOCK_IMPL_H_ diff --git a/dependencies64/cef/include/base/internal/cef_raw_scoped_refptr_mismatch_checker.h b/dependencies64/cef/include/base/internal/cef_raw_scoped_refptr_mismatch_checker.h new file mode 100644 index 000000000..8584fcd70 --- /dev/null +++ b/dependencies64/cef/include/base/internal/cef_raw_scoped_refptr_mismatch_checker.h @@ -0,0 +1,154 @@ +// Copyright (c) 2011 Google Inc. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +// Do not include this header file directly. Use base/cef_callback.h instead. + +#ifndef CEF_INCLUDE_BASE_INTERNAL_CEF_RAW_SCOPED_REFPTR_MISMATCH_CHECKER_H_ +#define CEF_INCLUDE_BASE_INTERNAL_CEF_RAW_SCOPED_REFPTR_MISMATCH_CHECKER_H_ + +#include "include/base/cef_build.h" +#include "include/base/cef_ref_counted.h" +#include "include/base/cef_template_util.h" +#include "include/base/cef_tuple.h" + +// It is dangerous to post a task with a T* argument where T is a subtype of +// RefCounted(Base|ThreadSafeBase), since by the time the parameter is used, the +// object may already have been deleted since it was not held with a +// scoped_refptr. Example: http://crbug.com/27191 +// The following set of traits are designed to generate a compile error +// whenever this antipattern is attempted. + +namespace base { + +namespace cef_internal { + +template +struct NeedsScopedRefptrButGetsRawPtr { +#if defined(OS_WIN) + enum { + value = base::false_type::value + }; +#else + enum { + // Human readable translation: you needed to be a scoped_refptr if you are a + // raw pointer type and are convertible to a RefCounted(Base|ThreadSafeBase) + // type. + value = (is_pointer::value && + (is_convertible::value || + is_convertible::value)) + }; +#endif +}; + +template +struct ParamsUseScopedRefptrCorrectly { + enum { value = 0 }; +}; + +template <> +struct ParamsUseScopedRefptrCorrectly { + enum { value = 1 }; +}; + +template +struct ParamsUseScopedRefptrCorrectly > { + enum { value = !NeedsScopedRefptrButGetsRawPtr::value }; +}; + +template +struct ParamsUseScopedRefptrCorrectly > { + enum { value = !(NeedsScopedRefptrButGetsRawPtr::value || + NeedsScopedRefptrButGetsRawPtr::value) }; +}; + +template +struct ParamsUseScopedRefptrCorrectly > { + enum { value = !(NeedsScopedRefptrButGetsRawPtr::value || + NeedsScopedRefptrButGetsRawPtr::value || + NeedsScopedRefptrButGetsRawPtr::value) }; +}; + +template +struct ParamsUseScopedRefptrCorrectly > { + enum { value = !(NeedsScopedRefptrButGetsRawPtr::value || + NeedsScopedRefptrButGetsRawPtr::value || + NeedsScopedRefptrButGetsRawPtr::value || + NeedsScopedRefptrButGetsRawPtr::value) }; +}; + +template +struct ParamsUseScopedRefptrCorrectly > { + enum { value = !(NeedsScopedRefptrButGetsRawPtr::value || + NeedsScopedRefptrButGetsRawPtr::value || + NeedsScopedRefptrButGetsRawPtr::value || + NeedsScopedRefptrButGetsRawPtr::value || + NeedsScopedRefptrButGetsRawPtr::value) }; +}; + +template +struct ParamsUseScopedRefptrCorrectly > { + enum { value = !(NeedsScopedRefptrButGetsRawPtr::value || + NeedsScopedRefptrButGetsRawPtr::value || + NeedsScopedRefptrButGetsRawPtr::value || + NeedsScopedRefptrButGetsRawPtr::value || + NeedsScopedRefptrButGetsRawPtr::value || + NeedsScopedRefptrButGetsRawPtr::value) }; +}; + +template +struct ParamsUseScopedRefptrCorrectly > { + enum { value = !(NeedsScopedRefptrButGetsRawPtr::value || + NeedsScopedRefptrButGetsRawPtr::value || + NeedsScopedRefptrButGetsRawPtr::value || + NeedsScopedRefptrButGetsRawPtr::value || + NeedsScopedRefptrButGetsRawPtr::value || + NeedsScopedRefptrButGetsRawPtr::value || + NeedsScopedRefptrButGetsRawPtr::value) }; +}; + +template +struct ParamsUseScopedRefptrCorrectly > { + enum { value = !(NeedsScopedRefptrButGetsRawPtr::value || + NeedsScopedRefptrButGetsRawPtr::value || + NeedsScopedRefptrButGetsRawPtr::value || + NeedsScopedRefptrButGetsRawPtr::value || + NeedsScopedRefptrButGetsRawPtr::value || + NeedsScopedRefptrButGetsRawPtr::value || + NeedsScopedRefptrButGetsRawPtr::value || + NeedsScopedRefptrButGetsRawPtr::value) }; +}; + +} // namespace cef_internal + +} // namespace base + +#endif // CEF_INCLUDE_BASE_INTERNAL_CEF_RAW_SCOPED_REFPTR_MISMATCH_CHECKER_H_ diff --git a/dependencies64/cef/include/base/internal/cef_thread_checker_impl.h b/dependencies64/cef/include/base/internal/cef_thread_checker_impl.h new file mode 100644 index 000000000..e74bcf8ac --- /dev/null +++ b/dependencies64/cef/include/base/internal/cef_thread_checker_impl.h @@ -0,0 +1,70 @@ +// Copyright (c) 2011 Google Inc. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +// Do not include this header file directly. Use base/cef_thread_checker.h +// instead. + +#ifndef CEF_INCLUDE_BASE_INTERNAL_THREAD_CHECKER_IMPL_H_ +#define CEF_INCLUDE_BASE_INTERNAL_THREAD_CHECKER_IMPL_H_ + +#include "include/base/cef_lock.h" +#include "include/base/cef_platform_thread.h" + +namespace base { + +// Real implementation of ThreadChecker, for use in debug mode, or +// for temporary use in release mode (e.g. to CHECK on a threading issue +// seen only in the wild). +// +// Note: You should almost always use the ThreadChecker class to get the +// right version for your build configuration. +class ThreadCheckerImpl { + public: + ThreadCheckerImpl(); + ~ThreadCheckerImpl(); + + bool CalledOnValidThread() const; + + // Changes the thread that is checked for in CalledOnValidThread. This may + // be useful when an object may be created on one thread and then used + // exclusively on another thread. + void DetachFromThread(); + + private: + void EnsureThreadIdAssigned() const; + + mutable base::Lock lock_; + // This is mutable so that CalledOnValidThread can set it. + // It's guarded by |lock_|. + mutable PlatformThreadRef valid_thread_id_; +}; + +} // namespace base + +#endif // CEF_INCLUDE_BASE_INTERNAL_THREAD_CHECKER_IMPL_H_ diff --git a/dependencies64/cef/include/capi/cef_app_capi.h b/dependencies64/cef/include/capi/cef_app_capi.h new file mode 100644 index 000000000..7d1a070da --- /dev/null +++ b/dependencies64/cef/include/capi/cef_app_capi.h @@ -0,0 +1,182 @@ +// Copyright (c) 2015 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool and should not edited +// by hand. See the translator.README.txt file in the tools directory for +// more information. +// + +#ifndef CEF_INCLUDE_CAPI_CEF_APP_CAPI_H_ +#define CEF_INCLUDE_CAPI_CEF_APP_CAPI_H_ +#pragma once + +#include "include/capi/cef_base_capi.h" +#include "include/capi/cef_browser_process_handler_capi.h" +#include "include/capi/cef_command_line_capi.h" +#include "include/capi/cef_render_process_handler_capi.h" +#include "include/capi/cef_resource_bundle_handler_capi.h" +#include "include/capi/cef_scheme_capi.h" + +#ifdef __cplusplus +extern "C" { +#endif + +struct _cef_app_t; + +/// +// Implement this structure to provide handler implementations. Methods will be +// called by the process and/or thread indicated. +/// +typedef struct _cef_app_t { + /// + // Base structure. + /// + cef_base_t base; + + /// + // Provides an opportunity to view and/or modify command-line arguments before + // processing by CEF and Chromium. The |process_type| value will be NULL for + // the browser process. Do not keep a reference to the cef_command_line_t + // object passed to this function. The CefSettings.command_line_args_disabled + // value can be used to start with an NULL command-line object. Any values + // specified in CefSettings that equate to command-line arguments will be set + // before this function is called. Be cautious when using this function to + // modify command-line arguments for non-browser processes as this may result + // in undefined behavior including crashes. + /// + void (CEF_CALLBACK *on_before_command_line_processing)( + struct _cef_app_t* self, const cef_string_t* process_type, + struct _cef_command_line_t* command_line); + + /// + // Provides an opportunity to register custom schemes. Do not keep a reference + // to the |registrar| object. This function is called on the main thread for + // each process and the registered schemes should be the same across all + // processes. + /// + void (CEF_CALLBACK *on_register_custom_schemes)(struct _cef_app_t* self, + struct _cef_scheme_registrar_t* registrar); + + /// + // Return the handler for resource bundle events. If + // CefSettings.pack_loading_disabled is true (1) a handler must be returned. + // If no handler is returned resources will be loaded from pack files. This + // function is called by the browser and render processes on multiple threads. + /// + struct _cef_resource_bundle_handler_t* ( + CEF_CALLBACK *get_resource_bundle_handler)(struct _cef_app_t* self); + + /// + // Return the handler for functionality specific to the browser process. This + // function is called on multiple threads in the browser process. + /// + struct _cef_browser_process_handler_t* ( + CEF_CALLBACK *get_browser_process_handler)(struct _cef_app_t* self); + + /// + // Return the handler for functionality specific to the render process. This + // function is called on the render process main thread. + /// + struct _cef_render_process_handler_t* ( + CEF_CALLBACK *get_render_process_handler)(struct _cef_app_t* self); +} cef_app_t; + + +/// +// This function should be called from the application entry point function to +// execute a secondary process. It can be used to run secondary processes from +// the browser client executable (default behavior) or from a separate +// executable specified by the CefSettings.browser_subprocess_path value. If +// called for the browser process (identified by no "type" command-line value) +// it will return immediately with a value of -1. If called for a recognized +// secondary process it will block until the process should exit and then return +// the process exit code. The |application| parameter may be NULL. The +// |windows_sandbox_info| parameter is only used on Windows and may be NULL (see +// cef_sandbox_win.h for details). +/// +CEF_EXPORT int cef_execute_process(const struct _cef_main_args_t* args, + cef_app_t* application, void* windows_sandbox_info); + +/// +// This function should be called on the main application thread to initialize +// the CEF browser process. The |application| parameter may be NULL. A return +// value of true (1) indicates that it succeeded and false (0) indicates that it +// failed. The |windows_sandbox_info| parameter is only used on Windows and may +// be NULL (see cef_sandbox_win.h for details). +/// +CEF_EXPORT int cef_initialize(const struct _cef_main_args_t* args, + const struct _cef_settings_t* settings, cef_app_t* application, + void* windows_sandbox_info); + +/// +// This function should be called on the main application thread to shut down +// the CEF browser process before the application exits. +/// +CEF_EXPORT void cef_shutdown(); + +/// +// Perform a single iteration of CEF message loop processing. This function is +// used to integrate the CEF message loop into an existing application message +// loop. Care must be taken to balance performance against excessive CPU usage. +// This function should only be called on the main application thread and only +// if cef_initialize() is called with a CefSettings.multi_threaded_message_loop +// value of false (0). This function will not block. +/// +CEF_EXPORT void cef_do_message_loop_work(); + +/// +// Run the CEF message loop. Use this function instead of an application- +// provided message loop to get the best balance between performance and CPU +// usage. This function should only be called on the main application thread and +// only if cef_initialize() is called with a +// CefSettings.multi_threaded_message_loop value of false (0). This function +// will block until a quit message is received by the system. +/// +CEF_EXPORT void cef_run_message_loop(); + +/// +// Quit the CEF message loop that was started by calling cef_run_message_loop(). +// This function should only be called on the main application thread and only +// if cef_run_message_loop() was used. +/// +CEF_EXPORT void cef_quit_message_loop(); + +/// +// Set to true (1) before calling Windows APIs like TrackPopupMenu that enter a +// modal message loop. Set to false (0) after exiting the modal message loop. +/// +CEF_EXPORT void cef_set_osmodal_loop(int osModalLoop); + +#ifdef __cplusplus +} +#endif + +#endif // CEF_INCLUDE_CAPI_CEF_APP_CAPI_H_ diff --git a/dependencies64/cef/include/capi/cef_auth_callback_capi.h b/dependencies64/cef/include/capi/cef_auth_callback_capi.h new file mode 100644 index 000000000..01f4c0810 --- /dev/null +++ b/dependencies64/cef/include/capi/cef_auth_callback_capi.h @@ -0,0 +1,75 @@ +// Copyright (c) 2015 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool and should not edited +// by hand. See the translator.README.txt file in the tools directory for +// more information. +// + +#ifndef CEF_INCLUDE_CAPI_CEF_AUTH_CALLBACK_CAPI_H_ +#define CEF_INCLUDE_CAPI_CEF_AUTH_CALLBACK_CAPI_H_ +#pragma once + +#include "include/capi/cef_base_capi.h" + +#ifdef __cplusplus +extern "C" { +#endif + + +/// +// Callback structure used for asynchronous continuation of authentication +// requests. +/// +typedef struct _cef_auth_callback_t { + /// + // Base structure. + /// + cef_base_t base; + + /// + // Continue the authentication request. + /// + void (CEF_CALLBACK *cont)(struct _cef_auth_callback_t* self, + const cef_string_t* username, const cef_string_t* password); + + /// + // Cancel the authentication request. + /// + void (CEF_CALLBACK *cancel)(struct _cef_auth_callback_t* self); +} cef_auth_callback_t; + + +#ifdef __cplusplus +} +#endif + +#endif // CEF_INCLUDE_CAPI_CEF_AUTH_CALLBACK_CAPI_H_ diff --git a/dependencies64/cef/include/capi/cef_base_capi.h b/dependencies64/cef/include/capi/cef_base_capi.h new file mode 100644 index 000000000..edeef3c0e --- /dev/null +++ b/dependencies64/cef/include/capi/cef_base_capi.h @@ -0,0 +1,89 @@ +// Copyright (c) 2014 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +#ifndef CEF_INCLUDE_CAPI_CEF_BASE_CAPI_H_ +#define CEF_INCLUDE_CAPI_CEF_BASE_CAPI_H_ + +#include + +#include "include/internal/cef_export.h" +#include "include/internal/cef_string.h" +#include "include/internal/cef_string_list.h" +#include "include/internal/cef_string_map.h" +#include "include/internal/cef_string_multimap.h" +#include "include/internal/cef_types.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/// +// Structure defining the reference count implementation functions. All +// framework structures must include the cef_base_t structure first. +/// +typedef struct _cef_base_t { + /// + // Size of the data structure. + /// + size_t size; + + /// + // Called to increment the reference count for the object. Should be called + // for every new copy of a pointer to a given object. + /// + void (CEF_CALLBACK *add_ref)(struct _cef_base_t* self); + + /// + // Called to decrement the reference count for the object. If the reference + // count falls to 0 the object should self-delete. Returns true (1) if the + // resulting reference count is 0. + /// + int (CEF_CALLBACK *release)(struct _cef_base_t* self); + + /// + // Returns true (1) if the current reference count is 1. + /// + int (CEF_CALLBACK *has_one_ref)(struct _cef_base_t* self); +} cef_base_t; + + +// Check that the structure |s|, which is defined with a cef_base_t member named +// |base|, is large enough to contain the specified member |f|. +#define CEF_MEMBER_EXISTS(s, f) \ + ((intptr_t)&((s)->f) - (intptr_t)(s) + sizeof((s)->f) <= (s)->base.size) + +#define CEF_MEMBER_MISSING(s, f) (!CEF_MEMBER_EXISTS(s, f) || !((s)->f)) + + +#ifdef __cplusplus +} +#endif + +#endif // CEF_INCLUDE_CAPI_CEF_BASE_CAPI_H_ diff --git a/dependencies64/cef/include/capi/cef_browser_capi.h b/dependencies64/cef/include/capi/cef_browser_capi.h new file mode 100644 index 000000000..ae8410019 --- /dev/null +++ b/dependencies64/cef/include/capi/cef_browser_capi.h @@ -0,0 +1,621 @@ +// Copyright (c) 2015 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool and should not edited +// by hand. See the translator.README.txt file in the tools directory for +// more information. +// + +#ifndef CEF_INCLUDE_CAPI_CEF_BROWSER_CAPI_H_ +#define CEF_INCLUDE_CAPI_CEF_BROWSER_CAPI_H_ +#pragma once + +#include "include/capi/cef_base_capi.h" +#include "include/capi/cef_drag_data_capi.h" +#include "include/capi/cef_frame_capi.h" +#include "include/capi/cef_navigation_entry_capi.h" +#include "include/capi/cef_process_message_capi.h" +#include "include/capi/cef_request_context_capi.h" + +#ifdef __cplusplus +extern "C" { +#endif + +struct _cef_browser_host_t; +struct _cef_client_t; + +/// +// Structure used to represent a browser window. When used in the browser +// process the functions of this structure may be called on any thread unless +// otherwise indicated in the comments. When used in the render process the +// functions of this structure may only be called on the main thread. +/// +typedef struct _cef_browser_t { + /// + // Base structure. + /// + cef_base_t base; + + /// + // Returns the browser host object. This function can only be called in the + // browser process. + /// + struct _cef_browser_host_t* (CEF_CALLBACK *get_host)( + struct _cef_browser_t* self); + + /// + // Returns true (1) if the browser can navigate backwards. + /// + int (CEF_CALLBACK *can_go_back)(struct _cef_browser_t* self); + + /// + // Navigate backwards. + /// + void (CEF_CALLBACK *go_back)(struct _cef_browser_t* self); + + /// + // Returns true (1) if the browser can navigate forwards. + /// + int (CEF_CALLBACK *can_go_forward)(struct _cef_browser_t* self); + + /// + // Navigate forwards. + /// + void (CEF_CALLBACK *go_forward)(struct _cef_browser_t* self); + + /// + // Returns true (1) if the browser is currently loading. + /// + int (CEF_CALLBACK *is_loading)(struct _cef_browser_t* self); + + /// + // Reload the current page. + /// + void (CEF_CALLBACK *reload)(struct _cef_browser_t* self); + + /// + // Reload the current page ignoring any cached data. + /// + void (CEF_CALLBACK *reload_ignore_cache)(struct _cef_browser_t* self); + + /// + // Stop loading the page. + /// + void (CEF_CALLBACK *stop_load)(struct _cef_browser_t* self); + + /// + // Returns the globally unique identifier for this browser. + /// + int (CEF_CALLBACK *get_identifier)(struct _cef_browser_t* self); + + /// + // Returns true (1) if this object is pointing to the same handle as |that| + // object. + /// + int (CEF_CALLBACK *is_same)(struct _cef_browser_t* self, + struct _cef_browser_t* that); + + /// + // Returns true (1) if the window is a popup window. + /// + int (CEF_CALLBACK *is_popup)(struct _cef_browser_t* self); + + /// + // Returns true (1) if a document has been loaded in the browser. + /// + int (CEF_CALLBACK *has_document)(struct _cef_browser_t* self); + + /// + // Returns the main (top-level) frame for the browser window. + /// + struct _cef_frame_t* (CEF_CALLBACK *get_main_frame)( + struct _cef_browser_t* self); + + /// + // Returns the focused frame for the browser window. + /// + struct _cef_frame_t* (CEF_CALLBACK *get_focused_frame)( + struct _cef_browser_t* self); + + /// + // Returns the frame with the specified identifier, or NULL if not found. + /// + struct _cef_frame_t* (CEF_CALLBACK *get_frame_byident)( + struct _cef_browser_t* self, int64 identifier); + + /// + // Returns the frame with the specified name, or NULL if not found. + /// + struct _cef_frame_t* (CEF_CALLBACK *get_frame)(struct _cef_browser_t* self, + const cef_string_t* name); + + /// + // Returns the number of frames that currently exist. + /// + size_t (CEF_CALLBACK *get_frame_count)(struct _cef_browser_t* self); + + /// + // Returns the identifiers of all existing frames. + /// + void (CEF_CALLBACK *get_frame_identifiers)(struct _cef_browser_t* self, + size_t* identifiersCount, int64* identifiers); + + /// + // Returns the names of all existing frames. + /// + void (CEF_CALLBACK *get_frame_names)(struct _cef_browser_t* self, + cef_string_list_t names); + + // + // Send a message to the specified |target_process|. Returns true (1) if the + // message was sent successfully. + /// + int (CEF_CALLBACK *send_process_message)(struct _cef_browser_t* self, + cef_process_id_t target_process, + struct _cef_process_message_t* message); +} cef_browser_t; + + +/// +// Callback structure for cef_browser_host_t::RunFileDialog. The functions of +// this structure will be called on the browser process UI thread. +/// +typedef struct _cef_run_file_dialog_callback_t { + /// + // Base structure. + /// + cef_base_t base; + + /// + // Called asynchronously after the file dialog is dismissed. + // |selected_accept_filter| is the 0-based index of the value selected from + // the accept filters array passed to cef_browser_host_t::RunFileDialog. + // |file_paths| will be a single value or a list of values depending on the + // dialog mode. If the selection was cancelled |file_paths| will be NULL. + /// + void (CEF_CALLBACK *on_file_dialog_dismissed)( + struct _cef_run_file_dialog_callback_t* self, int selected_accept_filter, + cef_string_list_t file_paths); +} cef_run_file_dialog_callback_t; + + +/// +// Callback structure for cef_browser_host_t::GetNavigationEntries. The +// functions of this structure will be called on the browser process UI thread. +/// +typedef struct _cef_navigation_entry_visitor_t { + /// + // Base structure. + /// + cef_base_t base; + + /// + // Method that will be executed. Do not keep a reference to |entry| outside of + // this callback. Return true (1) to continue visiting entries or false (0) to + // stop. |current| is true (1) if this entry is the currently loaded + // navigation entry. |index| is the 0-based index of this entry and |total| is + // the total number of entries. + /// + int (CEF_CALLBACK *visit)(struct _cef_navigation_entry_visitor_t* self, + struct _cef_navigation_entry_t* entry, int current, int index, + int total); +} cef_navigation_entry_visitor_t; + + +/// +// Structure used to represent the browser process aspects of a browser window. +// The functions of this structure can only be called in the browser process. +// They may be called on any thread in that process unless otherwise indicated +// in the comments. +/// +typedef struct _cef_browser_host_t { + /// + // Base structure. + /// + cef_base_t base; + + /// + // Returns the hosted browser object. + /// + struct _cef_browser_t* (CEF_CALLBACK *get_browser)( + struct _cef_browser_host_t* self); + + /// + // Request that the browser close. The JavaScript 'onbeforeunload' event will + // be fired. If |force_close| is false (0) the event handler, if any, will be + // allowed to prompt the user and the user can optionally cancel the close. If + // |force_close| is true (1) the prompt will not be displayed and the close + // will proceed. Results in a call to cef_life_span_handler_t::do_close() if + // the event handler allows the close or if |force_close| is true (1). See + // cef_life_span_handler_t::do_close() documentation for additional usage + // information. + /// + void (CEF_CALLBACK *close_browser)(struct _cef_browser_host_t* self, + int force_close); + + /// + // Set whether the browser is focused. + /// + void (CEF_CALLBACK *set_focus)(struct _cef_browser_host_t* self, int focus); + + /// + // Set whether the window containing the browser is visible + // (minimized/unminimized, app hidden/unhidden, etc). Only used on Mac OS X. + /// + void (CEF_CALLBACK *set_window_visibility)(struct _cef_browser_host_t* self, + int visible); + + /// + // Retrieve the window handle for this browser. + /// + cef_window_handle_t (CEF_CALLBACK *get_window_handle)( + struct _cef_browser_host_t* self); + + /// + // Retrieve the window handle of the browser that opened this browser. Will + // return NULL for non-popup windows. This function can be used in combination + // with custom handling of modal windows. + /// + cef_window_handle_t (CEF_CALLBACK *get_opener_window_handle)( + struct _cef_browser_host_t* self); + + /// + // Returns the client for this browser. + /// + struct _cef_client_t* (CEF_CALLBACK *get_client)( + struct _cef_browser_host_t* self); + + /// + // Returns the request context for this browser. + /// + struct _cef_request_context_t* (CEF_CALLBACK *get_request_context)( + struct _cef_browser_host_t* self); + + /// + // Get the current zoom level. The default zoom level is 0.0. This function + // can only be called on the UI thread. + /// + double (CEF_CALLBACK *get_zoom_level)(struct _cef_browser_host_t* self); + + /// + // Change the zoom level to the specified value. Specify 0.0 to reset the zoom + // level. If called on the UI thread the change will be applied immediately. + // Otherwise, the change will be applied asynchronously on the UI thread. + /// + void (CEF_CALLBACK *set_zoom_level)(struct _cef_browser_host_t* self, + double zoomLevel); + + /// + // Call to run a file chooser dialog. Only a single file chooser dialog may be + // pending at any given time. |mode| represents the type of dialog to display. + // |title| to the title to be used for the dialog and may be NULL to show the + // default title ("Open" or "Save" depending on the mode). |default_file_path| + // is the path with optional directory and/or file name component that will be + // initially selected in the dialog. |accept_filters| are used to restrict the + // selectable file types and may any combination of (a) valid lower-cased MIME + // types (e.g. "text/*" or "image/*"), (b) individual file extensions (e.g. + // ".txt" or ".png"), or (c) combined description and file extension delimited + // using "|" and ";" (e.g. "Image Types|.png;.gif;.jpg"). + // |selected_accept_filter| is the 0-based index of the filter that will be + // selected by default. |callback| will be executed after the dialog is + // dismissed or immediately if another dialog is already pending. The dialog + // will be initiated asynchronously on the UI thread. + /// + void (CEF_CALLBACK *run_file_dialog)(struct _cef_browser_host_t* self, + cef_file_dialog_mode_t mode, const cef_string_t* title, + const cef_string_t* default_file_path, cef_string_list_t accept_filters, + int selected_accept_filter, + struct _cef_run_file_dialog_callback_t* callback); + + /// + // Download the file at |url| using cef_download_handler_t. + /// + void (CEF_CALLBACK *start_download)(struct _cef_browser_host_t* self, + const cef_string_t* url); + + /// + // Print the current browser contents. + /// + void (CEF_CALLBACK *print)(struct _cef_browser_host_t* self); + + /// + // Search for |searchText|. |identifier| can be used to have multiple searches + // running simultaniously. |forward| indicates whether to search forward or + // backward within the page. |matchCase| indicates whether the search should + // be case-sensitive. |findNext| indicates whether this is the first request + // or a follow-up. The cef_find_handler_t instance, if any, returned via + // cef_client_t::GetFindHandler will be called to report find results. + /// + void (CEF_CALLBACK *find)(struct _cef_browser_host_t* self, int identifier, + const cef_string_t* searchText, int forward, int matchCase, + int findNext); + + /// + // Cancel all searches that are currently going on. + /// + void (CEF_CALLBACK *stop_finding)(struct _cef_browser_host_t* self, + int clearSelection); + + /// + // Open developer tools in its own window. If |inspect_element_at| is non- + // NULL the element at the specified (x,y) location will be inspected. + /// + void (CEF_CALLBACK *show_dev_tools)(struct _cef_browser_host_t* self, + const struct _cef_window_info_t* windowInfo, + struct _cef_client_t* client, + const struct _cef_browser_settings_t* settings, + const cef_point_t* inspect_element_at); + + /// + // Explicitly close the developer tools window if one exists for this browser + // instance. + /// + void (CEF_CALLBACK *close_dev_tools)(struct _cef_browser_host_t* self); + + /// + // Retrieve a snapshot of current navigation entries as values sent to the + // specified visitor. If |current_only| is true (1) only the current + // navigation entry will be sent, otherwise all navigation entries will be + // sent. + /// + /// + void (CEF_CALLBACK *get_navigation_entries)(struct _cef_browser_host_t* self, + struct _cef_navigation_entry_visitor_t* visitor, int current_only); + + /// + // Set whether mouse cursor change is disabled. + /// + void (CEF_CALLBACK *set_mouse_cursor_change_disabled)( + struct _cef_browser_host_t* self, int disabled); + + /// + // Returns true (1) if mouse cursor change is disabled. + /// + int (CEF_CALLBACK *is_mouse_cursor_change_disabled)( + struct _cef_browser_host_t* self); + + /// + // If a misspelled word is currently selected in an editable node calling this + // function will replace it with the specified |word|. + /// + void (CEF_CALLBACK *replace_misspelling)(struct _cef_browser_host_t* self, + const cef_string_t* word); + + /// + // Add the specified |word| to the spelling dictionary. + /// + void (CEF_CALLBACK *add_word_to_dictionary)(struct _cef_browser_host_t* self, + const cef_string_t* word); + + /// + // Returns true (1) if window rendering is disabled. + /// + int (CEF_CALLBACK *is_window_rendering_disabled)( + struct _cef_browser_host_t* self); + + /// + // Notify the browser that the widget has been resized. The browser will first + // call cef_render_handler_t::GetViewRect to get the new size and then call + // cef_render_handler_t::OnPaint asynchronously with the updated regions. This + // function is only used when window rendering is disabled. + /// + void (CEF_CALLBACK *was_resized)(struct _cef_browser_host_t* self); + + /// + // Notify the browser that it has been hidden or shown. Layouting and + // cef_render_handler_t::OnPaint notification will stop when the browser is + // hidden. This function is only used when window rendering is disabled. + /// + void (CEF_CALLBACK *was_hidden)(struct _cef_browser_host_t* self, int hidden); + + /// + // Send a notification to the browser that the screen info has changed. The + // browser will then call cef_render_handler_t::GetScreenInfo to update the + // screen information with the new values. This simulates moving the webview + // window from one display to another, or changing the properties of the + // current display. This function is only used when window rendering is + // disabled. + /// + void (CEF_CALLBACK *notify_screen_info_changed)( + struct _cef_browser_host_t* self); + + /// + // Invalidate the view. The browser will call cef_render_handler_t::OnPaint + // asynchronously. This function is only used when window rendering is + // disabled. + /// + void (CEF_CALLBACK *invalidate)(struct _cef_browser_host_t* self, + cef_paint_element_type_t type); + + /// + // Send a key event to the browser. + /// + void (CEF_CALLBACK *send_key_event)(struct _cef_browser_host_t* self, + const struct _cef_key_event_t* event); + + /// + // Send a mouse click event to the browser. The |x| and |y| coordinates are + // relative to the upper-left corner of the view. + /// + void (CEF_CALLBACK *send_mouse_click_event)(struct _cef_browser_host_t* self, + const struct _cef_mouse_event_t* event, cef_mouse_button_type_t type, + int mouseUp, int clickCount); + + /// + // Send a mouse move event to the browser. The |x| and |y| coordinates are + // relative to the upper-left corner of the view. + /// + void (CEF_CALLBACK *send_mouse_move_event)(struct _cef_browser_host_t* self, + const struct _cef_mouse_event_t* event, int mouseLeave); + + /// + // Send a mouse wheel event to the browser. The |x| and |y| coordinates are + // relative to the upper-left corner of the view. The |deltaX| and |deltaY| + // values represent the movement delta in the X and Y directions respectively. + // In order to scroll inside select popups with window rendering disabled + // cef_render_handler_t::GetScreenPoint should be implemented properly. + /// + void (CEF_CALLBACK *send_mouse_wheel_event)(struct _cef_browser_host_t* self, + const struct _cef_mouse_event_t* event, int deltaX, int deltaY); + + /// + // Send a focus event to the browser. + /// + void (CEF_CALLBACK *send_focus_event)(struct _cef_browser_host_t* self, + int setFocus); + + /// + // Send a capture lost event to the browser. + /// + void (CEF_CALLBACK *send_capture_lost_event)( + struct _cef_browser_host_t* self); + + /// + // Notify the browser that the window hosting it is about to be moved or + // resized. This function is only used on Windows and Linux. + /// + void (CEF_CALLBACK *notify_move_or_resize_started)( + struct _cef_browser_host_t* self); + + /// + // Get the NSTextInputContext implementation for enabling IME on Mac when + // window rendering is disabled. + /// + cef_text_input_context_t (CEF_CALLBACK *get_nstext_input_context)( + struct _cef_browser_host_t* self); + + /// + // Handles a keyDown event prior to passing it through the NSTextInputClient + // machinery. + /// + void (CEF_CALLBACK *handle_key_event_before_text_input_client)( + struct _cef_browser_host_t* self, cef_event_handle_t keyEvent); + + /// + // Performs any additional actions after NSTextInputClient handles the event. + /// + void (CEF_CALLBACK *handle_key_event_after_text_input_client)( + struct _cef_browser_host_t* self, cef_event_handle_t keyEvent); + + /// + // Call this function when the user drags the mouse into the web view (before + // calling DragTargetDragOver/DragTargetLeave/DragTargetDrop). |drag_data| + // should not contain file contents as this type of data is not allowed to be + // dragged into the web view. File contents can be removed using + // cef_drag_data_t::ResetFileContents (for example, if |drag_data| comes from + // cef_render_handler_t::StartDragging). This function is only used when + // window rendering is disabled. + /// + void (CEF_CALLBACK *drag_target_drag_enter)(struct _cef_browser_host_t* self, + struct _cef_drag_data_t* drag_data, + const struct _cef_mouse_event_t* event, + cef_drag_operations_mask_t allowed_ops); + + /// + // Call this function each time the mouse is moved across the web view during + // a drag operation (after calling DragTargetDragEnter and before calling + // DragTargetDragLeave/DragTargetDrop). This function is only used when window + // rendering is disabled. + /// + void (CEF_CALLBACK *drag_target_drag_over)(struct _cef_browser_host_t* self, + const struct _cef_mouse_event_t* event, + cef_drag_operations_mask_t allowed_ops); + + /// + // Call this function when the user drags the mouse out of the web view (after + // calling DragTargetDragEnter). This function is only used when window + // rendering is disabled. + /// + void (CEF_CALLBACK *drag_target_drag_leave)(struct _cef_browser_host_t* self); + + /// + // Call this function when the user completes the drag operation by dropping + // the object onto the web view (after calling DragTargetDragEnter). The + // object being dropped is |drag_data|, given as an argument to the previous + // DragTargetDragEnter call. This function is only used when window rendering + // is disabled. + /// + void (CEF_CALLBACK *drag_target_drop)(struct _cef_browser_host_t* self, + const struct _cef_mouse_event_t* event); + + /// + // Call this function when the drag operation started by a + // cef_render_handler_t::StartDragging call has ended either in a drop or by + // being cancelled. |x| and |y| are mouse coordinates relative to the upper- + // left corner of the view. If the web view is both the drag source and the + // drag target then all DragTarget* functions should be called before + // DragSource* mthods. This function is only used when window rendering is + // disabled. + /// + void (CEF_CALLBACK *drag_source_ended_at)(struct _cef_browser_host_t* self, + int x, int y, cef_drag_operations_mask_t op); + + /// + // Call this function when the drag operation started by a + // cef_render_handler_t::StartDragging call has completed. This function may + // be called immediately without first calling DragSourceEndedAt to cancel a + // drag operation. If the web view is both the drag source and the drag target + // then all DragTarget* functions should be called before DragSource* mthods. + // This function is only used when window rendering is disabled. + /// + void (CEF_CALLBACK *drag_source_system_drag_ended)( + struct _cef_browser_host_t* self); +} cef_browser_host_t; + + +/// +// Create a new browser window using the window parameters specified by +// |windowInfo|. All values will be copied internally and the actual window will +// be created on the UI thread. If |request_context| is NULL the global request +// context will be used. This function can be called on any browser process +// thread and will not block. +/// +CEF_EXPORT int cef_browser_host_create_browser( + const cef_window_info_t* windowInfo, struct _cef_client_t* client, + const cef_string_t* url, const struct _cef_browser_settings_t* settings, + struct _cef_request_context_t* request_context); + +/// +// Create a new browser window using the window parameters specified by +// |windowInfo|. If |request_context| is NULL the global request context will be +// used. This function can only be called on the browser process UI thread. +/// +CEF_EXPORT cef_browser_t* cef_browser_host_create_browser_sync( + const cef_window_info_t* windowInfo, struct _cef_client_t* client, + const cef_string_t* url, const struct _cef_browser_settings_t* settings, + struct _cef_request_context_t* request_context); + + +#ifdef __cplusplus +} +#endif + +#endif // CEF_INCLUDE_CAPI_CEF_BROWSER_CAPI_H_ diff --git a/dependencies64/cef/include/capi/cef_browser_process_handler_capi.h b/dependencies64/cef/include/capi/cef_browser_process_handler_capi.h new file mode 100644 index 000000000..a4f63cc99 --- /dev/null +++ b/dependencies64/cef/include/capi/cef_browser_process_handler_capi.h @@ -0,0 +1,104 @@ +// Copyright (c) 2015 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool and should not edited +// by hand. See the translator.README.txt file in the tools directory for +// more information. +// + +#ifndef CEF_INCLUDE_CAPI_CEF_BROWSER_PROCESS_HANDLER_CAPI_H_ +#define CEF_INCLUDE_CAPI_CEF_BROWSER_PROCESS_HANDLER_CAPI_H_ +#pragma once + +#include "include/capi/cef_base_capi.h" +#include "include/capi/cef_command_line_capi.h" +#include "include/capi/cef_print_handler_capi.h" +#include "include/capi/cef_values_capi.h" + +#ifdef __cplusplus +extern "C" { +#endif + + +/// +// Structure used to implement browser process callbacks. The functions of this +// structure will be called on the browser process main thread unless otherwise +// indicated. +/// +typedef struct _cef_browser_process_handler_t { + /// + // Base structure. + /// + cef_base_t base; + + /// + // Called on the browser process UI thread immediately after the CEF context + // has been initialized. + /// + void (CEF_CALLBACK *on_context_initialized)( + struct _cef_browser_process_handler_t* self); + + /// + // Called before a child process is launched. Will be called on the browser + // process UI thread when launching a render process and on the browser + // process IO thread when launching a GPU or plugin process. Provides an + // opportunity to modify the child process command line. Do not keep a + // reference to |command_line| outside of this function. + /// + void (CEF_CALLBACK *on_before_child_process_launch)( + struct _cef_browser_process_handler_t* self, + struct _cef_command_line_t* command_line); + + /// + // Called on the browser process IO thread after the main thread has been + // created for a new render process. Provides an opportunity to specify extra + // information that will be passed to + // cef_render_process_handler_t::on_render_thread_created() in the render + // process. Do not keep a reference to |extra_info| outside of this function. + /// + void (CEF_CALLBACK *on_render_process_thread_created)( + struct _cef_browser_process_handler_t* self, + struct _cef_list_value_t* extra_info); + + /// + // Return the handler for printing on Linux. If a print handler is not + // provided then printing will not be supported on the Linux platform. + /// + struct _cef_print_handler_t* (CEF_CALLBACK *get_print_handler)( + struct _cef_browser_process_handler_t* self); +} cef_browser_process_handler_t; + + +#ifdef __cplusplus +} +#endif + +#endif // CEF_INCLUDE_CAPI_CEF_BROWSER_PROCESS_HANDLER_CAPI_H_ diff --git a/dependencies64/cef/include/capi/cef_callback_capi.h b/dependencies64/cef/include/capi/cef_callback_capi.h new file mode 100644 index 000000000..275138686 --- /dev/null +++ b/dependencies64/cef/include/capi/cef_callback_capi.h @@ -0,0 +1,89 @@ +// Copyright (c) 2015 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool and should not edited +// by hand. See the translator.README.txt file in the tools directory for +// more information. +// + +#ifndef CEF_INCLUDE_CAPI_CEF_CALLBACK_CAPI_H_ +#define CEF_INCLUDE_CAPI_CEF_CALLBACK_CAPI_H_ +#pragma once + +#include "include/capi/cef_base_capi.h" + +#ifdef __cplusplus +extern "C" { +#endif + + +/// +// Generic callback structure used for asynchronous continuation. +/// +typedef struct _cef_callback_t { + /// + // Base structure. + /// + cef_base_t base; + + /// + // Continue processing. + /// + void (CEF_CALLBACK *cont)(struct _cef_callback_t* self); + + /// + // Cancel processing. + /// + void (CEF_CALLBACK *cancel)(struct _cef_callback_t* self); +} cef_callback_t; + + +/// +// Generic callback structure used for asynchronous completion. +/// +typedef struct _cef_completion_callback_t { + /// + // Base structure. + /// + cef_base_t base; + + /// + // Method that will be called once the task is complete. + /// + void (CEF_CALLBACK *on_complete)(struct _cef_completion_callback_t* self); +} cef_completion_callback_t; + + +#ifdef __cplusplus +} +#endif + +#endif // CEF_INCLUDE_CAPI_CEF_CALLBACK_CAPI_H_ diff --git a/dependencies64/cef/include/capi/cef_client_capi.h b/dependencies64/cef/include/capi/cef_client_capi.h new file mode 100644 index 000000000..7950152fe --- /dev/null +++ b/dependencies64/cef/include/capi/cef_client_capi.h @@ -0,0 +1,176 @@ +// Copyright (c) 2015 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool and should not edited +// by hand. See the translator.README.txt file in the tools directory for +// more information. +// + +#ifndef CEF_INCLUDE_CAPI_CEF_CLIENT_CAPI_H_ +#define CEF_INCLUDE_CAPI_CEF_CLIENT_CAPI_H_ +#pragma once + +#include "include/capi/cef_base_capi.h" +#include "include/capi/cef_context_menu_handler_capi.h" +#include "include/capi/cef_dialog_handler_capi.h" +#include "include/capi/cef_display_handler_capi.h" +#include "include/capi/cef_download_handler_capi.h" +#include "include/capi/cef_drag_handler_capi.h" +#include "include/capi/cef_find_handler_capi.h" +#include "include/capi/cef_focus_handler_capi.h" +#include "include/capi/cef_geolocation_handler_capi.h" +#include "include/capi/cef_jsdialog_handler_capi.h" +#include "include/capi/cef_keyboard_handler_capi.h" +#include "include/capi/cef_life_span_handler_capi.h" +#include "include/capi/cef_load_handler_capi.h" +#include "include/capi/cef_process_message_capi.h" +#include "include/capi/cef_render_handler_capi.h" +#include "include/capi/cef_request_handler_capi.h" + +#ifdef __cplusplus +extern "C" { +#endif + + +/// +// Implement this structure to provide handler implementations. +/// +typedef struct _cef_client_t { + /// + // Base structure. + /// + cef_base_t base; + + /// + // Return the handler for context menus. If no handler is provided the default + // implementation will be used. + /// + struct _cef_context_menu_handler_t* (CEF_CALLBACK *get_context_menu_handler)( + struct _cef_client_t* self); + + /// + // Return the handler for dialogs. If no handler is provided the default + // implementation will be used. + /// + struct _cef_dialog_handler_t* (CEF_CALLBACK *get_dialog_handler)( + struct _cef_client_t* self); + + /// + // Return the handler for browser display state events. + /// + struct _cef_display_handler_t* (CEF_CALLBACK *get_display_handler)( + struct _cef_client_t* self); + + /// + // Return the handler for download events. If no handler is returned downloads + // will not be allowed. + /// + struct _cef_download_handler_t* (CEF_CALLBACK *get_download_handler)( + struct _cef_client_t* self); + + /// + // Return the handler for drag events. + /// + struct _cef_drag_handler_t* (CEF_CALLBACK *get_drag_handler)( + struct _cef_client_t* self); + + /// + // Return the handler for find result events. + /// + struct _cef_find_handler_t* (CEF_CALLBACK *get_find_handler)( + struct _cef_client_t* self); + + /// + // Return the handler for focus events. + /// + struct _cef_focus_handler_t* (CEF_CALLBACK *get_focus_handler)( + struct _cef_client_t* self); + + /// + // Return the handler for geolocation permissions requests. If no handler is + // provided geolocation access will be denied by default. + /// + struct _cef_geolocation_handler_t* (CEF_CALLBACK *get_geolocation_handler)( + struct _cef_client_t* self); + + /// + // Return the handler for JavaScript dialogs. If no handler is provided the + // default implementation will be used. + /// + struct _cef_jsdialog_handler_t* (CEF_CALLBACK *get_jsdialog_handler)( + struct _cef_client_t* self); + + /// + // Return the handler for keyboard events. + /// + struct _cef_keyboard_handler_t* (CEF_CALLBACK *get_keyboard_handler)( + struct _cef_client_t* self); + + /// + // Return the handler for browser life span events. + /// + struct _cef_life_span_handler_t* (CEF_CALLBACK *get_life_span_handler)( + struct _cef_client_t* self); + + /// + // Return the handler for browser load status events. + /// + struct _cef_load_handler_t* (CEF_CALLBACK *get_load_handler)( + struct _cef_client_t* self); + + /// + // Return the handler for off-screen rendering events. + /// + struct _cef_render_handler_t* (CEF_CALLBACK *get_render_handler)( + struct _cef_client_t* self); + + /// + // Return the handler for browser request events. + /// + struct _cef_request_handler_t* (CEF_CALLBACK *get_request_handler)( + struct _cef_client_t* self); + + /// + // Called when a new message is received from a different process. Return true + // (1) if the message was handled or false (0) otherwise. Do not keep a + // reference to or attempt to access the message outside of this callback. + /// + int (CEF_CALLBACK *on_process_message_received)(struct _cef_client_t* self, + struct _cef_browser_t* browser, cef_process_id_t source_process, + struct _cef_process_message_t* message); +} cef_client_t; + + +#ifdef __cplusplus +} +#endif + +#endif // CEF_INCLUDE_CAPI_CEF_CLIENT_CAPI_H_ diff --git a/dependencies64/cef/include/capi/cef_command_line_capi.h b/dependencies64/cef/include/capi/cef_command_line_capi.h new file mode 100644 index 000000000..8fc308b97 --- /dev/null +++ b/dependencies64/cef/include/capi/cef_command_line_capi.h @@ -0,0 +1,213 @@ +// Copyright (c) 2015 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool and should not edited +// by hand. See the translator.README.txt file in the tools directory for +// more information. +// + +#ifndef CEF_INCLUDE_CAPI_CEF_COMMAND_LINE_CAPI_H_ +#define CEF_INCLUDE_CAPI_CEF_COMMAND_LINE_CAPI_H_ +#pragma once + +#include "include/capi/cef_base_capi.h" + +#ifdef __cplusplus +extern "C" { +#endif + + +/// +// Structure used to create and/or parse command line arguments. Arguments with +// '--', '-' and, on Windows, '/' prefixes are considered switches. Switches +// will always precede any arguments without switch prefixes. Switches can +// optionally have a value specified using the '=' delimiter (e.g. +// "-switch=value"). An argument of "--" will terminate switch parsing with all +// subsequent tokens, regardless of prefix, being interpreted as non-switch +// arguments. Switch names are considered case-insensitive. This structure can +// be used before cef_initialize() is called. +/// +typedef struct _cef_command_line_t { + /// + // Base structure. + /// + cef_base_t base; + + /// + // Returns true (1) if this object is valid. Do not call any other functions + // if this function returns false (0). + /// + int (CEF_CALLBACK *is_valid)(struct _cef_command_line_t* self); + + /// + // Returns true (1) if the values of this object are read-only. Some APIs may + // expose read-only objects. + /// + int (CEF_CALLBACK *is_read_only)(struct _cef_command_line_t* self); + + /// + // Returns a writable copy of this object. + /// + struct _cef_command_line_t* (CEF_CALLBACK *copy)( + struct _cef_command_line_t* self); + + /// + // Initialize the command line with the specified |argc| and |argv| values. + // The first argument must be the name of the program. This function is only + // supported on non-Windows platforms. + /// + void (CEF_CALLBACK *init_from_argv)(struct _cef_command_line_t* self, + int argc, const char* const* argv); + + /// + // Initialize the command line with the string returned by calling + // GetCommandLineW(). This function is only supported on Windows. + /// + void (CEF_CALLBACK *init_from_string)(struct _cef_command_line_t* self, + const cef_string_t* command_line); + + /// + // Reset the command-line switches and arguments but leave the program + // component unchanged. + /// + void (CEF_CALLBACK *reset)(struct _cef_command_line_t* self); + + /// + // Retrieve the original command line string as a vector of strings. The argv + // array: { program, [(--|-|/)switch[=value]]*, [--], [argument]* } + /// + void (CEF_CALLBACK *get_argv)(struct _cef_command_line_t* self, + cef_string_list_t argv); + + /// + // Constructs and returns the represented command line string. Use this + // function cautiously because quoting behavior is unclear. + /// + // The resulting string must be freed by calling cef_string_userfree_free(). + cef_string_userfree_t (CEF_CALLBACK *get_command_line_string)( + struct _cef_command_line_t* self); + + /// + // Get the program part of the command line string (the first item). + /// + // The resulting string must be freed by calling cef_string_userfree_free(). + cef_string_userfree_t (CEF_CALLBACK *get_program)( + struct _cef_command_line_t* self); + + /// + // Set the program part of the command line string (the first item). + /// + void (CEF_CALLBACK *set_program)(struct _cef_command_line_t* self, + const cef_string_t* program); + + /// + // Returns true (1) if the command line has switches. + /// + int (CEF_CALLBACK *has_switches)(struct _cef_command_line_t* self); + + /// + // Returns true (1) if the command line contains the given switch. + /// + int (CEF_CALLBACK *has_switch)(struct _cef_command_line_t* self, + const cef_string_t* name); + + /// + // Returns the value associated with the given switch. If the switch has no + // value or isn't present this function returns the NULL string. + /// + // The resulting string must be freed by calling cef_string_userfree_free(). + cef_string_userfree_t (CEF_CALLBACK *get_switch_value)( + struct _cef_command_line_t* self, const cef_string_t* name); + + /// + // Returns the map of switch names and values. If a switch has no value an + // NULL string is returned. + /// + void (CEF_CALLBACK *get_switches)(struct _cef_command_line_t* self, + cef_string_map_t switches); + + /// + // Add a switch to the end of the command line. If the switch has no value + // pass an NULL value string. + /// + void (CEF_CALLBACK *append_switch)(struct _cef_command_line_t* self, + const cef_string_t* name); + + /// + // Add a switch with the specified value to the end of the command line. + /// + void (CEF_CALLBACK *append_switch_with_value)( + struct _cef_command_line_t* self, const cef_string_t* name, + const cef_string_t* value); + + /// + // True if there are remaining command line arguments. + /// + int (CEF_CALLBACK *has_arguments)(struct _cef_command_line_t* self); + + /// + // Get the remaining command line arguments. + /// + void (CEF_CALLBACK *get_arguments)(struct _cef_command_line_t* self, + cef_string_list_t arguments); + + /// + // Add an argument to the end of the command line. + /// + void (CEF_CALLBACK *append_argument)(struct _cef_command_line_t* self, + const cef_string_t* argument); + + /// + // Insert a command before the current command. Common for debuggers, like + // "valgrind" or "gdb --args". + /// + void (CEF_CALLBACK *prepend_wrapper)(struct _cef_command_line_t* self, + const cef_string_t* wrapper); +} cef_command_line_t; + + +/// +// Create a new cef_command_line_t instance. +/// +CEF_EXPORT cef_command_line_t* cef_command_line_create(); + +/// +// Returns the singleton global cef_command_line_t object. The returned object +// will be read-only. +/// +CEF_EXPORT cef_command_line_t* cef_command_line_get_global(); + + +#ifdef __cplusplus +} +#endif + +#endif // CEF_INCLUDE_CAPI_CEF_COMMAND_LINE_CAPI_H_ diff --git a/dependencies64/cef/include/capi/cef_context_menu_handler_capi.h b/dependencies64/cef/include/capi/cef_context_menu_handler_capi.h new file mode 100644 index 000000000..531409b77 --- /dev/null +++ b/dependencies64/cef/include/capi/cef_context_menu_handler_capi.h @@ -0,0 +1,242 @@ +// Copyright (c) 2015 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool and should not edited +// by hand. See the translator.README.txt file in the tools directory for +// more information. +// + +#ifndef CEF_INCLUDE_CAPI_CEF_CONTEXT_MENU_HANDLER_CAPI_H_ +#define CEF_INCLUDE_CAPI_CEF_CONTEXT_MENU_HANDLER_CAPI_H_ +#pragma once + +#include "include/capi/cef_base_capi.h" +#include "include/capi/cef_browser_capi.h" +#include "include/capi/cef_frame_capi.h" +#include "include/capi/cef_menu_model_capi.h" + +#ifdef __cplusplus +extern "C" { +#endif + +struct _cef_context_menu_params_t; + +/// +// Implement this structure to handle context menu events. The functions of this +// structure will be called on the UI thread. +/// +typedef struct _cef_context_menu_handler_t { + /// + // Base structure. + /// + cef_base_t base; + + /// + // Called before a context menu is displayed. |params| provides information + // about the context menu state. |model| initially contains the default + // context menu. The |model| can be cleared to show no context menu or + // modified to show a custom menu. Do not keep references to |params| or + // |model| outside of this callback. + /// + void (CEF_CALLBACK *on_before_context_menu)( + struct _cef_context_menu_handler_t* self, struct _cef_browser_t* browser, + struct _cef_frame_t* frame, struct _cef_context_menu_params_t* params, + struct _cef_menu_model_t* model); + + /// + // Called to execute a command selected from the context menu. Return true (1) + // if the command was handled or false (0) for the default implementation. See + // cef_menu_id_t for the command ids that have default implementations. All + // user-defined command ids should be between MENU_ID_USER_FIRST and + // MENU_ID_USER_LAST. |params| will have the same values as what was passed to + // on_before_context_menu(). Do not keep a reference to |params| outside of + // this callback. + /// + int (CEF_CALLBACK *on_context_menu_command)( + struct _cef_context_menu_handler_t* self, struct _cef_browser_t* browser, + struct _cef_frame_t* frame, struct _cef_context_menu_params_t* params, + int command_id, cef_event_flags_t event_flags); + + /// + // Called when the context menu is dismissed irregardless of whether the menu + // was NULL or a command was selected. + /// + void (CEF_CALLBACK *on_context_menu_dismissed)( + struct _cef_context_menu_handler_t* self, struct _cef_browser_t* browser, + struct _cef_frame_t* frame); +} cef_context_menu_handler_t; + + +/// +// Provides information about the context menu state. The ethods of this +// structure can only be accessed on browser process the UI thread. +/// +typedef struct _cef_context_menu_params_t { + /// + // Base structure. + /// + cef_base_t base; + + /// + // Returns the X coordinate of the mouse where the context menu was invoked. + // Coords are relative to the associated RenderView's origin. + /// + int (CEF_CALLBACK *get_xcoord)(struct _cef_context_menu_params_t* self); + + /// + // Returns the Y coordinate of the mouse where the context menu was invoked. + // Coords are relative to the associated RenderView's origin. + /// + int (CEF_CALLBACK *get_ycoord)(struct _cef_context_menu_params_t* self); + + /// + // Returns flags representing the type of node that the context menu was + // invoked on. + /// + cef_context_menu_type_flags_t (CEF_CALLBACK *get_type_flags)( + struct _cef_context_menu_params_t* self); + + /// + // Returns the URL of the link, if any, that encloses the node that the + // context menu was invoked on. + /// + // The resulting string must be freed by calling cef_string_userfree_free(). + cef_string_userfree_t (CEF_CALLBACK *get_link_url)( + struct _cef_context_menu_params_t* self); + + /// + // Returns the link URL, if any, to be used ONLY for "copy link address". We + // don't validate this field in the frontend process. + /// + // The resulting string must be freed by calling cef_string_userfree_free(). + cef_string_userfree_t (CEF_CALLBACK *get_unfiltered_link_url)( + struct _cef_context_menu_params_t* self); + + /// + // Returns the source URL, if any, for the element that the context menu was + // invoked on. Example of elements with source URLs are img, audio, and video. + /// + // The resulting string must be freed by calling cef_string_userfree_free(). + cef_string_userfree_t (CEF_CALLBACK *get_source_url)( + struct _cef_context_menu_params_t* self); + + /// + // Returns true (1) if the context menu was invoked on an image which has non- + // NULL contents. + /// + int (CEF_CALLBACK *has_image_contents)( + struct _cef_context_menu_params_t* self); + + /// + // Returns the URL of the top level page that the context menu was invoked on. + /// + // The resulting string must be freed by calling cef_string_userfree_free(). + cef_string_userfree_t (CEF_CALLBACK *get_page_url)( + struct _cef_context_menu_params_t* self); + + /// + // Returns the URL of the subframe that the context menu was invoked on. + /// + // The resulting string must be freed by calling cef_string_userfree_free(). + cef_string_userfree_t (CEF_CALLBACK *get_frame_url)( + struct _cef_context_menu_params_t* self); + + /// + // Returns the character encoding of the subframe that the context menu was + // invoked on. + /// + // The resulting string must be freed by calling cef_string_userfree_free(). + cef_string_userfree_t (CEF_CALLBACK *get_frame_charset)( + struct _cef_context_menu_params_t* self); + + /// + // Returns the type of context node that the context menu was invoked on. + /// + cef_context_menu_media_type_t (CEF_CALLBACK *get_media_type)( + struct _cef_context_menu_params_t* self); + + /// + // Returns flags representing the actions supported by the media element, if + // any, that the context menu was invoked on. + /// + cef_context_menu_media_state_flags_t (CEF_CALLBACK *get_media_state_flags)( + struct _cef_context_menu_params_t* self); + + /// + // Returns the text of the selection, if any, that the context menu was + // invoked on. + /// + // The resulting string must be freed by calling cef_string_userfree_free(). + cef_string_userfree_t (CEF_CALLBACK *get_selection_text)( + struct _cef_context_menu_params_t* self); + + /// + // Returns the text of the misspelled word, if any, that the context menu was + // invoked on. + /// + // The resulting string must be freed by calling cef_string_userfree_free(). + cef_string_userfree_t (CEF_CALLBACK *get_misspelled_word)( + struct _cef_context_menu_params_t* self); + + /// + // Returns true (1) if suggestions exist, false (0) otherwise. Fills in + // |suggestions| from the spell check service for the misspelled word if there + // is one. + /// + int (CEF_CALLBACK *get_dictionary_suggestions)( + struct _cef_context_menu_params_t* self, cef_string_list_t suggestions); + + /// + // Returns true (1) if the context menu was invoked on an editable node. + /// + int (CEF_CALLBACK *is_editable)(struct _cef_context_menu_params_t* self); + + /// + // Returns true (1) if the context menu was invoked on an editable node where + // spell-check is enabled. + /// + int (CEF_CALLBACK *is_spell_check_enabled)( + struct _cef_context_menu_params_t* self); + + /// + // Returns flags representing the actions supported by the editable node, if + // any, that the context menu was invoked on. + /// + cef_context_menu_edit_state_flags_t (CEF_CALLBACK *get_edit_state_flags)( + struct _cef_context_menu_params_t* self); +} cef_context_menu_params_t; + + +#ifdef __cplusplus +} +#endif + +#endif // CEF_INCLUDE_CAPI_CEF_CONTEXT_MENU_HANDLER_CAPI_H_ diff --git a/dependencies64/cef/include/capi/cef_cookie_capi.h b/dependencies64/cef/include/capi/cef_cookie_capi.h new file mode 100644 index 000000000..eb62b1f14 --- /dev/null +++ b/dependencies64/cef/include/capi/cef_cookie_capi.h @@ -0,0 +1,232 @@ +// Copyright (c) 2015 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool and should not edited +// by hand. See the translator.README.txt file in the tools directory for +// more information. +// + +#ifndef CEF_INCLUDE_CAPI_CEF_COOKIE_CAPI_H_ +#define CEF_INCLUDE_CAPI_CEF_COOKIE_CAPI_H_ +#pragma once + +#include "include/capi/cef_base_capi.h" +#include "include/capi/cef_callback_capi.h" + +#ifdef __cplusplus +extern "C" { +#endif + +struct _cef_cookie_visitor_t; +struct _cef_delete_cookies_callback_t; +struct _cef_set_cookie_callback_t; + +/// +// Structure used for managing cookies. The functions of this structure may be +// called on any thread unless otherwise indicated. +/// +typedef struct _cef_cookie_manager_t { + /// + // Base structure. + /// + cef_base_t base; + + /// + // Set the schemes supported by this manager. By default only "http" and + // "https" schemes are supported. If |callback| is non-NULL it will be + // executed asnychronously on the IO thread after the change has been applied. + // Must be called before any cookies are accessed. + /// + void (CEF_CALLBACK *set_supported_schemes)(struct _cef_cookie_manager_t* self, + cef_string_list_t schemes, struct _cef_completion_callback_t* callback); + + /// + // Visit all cookies on the IO thread. The returned cookies are ordered by + // longest path, then by earliest creation date. Returns false (0) if cookies + // cannot be accessed. + /// + int (CEF_CALLBACK *visit_all_cookies)(struct _cef_cookie_manager_t* self, + struct _cef_cookie_visitor_t* visitor); + + /// + // Visit a subset of cookies on the IO thread. The results are filtered by the + // given url scheme, host, domain and path. If |includeHttpOnly| is true (1) + // HTTP-only cookies will also be included in the results. The returned + // cookies are ordered by longest path, then by earliest creation date. + // Returns false (0) if cookies cannot be accessed. + /// + int (CEF_CALLBACK *visit_url_cookies)(struct _cef_cookie_manager_t* self, + const cef_string_t* url, int includeHttpOnly, + struct _cef_cookie_visitor_t* visitor); + + /// + // Sets a cookie given a valid URL and explicit user-provided cookie + // attributes. This function expects each attribute to be well-formed. It will + // check for disallowed characters (e.g. the ';' character is disallowed + // within the cookie value attribute) and fail without setting the cookie if + // such characters are found. If |callback| is non-NULL it will be executed + // asnychronously on the IO thread after the cookie has been set. Returns + // false (0) if an invalid URL is specified or if cookies cannot be accessed. + /// + int (CEF_CALLBACK *set_cookie)(struct _cef_cookie_manager_t* self, + const cef_string_t* url, const struct _cef_cookie_t* cookie, + struct _cef_set_cookie_callback_t* callback); + + /// + // Delete all cookies that match the specified parameters. If both |url| and + // |cookie_name| values are specified all host and domain cookies matching + // both will be deleted. If only |url| is specified all host cookies (but not + // domain cookies) irrespective of path will be deleted. If |url| is NULL all + // cookies for all hosts and domains will be deleted. If |callback| is non- + // NULL it will be executed asnychronously on the IO thread after the cookies + // have been deleted. Returns false (0) if a non-NULL invalid URL is specified + // or if cookies cannot be accessed. Cookies can alternately be deleted using + // the Visit*Cookies() functions. + /// + int (CEF_CALLBACK *delete_cookies)(struct _cef_cookie_manager_t* self, + const cef_string_t* url, const cef_string_t* cookie_name, + struct _cef_delete_cookies_callback_t* callback); + + /// + // Sets the directory path that will be used for storing cookie data. If + // |path| is NULL data will be stored in memory only. Otherwise, data will be + // stored at the specified |path|. To persist session cookies (cookies without + // an expiry date or validity interval) set |persist_session_cookies| to true + // (1). Session cookies are generally intended to be transient and most Web + // browsers do not persist them. If |callback| is non-NULL it will be executed + // asnychronously on the IO thread after the manager's storage has been + // initialized. Returns false (0) if cookies cannot be accessed. + /// + int (CEF_CALLBACK *set_storage_path)(struct _cef_cookie_manager_t* self, + const cef_string_t* path, int persist_session_cookies, + struct _cef_completion_callback_t* callback); + + /// + // Flush the backing store (if any) to disk. If |callback| is non-NULL it will + // be executed asnychronously on the IO thread after the flush is complete. + // Returns false (0) if cookies cannot be accessed. + /// + int (CEF_CALLBACK *flush_store)(struct _cef_cookie_manager_t* self, + struct _cef_completion_callback_t* callback); +} cef_cookie_manager_t; + + +/// +// Returns the global cookie manager. By default data will be stored at +// CefSettings.cache_path if specified or in memory otherwise. If |callback| is +// non-NULL it will be executed asnychronously on the IO thread after the +// manager's storage has been initialized. Using this function is equivalent to +// calling cef_request_tContext::cef_request_context_get_global_context()->get_d +// efault_cookie_manager(). +/// +CEF_EXPORT cef_cookie_manager_t* cef_cookie_manager_get_global_manager( + struct _cef_completion_callback_t* callback); + +/// +// Creates a new cookie manager. If |path| is NULL data will be stored in memory +// only. Otherwise, data will be stored at the specified |path|. To persist +// session cookies (cookies without an expiry date or validity interval) set +// |persist_session_cookies| to true (1). Session cookies are generally intended +// to be transient and most Web browsers do not persist them. If |callback| is +// non-NULL it will be executed asnychronously on the IO thread after the +// manager's storage has been initialized. +/// +CEF_EXPORT cef_cookie_manager_t* cef_cookie_manager_create_manager( + const cef_string_t* path, int persist_session_cookies, + struct _cef_completion_callback_t* callback); + + +/// +// Structure to implement for visiting cookie values. The functions of this +// structure will always be called on the IO thread. +/// +typedef struct _cef_cookie_visitor_t { + /// + // Base structure. + /// + cef_base_t base; + + /// + // Method that will be called once for each cookie. |count| is the 0-based + // index for the current cookie. |total| is the total number of cookies. Set + // |deleteCookie| to true (1) to delete the cookie currently being visited. + // Return false (0) to stop visiting cookies. This function may never be + // called if no cookies are found. + /// + int (CEF_CALLBACK *visit)(struct _cef_cookie_visitor_t* self, + const struct _cef_cookie_t* cookie, int count, int total, + int* deleteCookie); +} cef_cookie_visitor_t; + + +/// +// Structure to implement to be notified of asynchronous completion via +// cef_cookie_manager_t::set_cookie(). +/// +typedef struct _cef_set_cookie_callback_t { + /// + // Base structure. + /// + cef_base_t base; + + /// + // Method that will be called upon completion. |success| will be true (1) if + // the cookie was set successfully. + /// + void (CEF_CALLBACK *on_complete)(struct _cef_set_cookie_callback_t* self, + int success); +} cef_set_cookie_callback_t; + + +/// +// Structure to implement to be notified of asynchronous completion via +// cef_cookie_manager_t::delete_cookies(). +/// +typedef struct _cef_delete_cookies_callback_t { + /// + // Base structure. + /// + cef_base_t base; + + /// + // Method that will be called upon completion. |num_deleted| will be the + // number of cookies that were deleted or -1 if unknown. + /// + void (CEF_CALLBACK *on_complete)(struct _cef_delete_cookies_callback_t* self, + int num_deleted); +} cef_delete_cookies_callback_t; + + +#ifdef __cplusplus +} +#endif + +#endif // CEF_INCLUDE_CAPI_CEF_COOKIE_CAPI_H_ diff --git a/dependencies64/cef/include/capi/cef_dialog_handler_capi.h b/dependencies64/cef/include/capi/cef_dialog_handler_capi.h new file mode 100644 index 000000000..c97a9639f --- /dev/null +++ b/dependencies64/cef/include/capi/cef_dialog_handler_capi.h @@ -0,0 +1,112 @@ +// Copyright (c) 2015 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool and should not edited +// by hand. See the translator.README.txt file in the tools directory for +// more information. +// + +#ifndef CEF_INCLUDE_CAPI_CEF_DIALOG_HANDLER_CAPI_H_ +#define CEF_INCLUDE_CAPI_CEF_DIALOG_HANDLER_CAPI_H_ +#pragma once + +#include "include/capi/cef_base_capi.h" +#include "include/capi/cef_browser_capi.h" + +#ifdef __cplusplus +extern "C" { +#endif + + +/// +// Callback structure for asynchronous continuation of file dialog requests. +/// +typedef struct _cef_file_dialog_callback_t { + /// + // Base structure. + /// + cef_base_t base; + + /// + // Continue the file selection. |selected_accept_filter| should be the 0-based + // index of the value selected from the accept filters array passed to + // cef_dialog_handler_t::OnFileDialog. |file_paths| should be a single value + // or a list of values depending on the dialog mode. An NULL |file_paths| + // value is treated the same as calling cancel(). + /// + void (CEF_CALLBACK *cont)(struct _cef_file_dialog_callback_t* self, + int selected_accept_filter, cef_string_list_t file_paths); + + /// + // Cancel the file selection. + /// + void (CEF_CALLBACK *cancel)(struct _cef_file_dialog_callback_t* self); +} cef_file_dialog_callback_t; + + +/// +// Implement this structure to handle dialog events. The functions of this +// structure will be called on the browser process UI thread. +/// +typedef struct _cef_dialog_handler_t { + /// + // Base structure. + /// + cef_base_t base; + + /// + // Called to run a file chooser dialog. |mode| represents the type of dialog + // to display. |title| to the title to be used for the dialog and may be NULL + // to show the default title ("Open" or "Save" depending on the mode). + // |default_file_path| is the path with optional directory and/or file name + // component that should be initially selected in the dialog. |accept_filters| + // are used to restrict the selectable file types and may any combination of + // (a) valid lower-cased MIME types (e.g. "text/*" or "image/*"), (b) + // individual file extensions (e.g. ".txt" or ".png"), or (c) combined + // description and file extension delimited using "|" and ";" (e.g. "Image + // Types|.png;.gif;.jpg"). |selected_accept_filter| is the 0-based index of + // the filter that should be selected by default. To display a custom dialog + // return true (1) and execute |callback| either inline or at a later time. To + // display the default dialog return false (0). + /// + int (CEF_CALLBACK *on_file_dialog)(struct _cef_dialog_handler_t* self, + struct _cef_browser_t* browser, cef_file_dialog_mode_t mode, + const cef_string_t* title, const cef_string_t* default_file_path, + cef_string_list_t accept_filters, int selected_accept_filter, + struct _cef_file_dialog_callback_t* callback); +} cef_dialog_handler_t; + + +#ifdef __cplusplus +} +#endif + +#endif // CEF_INCLUDE_CAPI_CEF_DIALOG_HANDLER_CAPI_H_ diff --git a/dependencies64/cef/include/capi/cef_display_handler_capi.h b/dependencies64/cef/include/capi/cef_display_handler_capi.h new file mode 100644 index 000000000..87e67c00b --- /dev/null +++ b/dependencies64/cef/include/capi/cef_display_handler_capi.h @@ -0,0 +1,111 @@ +// Copyright (c) 2015 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool and should not edited +// by hand. See the translator.README.txt file in the tools directory for +// more information. +// + +#ifndef CEF_INCLUDE_CAPI_CEF_DISPLAY_HANDLER_CAPI_H_ +#define CEF_INCLUDE_CAPI_CEF_DISPLAY_HANDLER_CAPI_H_ +#pragma once + +#include "include/capi/cef_base_capi.h" +#include "include/capi/cef_browser_capi.h" +#include "include/capi/cef_frame_capi.h" + +#ifdef __cplusplus +extern "C" { +#endif + + +/// +// Implement this structure to handle events related to browser display state. +// The functions of this structure will be called on the UI thread. +/// +typedef struct _cef_display_handler_t { + /// + // Base structure. + /// + cef_base_t base; + + /// + // Called when a frame's address has changed. + /// + void (CEF_CALLBACK *on_address_change)(struct _cef_display_handler_t* self, + struct _cef_browser_t* browser, struct _cef_frame_t* frame, + const cef_string_t* url); + + /// + // Called when the page title changes. + /// + void (CEF_CALLBACK *on_title_change)(struct _cef_display_handler_t* self, + struct _cef_browser_t* browser, const cef_string_t* title); + + /// + // Called when the page icon changes. + /// + void (CEF_CALLBACK *on_favicon_urlchange)(struct _cef_display_handler_t* self, + struct _cef_browser_t* browser, cef_string_list_t icon_urls); + + /// + // Called when the browser is about to display a tooltip. |text| contains the + // text that will be displayed in the tooltip. To handle the display of the + // tooltip yourself return true (1). Otherwise, you can optionally modify + // |text| and then return false (0) to allow the browser to display the + // tooltip. When window rendering is disabled the application is responsible + // for drawing tooltips and the return value is ignored. + /// + int (CEF_CALLBACK *on_tooltip)(struct _cef_display_handler_t* self, + struct _cef_browser_t* browser, cef_string_t* text); + + /// + // Called when the browser receives a status message. |value| contains the + // text that will be displayed in the status message. + /// + void (CEF_CALLBACK *on_status_message)(struct _cef_display_handler_t* self, + struct _cef_browser_t* browser, const cef_string_t* value); + + /// + // Called to display a console message. Return true (1) to stop the message + // from being output to the console. + /// + int (CEF_CALLBACK *on_console_message)(struct _cef_display_handler_t* self, + struct _cef_browser_t* browser, const cef_string_t* message, + const cef_string_t* source, int line); +} cef_display_handler_t; + + +#ifdef __cplusplus +} +#endif + +#endif // CEF_INCLUDE_CAPI_CEF_DISPLAY_HANDLER_CAPI_H_ diff --git a/dependencies64/cef/include/capi/cef_dom_capi.h b/dependencies64/cef/include/capi/cef_dom_capi.h new file mode 100644 index 000000000..ac4d1127c --- /dev/null +++ b/dependencies64/cef/include/capi/cef_dom_capi.h @@ -0,0 +1,341 @@ +// Copyright (c) 2015 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool and should not edited +// by hand. See the translator.README.txt file in the tools directory for +// more information. +// + +#ifndef CEF_INCLUDE_CAPI_CEF_DOM_CAPI_H_ +#define CEF_INCLUDE_CAPI_CEF_DOM_CAPI_H_ +#pragma once + +#include "include/capi/cef_base_capi.h" + +#ifdef __cplusplus +extern "C" { +#endif + +struct _cef_domdocument_t; +struct _cef_domnode_t; + +/// +// Structure to implement for visiting the DOM. The functions of this structure +// will be called on the render process main thread. +/// +typedef struct _cef_domvisitor_t { + /// + // Base structure. + /// + cef_base_t base; + + /// + // Method executed for visiting the DOM. The document object passed to this + // function represents a snapshot of the DOM at the time this function is + // executed. DOM objects are only valid for the scope of this function. Do not + // keep references to or attempt to access any DOM objects outside the scope + // of this function. + /// + void (CEF_CALLBACK *visit)(struct _cef_domvisitor_t* self, + struct _cef_domdocument_t* document); +} cef_domvisitor_t; + + +/// +// Structure used to represent a DOM document. The functions of this structure +// should only be called on the render process main thread thread. +/// +typedef struct _cef_domdocument_t { + /// + // Base structure. + /// + cef_base_t base; + + /// + // Returns the document type. + /// + cef_dom_document_type_t (CEF_CALLBACK *get_type)( + struct _cef_domdocument_t* self); + + /// + // Returns the root document node. + /// + struct _cef_domnode_t* (CEF_CALLBACK *get_document)( + struct _cef_domdocument_t* self); + + /// + // Returns the BODY node of an HTML document. + /// + struct _cef_domnode_t* (CEF_CALLBACK *get_body)( + struct _cef_domdocument_t* self); + + /// + // Returns the HEAD node of an HTML document. + /// + struct _cef_domnode_t* (CEF_CALLBACK *get_head)( + struct _cef_domdocument_t* self); + + /// + // Returns the title of an HTML document. + /// + // The resulting string must be freed by calling cef_string_userfree_free(). + cef_string_userfree_t (CEF_CALLBACK *get_title)( + struct _cef_domdocument_t* self); + + /// + // Returns the document element with the specified ID value. + /// + struct _cef_domnode_t* (CEF_CALLBACK *get_element_by_id)( + struct _cef_domdocument_t* self, const cef_string_t* id); + + /// + // Returns the node that currently has keyboard focus. + /// + struct _cef_domnode_t* (CEF_CALLBACK *get_focused_node)( + struct _cef_domdocument_t* self); + + /// + // Returns true (1) if a portion of the document is selected. + /// + int (CEF_CALLBACK *has_selection)(struct _cef_domdocument_t* self); + + /// + // Returns the selection offset within the start node. + /// + int (CEF_CALLBACK *get_selection_start_offset)( + struct _cef_domdocument_t* self); + + /// + // Returns the selection offset within the end node. + /// + int (CEF_CALLBACK *get_selection_end_offset)(struct _cef_domdocument_t* self); + + /// + // Returns the contents of this selection as markup. + /// + // The resulting string must be freed by calling cef_string_userfree_free(). + cef_string_userfree_t (CEF_CALLBACK *get_selection_as_markup)( + struct _cef_domdocument_t* self); + + /// + // Returns the contents of this selection as text. + /// + // The resulting string must be freed by calling cef_string_userfree_free(). + cef_string_userfree_t (CEF_CALLBACK *get_selection_as_text)( + struct _cef_domdocument_t* self); + + /// + // Returns the base URL for the document. + /// + // The resulting string must be freed by calling cef_string_userfree_free(). + cef_string_userfree_t (CEF_CALLBACK *get_base_url)( + struct _cef_domdocument_t* self); + + /// + // Returns a complete URL based on the document base URL and the specified + // partial URL. + /// + // The resulting string must be freed by calling cef_string_userfree_free(). + cef_string_userfree_t (CEF_CALLBACK *get_complete_url)( + struct _cef_domdocument_t* self, const cef_string_t* partialURL); +} cef_domdocument_t; + + +/// +// Structure used to represent a DOM node. The functions of this structure +// should only be called on the render process main thread. +/// +typedef struct _cef_domnode_t { + /// + // Base structure. + /// + cef_base_t base; + + /// + // Returns the type for this node. + /// + cef_dom_node_type_t (CEF_CALLBACK *get_type)(struct _cef_domnode_t* self); + + /// + // Returns true (1) if this is a text node. + /// + int (CEF_CALLBACK *is_text)(struct _cef_domnode_t* self); + + /// + // Returns true (1) if this is an element node. + /// + int (CEF_CALLBACK *is_element)(struct _cef_domnode_t* self); + + /// + // Returns true (1) if this is an editable node. + /// + int (CEF_CALLBACK *is_editable)(struct _cef_domnode_t* self); + + /// + // Returns true (1) if this is a form control element node. + /// + int (CEF_CALLBACK *is_form_control_element)(struct _cef_domnode_t* self); + + /// + // Returns the type of this form control element node. + /// + // The resulting string must be freed by calling cef_string_userfree_free(). + cef_string_userfree_t (CEF_CALLBACK *get_form_control_element_type)( + struct _cef_domnode_t* self); + + /// + // Returns true (1) if this object is pointing to the same handle as |that| + // object. + /// + int (CEF_CALLBACK *is_same)(struct _cef_domnode_t* self, + struct _cef_domnode_t* that); + + /// + // Returns the name of this node. + /// + // The resulting string must be freed by calling cef_string_userfree_free(). + cef_string_userfree_t (CEF_CALLBACK *get_name)(struct _cef_domnode_t* self); + + /// + // Returns the value of this node. + /// + // The resulting string must be freed by calling cef_string_userfree_free(). + cef_string_userfree_t (CEF_CALLBACK *get_value)(struct _cef_domnode_t* self); + + /// + // Set the value of this node. Returns true (1) on success. + /// + int (CEF_CALLBACK *set_value)(struct _cef_domnode_t* self, + const cef_string_t* value); + + /// + // Returns the contents of this node as markup. + /// + // The resulting string must be freed by calling cef_string_userfree_free(). + cef_string_userfree_t (CEF_CALLBACK *get_as_markup)( + struct _cef_domnode_t* self); + + /// + // Returns the document associated with this node. + /// + struct _cef_domdocument_t* (CEF_CALLBACK *get_document)( + struct _cef_domnode_t* self); + + /// + // Returns the parent node. + /// + struct _cef_domnode_t* (CEF_CALLBACK *get_parent)( + struct _cef_domnode_t* self); + + /// + // Returns the previous sibling node. + /// + struct _cef_domnode_t* (CEF_CALLBACK *get_previous_sibling)( + struct _cef_domnode_t* self); + + /// + // Returns the next sibling node. + /// + struct _cef_domnode_t* (CEF_CALLBACK *get_next_sibling)( + struct _cef_domnode_t* self); + + /// + // Returns true (1) if this node has child nodes. + /// + int (CEF_CALLBACK *has_children)(struct _cef_domnode_t* self); + + /// + // Return the first child node. + /// + struct _cef_domnode_t* (CEF_CALLBACK *get_first_child)( + struct _cef_domnode_t* self); + + /// + // Returns the last child node. + /// + struct _cef_domnode_t* (CEF_CALLBACK *get_last_child)( + struct _cef_domnode_t* self); + + + // The following functions are valid only for element nodes. + + /// + // Returns the tag name of this element. + /// + // The resulting string must be freed by calling cef_string_userfree_free(). + cef_string_userfree_t (CEF_CALLBACK *get_element_tag_name)( + struct _cef_domnode_t* self); + + /// + // Returns true (1) if this element has attributes. + /// + int (CEF_CALLBACK *has_element_attributes)(struct _cef_domnode_t* self); + + /// + // Returns true (1) if this element has an attribute named |attrName|. + /// + int (CEF_CALLBACK *has_element_attribute)(struct _cef_domnode_t* self, + const cef_string_t* attrName); + + /// + // Returns the element attribute named |attrName|. + /// + // The resulting string must be freed by calling cef_string_userfree_free(). + cef_string_userfree_t (CEF_CALLBACK *get_element_attribute)( + struct _cef_domnode_t* self, const cef_string_t* attrName); + + /// + // Returns a map of all element attributes. + /// + void (CEF_CALLBACK *get_element_attributes)(struct _cef_domnode_t* self, + cef_string_map_t attrMap); + + /// + // Set the value for the element attribute named |attrName|. Returns true (1) + // on success. + /// + int (CEF_CALLBACK *set_element_attribute)(struct _cef_domnode_t* self, + const cef_string_t* attrName, const cef_string_t* value); + + /// + // Returns the inner text of the element. + /// + // The resulting string must be freed by calling cef_string_userfree_free(). + cef_string_userfree_t (CEF_CALLBACK *get_element_inner_text)( + struct _cef_domnode_t* self); +} cef_domnode_t; + + +#ifdef __cplusplus +} +#endif + +#endif // CEF_INCLUDE_CAPI_CEF_DOM_CAPI_H_ diff --git a/dependencies64/cef/include/capi/cef_download_handler_capi.h b/dependencies64/cef/include/capi/cef_download_handler_capi.h new file mode 100644 index 000000000..6acf4fafa --- /dev/null +++ b/dependencies64/cef/include/capi/cef_download_handler_capi.h @@ -0,0 +1,137 @@ +// Copyright (c) 2015 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool and should not edited +// by hand. See the translator.README.txt file in the tools directory for +// more information. +// + +#ifndef CEF_INCLUDE_CAPI_CEF_DOWNLOAD_HANDLER_CAPI_H_ +#define CEF_INCLUDE_CAPI_CEF_DOWNLOAD_HANDLER_CAPI_H_ +#pragma once + +#include "include/capi/cef_base_capi.h" +#include "include/capi/cef_browser_capi.h" +#include "include/capi/cef_download_item_capi.h" + +#ifdef __cplusplus +extern "C" { +#endif + + +/// +// Callback structure used to asynchronously continue a download. +/// +typedef struct _cef_before_download_callback_t { + /// + // Base structure. + /// + cef_base_t base; + + /// + // Call to continue the download. Set |download_path| to the full file path + // for the download including the file name or leave blank to use the + // suggested name and the default temp directory. Set |show_dialog| to true + // (1) if you do wish to show the default "Save As" dialog. + /// + void (CEF_CALLBACK *cont)(struct _cef_before_download_callback_t* self, + const cef_string_t* download_path, int show_dialog); +} cef_before_download_callback_t; + + +/// +// Callback structure used to asynchronously cancel a download. +/// +typedef struct _cef_download_item_callback_t { + /// + // Base structure. + /// + cef_base_t base; + + /// + // Call to cancel the download. + /// + void (CEF_CALLBACK *cancel)(struct _cef_download_item_callback_t* self); + + /// + // Call to pause the download. + /// + void (CEF_CALLBACK *pause)(struct _cef_download_item_callback_t* self); + + /// + // Call to resume the download. + /// + void (CEF_CALLBACK *resume)(struct _cef_download_item_callback_t* self); +} cef_download_item_callback_t; + + +/// +// Structure used to handle file downloads. The functions of this structure will +// called on the browser process UI thread. +/// +typedef struct _cef_download_handler_t { + /// + // Base structure. + /// + cef_base_t base; + + /// + // Called before a download begins. |suggested_name| is the suggested name for + // the download file. By default the download will be canceled. Execute + // |callback| either asynchronously or in this function to continue the + // download if desired. Do not keep a reference to |download_item| outside of + // this function. + /// + void (CEF_CALLBACK *on_before_download)(struct _cef_download_handler_t* self, + struct _cef_browser_t* browser, + struct _cef_download_item_t* download_item, + const cef_string_t* suggested_name, + struct _cef_before_download_callback_t* callback); + + /// + // Called when a download's status or progress information has been updated. + // This may be called multiple times before and after on_before_download(). + // Execute |callback| either asynchronously or in this function to cancel the + // download if desired. Do not keep a reference to |download_item| outside of + // this function. + /// + void (CEF_CALLBACK *on_download_updated)(struct _cef_download_handler_t* self, + struct _cef_browser_t* browser, + struct _cef_download_item_t* download_item, + struct _cef_download_item_callback_t* callback); +} cef_download_handler_t; + + +#ifdef __cplusplus +} +#endif + +#endif // CEF_INCLUDE_CAPI_CEF_DOWNLOAD_HANDLER_CAPI_H_ diff --git a/dependencies64/cef/include/capi/cef_download_item_capi.h b/dependencies64/cef/include/capi/cef_download_item_capi.h new file mode 100644 index 000000000..6da4c684b --- /dev/null +++ b/dependencies64/cef/include/capi/cef_download_item_capi.h @@ -0,0 +1,162 @@ +// Copyright (c) 2015 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool and should not edited +// by hand. See the translator.README.txt file in the tools directory for +// more information. +// + +#ifndef CEF_INCLUDE_CAPI_CEF_DOWNLOAD_ITEM_CAPI_H_ +#define CEF_INCLUDE_CAPI_CEF_DOWNLOAD_ITEM_CAPI_H_ +#pragma once + +#include "include/capi/cef_base_capi.h" + +#ifdef __cplusplus +extern "C" { +#endif + + +/// +// Structure used to represent a download item. +/// +typedef struct _cef_download_item_t { + /// + // Base structure. + /// + cef_base_t base; + + /// + // Returns true (1) if this object is valid. Do not call any other functions + // if this function returns false (0). + /// + int (CEF_CALLBACK *is_valid)(struct _cef_download_item_t* self); + + /// + // Returns true (1) if the download is in progress. + /// + int (CEF_CALLBACK *is_in_progress)(struct _cef_download_item_t* self); + + /// + // Returns true (1) if the download is complete. + /// + int (CEF_CALLBACK *is_complete)(struct _cef_download_item_t* self); + + /// + // Returns true (1) if the download has been canceled or interrupted. + /// + int (CEF_CALLBACK *is_canceled)(struct _cef_download_item_t* self); + + /// + // Returns a simple speed estimate in bytes/s. + /// + int64 (CEF_CALLBACK *get_current_speed)(struct _cef_download_item_t* self); + + /// + // Returns the rough percent complete or -1 if the receive total size is + // unknown. + /// + int (CEF_CALLBACK *get_percent_complete)(struct _cef_download_item_t* self); + + /// + // Returns the total number of bytes. + /// + int64 (CEF_CALLBACK *get_total_bytes)(struct _cef_download_item_t* self); + + /// + // Returns the number of received bytes. + /// + int64 (CEF_CALLBACK *get_received_bytes)(struct _cef_download_item_t* self); + + /// + // Returns the time that the download started. + /// + cef_time_t (CEF_CALLBACK *get_start_time)(struct _cef_download_item_t* self); + + /// + // Returns the time that the download ended. + /// + cef_time_t (CEF_CALLBACK *get_end_time)(struct _cef_download_item_t* self); + + /// + // Returns the full path to the downloaded or downloading file. + /// + // The resulting string must be freed by calling cef_string_userfree_free(). + cef_string_userfree_t (CEF_CALLBACK *get_full_path)( + struct _cef_download_item_t* self); + + /// + // Returns the unique identifier for this download. + /// + uint32 (CEF_CALLBACK *get_id)(struct _cef_download_item_t* self); + + /// + // Returns the URL. + /// + // The resulting string must be freed by calling cef_string_userfree_free(). + cef_string_userfree_t (CEF_CALLBACK *get_url)( + struct _cef_download_item_t* self); + + /// + // Returns the original URL before any redirections. + /// + // The resulting string must be freed by calling cef_string_userfree_free(). + cef_string_userfree_t (CEF_CALLBACK *get_original_url)( + struct _cef_download_item_t* self); + + /// + // Returns the suggested file name. + /// + // The resulting string must be freed by calling cef_string_userfree_free(). + cef_string_userfree_t (CEF_CALLBACK *get_suggested_file_name)( + struct _cef_download_item_t* self); + + /// + // Returns the content disposition. + /// + // The resulting string must be freed by calling cef_string_userfree_free(). + cef_string_userfree_t (CEF_CALLBACK *get_content_disposition)( + struct _cef_download_item_t* self); + + /// + // Returns the mime type. + /// + // The resulting string must be freed by calling cef_string_userfree_free(). + cef_string_userfree_t (CEF_CALLBACK *get_mime_type)( + struct _cef_download_item_t* self); +} cef_download_item_t; + + +#ifdef __cplusplus +} +#endif + +#endif // CEF_INCLUDE_CAPI_CEF_DOWNLOAD_ITEM_CAPI_H_ diff --git a/dependencies64/cef/include/capi/cef_drag_data_capi.h b/dependencies64/cef/include/capi/cef_drag_data_capi.h new file mode 100644 index 000000000..a24dd1ff4 --- /dev/null +++ b/dependencies64/cef/include/capi/cef_drag_data_capi.h @@ -0,0 +1,211 @@ +// Copyright (c) 2015 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool and should not edited +// by hand. See the translator.README.txt file in the tools directory for +// more information. +// + +#ifndef CEF_INCLUDE_CAPI_CEF_DRAG_DATA_CAPI_H_ +#define CEF_INCLUDE_CAPI_CEF_DRAG_DATA_CAPI_H_ +#pragma once + +#include "include/capi/cef_base_capi.h" +#include "include/capi/cef_stream_capi.h" + +#ifdef __cplusplus +extern "C" { +#endif + + +/// +// Structure used to represent drag data. The functions of this structure may be +// called on any thread. +/// +typedef struct _cef_drag_data_t { + /// + // Base structure. + /// + cef_base_t base; + + /// + // Returns a copy of the current object. + /// + struct _cef_drag_data_t* (CEF_CALLBACK *clone)(struct _cef_drag_data_t* self); + + /// + // Returns true (1) if this object is read-only. + /// + int (CEF_CALLBACK *is_read_only)(struct _cef_drag_data_t* self); + + /// + // Returns true (1) if the drag data is a link. + /// + int (CEF_CALLBACK *is_link)(struct _cef_drag_data_t* self); + + /// + // Returns true (1) if the drag data is a text or html fragment. + /// + int (CEF_CALLBACK *is_fragment)(struct _cef_drag_data_t* self); + + /// + // Returns true (1) if the drag data is a file. + /// + int (CEF_CALLBACK *is_file)(struct _cef_drag_data_t* self); + + /// + // Return the link URL that is being dragged. + /// + // The resulting string must be freed by calling cef_string_userfree_free(). + cef_string_userfree_t (CEF_CALLBACK *get_link_url)( + struct _cef_drag_data_t* self); + + /// + // Return the title associated with the link being dragged. + /// + // The resulting string must be freed by calling cef_string_userfree_free(). + cef_string_userfree_t (CEF_CALLBACK *get_link_title)( + struct _cef_drag_data_t* self); + + /// + // Return the metadata, if any, associated with the link being dragged. + /// + // The resulting string must be freed by calling cef_string_userfree_free(). + cef_string_userfree_t (CEF_CALLBACK *get_link_metadata)( + struct _cef_drag_data_t* self); + + /// + // Return the plain text fragment that is being dragged. + /// + // The resulting string must be freed by calling cef_string_userfree_free(). + cef_string_userfree_t (CEF_CALLBACK *get_fragment_text)( + struct _cef_drag_data_t* self); + + /// + // Return the text/html fragment that is being dragged. + /// + // The resulting string must be freed by calling cef_string_userfree_free(). + cef_string_userfree_t (CEF_CALLBACK *get_fragment_html)( + struct _cef_drag_data_t* self); + + /// + // Return the base URL that the fragment came from. This value is used for + // resolving relative URLs and may be NULL. + /// + // The resulting string must be freed by calling cef_string_userfree_free(). + cef_string_userfree_t (CEF_CALLBACK *get_fragment_base_url)( + struct _cef_drag_data_t* self); + + /// + // Return the name of the file being dragged out of the browser window. + /// + // The resulting string must be freed by calling cef_string_userfree_free(). + cef_string_userfree_t (CEF_CALLBACK *get_file_name)( + struct _cef_drag_data_t* self); + + /// + // Write the contents of the file being dragged out of the web view into + // |writer|. Returns the number of bytes sent to |writer|. If |writer| is NULL + // this function will return the size of the file contents in bytes. Call + // get_file_name() to get a suggested name for the file. + /// + size_t (CEF_CALLBACK *get_file_contents)(struct _cef_drag_data_t* self, + struct _cef_stream_writer_t* writer); + + /// + // Retrieve the list of file names that are being dragged into the browser + // window. + /// + int (CEF_CALLBACK *get_file_names)(struct _cef_drag_data_t* self, + cef_string_list_t names); + + /// + // Set the link URL that is being dragged. + /// + void (CEF_CALLBACK *set_link_url)(struct _cef_drag_data_t* self, + const cef_string_t* url); + + /// + // Set the title associated with the link being dragged. + /// + void (CEF_CALLBACK *set_link_title)(struct _cef_drag_data_t* self, + const cef_string_t* title); + + /// + // Set the metadata associated with the link being dragged. + /// + void (CEF_CALLBACK *set_link_metadata)(struct _cef_drag_data_t* self, + const cef_string_t* data); + + /// + // Set the plain text fragment that is being dragged. + /// + void (CEF_CALLBACK *set_fragment_text)(struct _cef_drag_data_t* self, + const cef_string_t* text); + + /// + // Set the text/html fragment that is being dragged. + /// + void (CEF_CALLBACK *set_fragment_html)(struct _cef_drag_data_t* self, + const cef_string_t* html); + + /// + // Set the base URL that the fragment came from. + /// + void (CEF_CALLBACK *set_fragment_base_url)(struct _cef_drag_data_t* self, + const cef_string_t* base_url); + + /// + // Reset the file contents. You should do this before calling + // cef_browser_host_t::DragTargetDragEnter as the web view does not allow us + // to drag in this kind of data. + /// + void (CEF_CALLBACK *reset_file_contents)(struct _cef_drag_data_t* self); + + /// + // Add a file that is being dragged into the webview. + /// + void (CEF_CALLBACK *add_file)(struct _cef_drag_data_t* self, + const cef_string_t* path, const cef_string_t* display_name); +} cef_drag_data_t; + + +/// +// Create a new cef_drag_data_t object. +/// +CEF_EXPORT cef_drag_data_t* cef_drag_data_create(); + + +#ifdef __cplusplus +} +#endif + +#endif // CEF_INCLUDE_CAPI_CEF_DRAG_DATA_CAPI_H_ diff --git a/dependencies64/cef/include/capi/cef_drag_handler_capi.h b/dependencies64/cef/include/capi/cef_drag_handler_capi.h new file mode 100644 index 000000000..1e2368b25 --- /dev/null +++ b/dependencies64/cef/include/capi/cef_drag_handler_capi.h @@ -0,0 +1,76 @@ +// Copyright (c) 2015 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool and should not edited +// by hand. See the translator.README.txt file in the tools directory for +// more information. +// + +#ifndef CEF_INCLUDE_CAPI_CEF_DRAG_HANDLER_CAPI_H_ +#define CEF_INCLUDE_CAPI_CEF_DRAG_HANDLER_CAPI_H_ +#pragma once + +#include "include/capi/cef_base_capi.h" +#include "include/capi/cef_browser_capi.h" +#include "include/capi/cef_drag_data_capi.h" + +#ifdef __cplusplus +extern "C" { +#endif + + +/// +// Implement this structure to handle events related to dragging. The functions +// of this structure will be called on the UI thread. +/// +typedef struct _cef_drag_handler_t { + /// + // Base structure. + /// + cef_base_t base; + + /// + // Called when an external drag event enters the browser window. |dragData| + // contains the drag event data and |mask| represents the type of drag + // operation. Return false (0) for default drag handling behavior or true (1) + // to cancel the drag event. + /// + int (CEF_CALLBACK *on_drag_enter)(struct _cef_drag_handler_t* self, + struct _cef_browser_t* browser, struct _cef_drag_data_t* dragData, + cef_drag_operations_mask_t mask); +} cef_drag_handler_t; + + +#ifdef __cplusplus +} +#endif + +#endif // CEF_INCLUDE_CAPI_CEF_DRAG_HANDLER_CAPI_H_ diff --git a/dependencies64/cef/include/capi/cef_find_handler_capi.h b/dependencies64/cef/include/capi/cef_find_handler_capi.h new file mode 100644 index 000000000..14e15bb86 --- /dev/null +++ b/dependencies64/cef/include/capi/cef_find_handler_capi.h @@ -0,0 +1,78 @@ +// Copyright (c) 2015 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool and should not edited +// by hand. See the translator.README.txt file in the tools directory for +// more information. +// + +#ifndef CEF_INCLUDE_CAPI_CEF_FIND_HANDLER_CAPI_H_ +#define CEF_INCLUDE_CAPI_CEF_FIND_HANDLER_CAPI_H_ +#pragma once + +#include "include/capi/cef_base_capi.h" +#include "include/capi/cef_browser_capi.h" + +#ifdef __cplusplus +extern "C" { +#endif + + +/// +// Implement this structure to handle events related to find results. The +// functions of this structure will be called on the UI thread. +/// +typedef struct _cef_find_handler_t { + /// + // Base structure. + /// + cef_base_t base; + + /// + // Called to report find results returned by cef_browser_host_t::find(). + // |identifer| is the identifier passed to find(), |count| is the number of + // matches currently identified, |selectionRect| is the location of where the + // match was found (in window coordinates), |activeMatchOrdinal| is the + // current position in the search results, and |finalUpdate| is true (1) if + // this is the last find notification. + /// + void (CEF_CALLBACK *on_find_result)(struct _cef_find_handler_t* self, + struct _cef_browser_t* browser, int identifier, int count, + const cef_rect_t* selectionRect, int activeMatchOrdinal, + int finalUpdate); +} cef_find_handler_t; + + +#ifdef __cplusplus +} +#endif + +#endif // CEF_INCLUDE_CAPI_CEF_FIND_HANDLER_CAPI_H_ diff --git a/dependencies64/cef/include/capi/cef_focus_handler_capi.h b/dependencies64/cef/include/capi/cef_focus_handler_capi.h new file mode 100644 index 000000000..c0c1e9d9c --- /dev/null +++ b/dependencies64/cef/include/capi/cef_focus_handler_capi.h @@ -0,0 +1,90 @@ +// Copyright (c) 2015 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool and should not edited +// by hand. See the translator.README.txt file in the tools directory for +// more information. +// + +#ifndef CEF_INCLUDE_CAPI_CEF_FOCUS_HANDLER_CAPI_H_ +#define CEF_INCLUDE_CAPI_CEF_FOCUS_HANDLER_CAPI_H_ +#pragma once + +#include "include/capi/cef_base_capi.h" +#include "include/capi/cef_browser_capi.h" +#include "include/capi/cef_dom_capi.h" +#include "include/capi/cef_frame_capi.h" + +#ifdef __cplusplus +extern "C" { +#endif + + +/// +// Implement this structure to handle events related to focus. The functions of +// this structure will be called on the UI thread. +/// +typedef struct _cef_focus_handler_t { + /// + // Base structure. + /// + cef_base_t base; + + /// + // Called when the browser component is about to loose focus. For instance, if + // focus was on the last HTML element and the user pressed the TAB key. |next| + // will be true (1) if the browser is giving focus to the next component and + // false (0) if the browser is giving focus to the previous component. + /// + void (CEF_CALLBACK *on_take_focus)(struct _cef_focus_handler_t* self, + struct _cef_browser_t* browser, int next); + + /// + // Called when the browser component is requesting focus. |source| indicates + // where the focus request is originating from. Return false (0) to allow the + // focus to be set or true (1) to cancel setting the focus. + /// + int (CEF_CALLBACK *on_set_focus)(struct _cef_focus_handler_t* self, + struct _cef_browser_t* browser, cef_focus_source_t source); + + /// + // Called when the browser component has received focus. + /// + void (CEF_CALLBACK *on_got_focus)(struct _cef_focus_handler_t* self, + struct _cef_browser_t* browser); +} cef_focus_handler_t; + + +#ifdef __cplusplus +} +#endif + +#endif // CEF_INCLUDE_CAPI_CEF_FOCUS_HANDLER_CAPI_H_ diff --git a/dependencies64/cef/include/capi/cef_frame_capi.h b/dependencies64/cef/include/capi/cef_frame_capi.h new file mode 100644 index 000000000..c1c40bdf6 --- /dev/null +++ b/dependencies64/cef/include/capi/cef_frame_capi.h @@ -0,0 +1,220 @@ +// Copyright (c) 2015 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool and should not edited +// by hand. See the translator.README.txt file in the tools directory for +// more information. +// + +#ifndef CEF_INCLUDE_CAPI_CEF_FRAME_CAPI_H_ +#define CEF_INCLUDE_CAPI_CEF_FRAME_CAPI_H_ +#pragma once + +#include "include/capi/cef_base_capi.h" +#include "include/capi/cef_dom_capi.h" +#include "include/capi/cef_request_capi.h" +#include "include/capi/cef_stream_capi.h" +#include "include/capi/cef_string_visitor_capi.h" + +#ifdef __cplusplus +extern "C" { +#endif + +struct _cef_browser_t; +struct _cef_v8context_t; + +/// +// Structure used to represent a frame in the browser window. When used in the +// browser process the functions of this structure may be called on any thread +// unless otherwise indicated in the comments. When used in the render process +// the functions of this structure may only be called on the main thread. +/// +typedef struct _cef_frame_t { + /// + // Base structure. + /// + cef_base_t base; + + /// + // True if this object is currently attached to a valid frame. + /// + int (CEF_CALLBACK *is_valid)(struct _cef_frame_t* self); + + /// + // Execute undo in this frame. + /// + void (CEF_CALLBACK *undo)(struct _cef_frame_t* self); + + /// + // Execute redo in this frame. + /// + void (CEF_CALLBACK *redo)(struct _cef_frame_t* self); + + /// + // Execute cut in this frame. + /// + void (CEF_CALLBACK *cut)(struct _cef_frame_t* self); + + /// + // Execute copy in this frame. + /// + void (CEF_CALLBACK *copy)(struct _cef_frame_t* self); + + /// + // Execute paste in this frame. + /// + void (CEF_CALLBACK *paste)(struct _cef_frame_t* self); + + /// + // Execute delete in this frame. + /// + void (CEF_CALLBACK *del)(struct _cef_frame_t* self); + + /// + // Execute select all in this frame. + /// + void (CEF_CALLBACK *select_all)(struct _cef_frame_t* self); + + /// + // Save this frame's HTML source to a temporary file and open it in the + // default text viewing application. This function can only be called from the + // browser process. + /// + void (CEF_CALLBACK *view_source)(struct _cef_frame_t* self); + + /// + // Retrieve this frame's HTML source as a string sent to the specified + // visitor. + /// + void (CEF_CALLBACK *get_source)(struct _cef_frame_t* self, + struct _cef_string_visitor_t* visitor); + + /// + // Retrieve this frame's display text as a string sent to the specified + // visitor. + /// + void (CEF_CALLBACK *get_text)(struct _cef_frame_t* self, + struct _cef_string_visitor_t* visitor); + + /// + // Load the request represented by the |request| object. + /// + void (CEF_CALLBACK *load_request)(struct _cef_frame_t* self, + struct _cef_request_t* request); + + /// + // Load the specified |url|. + /// + void (CEF_CALLBACK *load_url)(struct _cef_frame_t* self, + const cef_string_t* url); + + /// + // Load the contents of |string_val| with the specified dummy |url|. |url| + // should have a standard scheme (for example, http scheme) or behaviors like + // link clicks and web security restrictions may not behave as expected. + /// + void (CEF_CALLBACK *load_string)(struct _cef_frame_t* self, + const cef_string_t* string_val, const cef_string_t* url); + + /// + // Execute a string of JavaScript code in this frame. The |script_url| + // parameter is the URL where the script in question can be found, if any. The + // renderer may request this URL to show the developer the source of the + // error. The |start_line| parameter is the base line number to use for error + // reporting. + /// + void (CEF_CALLBACK *execute_java_script)(struct _cef_frame_t* self, + const cef_string_t* code, const cef_string_t* script_url, + int start_line); + + /// + // Returns true (1) if this is the main (top-level) frame. + /// + int (CEF_CALLBACK *is_main)(struct _cef_frame_t* self); + + /// + // Returns true (1) if this is the focused frame. + /// + int (CEF_CALLBACK *is_focused)(struct _cef_frame_t* self); + + /// + // Returns the name for this frame. If the frame has an assigned name (for + // example, set via the iframe "name" attribute) then that value will be + // returned. Otherwise a unique name will be constructed based on the frame + // parent hierarchy. The main (top-level) frame will always have an NULL name + // value. + /// + // The resulting string must be freed by calling cef_string_userfree_free(). + cef_string_userfree_t (CEF_CALLBACK *get_name)(struct _cef_frame_t* self); + + /// + // Returns the globally unique identifier for this frame. + /// + int64 (CEF_CALLBACK *get_identifier)(struct _cef_frame_t* self); + + /// + // Returns the parent of this frame or NULL if this is the main (top-level) + // frame. + /// + struct _cef_frame_t* (CEF_CALLBACK *get_parent)(struct _cef_frame_t* self); + + /// + // Returns the URL currently loaded in this frame. + /// + // The resulting string must be freed by calling cef_string_userfree_free(). + cef_string_userfree_t (CEF_CALLBACK *get_url)(struct _cef_frame_t* self); + + /// + // Returns the browser that this frame belongs to. + /// + struct _cef_browser_t* (CEF_CALLBACK *get_browser)(struct _cef_frame_t* self); + + /// + // Get the V8 context associated with the frame. This function can only be + // called from the render process. + /// + struct _cef_v8context_t* (CEF_CALLBACK *get_v8context)( + struct _cef_frame_t* self); + + /// + // Visit the DOM document. This function can only be called from the render + // process. + /// + void (CEF_CALLBACK *visit_dom)(struct _cef_frame_t* self, + struct _cef_domvisitor_t* visitor); +} cef_frame_t; + + +#ifdef __cplusplus +} +#endif + +#endif // CEF_INCLUDE_CAPI_CEF_FRAME_CAPI_H_ diff --git a/dependencies64/cef/include/capi/cef_geolocation_capi.h b/dependencies64/cef/include/capi/cef_geolocation_capi.h new file mode 100644 index 000000000..8a72c5b7f --- /dev/null +++ b/dependencies64/cef/include/capi/cef_geolocation_capi.h @@ -0,0 +1,79 @@ +// Copyright (c) 2015 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool and should not edited +// by hand. See the translator.README.txt file in the tools directory for +// more information. +// + +#ifndef CEF_INCLUDE_CAPI_CEF_GEOLOCATION_CAPI_H_ +#define CEF_INCLUDE_CAPI_CEF_GEOLOCATION_CAPI_H_ +#pragma once + +#include "include/capi/cef_base_capi.h" + +#ifdef __cplusplus +extern "C" { +#endif + + +/// +// Implement this structure to receive geolocation updates. The functions of +// this structure will be called on the browser process UI thread. +/// +typedef struct _cef_get_geolocation_callback_t { + /// + // Base structure. + /// + cef_base_t base; + + /// + // Called with the 'best available' location information or, if the location + // update failed, with error information. + /// + void (CEF_CALLBACK *on_location_update)( + struct _cef_get_geolocation_callback_t* self, + const struct _cef_geoposition_t* position); +} cef_get_geolocation_callback_t; + + +/// +// Request a one-time geolocation update. This function bypasses any user +// permission checks so should only be used by code that is allowed to access +// location information. +/// +CEF_EXPORT int cef_get_geolocation(cef_get_geolocation_callback_t* callback); + +#ifdef __cplusplus +} +#endif + +#endif // CEF_INCLUDE_CAPI_CEF_GEOLOCATION_CAPI_H_ diff --git a/dependencies64/cef/include/capi/cef_geolocation_handler_capi.h b/dependencies64/cef/include/capi/cef_geolocation_handler_capi.h new file mode 100644 index 000000000..f739f4df0 --- /dev/null +++ b/dependencies64/cef/include/capi/cef_geolocation_handler_capi.h @@ -0,0 +1,106 @@ +// Copyright (c) 2015 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool and should not edited +// by hand. See the translator.README.txt file in the tools directory for +// more information. +// + +#ifndef CEF_INCLUDE_CAPI_CEF_GEOLOCATION_HANDLER_CAPI_H_ +#define CEF_INCLUDE_CAPI_CEF_GEOLOCATION_HANDLER_CAPI_H_ +#pragma once + +#include "include/capi/cef_base_capi.h" +#include "include/capi/cef_browser_capi.h" + +#ifdef __cplusplus +extern "C" { +#endif + + +/// +// Callback structure used for asynchronous continuation of geolocation +// permission requests. +/// +typedef struct _cef_geolocation_callback_t { + /// + // Base structure. + /// + cef_base_t base; + + /// + // Call to allow or deny geolocation access. + /// + void (CEF_CALLBACK *cont)(struct _cef_geolocation_callback_t* self, + int allow); +} cef_geolocation_callback_t; + + +/// +// Implement this structure to handle events related to geolocation permission +// requests. The functions of this structure will be called on the browser +// process UI thread. +/// +typedef struct _cef_geolocation_handler_t { + /// + // Base structure. + /// + cef_base_t base; + + /// + // Called when a page requests permission to access geolocation information. + // |requesting_url| is the URL requesting permission and |request_id| is the + // unique ID for the permission request. Return true (1) and call + // cef_geolocation_callback_t::cont() either in this function or at a later + // time to continue or cancel the request. Return false (0) to cancel the + // request immediately. + /// + int (CEF_CALLBACK *on_request_geolocation_permission)( + struct _cef_geolocation_handler_t* self, struct _cef_browser_t* browser, + const cef_string_t* requesting_url, int request_id, + struct _cef_geolocation_callback_t* callback); + + /// + // Called when a geolocation access request is canceled. |requesting_url| is + // the URL that originally requested permission and |request_id| is the unique + // ID for the permission request. + /// + void (CEF_CALLBACK *on_cancel_geolocation_permission)( + struct _cef_geolocation_handler_t* self, struct _cef_browser_t* browser, + const cef_string_t* requesting_url, int request_id); +} cef_geolocation_handler_t; + + +#ifdef __cplusplus +} +#endif + +#endif // CEF_INCLUDE_CAPI_CEF_GEOLOCATION_HANDLER_CAPI_H_ diff --git a/dependencies64/cef/include/capi/cef_jsdialog_handler_capi.h b/dependencies64/cef/include/capi/cef_jsdialog_handler_capi.h new file mode 100644 index 000000000..c674341f1 --- /dev/null +++ b/dependencies64/cef/include/capi/cef_jsdialog_handler_capi.h @@ -0,0 +1,133 @@ +// Copyright (c) 2015 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool and should not edited +// by hand. See the translator.README.txt file in the tools directory for +// more information. +// + +#ifndef CEF_INCLUDE_CAPI_CEF_JSDIALOG_HANDLER_CAPI_H_ +#define CEF_INCLUDE_CAPI_CEF_JSDIALOG_HANDLER_CAPI_H_ +#pragma once + +#include "include/capi/cef_base_capi.h" +#include "include/capi/cef_browser_capi.h" + +#ifdef __cplusplus +extern "C" { +#endif + + +/// +// Callback structure used for asynchronous continuation of JavaScript dialog +// requests. +/// +typedef struct _cef_jsdialog_callback_t { + /// + // Base structure. + /// + cef_base_t base; + + /// + // Continue the JS dialog request. Set |success| to true (1) if the OK button + // was pressed. The |user_input| value should be specified for prompt dialogs. + /// + void (CEF_CALLBACK *cont)(struct _cef_jsdialog_callback_t* self, int success, + const cef_string_t* user_input); +} cef_jsdialog_callback_t; + + +/// +// Implement this structure to handle events related to JavaScript dialogs. The +// functions of this structure will be called on the UI thread. +/// +typedef struct _cef_jsdialog_handler_t { + /// + // Base structure. + /// + cef_base_t base; + + /// + // Called to run a JavaScript dialog. The |default_prompt_text| value will be + // specified for prompt dialogs only. Set |suppress_message| to true (1) and + // return false (0) to suppress the message (suppressing messages is + // preferable to immediately executing the callback as this is used to detect + // presumably malicious behavior like spamming alert messages in + // onbeforeunload). Set |suppress_message| to false (0) and return false (0) + // to use the default implementation (the default implementation will show one + // modal dialog at a time and suppress any additional dialog requests until + // the displayed dialog is dismissed). Return true (1) if the application will + // use a custom dialog or if the callback has been executed immediately. + // Custom dialogs may be either modal or modeless. If a custom dialog is used + // the application must execute |callback| once the custom dialog is + // dismissed. + /// + int (CEF_CALLBACK *on_jsdialog)(struct _cef_jsdialog_handler_t* self, + struct _cef_browser_t* browser, const cef_string_t* origin_url, + const cef_string_t* accept_lang, cef_jsdialog_type_t dialog_type, + const cef_string_t* message_text, + const cef_string_t* default_prompt_text, + struct _cef_jsdialog_callback_t* callback, int* suppress_message); + + /// + // Called to run a dialog asking the user if they want to leave a page. Return + // false (0) to use the default dialog implementation. Return true (1) if the + // application will use a custom dialog or if the callback has been executed + // immediately. Custom dialogs may be either modal or modeless. If a custom + // dialog is used the application must execute |callback| once the custom + // dialog is dismissed. + /// + int (CEF_CALLBACK *on_before_unload_dialog)( + struct _cef_jsdialog_handler_t* self, struct _cef_browser_t* browser, + const cef_string_t* message_text, int is_reload, + struct _cef_jsdialog_callback_t* callback); + + /// + // Called to cancel any pending dialogs and reset any saved dialog state. Will + // be called due to events like page navigation irregardless of whether any + // dialogs are currently pending. + /// + void (CEF_CALLBACK *on_reset_dialog_state)( + struct _cef_jsdialog_handler_t* self, struct _cef_browser_t* browser); + + /// + // Called when the default implementation dialog is closed. + /// + void (CEF_CALLBACK *on_dialog_closed)(struct _cef_jsdialog_handler_t* self, + struct _cef_browser_t* browser); +} cef_jsdialog_handler_t; + + +#ifdef __cplusplus +} +#endif + +#endif // CEF_INCLUDE_CAPI_CEF_JSDIALOG_HANDLER_CAPI_H_ diff --git a/dependencies64/cef/include/capi/cef_keyboard_handler_capi.h b/dependencies64/cef/include/capi/cef_keyboard_handler_capi.h new file mode 100644 index 000000000..a50e1977f --- /dev/null +++ b/dependencies64/cef/include/capi/cef_keyboard_handler_capi.h @@ -0,0 +1,84 @@ +// Copyright (c) 2015 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool and should not edited +// by hand. See the translator.README.txt file in the tools directory for +// more information. +// + +#ifndef CEF_INCLUDE_CAPI_CEF_KEYBOARD_HANDLER_CAPI_H_ +#define CEF_INCLUDE_CAPI_CEF_KEYBOARD_HANDLER_CAPI_H_ +#pragma once + +#include "include/capi/cef_base_capi.h" +#include "include/capi/cef_browser_capi.h" + +#ifdef __cplusplus +extern "C" { +#endif + + +/// +// Implement this structure to handle events related to keyboard input. The +// functions of this structure will be called on the UI thread. +/// +typedef struct _cef_keyboard_handler_t { + /// + // Base structure. + /// + cef_base_t base; + + // Called before a keyboard event is sent to the renderer. |event| contains + // information about the keyboard event. |os_event| is the operating system + // event message, if any. Return true (1) if the event was handled or false + // (0) otherwise. If the event will be handled in on_key_event() as a keyboard + // shortcut set |is_keyboard_shortcut| to true (1) and return false (0). + int (CEF_CALLBACK *on_pre_key_event)(struct _cef_keyboard_handler_t* self, + struct _cef_browser_t* browser, const struct _cef_key_event_t* event, + cef_event_handle_t os_event, int* is_keyboard_shortcut); + + /// + // Called after the renderer and JavaScript in the page has had a chance to + // handle the event. |event| contains information about the keyboard event. + // |os_event| is the operating system event message, if any. Return true (1) + // if the keyboard event was handled or false (0) otherwise. + /// + int (CEF_CALLBACK *on_key_event)(struct _cef_keyboard_handler_t* self, + struct _cef_browser_t* browser, const struct _cef_key_event_t* event, + cef_event_handle_t os_event); +} cef_keyboard_handler_t; + + +#ifdef __cplusplus +} +#endif + +#endif // CEF_INCLUDE_CAPI_CEF_KEYBOARD_HANDLER_CAPI_H_ diff --git a/dependencies64/cef/include/capi/cef_life_span_handler_capi.h b/dependencies64/cef/include/capi/cef_life_span_handler_capi.h new file mode 100644 index 000000000..59595c0e3 --- /dev/null +++ b/dependencies64/cef/include/capi/cef_life_span_handler_capi.h @@ -0,0 +1,177 @@ +// Copyright (c) 2015 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool and should not edited +// by hand. See the translator.README.txt file in the tools directory for +// more information. +// + +#ifndef CEF_INCLUDE_CAPI_CEF_LIFE_SPAN_HANDLER_CAPI_H_ +#define CEF_INCLUDE_CAPI_CEF_LIFE_SPAN_HANDLER_CAPI_H_ +#pragma once + +#include "include/capi/cef_base_capi.h" +#include "include/capi/cef_browser_capi.h" + +#ifdef __cplusplus +extern "C" { +#endif + +struct _cef_client_t; + +/// +// Implement this structure to handle events related to browser life span. The +// functions of this structure will be called on the UI thread unless otherwise +// indicated. +/// +typedef struct _cef_life_span_handler_t { + /// + // Base structure. + /// + cef_base_t base; + + /// + // Called on the IO thread before a new popup browser is created. The + // |browser| and |frame| values represent the source of the popup request. The + // |target_url| and |target_frame_name| values indicate where the popup + // browser should navigate and may be NULL if not specified with the request. + // The |target_disposition| value indicates where the user intended to open + // the popup (e.g. current tab, new tab, etc). The |user_gesture| value will + // be true (1) if the popup was opened via explicit user gesture (e.g. + // clicking a link) or false (0) if the popup opened automatically (e.g. via + // the DomContentLoaded event). The |popupFeatures| structure contains + // additional information about the requested popup window. To allow creation + // of the popup browser optionally modify |windowInfo|, |client|, |settings| + // and |no_javascript_access| and return false (0). To cancel creation of the + // popup browser return true (1). The |client| and |settings| values will + // default to the source browser's values. If the |no_javascript_access| value + // is set to false (0) the new browser will not be scriptable and may not be + // hosted in the same renderer process as the source browser. + int (CEF_CALLBACK *on_before_popup)(struct _cef_life_span_handler_t* self, + struct _cef_browser_t* browser, struct _cef_frame_t* frame, + const cef_string_t* target_url, const cef_string_t* target_frame_name, + cef_window_open_disposition_t target_disposition, int user_gesture, + const struct _cef_popup_features_t* popupFeatures, + struct _cef_window_info_t* windowInfo, struct _cef_client_t** client, + struct _cef_browser_settings_t* settings, int* no_javascript_access); + + /// + // Called after a new browser is created. + /// + void (CEF_CALLBACK *on_after_created)(struct _cef_life_span_handler_t* self, + struct _cef_browser_t* browser); + + /// + // Called when a modal window is about to display and the modal loop should + // begin running. Return false (0) to use the default modal loop + // implementation or true (1) to use a custom implementation. + /// + int (CEF_CALLBACK *run_modal)(struct _cef_life_span_handler_t* self, + struct _cef_browser_t* browser); + + /// + // Called when a browser has recieved a request to close. This may result + // directly from a call to cef_browser_host_t::close_browser() or indirectly + // if the browser is a top-level OS window created by CEF and the user + // attempts to close the window. This function will be called after the + // JavaScript 'onunload' event has been fired. It will not be called for + // browsers after the associated OS window has been destroyed (for those + // browsers it is no longer possible to cancel the close). + // + // If CEF created an OS window for the browser returning false (0) will send + // an OS close notification to the browser window's top-level owner (e.g. + // WM_CLOSE on Windows, performClose: on OS-X and "delete_event" on Linux). If + // no OS window exists (window rendering disabled) returning false (0) will + // cause the browser object to be destroyed immediately. Return true (1) if + // the browser is parented to another window and that other window needs to + // receive close notification via some non-standard technique. + // + // If an application provides its own top-level window it should handle OS + // close notifications by calling cef_browser_host_t::CloseBrowser(false (0)) + // instead of immediately closing (see the example below). This gives CEF an + // opportunity to process the 'onbeforeunload' event and optionally cancel the + // close before do_close() is called. + // + // The cef_life_span_handler_t::on_before_close() function will be called + // immediately before the browser object is destroyed. The application should + // only exit after on_before_close() has been called for all existing + // browsers. + // + // If the browser represents a modal window and a custom modal loop + // implementation was provided in cef_life_span_handler_t::run_modal() this + // callback should be used to restore the opener window to a usable state. + // + // By way of example consider what should happen during window close when the + // browser is parented to an application-provided top-level OS window. 1. + // User clicks the window close button which sends an OS close + // notification (e.g. WM_CLOSE on Windows, performClose: on OS-X and + // "delete_event" on Linux). + // 2. Application's top-level window receives the close notification and: + // A. Calls CefBrowserHost::CloseBrowser(false). + // B. Cancels the window close. + // 3. JavaScript 'onbeforeunload' handler executes and shows the close + // confirmation dialog (which can be overridden via + // CefJSDialogHandler::OnBeforeUnloadDialog()). + // 4. User approves the close. 5. JavaScript 'onunload' handler executes. 6. + // Application's do_close() handler is called. Application will: + // A. Set a flag to indicate that the next close attempt will be allowed. + // B. Return false. + // 7. CEF sends an OS close notification. 8. Application's top-level window + // receives the OS close notification and + // allows the window to close based on the flag from #6B. + // 9. Browser OS window is destroyed. 10. Application's + // cef_life_span_handler_t::on_before_close() handler is called and + // the browser object is destroyed. + // 11. Application exits by calling cef_quit_message_loop() if no other + // browsers + // exist. + /// + int (CEF_CALLBACK *do_close)(struct _cef_life_span_handler_t* self, + struct _cef_browser_t* browser); + + /// + // Called just before a browser is destroyed. Release all references to the + // browser object and do not attempt to execute any functions on the browser + // object after this callback returns. If this is a modal window and a custom + // modal loop implementation was provided in run_modal() this callback should + // be used to exit the custom modal loop. See do_close() documentation for + // additional usage information. + /// + void (CEF_CALLBACK *on_before_close)(struct _cef_life_span_handler_t* self, + struct _cef_browser_t* browser); +} cef_life_span_handler_t; + + +#ifdef __cplusplus +} +#endif + +#endif // CEF_INCLUDE_CAPI_CEF_LIFE_SPAN_HANDLER_CAPI_H_ diff --git a/dependencies64/cef/include/capi/cef_load_handler_capi.h b/dependencies64/cef/include/capi/cef_load_handler_capi.h new file mode 100644 index 000000000..21388b54c --- /dev/null +++ b/dependencies64/cef/include/capi/cef_load_handler_capi.h @@ -0,0 +1,112 @@ +// Copyright (c) 2015 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool and should not edited +// by hand. See the translator.README.txt file in the tools directory for +// more information. +// + +#ifndef CEF_INCLUDE_CAPI_CEF_LOAD_HANDLER_CAPI_H_ +#define CEF_INCLUDE_CAPI_CEF_LOAD_HANDLER_CAPI_H_ +#pragma once + +#include "include/capi/cef_base_capi.h" +#include "include/capi/cef_browser_capi.h" +#include "include/capi/cef_frame_capi.h" + +#ifdef __cplusplus +extern "C" { +#endif + + +/// +// Implement this structure to handle events related to browser load status. The +// functions of this structure will be called on the browser process UI thread +// or render process main thread (TID_RENDERER). +/// +typedef struct _cef_load_handler_t { + /// + // Base structure. + /// + cef_base_t base; + + /// + // Called when the loading state has changed. This callback will be executed + // twice -- once when loading is initiated either programmatically or by user + // action, and once when loading is terminated due to completion, cancellation + // of failure. + /// + void (CEF_CALLBACK *on_loading_state_change)(struct _cef_load_handler_t* self, + struct _cef_browser_t* browser, int isLoading, int canGoBack, + int canGoForward); + + /// + // Called when the browser begins loading a frame. The |frame| value will + // never be NULL -- call the is_main() function to check if this frame is the + // main frame. Multiple frames may be loading at the same time. Sub-frames may + // start or continue loading after the main frame load has ended. This + // function may not be called for a particular frame if the load request for + // that frame fails. For notification of overall browser load status use + // OnLoadingStateChange instead. + /// + void (CEF_CALLBACK *on_load_start)(struct _cef_load_handler_t* self, + struct _cef_browser_t* browser, struct _cef_frame_t* frame); + + /// + // Called when the browser is done loading a frame. The |frame| value will + // never be NULL -- call the is_main() function to check if this frame is the + // main frame. Multiple frames may be loading at the same time. Sub-frames may + // start or continue loading after the main frame load has ended. This + // function will always be called for all frames irrespective of whether the + // request completes successfully. + /// + void (CEF_CALLBACK *on_load_end)(struct _cef_load_handler_t* self, + struct _cef_browser_t* browser, struct _cef_frame_t* frame, + int httpStatusCode); + + /// + // Called when the resource load for a navigation fails or is canceled. + // |errorCode| is the error code number, |errorText| is the error text and + // |failedUrl| is the URL that failed to load. See net\base\net_error_list.h + // for complete descriptions of the error codes. + /// + void (CEF_CALLBACK *on_load_error)(struct _cef_load_handler_t* self, + struct _cef_browser_t* browser, struct _cef_frame_t* frame, + cef_errorcode_t errorCode, const cef_string_t* errorText, + const cef_string_t* failedUrl); +} cef_load_handler_t; + + +#ifdef __cplusplus +} +#endif + +#endif // CEF_INCLUDE_CAPI_CEF_LOAD_HANDLER_CAPI_H_ diff --git a/dependencies64/cef/include/capi/cef_menu_model_capi.h b/dependencies64/cef/include/capi/cef_menu_model_capi.h new file mode 100644 index 000000000..0a9c21a75 --- /dev/null +++ b/dependencies64/cef/include/capi/cef_menu_model_capi.h @@ -0,0 +1,388 @@ +// Copyright (c) 2015 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool and should not edited +// by hand. See the translator.README.txt file in the tools directory for +// more information. +// + +#ifndef CEF_INCLUDE_CAPI_CEF_MENU_MODEL_CAPI_H_ +#define CEF_INCLUDE_CAPI_CEF_MENU_MODEL_CAPI_H_ +#pragma once + +#include "include/capi/cef_base_capi.h" + +#ifdef __cplusplus +extern "C" { +#endif + + +/// +// Supports creation and modification of menus. See cef_menu_id_t for the +// command ids that have default implementations. All user-defined command ids +// should be between MENU_ID_USER_FIRST and MENU_ID_USER_LAST. The functions of +// this structure can only be accessed on the browser process the UI thread. +/// +typedef struct _cef_menu_model_t { + /// + // Base structure. + /// + cef_base_t base; + + /// + // Clears the menu. Returns true (1) on success. + /// + int (CEF_CALLBACK *clear)(struct _cef_menu_model_t* self); + + /// + // Returns the number of items in this menu. + /// + int (CEF_CALLBACK *get_count)(struct _cef_menu_model_t* self); + + // + // Add a separator to the menu. Returns true (1) on success. + /// + int (CEF_CALLBACK *add_separator)(struct _cef_menu_model_t* self); + + // + // Add an item to the menu. Returns true (1) on success. + /// + int (CEF_CALLBACK *add_item)(struct _cef_menu_model_t* self, int command_id, + const cef_string_t* label); + + // + // Add a check item to the menu. Returns true (1) on success. + /// + int (CEF_CALLBACK *add_check_item)(struct _cef_menu_model_t* self, + int command_id, const cef_string_t* label); + + // + // Add a radio item to the menu. Only a single item with the specified + // |group_id| can be checked at a time. Returns true (1) on success. + /// + int (CEF_CALLBACK *add_radio_item)(struct _cef_menu_model_t* self, + int command_id, const cef_string_t* label, int group_id); + + // + // Add a sub-menu to the menu. The new sub-menu is returned. + /// + struct _cef_menu_model_t* (CEF_CALLBACK *add_sub_menu)( + struct _cef_menu_model_t* self, int command_id, + const cef_string_t* label); + + // + // Insert a separator in the menu at the specified |index|. Returns true (1) + // on success. + /// + int (CEF_CALLBACK *insert_separator_at)(struct _cef_menu_model_t* self, + int index); + + // + // Insert an item in the menu at the specified |index|. Returns true (1) on + // success. + /// + int (CEF_CALLBACK *insert_item_at)(struct _cef_menu_model_t* self, int index, + int command_id, const cef_string_t* label); + + // + // Insert a check item in the menu at the specified |index|. Returns true (1) + // on success. + /// + int (CEF_CALLBACK *insert_check_item_at)(struct _cef_menu_model_t* self, + int index, int command_id, const cef_string_t* label); + + // + // Insert a radio item in the menu at the specified |index|. Only a single + // item with the specified |group_id| can be checked at a time. Returns true + // (1) on success. + /// + int (CEF_CALLBACK *insert_radio_item_at)(struct _cef_menu_model_t* self, + int index, int command_id, const cef_string_t* label, int group_id); + + // + // Insert a sub-menu in the menu at the specified |index|. The new sub-menu is + // returned. + /// + struct _cef_menu_model_t* (CEF_CALLBACK *insert_sub_menu_at)( + struct _cef_menu_model_t* self, int index, int command_id, + const cef_string_t* label); + + /// + // Removes the item with the specified |command_id|. Returns true (1) on + // success. + /// + int (CEF_CALLBACK *remove)(struct _cef_menu_model_t* self, int command_id); + + /// + // Removes the item at the specified |index|. Returns true (1) on success. + /// + int (CEF_CALLBACK *remove_at)(struct _cef_menu_model_t* self, int index); + + /// + // Returns the index associated with the specified |command_id| or -1 if not + // found due to the command id not existing in the menu. + /// + int (CEF_CALLBACK *get_index_of)(struct _cef_menu_model_t* self, + int command_id); + + /// + // Returns the command id at the specified |index| or -1 if not found due to + // invalid range or the index being a separator. + /// + int (CEF_CALLBACK *get_command_id_at)(struct _cef_menu_model_t* self, + int index); + + /// + // Sets the command id at the specified |index|. Returns true (1) on success. + /// + int (CEF_CALLBACK *set_command_id_at)(struct _cef_menu_model_t* self, + int index, int command_id); + + /// + // Returns the label for the specified |command_id| or NULL if not found. + /// + // The resulting string must be freed by calling cef_string_userfree_free(). + cef_string_userfree_t (CEF_CALLBACK *get_label)( + struct _cef_menu_model_t* self, int command_id); + + /// + // Returns the label at the specified |index| or NULL if not found due to + // invalid range or the index being a separator. + /// + // The resulting string must be freed by calling cef_string_userfree_free(). + cef_string_userfree_t (CEF_CALLBACK *get_label_at)( + struct _cef_menu_model_t* self, int index); + + /// + // Sets the label for the specified |command_id|. Returns true (1) on success. + /// + int (CEF_CALLBACK *set_label)(struct _cef_menu_model_t* self, int command_id, + const cef_string_t* label); + + /// + // Set the label at the specified |index|. Returns true (1) on success. + /// + int (CEF_CALLBACK *set_label_at)(struct _cef_menu_model_t* self, int index, + const cef_string_t* label); + + /// + // Returns the item type for the specified |command_id|. + /// + cef_menu_item_type_t (CEF_CALLBACK *get_type)(struct _cef_menu_model_t* self, + int command_id); + + /// + // Returns the item type at the specified |index|. + /// + cef_menu_item_type_t (CEF_CALLBACK *get_type_at)( + struct _cef_menu_model_t* self, int index); + + /// + // Returns the group id for the specified |command_id| or -1 if invalid. + /// + int (CEF_CALLBACK *get_group_id)(struct _cef_menu_model_t* self, + int command_id); + + /// + // Returns the group id at the specified |index| or -1 if invalid. + /// + int (CEF_CALLBACK *get_group_id_at)(struct _cef_menu_model_t* self, + int index); + + /// + // Sets the group id for the specified |command_id|. Returns true (1) on + // success. + /// + int (CEF_CALLBACK *set_group_id)(struct _cef_menu_model_t* self, + int command_id, int group_id); + + /// + // Sets the group id at the specified |index|. Returns true (1) on success. + /// + int (CEF_CALLBACK *set_group_id_at)(struct _cef_menu_model_t* self, int index, + int group_id); + + /// + // Returns the submenu for the specified |command_id| or NULL if invalid. + /// + struct _cef_menu_model_t* (CEF_CALLBACK *get_sub_menu)( + struct _cef_menu_model_t* self, int command_id); + + /// + // Returns the submenu at the specified |index| or NULL if invalid. + /// + struct _cef_menu_model_t* (CEF_CALLBACK *get_sub_menu_at)( + struct _cef_menu_model_t* self, int index); + + // + // Returns true (1) if the specified |command_id| is visible. + /// + int (CEF_CALLBACK *is_visible)(struct _cef_menu_model_t* self, + int command_id); + + // + // Returns true (1) if the specified |index| is visible. + /// + int (CEF_CALLBACK *is_visible_at)(struct _cef_menu_model_t* self, int index); + + // + // Change the visibility of the specified |command_id|. Returns true (1) on + // success. + /// + int (CEF_CALLBACK *set_visible)(struct _cef_menu_model_t* self, + int command_id, int visible); + + // + // Change the visibility at the specified |index|. Returns true (1) on + // success. + /// + int (CEF_CALLBACK *set_visible_at)(struct _cef_menu_model_t* self, int index, + int visible); + + // + // Returns true (1) if the specified |command_id| is enabled. + /// + int (CEF_CALLBACK *is_enabled)(struct _cef_menu_model_t* self, + int command_id); + + // + // Returns true (1) if the specified |index| is enabled. + /// + int (CEF_CALLBACK *is_enabled_at)(struct _cef_menu_model_t* self, int index); + + // + // Change the enabled status of the specified |command_id|. Returns true (1) + // on success. + /// + int (CEF_CALLBACK *set_enabled)(struct _cef_menu_model_t* self, + int command_id, int enabled); + + // + // Change the enabled status at the specified |index|. Returns true (1) on + // success. + /// + int (CEF_CALLBACK *set_enabled_at)(struct _cef_menu_model_t* self, int index, + int enabled); + + // + // Returns true (1) if the specified |command_id| is checked. Only applies to + // check and radio items. + /// + int (CEF_CALLBACK *is_checked)(struct _cef_menu_model_t* self, + int command_id); + + // + // Returns true (1) if the specified |index| is checked. Only applies to check + // and radio items. + /// + int (CEF_CALLBACK *is_checked_at)(struct _cef_menu_model_t* self, int index); + + // + // Check the specified |command_id|. Only applies to check and radio items. + // Returns true (1) on success. + /// + int (CEF_CALLBACK *set_checked)(struct _cef_menu_model_t* self, + int command_id, int checked); + + // + // Check the specified |index|. Only applies to check and radio items. Returns + // true (1) on success. + /// + int (CEF_CALLBACK *set_checked_at)(struct _cef_menu_model_t* self, int index, + int checked); + + // + // Returns true (1) if the specified |command_id| has a keyboard accelerator + // assigned. + /// + int (CEF_CALLBACK *has_accelerator)(struct _cef_menu_model_t* self, + int command_id); + + // + // Returns true (1) if the specified |index| has a keyboard accelerator + // assigned. + /// + int (CEF_CALLBACK *has_accelerator_at)(struct _cef_menu_model_t* self, + int index); + + // + // Set the keyboard accelerator for the specified |command_id|. |key_code| can + // be any virtual key or character value. Returns true (1) on success. + /// + int (CEF_CALLBACK *set_accelerator)(struct _cef_menu_model_t* self, + int command_id, int key_code, int shift_pressed, int ctrl_pressed, + int alt_pressed); + + // + // Set the keyboard accelerator at the specified |index|. |key_code| can be + // any virtual key or character value. Returns true (1) on success. + /// + int (CEF_CALLBACK *set_accelerator_at)(struct _cef_menu_model_t* self, + int index, int key_code, int shift_pressed, int ctrl_pressed, + int alt_pressed); + + // + // Remove the keyboard accelerator for the specified |command_id|. Returns + // true (1) on success. + /// + int (CEF_CALLBACK *remove_accelerator)(struct _cef_menu_model_t* self, + int command_id); + + // + // Remove the keyboard accelerator at the specified |index|. Returns true (1) + // on success. + /// + int (CEF_CALLBACK *remove_accelerator_at)(struct _cef_menu_model_t* self, + int index); + + // + // Retrieves the keyboard accelerator for the specified |command_id|. Returns + // true (1) on success. + /// + int (CEF_CALLBACK *get_accelerator)(struct _cef_menu_model_t* self, + int command_id, int* key_code, int* shift_pressed, int* ctrl_pressed, + int* alt_pressed); + + // + // Retrieves the keyboard accelerator for the specified |index|. Returns true + // (1) on success. + /// + int (CEF_CALLBACK *get_accelerator_at)(struct _cef_menu_model_t* self, + int index, int* key_code, int* shift_pressed, int* ctrl_pressed, + int* alt_pressed); +} cef_menu_model_t; + + +#ifdef __cplusplus +} +#endif + +#endif // CEF_INCLUDE_CAPI_CEF_MENU_MODEL_CAPI_H_ diff --git a/dependencies64/cef/include/capi/cef_navigation_entry_capi.h b/dependencies64/cef/include/capi/cef_navigation_entry_capi.h new file mode 100644 index 000000000..642f0b928 --- /dev/null +++ b/dependencies64/cef/include/capi/cef_navigation_entry_capi.h @@ -0,0 +1,134 @@ +// Copyright (c) 2015 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool and should not edited +// by hand. See the translator.README.txt file in the tools directory for +// more information. +// + +#ifndef CEF_INCLUDE_CAPI_CEF_NAVIGATION_ENTRY_CAPI_H_ +#define CEF_INCLUDE_CAPI_CEF_NAVIGATION_ENTRY_CAPI_H_ +#pragma once + +#include "include/capi/cef_base_capi.h" + +#ifdef __cplusplus +extern "C" { +#endif + + +/// +// Structure used to represent an entry in navigation history. +/// +typedef struct _cef_navigation_entry_t { + /// + // Base structure. + /// + cef_base_t base; + + /// + // Returns true (1) if this object is valid. Do not call any other functions + // if this function returns false (0). + /// + int (CEF_CALLBACK *is_valid)(struct _cef_navigation_entry_t* self); + + /// + // Returns the actual URL of the page. For some pages this may be data: URL or + // similar. Use get_display_url() to return a display-friendly version. + /// + // The resulting string must be freed by calling cef_string_userfree_free(). + cef_string_userfree_t (CEF_CALLBACK *get_url)( + struct _cef_navigation_entry_t* self); + + /// + // Returns a display-friendly version of the URL. + /// + // The resulting string must be freed by calling cef_string_userfree_free(). + cef_string_userfree_t (CEF_CALLBACK *get_display_url)( + struct _cef_navigation_entry_t* self); + + /// + // Returns the original URL that was entered by the user before any redirects. + /// + // The resulting string must be freed by calling cef_string_userfree_free(). + cef_string_userfree_t (CEF_CALLBACK *get_original_url)( + struct _cef_navigation_entry_t* self); + + /// + // Returns the title set by the page. This value may be NULL. + /// + // The resulting string must be freed by calling cef_string_userfree_free(). + cef_string_userfree_t (CEF_CALLBACK *get_title)( + struct _cef_navigation_entry_t* self); + + /// + // Returns the transition type which indicates what the user did to move to + // this page from the previous page. + /// + cef_transition_type_t (CEF_CALLBACK *get_transition_type)( + struct _cef_navigation_entry_t* self); + + /// + // Returns true (1) if this navigation includes post data. + /// + int (CEF_CALLBACK *has_post_data)(struct _cef_navigation_entry_t* self); + + /// + // Returns the name of the sub-frame that navigated or an NULL value if the + // main frame navigated. + /// + // The resulting string must be freed by calling cef_string_userfree_free(). + cef_string_userfree_t (CEF_CALLBACK *get_frame_name)( + struct _cef_navigation_entry_t* self); + + /// + // Returns the time for the last known successful navigation completion. A + // navigation may be completed more than once if the page is reloaded. May be + // 0 if the navigation has not yet completed. + /// + cef_time_t (CEF_CALLBACK *get_completion_time)( + struct _cef_navigation_entry_t* self); + + /// + // Returns the HTTP status code for the last known successful navigation + // response. May be 0 if the response has not yet been received or if the + // navigation has not yet completed. + /// + int (CEF_CALLBACK *get_http_status_code)( + struct _cef_navigation_entry_t* self); +} cef_navigation_entry_t; + + +#ifdef __cplusplus +} +#endif + +#endif // CEF_INCLUDE_CAPI_CEF_NAVIGATION_ENTRY_CAPI_H_ diff --git a/dependencies64/cef/include/capi/cef_origin_whitelist_capi.h b/dependencies64/cef/include/capi/cef_origin_whitelist_capi.h new file mode 100644 index 000000000..6cd123762 --- /dev/null +++ b/dependencies64/cef/include/capi/cef_origin_whitelist_capi.h @@ -0,0 +1,106 @@ +// Copyright (c) 2015 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool and should not edited +// by hand. See the translator.README.txt file in the tools directory for +// more information. +// + +#ifndef CEF_INCLUDE_CAPI_CEF_ORIGIN_WHITELIST_CAPI_H_ +#define CEF_INCLUDE_CAPI_CEF_ORIGIN_WHITELIST_CAPI_H_ +#pragma once + +#include "include/capi/cef_base_capi.h" + +#ifdef __cplusplus +extern "C" { +#endif + + +/// +// Add an entry to the cross-origin access whitelist. +// +// The same-origin policy restricts how scripts hosted from different origins +// (scheme + domain + port) can communicate. By default, scripts can only access +// resources with the same origin. Scripts hosted on the HTTP and HTTPS schemes +// (but no other schemes) can use the "Access-Control-Allow-Origin" header to +// allow cross-origin requests. For example, https://source.example.com can make +// XMLHttpRequest requests on http://target.example.com if the +// http://target.example.com request returns an "Access-Control-Allow-Origin: +// https://source.example.com" response header. +// +// Scripts in separate frames or iframes and hosted from the same protocol and +// domain suffix can execute cross-origin JavaScript if both pages set the +// document.domain value to the same domain suffix. For example, +// scheme://foo.example.com and scheme://bar.example.com can communicate using +// JavaScript if both domains set document.domain="example.com". +// +// This function is used to allow access to origins that would otherwise violate +// the same-origin policy. Scripts hosted underneath the fully qualified +// |source_origin| URL (like http://www.example.com) will be allowed access to +// all resources hosted on the specified |target_protocol| and |target_domain|. +// If |target_domain| is non-NULL and |allow_target_subdomains| if false (0) +// only exact domain matches will be allowed. If |target_domain| contains a top- +// level domain component (like "example.com") and |allow_target_subdomains| is +// true (1) sub-domain matches will be allowed. If |target_domain| is NULL and +// |allow_target_subdomains| if true (1) all domains and IP addresses will be +// allowed. +// +// This function cannot be used to bypass the restrictions on local or display +// isolated schemes. See the comments on CefRegisterCustomScheme for more +// information. +// +// This function may be called on any thread. Returns false (0) if +// |source_origin| is invalid or the whitelist cannot be accessed. +/// +CEF_EXPORT int cef_add_cross_origin_whitelist_entry( + const cef_string_t* source_origin, const cef_string_t* target_protocol, + const cef_string_t* target_domain, int allow_target_subdomains); + +/// +// Remove an entry from the cross-origin access whitelist. Returns false (0) if +// |source_origin| is invalid or the whitelist cannot be accessed. +/// +CEF_EXPORT int cef_remove_cross_origin_whitelist_entry( + const cef_string_t* source_origin, const cef_string_t* target_protocol, + const cef_string_t* target_domain, int allow_target_subdomains); + +/// +// Remove all entries from the cross-origin access whitelist. Returns false (0) +// if the whitelist cannot be accessed. +/// +CEF_EXPORT int cef_clear_cross_origin_whitelist(); + +#ifdef __cplusplus +} +#endif + +#endif // CEF_INCLUDE_CAPI_CEF_ORIGIN_WHITELIST_CAPI_H_ diff --git a/dependencies64/cef/include/capi/cef_parser_capi.h b/dependencies64/cef/include/capi/cef_parser_capi.h new file mode 100644 index 000000000..e6af4e949 --- /dev/null +++ b/dependencies64/cef/include/capi/cef_parser_capi.h @@ -0,0 +1,129 @@ +// Copyright (c) 2015 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool and should not edited +// by hand. See the translator.README.txt file in the tools directory for +// more information. +// + +#ifndef CEF_INCLUDE_CAPI_CEF_PARSER_CAPI_H_ +#define CEF_INCLUDE_CAPI_CEF_PARSER_CAPI_H_ +#pragma once + +#include "include/capi/cef_base_capi.h" + +#ifdef __cplusplus +extern "C" { +#endif + + +/// +// Parse the specified |url| into its component parts. Returns false (0) if the +// URL is NULL or invalid. +/// +CEF_EXPORT int cef_parse_url(const cef_string_t* url, + struct _cef_urlparts_t* parts); + +/// +// Creates a URL from the specified |parts|, which must contain a non-NULL spec +// or a non-NULL host and path (at a minimum), but not both. Returns false (0) +// if |parts| isn't initialized as described. +/// +CEF_EXPORT int cef_create_url(const struct _cef_urlparts_t* parts, + cef_string_t* url); + +/// +// Returns the mime type for the specified file extension or an NULL string if +// unknown. +/// +// The resulting string must be freed by calling cef_string_userfree_free(). +CEF_EXPORT cef_string_userfree_t cef_get_mime_type( + const cef_string_t* extension); + +// Get the extensions associated with the given mime type. This should be passed +// in lower case. There could be multiple extensions for a given mime type, like +// "html,htm" for "text/html", or "txt,text,html,..." for "text/*". Any existing +// elements in the provided vector will not be erased. +CEF_EXPORT void cef_get_extensions_for_mime_type(const cef_string_t* mime_type, + cef_string_list_t extensions); + +/// +// Encodes |data| as a base64 string. +/// +// The resulting string must be freed by calling cef_string_userfree_free(). +CEF_EXPORT cef_string_userfree_t cef_base64encode(const void* data, + size_t data_size); + +/// +// Decodes the base64 encoded string |data|. The returned value will be NULL if +// the decoding fails. +/// +CEF_EXPORT struct _cef_binary_value_t* cef_base64decode( + const cef_string_t* data); + +/// +// Escapes characters in |text| which are unsuitable for use as a query +// parameter value. Everything except alphanumerics and -_.!~*'() will be +// converted to "%XX". If |use_plus| is true (1) spaces will change to "+". The +// result is basically the same as encodeURIComponent in Javacript. +/// +// The resulting string must be freed by calling cef_string_userfree_free(). +CEF_EXPORT cef_string_userfree_t cef_uriencode(const cef_string_t* text, + int use_plus); + +/// +// Unescapes |text| and returns the result. Unescaping consists of looking for +// the exact pattern "%XX" where each X is a hex digit and converting to the +// character with the numerical value of those digits (e.g. "i%20=%203%3b" +// unescapes to "i = 3;"). If |convert_to_utf8| is true (1) this function will +// attempt to interpret the initial decoded result as UTF-8. If the result is +// convertable into UTF-8 it will be returned as converted. Otherwise the +// initial decoded result will be returned. The |unescape_rule| parameter +// supports further customization the decoding process. +/// +// The resulting string must be freed by calling cef_string_userfree_free(). +CEF_EXPORT cef_string_userfree_t cef_uridecode(const cef_string_t* text, + int convert_to_utf8, cef_uri_unescape_rule_t unescape_rule); + +/// +// Parses |string| which represents a CSS color value. If |strict| is true (1) +// strict parsing rules will be applied. Returns true (1) on success or false +// (0) on error. If parsing succeeds |color| will be set to the color value +// otherwise |color| will remain unchanged. +/// +CEF_EXPORT int cef_parse_csscolor(const cef_string_t* string, int strict, + cef_color_t* color); + +#ifdef __cplusplus +} +#endif + +#endif // CEF_INCLUDE_CAPI_CEF_PARSER_CAPI_H_ diff --git a/dependencies64/cef/include/capi/cef_path_util_capi.h b/dependencies64/cef/include/capi/cef_path_util_capi.h new file mode 100644 index 000000000..4655b792a --- /dev/null +++ b/dependencies64/cef/include/capi/cef_path_util_capi.h @@ -0,0 +1,58 @@ +// Copyright (c) 2015 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool and should not edited +// by hand. See the translator.README.txt file in the tools directory for +// more information. +// + +#ifndef CEF_INCLUDE_CAPI_CEF_PATH_UTIL_CAPI_H_ +#define CEF_INCLUDE_CAPI_CEF_PATH_UTIL_CAPI_H_ +#pragma once + +#include "include/capi/cef_base_capi.h" + +#ifdef __cplusplus +extern "C" { +#endif + + +/// +// Retrieve the path associated with the specified |key|. Returns true (1) on +// success. Can be called on any thread in the browser process. +/// +CEF_EXPORT int cef_get_path(cef_path_key_t key, cef_string_t* path); + +#ifdef __cplusplus +} +#endif + +#endif // CEF_INCLUDE_CAPI_CEF_PATH_UTIL_CAPI_H_ diff --git a/dependencies64/cef/include/capi/cef_print_handler_capi.h b/dependencies64/cef/include/capi/cef_print_handler_capi.h new file mode 100644 index 000000000..f2e29ae51 --- /dev/null +++ b/dependencies64/cef/include/capi/cef_print_handler_capi.h @@ -0,0 +1,134 @@ +// Copyright (c) 2015 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool and should not edited +// by hand. See the translator.README.txt file in the tools directory for +// more information. +// + +#ifndef CEF_INCLUDE_CAPI_CEF_PRINT_HANDLER_CAPI_H_ +#define CEF_INCLUDE_CAPI_CEF_PRINT_HANDLER_CAPI_H_ +#pragma once + +#include "include/capi/cef_base_capi.h" +#include "include/capi/cef_browser_capi.h" +#include "include/capi/cef_print_settings_capi.h" + +#ifdef __cplusplus +extern "C" { +#endif + + +/// +// Callback structure for asynchronous continuation of print dialog requests. +/// +typedef struct _cef_print_dialog_callback_t { + /// + // Base structure. + /// + cef_base_t base; + + /// + // Continue printing with the specified |settings|. + /// + void (CEF_CALLBACK *cont)(struct _cef_print_dialog_callback_t* self, + struct _cef_print_settings_t* settings); + + /// + // Cancel the printing. + /// + void (CEF_CALLBACK *cancel)(struct _cef_print_dialog_callback_t* self); +} cef_print_dialog_callback_t; + + +/// +// Callback structure for asynchronous continuation of print job requests. +/// +typedef struct _cef_print_job_callback_t { + /// + // Base structure. + /// + cef_base_t base; + + /// + // Indicate completion of the print job. + /// + void (CEF_CALLBACK *cont)(struct _cef_print_job_callback_t* self); +} cef_print_job_callback_t; + + +/// +// Implement this structure to handle printing on Linux. The functions of this +// structure will be called on the browser process UI thread. +/// +typedef struct _cef_print_handler_t { + /// + // Base structure. + /// + cef_base_t base; + + /// + // Synchronize |settings| with client state. If |get_defaults| is true (1) + // then populate |settings| with the default print settings. Do not keep a + // reference to |settings| outside of this callback. + /// + void (CEF_CALLBACK *on_print_settings)(struct _cef_print_handler_t* self, + struct _cef_print_settings_t* settings, int get_defaults); + + /// + // Show the print dialog. Execute |callback| once the dialog is dismissed. + // Return true (1) if the dialog will be displayed or false (0) to cancel the + // printing immediately. + /// + int (CEF_CALLBACK *on_print_dialog)(struct _cef_print_handler_t* self, + int has_selection, struct _cef_print_dialog_callback_t* callback); + + /// + // Send the print job to the printer. Execute |callback| once the job is + // completed. Return true (1) if the job will proceed or false (0) to cancel + // the job immediately. + /// + int (CEF_CALLBACK *on_print_job)(struct _cef_print_handler_t* self, + const cef_string_t* document_name, const cef_string_t* pdf_file_path, + struct _cef_print_job_callback_t* callback); + + /// + // Reset client state related to printing. + /// + void (CEF_CALLBACK *on_print_reset)(struct _cef_print_handler_t* self); +} cef_print_handler_t; + + +#ifdef __cplusplus +} +#endif + +#endif // CEF_INCLUDE_CAPI_CEF_PRINT_HANDLER_CAPI_H_ diff --git a/dependencies64/cef/include/capi/cef_print_settings_capi.h b/dependencies64/cef/include/capi/cef_print_settings_capi.h new file mode 100644 index 000000000..5dfd0ffd9 --- /dev/null +++ b/dependencies64/cef/include/capi/cef_print_settings_capi.h @@ -0,0 +1,207 @@ +// Copyright (c) 2015 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool and should not edited +// by hand. See the translator.README.txt file in the tools directory for +// more information. +// + +#ifndef CEF_INCLUDE_CAPI_CEF_PRINT_SETTINGS_CAPI_H_ +#define CEF_INCLUDE_CAPI_CEF_PRINT_SETTINGS_CAPI_H_ +#pragma once + +#include "include/capi/cef_base_capi.h" + +#ifdef __cplusplus +extern "C" { +#endif + + +/// +// Structure representing print settings. +/// +typedef struct _cef_print_settings_t { + /// + // Base structure. + /// + cef_base_t base; + + /// + // Returns true (1) if this object is valid. Do not call any other functions + // if this function returns false (0). + /// + int (CEF_CALLBACK *is_valid)(struct _cef_print_settings_t* self); + + /// + // Returns true (1) if the values of this object are read-only. Some APIs may + // expose read-only objects. + /// + int (CEF_CALLBACK *is_read_only)(struct _cef_print_settings_t* self); + + /// + // Returns a writable copy of this object. + /// + struct _cef_print_settings_t* (CEF_CALLBACK *copy)( + struct _cef_print_settings_t* self); + + /// + // Set the page orientation. + /// + void (CEF_CALLBACK *set_orientation)(struct _cef_print_settings_t* self, + int landscape); + + /// + // Returns true (1) if the orientation is landscape. + /// + int (CEF_CALLBACK *is_landscape)(struct _cef_print_settings_t* self); + + /// + // Set the printer printable area in device units. Some platforms already + // provide flipped area. Set |landscape_needs_flip| to false (0) on those + // platforms to avoid double flipping. + /// + void (CEF_CALLBACK *set_printer_printable_area)( + struct _cef_print_settings_t* self, + const cef_size_t* physical_size_device_units, + const cef_rect_t* printable_area_device_units, + int landscape_needs_flip); + + /// + // Set the device name. + /// + void (CEF_CALLBACK *set_device_name)(struct _cef_print_settings_t* self, + const cef_string_t* name); + + /// + // Get the device name. + /// + // The resulting string must be freed by calling cef_string_userfree_free(). + cef_string_userfree_t (CEF_CALLBACK *get_device_name)( + struct _cef_print_settings_t* self); + + /// + // Set the DPI (dots per inch). + /// + void (CEF_CALLBACK *set_dpi)(struct _cef_print_settings_t* self, int dpi); + + /// + // Get the DPI (dots per inch). + /// + int (CEF_CALLBACK *get_dpi)(struct _cef_print_settings_t* self); + + /// + // Set the page ranges. + /// + void (CEF_CALLBACK *set_page_ranges)(struct _cef_print_settings_t* self, + size_t rangesCount, cef_page_range_t const* ranges); + + /// + // Returns the number of page ranges that currently exist. + /// + size_t (CEF_CALLBACK *get_page_ranges_count)( + struct _cef_print_settings_t* self); + + /// + // Retrieve the page ranges. + /// + void (CEF_CALLBACK *get_page_ranges)(struct _cef_print_settings_t* self, + size_t* rangesCount, cef_page_range_t* ranges); + + /// + // Set whether only the selection will be printed. + /// + void (CEF_CALLBACK *set_selection_only)(struct _cef_print_settings_t* self, + int selection_only); + + /// + // Returns true (1) if only the selection will be printed. + /// + int (CEF_CALLBACK *is_selection_only)(struct _cef_print_settings_t* self); + + /// + // Set whether pages will be collated. + /// + void (CEF_CALLBACK *set_collate)(struct _cef_print_settings_t* self, + int collate); + + /// + // Returns true (1) if pages will be collated. + /// + int (CEF_CALLBACK *will_collate)(struct _cef_print_settings_t* self); + + /// + // Set the color model. + /// + void (CEF_CALLBACK *set_color_model)(struct _cef_print_settings_t* self, + cef_color_model_t model); + + /// + // Get the color model. + /// + cef_color_model_t (CEF_CALLBACK *get_color_model)( + struct _cef_print_settings_t* self); + + /// + // Set the number of copies. + /// + void (CEF_CALLBACK *set_copies)(struct _cef_print_settings_t* self, + int copies); + + /// + // Get the number of copies. + /// + int (CEF_CALLBACK *get_copies)(struct _cef_print_settings_t* self); + + /// + // Set the duplex mode. + /// + void (CEF_CALLBACK *set_duplex_mode)(struct _cef_print_settings_t* self, + cef_duplex_mode_t mode); + + /// + // Get the duplex mode. + /// + cef_duplex_mode_t (CEF_CALLBACK *get_duplex_mode)( + struct _cef_print_settings_t* self); +} cef_print_settings_t; + + +/// +// Create a new cef_print_settings_t object. +/// +CEF_EXPORT cef_print_settings_t* cef_print_settings_create(); + + +#ifdef __cplusplus +} +#endif + +#endif // CEF_INCLUDE_CAPI_CEF_PRINT_SETTINGS_CAPI_H_ diff --git a/dependencies64/cef/include/capi/cef_process_message_capi.h b/dependencies64/cef/include/capi/cef_process_message_capi.h new file mode 100644 index 000000000..975450caf --- /dev/null +++ b/dependencies64/cef/include/capi/cef_process_message_capi.h @@ -0,0 +1,102 @@ +// Copyright (c) 2015 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool and should not edited +// by hand. See the translator.README.txt file in the tools directory for +// more information. +// + +#ifndef CEF_INCLUDE_CAPI_CEF_PROCESS_MESSAGE_CAPI_H_ +#define CEF_INCLUDE_CAPI_CEF_PROCESS_MESSAGE_CAPI_H_ +#pragma once + +#include "include/capi/cef_base_capi.h" +#include "include/capi/cef_values_capi.h" + +#ifdef __cplusplus +extern "C" { +#endif + + +/// +// Structure representing a message. Can be used on any process and thread. +/// +typedef struct _cef_process_message_t { + /// + // Base structure. + /// + cef_base_t base; + + /// + // Returns true (1) if this object is valid. Do not call any other functions + // if this function returns false (0). + /// + int (CEF_CALLBACK *is_valid)(struct _cef_process_message_t* self); + + /// + // Returns true (1) if the values of this object are read-only. Some APIs may + // expose read-only objects. + /// + int (CEF_CALLBACK *is_read_only)(struct _cef_process_message_t* self); + + /// + // Returns a writable copy of this object. + /// + struct _cef_process_message_t* (CEF_CALLBACK *copy)( + struct _cef_process_message_t* self); + + /// + // Returns the message name. + /// + // The resulting string must be freed by calling cef_string_userfree_free(). + cef_string_userfree_t (CEF_CALLBACK *get_name)( + struct _cef_process_message_t* self); + + /// + // Returns the list of arguments. + /// + struct _cef_list_value_t* (CEF_CALLBACK *get_argument_list)( + struct _cef_process_message_t* self); +} cef_process_message_t; + + +/// +// Create a new cef_process_message_t object with the specified name. +/// +CEF_EXPORT cef_process_message_t* cef_process_message_create( + const cef_string_t* name); + + +#ifdef __cplusplus +} +#endif + +#endif // CEF_INCLUDE_CAPI_CEF_PROCESS_MESSAGE_CAPI_H_ diff --git a/dependencies64/cef/include/capi/cef_process_util_capi.h b/dependencies64/cef/include/capi/cef_process_util_capi.h new file mode 100644 index 000000000..f5061009e --- /dev/null +++ b/dependencies64/cef/include/capi/cef_process_util_capi.h @@ -0,0 +1,64 @@ +// Copyright (c) 2015 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool and should not edited +// by hand. See the translator.README.txt file in the tools directory for +// more information. +// + +#ifndef CEF_INCLUDE_CAPI_CEF_PROCESS_UTIL_CAPI_H_ +#define CEF_INCLUDE_CAPI_CEF_PROCESS_UTIL_CAPI_H_ +#pragma once + +#include "include/capi/cef_base_capi.h" + +#ifdef __cplusplus +extern "C" { +#endif + + +/// +// Launches the process specified via |command_line|. Returns true (1) upon +// success. Must be called on the browser process TID_PROCESS_LAUNCHER thread. +// +// Unix-specific notes: - All file descriptors open in the parent process will +// be closed in the +// child process except for stdin, stdout, and stderr. +// - If the first argument on the command line does not contain a slash, +// PATH will be searched. (See man execvp.) +/// +CEF_EXPORT int cef_launch_process(struct _cef_command_line_t* command_line); + +#ifdef __cplusplus +} +#endif + +#endif // CEF_INCLUDE_CAPI_CEF_PROCESS_UTIL_CAPI_H_ diff --git a/dependencies64/cef/include/capi/cef_render_handler_capi.h b/dependencies64/cef/include/capi/cef_render_handler_capi.h new file mode 100644 index 000000000..bf1a2921a --- /dev/null +++ b/dependencies64/cef/include/capi/cef_render_handler_capi.h @@ -0,0 +1,171 @@ +// Copyright (c) 2015 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool and should not edited +// by hand. See the translator.README.txt file in the tools directory for +// more information. +// + +#ifndef CEF_INCLUDE_CAPI_CEF_RENDER_HANDLER_CAPI_H_ +#define CEF_INCLUDE_CAPI_CEF_RENDER_HANDLER_CAPI_H_ +#pragma once + +#include "include/capi/cef_base_capi.h" +#include "include/capi/cef_browser_capi.h" +#include "include/capi/cef_drag_data_capi.h" + +#ifdef __cplusplus +extern "C" { +#endif + + +/// +// Implement this structure to handle events when window rendering is disabled. +// The functions of this structure will be called on the UI thread. +/// +typedef struct _cef_render_handler_t { + /// + // Base structure. + /// + cef_base_t base; + + /// + // Called to retrieve the root window rectangle in screen coordinates. Return + // true (1) if the rectangle was provided. + /// + int (CEF_CALLBACK *get_root_screen_rect)(struct _cef_render_handler_t* self, + struct _cef_browser_t* browser, cef_rect_t* rect); + + /// + // Called to retrieve the view rectangle which is relative to screen + // coordinates. Return true (1) if the rectangle was provided. + /// + int (CEF_CALLBACK *get_view_rect)(struct _cef_render_handler_t* self, + struct _cef_browser_t* browser, cef_rect_t* rect); + + /// + // Called to retrieve the translation from view coordinates to actual screen + // coordinates. Return true (1) if the screen coordinates were provided. + /// + int (CEF_CALLBACK *get_screen_point)(struct _cef_render_handler_t* self, + struct _cef_browser_t* browser, int viewX, int viewY, int* screenX, + int* screenY); + + /// + // Called to allow the client to fill in the CefScreenInfo object with + // appropriate values. Return true (1) if the |screen_info| structure has been + // modified. + // + // If the screen info rectangle is left NULL the rectangle from GetViewRect + // will be used. If the rectangle is still NULL or invalid popups may not be + // drawn correctly. + /// + int (CEF_CALLBACK *get_screen_info)(struct _cef_render_handler_t* self, + struct _cef_browser_t* browser, struct _cef_screen_info_t* screen_info); + + /// + // Called when the browser wants to show or hide the popup widget. The popup + // should be shown if |show| is true (1) and hidden if |show| is false (0). + /// + void (CEF_CALLBACK *on_popup_show)(struct _cef_render_handler_t* self, + struct _cef_browser_t* browser, int show); + + /// + // Called when the browser wants to move or resize the popup widget. |rect| + // contains the new location and size in view coordinates. + /// + void (CEF_CALLBACK *on_popup_size)(struct _cef_render_handler_t* self, + struct _cef_browser_t* browser, const cef_rect_t* rect); + + /// + // Called when an element should be painted. Pixel values passed to this + // function are scaled relative to view coordinates based on the value of + // CefScreenInfo.device_scale_factor returned from GetScreenInfo. |type| + // indicates whether the element is the view or the popup widget. |buffer| + // contains the pixel data for the whole image. |dirtyRects| contains the set + // of rectangles in pixel coordinates that need to be repainted. |buffer| will + // be |width|*|height|*4 bytes in size and represents a BGRA image with an + // upper-left origin. + /// + void (CEF_CALLBACK *on_paint)(struct _cef_render_handler_t* self, + struct _cef_browser_t* browser, cef_paint_element_type_t type, + size_t dirtyRectsCount, cef_rect_t const* dirtyRects, const void* buffer, + int width, int height); + + /// + // Called when the browser's cursor has changed. If |type| is CT_CUSTOM then + // |custom_cursor_info| will be populated with the custom cursor information. + /// + void (CEF_CALLBACK *on_cursor_change)(struct _cef_render_handler_t* self, + struct _cef_browser_t* browser, cef_cursor_handle_t cursor, + cef_cursor_type_t type, + const struct _cef_cursor_info_t* custom_cursor_info); + + /// + // Called when the user starts dragging content in the web view. Contextual + // information about the dragged content is supplied by |drag_data|. (|x|, + // |y|) is the drag start location in screen coordinates. OS APIs that run a + // system message loop may be used within the StartDragging call. + // + // Return false (0) to abort the drag operation. Don't call any of + // cef_browser_host_t::DragSource*Ended* functions after returning false (0). + // + // Return true (1) to handle the drag operation. Call + // cef_browser_host_t::DragSourceEndedAt and DragSourceSystemDragEnded either + // synchronously or asynchronously to inform the web view that the drag + // operation has ended. + /// + int (CEF_CALLBACK *start_dragging)(struct _cef_render_handler_t* self, + struct _cef_browser_t* browser, struct _cef_drag_data_t* drag_data, + cef_drag_operations_mask_t allowed_ops, int x, int y); + + /// + // Called when the web view wants to update the mouse cursor during a drag & + // drop operation. |operation| describes the allowed operation (none, move, + // copy, link). + /// + void (CEF_CALLBACK *update_drag_cursor)(struct _cef_render_handler_t* self, + struct _cef_browser_t* browser, cef_drag_operations_mask_t operation); + + /// + // Called when the scroll offset has changed. + /// + void (CEF_CALLBACK *on_scroll_offset_changed)( + struct _cef_render_handler_t* self, struct _cef_browser_t* browser, + double x, double y); +} cef_render_handler_t; + + +#ifdef __cplusplus +} +#endif + +#endif // CEF_INCLUDE_CAPI_CEF_RENDER_HANDLER_CAPI_H_ diff --git a/dependencies64/cef/include/capi/cef_render_process_handler_capi.h b/dependencies64/cef/include/capi/cef_render_process_handler_capi.h new file mode 100644 index 000000000..35f6c94cb --- /dev/null +++ b/dependencies64/cef/include/capi/cef_render_process_handler_capi.h @@ -0,0 +1,177 @@ +// Copyright (c) 2015 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool and should not edited +// by hand. See the translator.README.txt file in the tools directory for +// more information. +// + +#ifndef CEF_INCLUDE_CAPI_CEF_RENDER_PROCESS_HANDLER_CAPI_H_ +#define CEF_INCLUDE_CAPI_CEF_RENDER_PROCESS_HANDLER_CAPI_H_ +#pragma once + +#include "include/capi/cef_base_capi.h" +#include "include/capi/cef_browser_capi.h" +#include "include/capi/cef_dom_capi.h" +#include "include/capi/cef_frame_capi.h" +#include "include/capi/cef_load_handler_capi.h" +#include "include/capi/cef_process_message_capi.h" +#include "include/capi/cef_v8_capi.h" +#include "include/capi/cef_values_capi.h" + +#ifdef __cplusplus +extern "C" { +#endif + + +/// +// Structure used to implement render process callbacks. The functions of this +// structure will be called on the render process main thread (TID_RENDERER) +// unless otherwise indicated. +/// +typedef struct _cef_render_process_handler_t { + /// + // Base structure. + /// + cef_base_t base; + + /// + // Called after the render process main thread has been created. |extra_info| + // is a read-only value originating from + // cef_browser_process_handler_t::on_render_process_thread_created(). Do not + // keep a reference to |extra_info| outside of this function. + /// + void (CEF_CALLBACK *on_render_thread_created)( + struct _cef_render_process_handler_t* self, + struct _cef_list_value_t* extra_info); + + /// + // Called after WebKit has been initialized. + /// + void (CEF_CALLBACK *on_web_kit_initialized)( + struct _cef_render_process_handler_t* self); + + /// + // Called after a browser has been created. When browsing cross-origin a new + // browser will be created before the old browser with the same identifier is + // destroyed. + /// + void (CEF_CALLBACK *on_browser_created)( + struct _cef_render_process_handler_t* self, + struct _cef_browser_t* browser); + + /// + // Called before a browser is destroyed. + /// + void (CEF_CALLBACK *on_browser_destroyed)( + struct _cef_render_process_handler_t* self, + struct _cef_browser_t* browser); + + /// + // Return the handler for browser load status events. + /// + struct _cef_load_handler_t* (CEF_CALLBACK *get_load_handler)( + struct _cef_render_process_handler_t* self); + + /// + // Called before browser navigation. Return true (1) to cancel the navigation + // or false (0) to allow the navigation to proceed. The |request| object + // cannot be modified in this callback. + /// + int (CEF_CALLBACK *on_before_navigation)( + struct _cef_render_process_handler_t* self, + struct _cef_browser_t* browser, struct _cef_frame_t* frame, + struct _cef_request_t* request, cef_navigation_type_t navigation_type, + int is_redirect); + + /// + // Called immediately after the V8 context for a frame has been created. To + // retrieve the JavaScript 'window' object use the + // cef_v8context_t::get_global() function. V8 handles can only be accessed + // from the thread on which they are created. A task runner for posting tasks + // on the associated thread can be retrieved via the + // cef_v8context_t::get_task_runner() function. + /// + void (CEF_CALLBACK *on_context_created)( + struct _cef_render_process_handler_t* self, + struct _cef_browser_t* browser, struct _cef_frame_t* frame, + struct _cef_v8context_t* context); + + /// + // Called immediately before the V8 context for a frame is released. No + // references to the context should be kept after this function is called. + /// + void (CEF_CALLBACK *on_context_released)( + struct _cef_render_process_handler_t* self, + struct _cef_browser_t* browser, struct _cef_frame_t* frame, + struct _cef_v8context_t* context); + + /// + // Called for global uncaught exceptions in a frame. Execution of this + // callback is disabled by default. To enable set + // CefSettings.uncaught_exception_stack_size > 0. + /// + void (CEF_CALLBACK *on_uncaught_exception)( + struct _cef_render_process_handler_t* self, + struct _cef_browser_t* browser, struct _cef_frame_t* frame, + struct _cef_v8context_t* context, struct _cef_v8exception_t* exception, + struct _cef_v8stack_trace_t* stackTrace); + + /// + // Called when a new node in the the browser gets focus. The |node| value may + // be NULL if no specific node has gained focus. The node object passed to + // this function represents a snapshot of the DOM at the time this function is + // executed. DOM objects are only valid for the scope of this function. Do not + // keep references to or attempt to access any DOM objects outside the scope + // of this function. + /// + void (CEF_CALLBACK *on_focused_node_changed)( + struct _cef_render_process_handler_t* self, + struct _cef_browser_t* browser, struct _cef_frame_t* frame, + struct _cef_domnode_t* node); + + /// + // Called when a new message is received from a different process. Return true + // (1) if the message was handled or false (0) otherwise. Do not keep a + // reference to or attempt to access the message outside of this callback. + /// + int (CEF_CALLBACK *on_process_message_received)( + struct _cef_render_process_handler_t* self, + struct _cef_browser_t* browser, cef_process_id_t source_process, + struct _cef_process_message_t* message); +} cef_render_process_handler_t; + + +#ifdef __cplusplus +} +#endif + +#endif // CEF_INCLUDE_CAPI_CEF_RENDER_PROCESS_HANDLER_CAPI_H_ diff --git a/dependencies64/cef/include/capi/cef_request_capi.h b/dependencies64/cef/include/capi/cef_request_capi.h new file mode 100644 index 000000000..a42c0fd7a --- /dev/null +++ b/dependencies64/cef/include/capi/cef_request_capi.h @@ -0,0 +1,300 @@ +// Copyright (c) 2015 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool and should not edited +// by hand. See the translator.README.txt file in the tools directory for +// more information. +// + +#ifndef CEF_INCLUDE_CAPI_CEF_REQUEST_CAPI_H_ +#define CEF_INCLUDE_CAPI_CEF_REQUEST_CAPI_H_ +#pragma once + +#include "include/capi/cef_base_capi.h" + +#ifdef __cplusplus +extern "C" { +#endif + +struct _cef_post_data_element_t; +struct _cef_post_data_t; + +/// +// Structure used to represent a web request. The functions of this structure +// may be called on any thread. +/// +typedef struct _cef_request_t { + /// + // Base structure. + /// + cef_base_t base; + + /// + // Returns true (1) if this object is read-only. + /// + int (CEF_CALLBACK *is_read_only)(struct _cef_request_t* self); + + /// + // Get the fully qualified URL. + /// + // The resulting string must be freed by calling cef_string_userfree_free(). + cef_string_userfree_t (CEF_CALLBACK *get_url)(struct _cef_request_t* self); + + /// + // Set the fully qualified URL. + /// + void (CEF_CALLBACK *set_url)(struct _cef_request_t* self, + const cef_string_t* url); + + /// + // Get the request function type. The value will default to POST if post data + // is provided and GET otherwise. + /// + // The resulting string must be freed by calling cef_string_userfree_free(). + cef_string_userfree_t (CEF_CALLBACK *get_method)(struct _cef_request_t* self); + + /// + // Set the request function type. + /// + void (CEF_CALLBACK *set_method)(struct _cef_request_t* self, + const cef_string_t* method); + + /// + // Get the post data. + /// + struct _cef_post_data_t* (CEF_CALLBACK *get_post_data)( + struct _cef_request_t* self); + + /// + // Set the post data. + /// + void (CEF_CALLBACK *set_post_data)(struct _cef_request_t* self, + struct _cef_post_data_t* postData); + + /// + // Get the header values. + /// + void (CEF_CALLBACK *get_header_map)(struct _cef_request_t* self, + cef_string_multimap_t headerMap); + + /// + // Set the header values. + /// + void (CEF_CALLBACK *set_header_map)(struct _cef_request_t* self, + cef_string_multimap_t headerMap); + + /// + // Set all values at one time. + /// + void (CEF_CALLBACK *set)(struct _cef_request_t* self, const cef_string_t* url, + const cef_string_t* method, struct _cef_post_data_t* postData, + cef_string_multimap_t headerMap); + + /// + // Get the flags used in combination with cef_urlrequest_t. See + // cef_urlrequest_flags_t for supported values. + /// + int (CEF_CALLBACK *get_flags)(struct _cef_request_t* self); + + /// + // Set the flags used in combination with cef_urlrequest_t. See + // cef_urlrequest_flags_t for supported values. + /// + void (CEF_CALLBACK *set_flags)(struct _cef_request_t* self, int flags); + + /// + // Set the URL to the first party for cookies used in combination with + // cef_urlrequest_t. + /// + // The resulting string must be freed by calling cef_string_userfree_free(). + cef_string_userfree_t (CEF_CALLBACK *get_first_party_for_cookies)( + struct _cef_request_t* self); + + /// + // Get the URL to the first party for cookies used in combination with + // cef_urlrequest_t. + /// + void (CEF_CALLBACK *set_first_party_for_cookies)(struct _cef_request_t* self, + const cef_string_t* url); + + /// + // Get the resource type for this request. Only available in the browser + // process. + /// + cef_resource_type_t (CEF_CALLBACK *get_resource_type)( + struct _cef_request_t* self); + + /// + // Get the transition type for this request. Only available in the browser + // process and only applies to requests that represent a main frame or sub- + // frame navigation. + /// + cef_transition_type_t (CEF_CALLBACK *get_transition_type)( + struct _cef_request_t* self); + + /// + // Returns the globally unique identifier for this request or 0 if not + // specified. Can be used by cef_request_tHandler implementations in the + // browser process to track a single request across multiple callbacks. + /// + uint64 (CEF_CALLBACK *get_identifier)(struct _cef_request_t* self); +} cef_request_t; + + +/// +// Create a new cef_request_t object. +/// +CEF_EXPORT cef_request_t* cef_request_create(); + + +/// +// Structure used to represent post data for a web request. The functions of +// this structure may be called on any thread. +/// +typedef struct _cef_post_data_t { + /// + // Base structure. + /// + cef_base_t base; + + /// + // Returns true (1) if this object is read-only. + /// + int (CEF_CALLBACK *is_read_only)(struct _cef_post_data_t* self); + + /// + // Returns the number of existing post data elements. + /// + size_t (CEF_CALLBACK *get_element_count)(struct _cef_post_data_t* self); + + /// + // Retrieve the post data elements. + /// + void (CEF_CALLBACK *get_elements)(struct _cef_post_data_t* self, + size_t* elementsCount, struct _cef_post_data_element_t** elements); + + /// + // Remove the specified post data element. Returns true (1) if the removal + // succeeds. + /// + int (CEF_CALLBACK *remove_element)(struct _cef_post_data_t* self, + struct _cef_post_data_element_t* element); + + /// + // Add the specified post data element. Returns true (1) if the add succeeds. + /// + int (CEF_CALLBACK *add_element)(struct _cef_post_data_t* self, + struct _cef_post_data_element_t* element); + + /// + // Remove all existing post data elements. + /// + void (CEF_CALLBACK *remove_elements)(struct _cef_post_data_t* self); +} cef_post_data_t; + + +/// +// Create a new cef_post_data_t object. +/// +CEF_EXPORT cef_post_data_t* cef_post_data_create(); + + +/// +// Structure used to represent a single element in the request post data. The +// functions of this structure may be called on any thread. +/// +typedef struct _cef_post_data_element_t { + /// + // Base structure. + /// + cef_base_t base; + + /// + // Returns true (1) if this object is read-only. + /// + int (CEF_CALLBACK *is_read_only)(struct _cef_post_data_element_t* self); + + /// + // Remove all contents from the post data element. + /// + void (CEF_CALLBACK *set_to_empty)(struct _cef_post_data_element_t* self); + + /// + // The post data element will represent a file. + /// + void (CEF_CALLBACK *set_to_file)(struct _cef_post_data_element_t* self, + const cef_string_t* fileName); + + /// + // The post data element will represent bytes. The bytes passed in will be + // copied. + /// + void (CEF_CALLBACK *set_to_bytes)(struct _cef_post_data_element_t* self, + size_t size, const void* bytes); + + /// + // Return the type of this post data element. + /// + cef_postdataelement_type_t (CEF_CALLBACK *get_type)( + struct _cef_post_data_element_t* self); + + /// + // Return the file name. + /// + // The resulting string must be freed by calling cef_string_userfree_free(). + cef_string_userfree_t (CEF_CALLBACK *get_file)( + struct _cef_post_data_element_t* self); + + /// + // Return the number of bytes. + /// + size_t (CEF_CALLBACK *get_bytes_count)(struct _cef_post_data_element_t* self); + + /// + // Read up to |size| bytes into |bytes| and return the number of bytes + // actually read. + /// + size_t (CEF_CALLBACK *get_bytes)(struct _cef_post_data_element_t* self, + size_t size, void* bytes); +} cef_post_data_element_t; + + +/// +// Create a new cef_post_data_element_t object. +/// +CEF_EXPORT cef_post_data_element_t* cef_post_data_element_create(); + + +#ifdef __cplusplus +} +#endif + +#endif // CEF_INCLUDE_CAPI_CEF_REQUEST_CAPI_H_ diff --git a/dependencies64/cef/include/capi/cef_request_context_capi.h b/dependencies64/cef/include/capi/cef_request_context_capi.h new file mode 100644 index 000000000..5c8d24d39 --- /dev/null +++ b/dependencies64/cef/include/capi/cef_request_context_capi.h @@ -0,0 +1,172 @@ +// Copyright (c) 2015 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool and should not edited +// by hand. See the translator.README.txt file in the tools directory for +// more information. +// + +#ifndef CEF_INCLUDE_CAPI_CEF_REQUEST_CONTEXT_CAPI_H_ +#define CEF_INCLUDE_CAPI_CEF_REQUEST_CONTEXT_CAPI_H_ +#pragma once + +#include "include/capi/cef_cookie_capi.h" +#include "include/capi/cef_request_context_handler_capi.h" + +#ifdef __cplusplus +extern "C" { +#endif + +struct _cef_scheme_handler_factory_t; + +/// +// A request context provides request handling for a set of related browser or +// URL request objects. A request context can be specified when creating a new +// browser via the cef_browser_host_t static factory functions or when creating +// a new URL request via the cef_urlrequest_t static factory functions. Browser +// objects with different request contexts will never be hosted in the same +// render process. Browser objects with the same request context may or may not +// be hosted in the same render process depending on the process model. Browser +// objects created indirectly via the JavaScript window.open function or +// targeted links will share the same render process and the same request +// context as the source browser. When running in single-process mode there is +// only a single render process (the main process) and so all browsers created +// in single-process mode will share the same request context. This will be the +// first request context passed into a cef_browser_host_t static factory +// function and all other request context objects will be ignored. +/// +typedef struct _cef_request_context_t { + /// + // Base structure. + /// + cef_base_t base; + + /// + // Returns true (1) if this object is pointing to the same context as |that| + // object. + /// + int (CEF_CALLBACK *is_same)(struct _cef_request_context_t* self, + struct _cef_request_context_t* other); + + /// + // Returns true (1) if this object is sharing the same storage as |that| + // object. + /// + int (CEF_CALLBACK *is_sharing_with)(struct _cef_request_context_t* self, + struct _cef_request_context_t* other); + + /// + // Returns true (1) if this object is the global context. The global context + // is used by default when creating a browser or URL request with a NULL + // context argument. + /// + int (CEF_CALLBACK *is_global)(struct _cef_request_context_t* self); + + /// + // Returns the handler for this context if any. + /// + struct _cef_request_context_handler_t* (CEF_CALLBACK *get_handler)( + struct _cef_request_context_t* self); + + /// + // Returns the cache path for this object. If NULL an "incognito mode" in- + // memory cache is being used. + /// + // The resulting string must be freed by calling cef_string_userfree_free(). + cef_string_userfree_t (CEF_CALLBACK *get_cache_path)( + struct _cef_request_context_t* self); + + /// + // Returns the default cookie manager for this object. This will be the global + // cookie manager if this object is the global request context. Otherwise, + // this will be the default cookie manager used when this request context does + // not receive a value via cef_request_tContextHandler::get_cookie_manager(). + // If |callback| is non-NULL it will be executed asnychronously on the IO + // thread after the manager's storage has been initialized. + /// + struct _cef_cookie_manager_t* (CEF_CALLBACK *get_default_cookie_manager)( + struct _cef_request_context_t* self, + struct _cef_completion_callback_t* callback); + + /// + // Register a scheme handler factory for the specified |scheme_name| and + // optional |domain_name|. An NULL |domain_name| value for a standard scheme + // will cause the factory to match all domain names. The |domain_name| value + // will be ignored for non-standard schemes. If |scheme_name| is a built-in + // scheme and no handler is returned by |factory| then the built-in scheme + // handler factory will be called. If |scheme_name| is a custom scheme then + // you must also implement the cef_app_t::on_register_custom_schemes() + // function in all processes. This function may be called multiple times to + // change or remove the factory that matches the specified |scheme_name| and + // optional |domain_name|. Returns false (0) if an error occurs. This function + // may be called on any thread in the browser process. + /// + int (CEF_CALLBACK *register_scheme_handler_factory)( + struct _cef_request_context_t* self, const cef_string_t* scheme_name, + const cef_string_t* domain_name, + struct _cef_scheme_handler_factory_t* factory); + + /// + // Clear all registered scheme handler factories. Returns false (0) on error. + // This function may be called on any thread in the browser process. + /// + int (CEF_CALLBACK *clear_scheme_handler_factories)( + struct _cef_request_context_t* self); +} cef_request_context_t; + + +/// +// Returns the global context object. +/// +CEF_EXPORT cef_request_context_t* cef_request_context_get_global_context(); + +/// +// Creates a new context object with the specified |settings| and optional +// |handler|. +/// +CEF_EXPORT cef_request_context_t* cef_request_context_create_context( + const struct _cef_request_context_settings_t* settings, + struct _cef_request_context_handler_t* handler); + +/// +// Creates a new context object that shares storage with |other| and uses an +// optional |handler|. +/// +CEF_EXPORT cef_request_context_t* create_context_shared( + cef_request_context_t* other, + struct _cef_request_context_handler_t* handler); + + +#ifdef __cplusplus +} +#endif + +#endif // CEF_INCLUDE_CAPI_CEF_REQUEST_CONTEXT_CAPI_H_ diff --git a/dependencies64/cef/include/capi/cef_request_context_handler_capi.h b/dependencies64/cef/include/capi/cef_request_context_handler_capi.h new file mode 100644 index 000000000..09716402c --- /dev/null +++ b/dependencies64/cef/include/capi/cef_request_context_handler_capi.h @@ -0,0 +1,74 @@ +// Copyright (c) 2015 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool and should not edited +// by hand. See the translator.README.txt file in the tools directory for +// more information. +// + +#ifndef CEF_INCLUDE_CAPI_CEF_REQUEST_CONTEXT_HANDLER_CAPI_H_ +#define CEF_INCLUDE_CAPI_CEF_REQUEST_CONTEXT_HANDLER_CAPI_H_ +#pragma once + +#include "include/capi/cef_base_capi.h" +#include "include/capi/cef_cookie_capi.h" + +#ifdef __cplusplus +extern "C" { +#endif + + +/// +// Implement this structure to provide handler implementations. The handler +// instance will not be released until all objects related to the context have +// been destroyed. +/// +typedef struct _cef_request_context_handler_t { + /// + // Base structure. + /// + cef_base_t base; + + /// + // Called on the IO thread to retrieve the cookie manager. If this function + // returns NULL the default cookie manager retrievable via + // cef_request_tContext::get_default_cookie_manager() will be used. + /// + struct _cef_cookie_manager_t* (CEF_CALLBACK *get_cookie_manager)( + struct _cef_request_context_handler_t* self); +} cef_request_context_handler_t; + + +#ifdef __cplusplus +} +#endif + +#endif // CEF_INCLUDE_CAPI_CEF_REQUEST_CONTEXT_HANDLER_CAPI_H_ diff --git a/dependencies64/cef/include/capi/cef_request_handler_capi.h b/dependencies64/cef/include/capi/cef_request_handler_capi.h new file mode 100644 index 000000000..45ff7718b --- /dev/null +++ b/dependencies64/cef/include/capi/cef_request_handler_capi.h @@ -0,0 +1,254 @@ +// Copyright (c) 2015 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool and should not edited +// by hand. See the translator.README.txt file in the tools directory for +// more information. +// + +#ifndef CEF_INCLUDE_CAPI_CEF_REQUEST_HANDLER_CAPI_H_ +#define CEF_INCLUDE_CAPI_CEF_REQUEST_HANDLER_CAPI_H_ +#pragma once + +#include "include/capi/cef_auth_callback_capi.h" +#include "include/capi/cef_base_capi.h" +#include "include/capi/cef_browser_capi.h" +#include "include/capi/cef_frame_capi.h" +#include "include/capi/cef_request_capi.h" +#include "include/capi/cef_resource_handler_capi.h" +#include "include/capi/cef_response_capi.h" +#include "include/capi/cef_ssl_info_capi.h" +#include "include/capi/cef_web_plugin_capi.h" + +#ifdef __cplusplus +extern "C" { +#endif + + +/// +// Callback structure used for asynchronous continuation of url requests. +/// +typedef struct _cef_request_callback_t { + /// + // Base structure. + /// + cef_base_t base; + + /// + // Continue the url request. If |allow| is true (1) the request will be + // continued. Otherwise, the request will be canceled. + /// + void (CEF_CALLBACK *cont)(struct _cef_request_callback_t* self, int allow); + + /// + // Cancel the url request. + /// + void (CEF_CALLBACK *cancel)(struct _cef_request_callback_t* self); +} cef_request_callback_t; + + +/// +// Implement this structure to handle events related to browser requests. The +// functions of this structure will be called on the thread indicated. +/// +typedef struct _cef_request_handler_t { + /// + // Base structure. + /// + cef_base_t base; + + /// + // Called on the UI thread before browser navigation. Return true (1) to + // cancel the navigation or false (0) to allow the navigation to proceed. The + // |request| object cannot be modified in this callback. + // cef_load_handler_t::OnLoadingStateChange will be called twice in all cases. + // If the navigation is allowed cef_load_handler_t::OnLoadStart and + // cef_load_handler_t::OnLoadEnd will be called. If the navigation is canceled + // cef_load_handler_t::OnLoadError will be called with an |errorCode| value of + // ERR_ABORTED. + /// + int (CEF_CALLBACK *on_before_browse)(struct _cef_request_handler_t* self, + struct _cef_browser_t* browser, struct _cef_frame_t* frame, + struct _cef_request_t* request, int is_redirect); + + /// + // Called on the UI thread before OnBeforeBrowse in certain limited cases + // where navigating a new or different browser might be desirable. This + // includes user-initiated navigation that might open in a special way (e.g. + // links clicked via middle-click or ctrl + left-click) and certain types of + // cross-origin navigation initiated from the renderer process (e.g. + // navigating the top-level frame to/from a file URL). The |browser| and + // |frame| values represent the source of the navigation. The + // |target_disposition| value indicates where the user intended to navigate + // the browser based on standard Chromium behaviors (e.g. current tab, new + // tab, etc). The |user_gesture| value will be true (1) if the browser + // navigated via explicit user gesture (e.g. clicking a link) or false (0) if + // it navigated automatically (e.g. via the DomContentLoaded event). Return + // true (1) to cancel the navigation or false (0) to allow the navigation to + // proceed in the source browser's top-level frame. + /// + int (CEF_CALLBACK *on_open_urlfrom_tab)(struct _cef_request_handler_t* self, + struct _cef_browser_t* browser, struct _cef_frame_t* frame, + const cef_string_t* target_url, + cef_window_open_disposition_t target_disposition, int user_gesture); + + /// + // Called on the IO thread before a resource request is loaded. The |request| + // object may be modified. Return RV_CONTINUE to continue the request + // immediately. Return RV_CONTINUE_ASYNC and call cef_request_tCallback:: + // cont() at a later time to continue or cancel the request asynchronously. + // Return RV_CANCEL to cancel the request immediately. + // + /// + cef_return_value_t (CEF_CALLBACK *on_before_resource_load)( + struct _cef_request_handler_t* self, struct _cef_browser_t* browser, + struct _cef_frame_t* frame, struct _cef_request_t* request, + struct _cef_request_callback_t* callback); + + /// + // Called on the IO thread before a resource is loaded. To allow the resource + // to load normally return NULL. To specify a handler for the resource return + // a cef_resource_handler_t object. The |request| object should not be + // modified in this callback. + /// + struct _cef_resource_handler_t* (CEF_CALLBACK *get_resource_handler)( + struct _cef_request_handler_t* self, struct _cef_browser_t* browser, + struct _cef_frame_t* frame, struct _cef_request_t* request); + + /// + // Called on the IO thread when a resource load is redirected. The |request| + // parameter will contain the old URL and other request-related information. + // The |new_url| parameter will contain the new URL and can be changed if + // desired. The |request| object cannot be modified in this callback. + /// + void (CEF_CALLBACK *on_resource_redirect)(struct _cef_request_handler_t* self, + struct _cef_browser_t* browser, struct _cef_frame_t* frame, + struct _cef_request_t* request, cef_string_t* new_url); + + /// + // Called on the IO thread when a resource response is received. To allow the + // resource to load normally return false (0). To redirect or retry the + // resource modify |request| (url, headers or post body) and return true (1). + // The |response| object cannot be modified in this callback. + /// + int (CEF_CALLBACK *on_resource_response)(struct _cef_request_handler_t* self, + struct _cef_browser_t* browser, struct _cef_frame_t* frame, + struct _cef_request_t* request, struct _cef_response_t* response); + + /// + // Called on the IO thread when the browser needs credentials from the user. + // |isProxy| indicates whether the host is a proxy server. |host| contains the + // hostname and |port| contains the port number. Return true (1) to continue + // the request and call cef_auth_callback_t::cont() either in this function or + // at a later time when the authentication information is available. Return + // false (0) to cancel the request immediately. + /// + int (CEF_CALLBACK *get_auth_credentials)(struct _cef_request_handler_t* self, + struct _cef_browser_t* browser, struct _cef_frame_t* frame, int isProxy, + const cef_string_t* host, int port, const cef_string_t* realm, + const cef_string_t* scheme, struct _cef_auth_callback_t* callback); + + /// + // Called on the IO thread when JavaScript requests a specific storage quota + // size via the webkitStorageInfo.requestQuota function. |origin_url| is the + // origin of the page making the request. |new_size| is the requested quota + // size in bytes. Return true (1) to continue the request and call + // cef_request_tCallback::cont() either in this function or at a later time to + // grant or deny the request. Return false (0) to cancel the request + // immediately. + /// + int (CEF_CALLBACK *on_quota_request)(struct _cef_request_handler_t* self, + struct _cef_browser_t* browser, const cef_string_t* origin_url, + int64 new_size, struct _cef_request_callback_t* callback); + + /// + // Called on the UI thread to handle requests for URLs with an unknown + // protocol component. Set |allow_os_execution| to true (1) to attempt + // execution via the registered OS protocol handler, if any. SECURITY WARNING: + // YOU SHOULD USE THIS METHOD TO ENFORCE RESTRICTIONS BASED ON SCHEME, HOST OR + // OTHER URL ANALYSIS BEFORE ALLOWING OS EXECUTION. + /// + void (CEF_CALLBACK *on_protocol_execution)( + struct _cef_request_handler_t* self, struct _cef_browser_t* browser, + const cef_string_t* url, int* allow_os_execution); + + /// + // Called on the UI thread to handle requests for URLs with an invalid SSL + // certificate. Return true (1) and call cef_request_tCallback::cont() either + // in this function or at a later time to continue or cancel the request. + // Return false (0) to cancel the request immediately. If |callback| is NULL + // the error cannot be recovered from and the request will be canceled + // automatically. If CefSettings.ignore_certificate_errors is set all invalid + // certificates will be accepted without calling this function. + /// + int (CEF_CALLBACK *on_certificate_error)(struct _cef_request_handler_t* self, + struct _cef_browser_t* browser, cef_errorcode_t cert_error, + const cef_string_t* request_url, struct _cef_sslinfo_t* ssl_info, + struct _cef_request_callback_t* callback); + + /// + // Called on the browser process IO thread before a plugin is loaded. Return + // true (1) to block loading of the plugin. + /// + int (CEF_CALLBACK *on_before_plugin_load)(struct _cef_request_handler_t* self, + struct _cef_browser_t* browser, const cef_string_t* url, + const cef_string_t* policy_url, struct _cef_web_plugin_info_t* info); + + /// + // Called on the browser process UI thread when a plugin has crashed. + // |plugin_path| is the path of the plugin that crashed. + /// + void (CEF_CALLBACK *on_plugin_crashed)(struct _cef_request_handler_t* self, + struct _cef_browser_t* browser, const cef_string_t* plugin_path); + + /// + // Called on the browser process UI thread when the render view associated + // with |browser| is ready to receive/handle IPC messages in the render + // process. + /// + void (CEF_CALLBACK *on_render_view_ready)(struct _cef_request_handler_t* self, + struct _cef_browser_t* browser); + + /// + // Called on the browser process UI thread when the render process terminates + // unexpectedly. |status| indicates how the process terminated. + /// + void (CEF_CALLBACK *on_render_process_terminated)( + struct _cef_request_handler_t* self, struct _cef_browser_t* browser, + cef_termination_status_t status); +} cef_request_handler_t; + + +#ifdef __cplusplus +} +#endif + +#endif // CEF_INCLUDE_CAPI_CEF_REQUEST_HANDLER_CAPI_H_ diff --git a/dependencies64/cef/include/capi/cef_resource_bundle_handler_capi.h b/dependencies64/cef/include/capi/cef_resource_bundle_handler_capi.h new file mode 100644 index 000000000..b84adc47a --- /dev/null +++ b/dependencies64/cef/include/capi/cef_resource_bundle_handler_capi.h @@ -0,0 +1,86 @@ +// Copyright (c) 2015 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool and should not edited +// by hand. See the translator.README.txt file in the tools directory for +// more information. +// + +#ifndef CEF_INCLUDE_CAPI_CEF_RESOURCE_BUNDLE_HANDLER_CAPI_H_ +#define CEF_INCLUDE_CAPI_CEF_RESOURCE_BUNDLE_HANDLER_CAPI_H_ +#pragma once + +#include "include/capi/cef_base_capi.h" + +#ifdef __cplusplus +extern "C" { +#endif + + +/// +// Structure used to implement a custom resource bundle structure. The functions +// of this structure may be called on multiple threads. +/// +typedef struct _cef_resource_bundle_handler_t { + /// + // Base structure. + /// + cef_base_t base; + + /// + // Called to retrieve a localized translation for the string specified by + // |message_id|. To provide the translation set |string| to the translation + // string and return true (1). To use the default translation return false + // (0). Supported message IDs are listed in cef_pack_strings.h. + /// + int (CEF_CALLBACK *get_localized_string)( + struct _cef_resource_bundle_handler_t* self, int message_id, + cef_string_t* string); + + /// + // Called to retrieve data for the resource specified by |resource_id|. To + // provide the resource data set |data| and |data_size| to the data pointer + // and size respectively and return true (1). To use the default resource data + // return false (0). The resource data will not be copied and must remain + // resident in memory. Supported resource IDs are listed in + // cef_pack_resources.h. + /// + int (CEF_CALLBACK *get_data_resource)( + struct _cef_resource_bundle_handler_t* self, int resource_id, void** data, + size_t* data_size); +} cef_resource_bundle_handler_t; + + +#ifdef __cplusplus +} +#endif + +#endif // CEF_INCLUDE_CAPI_CEF_RESOURCE_BUNDLE_HANDLER_CAPI_H_ diff --git a/dependencies64/cef/include/capi/cef_resource_handler_capi.h b/dependencies64/cef/include/capi/cef_resource_handler_capi.h new file mode 100644 index 000000000..cf3bae9f4 --- /dev/null +++ b/dependencies64/cef/include/capi/cef_resource_handler_capi.h @@ -0,0 +1,124 @@ +// Copyright (c) 2015 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool and should not edited +// by hand. See the translator.README.txt file in the tools directory for +// more information. +// + +#ifndef CEF_INCLUDE_CAPI_CEF_RESOURCE_HANDLER_CAPI_H_ +#define CEF_INCLUDE_CAPI_CEF_RESOURCE_HANDLER_CAPI_H_ +#pragma once + +#include "include/capi/cef_base_capi.h" +#include "include/capi/cef_browser_capi.h" +#include "include/capi/cef_callback_capi.h" +#include "include/capi/cef_cookie_capi.h" +#include "include/capi/cef_request_capi.h" +#include "include/capi/cef_response_capi.h" + +#ifdef __cplusplus +extern "C" { +#endif + + +/// +// Structure used to implement a custom request handler structure. The functions +// of this structure will always be called on the IO thread. +/// +typedef struct _cef_resource_handler_t { + /// + // Base structure. + /// + cef_base_t base; + + /// + // Begin processing the request. To handle the request return true (1) and + // call cef_callback_t::cont() once the response header information is + // available (cef_callback_t::cont() can also be called from inside this + // function if header information is available immediately). To cancel the + // request return false (0). + /// + int (CEF_CALLBACK *process_request)(struct _cef_resource_handler_t* self, + struct _cef_request_t* request, struct _cef_callback_t* callback); + + /// + // Retrieve response header information. If the response length is not known + // set |response_length| to -1 and read_response() will be called until it + // returns false (0). If the response length is known set |response_length| to + // a positive value and read_response() will be called until it returns false + // (0) or the specified number of bytes have been read. Use the |response| + // object to set the mime type, http status code and other optional header + // values. To redirect the request to a new URL set |redirectUrl| to the new + // URL. + /// + void (CEF_CALLBACK *get_response_headers)( + struct _cef_resource_handler_t* self, struct _cef_response_t* response, + int64* response_length, cef_string_t* redirectUrl); + + /// + // Read response data. If data is available immediately copy up to + // |bytes_to_read| bytes into |data_out|, set |bytes_read| to the number of + // bytes copied, and return true (1). To read the data at a later time set + // |bytes_read| to 0, return true (1) and call cef_callback_t::cont() when the + // data is available. To indicate response completion return false (0). + /// + int (CEF_CALLBACK *read_response)(struct _cef_resource_handler_t* self, + void* data_out, int bytes_to_read, int* bytes_read, + struct _cef_callback_t* callback); + + /// + // Return true (1) if the specified cookie can be sent with the request or + // false (0) otherwise. If false (0) is returned for any cookie then no + // cookies will be sent with the request. + /// + int (CEF_CALLBACK *can_get_cookie)(struct _cef_resource_handler_t* self, + const struct _cef_cookie_t* cookie); + + /// + // Return true (1) if the specified cookie returned with the response can be + // set or false (0) otherwise. + /// + int (CEF_CALLBACK *can_set_cookie)(struct _cef_resource_handler_t* self, + const struct _cef_cookie_t* cookie); + + /// + // Request processing has been canceled. + /// + void (CEF_CALLBACK *cancel)(struct _cef_resource_handler_t* self); +} cef_resource_handler_t; + + +#ifdef __cplusplus +} +#endif + +#endif // CEF_INCLUDE_CAPI_CEF_RESOURCE_HANDLER_CAPI_H_ diff --git a/dependencies64/cef/include/capi/cef_response_capi.h b/dependencies64/cef/include/capi/cef_response_capi.h new file mode 100644 index 000000000..d48a2d18e --- /dev/null +++ b/dependencies64/cef/include/capi/cef_response_capi.h @@ -0,0 +1,130 @@ +// Copyright (c) 2015 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool and should not edited +// by hand. See the translator.README.txt file in the tools directory for +// more information. +// + +#ifndef CEF_INCLUDE_CAPI_CEF_RESPONSE_CAPI_H_ +#define CEF_INCLUDE_CAPI_CEF_RESPONSE_CAPI_H_ +#pragma once + +#include "include/capi/cef_base_capi.h" + +#ifdef __cplusplus +extern "C" { +#endif + + +/// +// Structure used to represent a web response. The functions of this structure +// may be called on any thread. +/// +typedef struct _cef_response_t { + /// + // Base structure. + /// + cef_base_t base; + + /// + // Returns true (1) if this object is read-only. + /// + int (CEF_CALLBACK *is_read_only)(struct _cef_response_t* self); + + /// + // Get the response status code. + /// + int (CEF_CALLBACK *get_status)(struct _cef_response_t* self); + + /// + // Set the response status code. + /// + void (CEF_CALLBACK *set_status)(struct _cef_response_t* self, int status); + + /// + // Get the response status text. + /// + // The resulting string must be freed by calling cef_string_userfree_free(). + cef_string_userfree_t (CEF_CALLBACK *get_status_text)( + struct _cef_response_t* self); + + /// + // Set the response status text. + /// + void (CEF_CALLBACK *set_status_text)(struct _cef_response_t* self, + const cef_string_t* statusText); + + /// + // Get the response mime type. + /// + // The resulting string must be freed by calling cef_string_userfree_free(). + cef_string_userfree_t (CEF_CALLBACK *get_mime_type)( + struct _cef_response_t* self); + + /// + // Set the response mime type. + /// + void (CEF_CALLBACK *set_mime_type)(struct _cef_response_t* self, + const cef_string_t* mimeType); + + /// + // Get the value for the specified response header field. + /// + // The resulting string must be freed by calling cef_string_userfree_free(). + cef_string_userfree_t (CEF_CALLBACK *get_header)(struct _cef_response_t* self, + const cef_string_t* name); + + /// + // Get all response header fields. + /// + void (CEF_CALLBACK *get_header_map)(struct _cef_response_t* self, + cef_string_multimap_t headerMap); + + /// + // Set all response header fields. + /// + void (CEF_CALLBACK *set_header_map)(struct _cef_response_t* self, + cef_string_multimap_t headerMap); +} cef_response_t; + + +/// +// Create a new cef_response_t object. +/// +CEF_EXPORT cef_response_t* cef_response_create(); + + +#ifdef __cplusplus +} +#endif + +#endif // CEF_INCLUDE_CAPI_CEF_RESPONSE_CAPI_H_ diff --git a/dependencies64/cef/include/capi/cef_scheme_capi.h b/dependencies64/cef/include/capi/cef_scheme_capi.h new file mode 100644 index 000000000..7fb15da20 --- /dev/null +++ b/dependencies64/cef/include/capi/cef_scheme_capi.h @@ -0,0 +1,173 @@ +// Copyright (c) 2015 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool and should not edited +// by hand. See the translator.README.txt file in the tools directory for +// more information. +// + +#ifndef CEF_INCLUDE_CAPI_CEF_SCHEME_CAPI_H_ +#define CEF_INCLUDE_CAPI_CEF_SCHEME_CAPI_H_ +#pragma once + +#include "include/capi/cef_base_capi.h" +#include "include/capi/cef_browser_capi.h" +#include "include/capi/cef_frame_capi.h" +#include "include/capi/cef_request_capi.h" +#include "include/capi/cef_resource_handler_capi.h" +#include "include/capi/cef_response_capi.h" + +#ifdef __cplusplus +extern "C" { +#endif + +struct _cef_scheme_handler_factory_t; + +/// +// Structure that manages custom scheme registrations. +/// +typedef struct _cef_scheme_registrar_t { + /// + // Base structure. + /// + cef_base_t base; + + /// + // Register a custom scheme. This function should not be called for the built- + // in HTTP, HTTPS, FILE, FTP, ABOUT and DATA schemes. + // + // If |is_standard| is true (1) the scheme will be treated as a standard + // scheme. Standard schemes are subject to URL canonicalization and parsing + // rules as defined in the Common Internet Scheme Syntax RFC 1738 Section 3.1 + // available at http://www.ietf.org/rfc/rfc1738.txt + // + // In particular, the syntax for standard scheme URLs must be of the form: + //
+  //  [scheme]://[username]:[password]@[host]:[port]/[url-path]
+  // 
Standard scheme URLs must have a host component that is a fully + // qualified domain name as defined in Section 3.5 of RFC 1034 [13] and + // Section 2.1 of RFC 1123. These URLs will be canonicalized to + // "scheme://host/path" in the simplest case and + // "scheme://username:password@host:port/path" in the most explicit case. For + // example, "scheme:host/path" and "scheme:///host/path" will both be + // canonicalized to "scheme://host/path". The origin of a standard scheme URL + // is the combination of scheme, host and port (i.e., "scheme://host:port" in + // the most explicit case). + // + // For non-standard scheme URLs only the "scheme:" component is parsed and + // canonicalized. The remainder of the URL will be passed to the handler as- + // is. For example, "scheme:///some%20text" will remain the same. Non-standard + // scheme URLs cannot be used as a target for form submission. + // + // If |is_local| is true (1) the scheme will be treated as local (i.e., with + // the same security rules as those applied to "file" URLs). Normal pages + // cannot link to or access local URLs. Also, by default, local URLs can only + // perform XMLHttpRequest calls to the same URL (origin + path) that + // originated the request. To allow XMLHttpRequest calls from a local URL to + // other URLs with the same origin set the + // CefSettings.file_access_from_file_urls_allowed value to true (1). To allow + // XMLHttpRequest calls from a local URL to all origins set the + // CefSettings.universal_access_from_file_urls_allowed value to true (1). + // + // If |is_display_isolated| is true (1) the scheme will be treated as display- + // isolated. This means that pages cannot display these URLs unless they are + // from the same scheme. For example, pages in another origin cannot create + // iframes or hyperlinks to URLs with this scheme. + // + // This function may be called on any thread. It should only be called once + // per unique |scheme_name| value. If |scheme_name| is already registered or + // if an error occurs this function will return false (0). + /// + int (CEF_CALLBACK *add_custom_scheme)(struct _cef_scheme_registrar_t* self, + const cef_string_t* scheme_name, int is_standard, int is_local, + int is_display_isolated); +} cef_scheme_registrar_t; + + +/// +// Structure that creates cef_resource_handler_t instances for handling scheme +// requests. The functions of this structure will always be called on the IO +// thread. +/// +typedef struct _cef_scheme_handler_factory_t { + /// + // Base structure. + /// + cef_base_t base; + + /// + // Return a new resource handler instance to handle the request or an NULL + // reference to allow default handling of the request. |browser| and |frame| + // will be the browser window and frame respectively that originated the + // request or NULL if the request did not originate from a browser window (for + // example, if the request came from cef_urlrequest_t). The |request| object + // passed to this function will not contain cookie data. + /// + struct _cef_resource_handler_t* (CEF_CALLBACK *create)( + struct _cef_scheme_handler_factory_t* self, + struct _cef_browser_t* browser, struct _cef_frame_t* frame, + const cef_string_t* scheme_name, struct _cef_request_t* request); +} cef_scheme_handler_factory_t; + + +/// +// Register a scheme handler factory with the global request context. An NULL +// |domain_name| value for a standard scheme will cause the factory to match all +// domain names. The |domain_name| value will be ignored for non-standard +// schemes. If |scheme_name| is a built-in scheme and no handler is returned by +// |factory| then the built-in scheme handler factory will be called. If +// |scheme_name| is a custom scheme then you must also implement the +// cef_app_t::on_register_custom_schemes() function in all processes. This +// function may be called multiple times to change or remove the factory that +// matches the specified |scheme_name| and optional |domain_name|. Returns false +// (0) if an error occurs. This function may be called on any thread in the +// browser process. Using this function is equivalent to calling cef_request_tCo +// ntext::cef_request_context_get_global_context()->register_scheme_handler_fact +// ory(). +/// +CEF_EXPORT int cef_register_scheme_handler_factory( + const cef_string_t* scheme_name, const cef_string_t* domain_name, + cef_scheme_handler_factory_t* factory); + +/// +// Clear all scheme handler factories registered with the global request +// context. Returns false (0) on error. This function may be called on any +// thread in the browser process. Using this function is equivalent to calling c +// ef_request_tContext::cef_request_context_get_global_context()->clear_scheme_h +// andler_factories(). +/// +CEF_EXPORT int cef_clear_scheme_handler_factories(); + +#ifdef __cplusplus +} +#endif + +#endif // CEF_INCLUDE_CAPI_CEF_SCHEME_CAPI_H_ diff --git a/dependencies64/cef/include/capi/cef_ssl_info_capi.h b/dependencies64/cef/include/capi/cef_ssl_info_capi.h new file mode 100644 index 000000000..dd0e6a9ff --- /dev/null +++ b/dependencies64/cef/include/capi/cef_ssl_info_capi.h @@ -0,0 +1,180 @@ +// Copyright (c) 2015 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool and should not edited +// by hand. See the translator.README.txt file in the tools directory for +// more information. +// + +#ifndef CEF_INCLUDE_CAPI_CEF_SSL_INFO_CAPI_H_ +#define CEF_INCLUDE_CAPI_CEF_SSL_INFO_CAPI_H_ +#pragma once + +#include "include/capi/cef_base_capi.h" +#include "include/capi/cef_values_capi.h" + +#ifdef __cplusplus +extern "C" { +#endif + + +/// +// Structure representing the issuer or subject field of an X.509 certificate. +/// +typedef struct _cef_sslcert_principal_t { + /// + // Base structure. + /// + cef_base_t base; + + /// + // Returns a name that can be used to represent the issuer. It tries in this + // order: CN, O and OU and returns the first non-NULL one found. + /// + // The resulting string must be freed by calling cef_string_userfree_free(). + cef_string_userfree_t (CEF_CALLBACK *get_display_name)( + struct _cef_sslcert_principal_t* self); + + /// + // Returns the common name. + /// + // The resulting string must be freed by calling cef_string_userfree_free(). + cef_string_userfree_t (CEF_CALLBACK *get_common_name)( + struct _cef_sslcert_principal_t* self); + + /// + // Returns the locality name. + /// + // The resulting string must be freed by calling cef_string_userfree_free(). + cef_string_userfree_t (CEF_CALLBACK *get_locality_name)( + struct _cef_sslcert_principal_t* self); + + /// + // Returns the state or province name. + /// + // The resulting string must be freed by calling cef_string_userfree_free(). + cef_string_userfree_t (CEF_CALLBACK *get_state_or_province_name)( + struct _cef_sslcert_principal_t* self); + + /// + // Returns the country name. + /// + // The resulting string must be freed by calling cef_string_userfree_free(). + cef_string_userfree_t (CEF_CALLBACK *get_country_name)( + struct _cef_sslcert_principal_t* self); + + /// + // Retrieve the list of street addresses. + /// + void (CEF_CALLBACK *get_street_addresses)( + struct _cef_sslcert_principal_t* self, cef_string_list_t addresses); + + /// + // Retrieve the list of organization names. + /// + void (CEF_CALLBACK *get_organization_names)( + struct _cef_sslcert_principal_t* self, cef_string_list_t names); + + /// + // Retrieve the list of organization unit names. + /// + void (CEF_CALLBACK *get_organization_unit_names)( + struct _cef_sslcert_principal_t* self, cef_string_list_t names); + + /// + // Retrieve the list of domain components. + /// + void (CEF_CALLBACK *get_domain_components)( + struct _cef_sslcert_principal_t* self, cef_string_list_t components); +} cef_sslcert_principal_t; + + +/// +// Structure representing SSL information. +/// +typedef struct _cef_sslinfo_t { + /// + // Base structure. + /// + cef_base_t base; + + /// + // Returns the subject of the X.509 certificate. For HTTPS server certificates + // this represents the web server. The common name of the subject should + // match the host name of the web server. + /// + struct _cef_sslcert_principal_t* (CEF_CALLBACK *get_subject)( + struct _cef_sslinfo_t* self); + + /// + // Returns the issuer of the X.509 certificate. + /// + struct _cef_sslcert_principal_t* (CEF_CALLBACK *get_issuer)( + struct _cef_sslinfo_t* self); + + /// + // Returns the DER encoded serial number for the X.509 certificate. The value + // possibly includes a leading 00 byte. + /// + struct _cef_binary_value_t* (CEF_CALLBACK *get_serial_number)( + struct _cef_sslinfo_t* self); + + /// + // Returns the date before which the X.509 certificate is invalid. + // CefTime.GetTimeT() will return 0 if no date was specified. + /// + cef_time_t (CEF_CALLBACK *get_valid_start)(struct _cef_sslinfo_t* self); + + /// + // Returns the date after which the X.509 certificate is invalid. + // CefTime.GetTimeT() will return 0 if no date was specified. + /// + cef_time_t (CEF_CALLBACK *get_valid_expiry)(struct _cef_sslinfo_t* self); + + /// + // Returns the DER encoded data for the X.509 certificate. + /// + struct _cef_binary_value_t* (CEF_CALLBACK *get_derencoded)( + struct _cef_sslinfo_t* self); + + /// + // Returns the PEM encoded data for the X.509 certificate. + /// + struct _cef_binary_value_t* (CEF_CALLBACK *get_pemencoded)( + struct _cef_sslinfo_t* self); +} cef_sslinfo_t; + + +#ifdef __cplusplus +} +#endif + +#endif // CEF_INCLUDE_CAPI_CEF_SSL_INFO_CAPI_H_ diff --git a/dependencies64/cef/include/capi/cef_stream_capi.h b/dependencies64/cef/include/capi/cef_stream_capi.h new file mode 100644 index 000000000..260dae8c3 --- /dev/null +++ b/dependencies64/cef/include/capi/cef_stream_capi.h @@ -0,0 +1,252 @@ +// Copyright (c) 2015 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool and should not edited +// by hand. See the translator.README.txt file in the tools directory for +// more information. +// + +#ifndef CEF_INCLUDE_CAPI_CEF_STREAM_CAPI_H_ +#define CEF_INCLUDE_CAPI_CEF_STREAM_CAPI_H_ +#pragma once + +#include "include/capi/cef_base_capi.h" + +#ifdef __cplusplus +extern "C" { +#endif + + +/// +// Structure the client can implement to provide a custom stream reader. The +// functions of this structure may be called on any thread. +/// +typedef struct _cef_read_handler_t { + /// + // Base structure. + /// + cef_base_t base; + + /// + // Read raw binary data. + /// + size_t (CEF_CALLBACK *read)(struct _cef_read_handler_t* self, void* ptr, + size_t size, size_t n); + + /// + // Seek to the specified offset position. |whence| may be any one of SEEK_CUR, + // SEEK_END or SEEK_SET. Return zero on success and non-zero on failure. + /// + int (CEF_CALLBACK *seek)(struct _cef_read_handler_t* self, int64 offset, + int whence); + + /// + // Return the current offset position. + /// + int64 (CEF_CALLBACK *tell)(struct _cef_read_handler_t* self); + + /// + // Return non-zero if at end of file. + /// + int (CEF_CALLBACK *eof)(struct _cef_read_handler_t* self); + + /// + // Return true (1) if this handler performs work like accessing the file + // system which may block. Used as a hint for determining the thread to access + // the handler from. + /// + int (CEF_CALLBACK *may_block)(struct _cef_read_handler_t* self); +} cef_read_handler_t; + + +/// +// Structure used to read data from a stream. The functions of this structure +// may be called on any thread. +/// +typedef struct _cef_stream_reader_t { + /// + // Base structure. + /// + cef_base_t base; + + /// + // Read raw binary data. + /// + size_t (CEF_CALLBACK *read)(struct _cef_stream_reader_t* self, void* ptr, + size_t size, size_t n); + + /// + // Seek to the specified offset position. |whence| may be any one of SEEK_CUR, + // SEEK_END or SEEK_SET. Returns zero on success and non-zero on failure. + /// + int (CEF_CALLBACK *seek)(struct _cef_stream_reader_t* self, int64 offset, + int whence); + + /// + // Return the current offset position. + /// + int64 (CEF_CALLBACK *tell)(struct _cef_stream_reader_t* self); + + /// + // Return non-zero if at end of file. + /// + int (CEF_CALLBACK *eof)(struct _cef_stream_reader_t* self); + + /// + // Returns true (1) if this reader performs work like accessing the file + // system which may block. Used as a hint for determining the thread to access + // the reader from. + /// + int (CEF_CALLBACK *may_block)(struct _cef_stream_reader_t* self); +} cef_stream_reader_t; + + +/// +// Create a new cef_stream_reader_t object from a file. +/// +CEF_EXPORT cef_stream_reader_t* cef_stream_reader_create_for_file( + const cef_string_t* fileName); + +/// +// Create a new cef_stream_reader_t object from data. +/// +CEF_EXPORT cef_stream_reader_t* cef_stream_reader_create_for_data(void* data, + size_t size); + +/// +// Create a new cef_stream_reader_t object from a custom handler. +/// +CEF_EXPORT cef_stream_reader_t* cef_stream_reader_create_for_handler( + cef_read_handler_t* handler); + + +/// +// Structure the client can implement to provide a custom stream writer. The +// functions of this structure may be called on any thread. +/// +typedef struct _cef_write_handler_t { + /// + // Base structure. + /// + cef_base_t base; + + /// + // Write raw binary data. + /// + size_t (CEF_CALLBACK *write)(struct _cef_write_handler_t* self, + const void* ptr, size_t size, size_t n); + + /// + // Seek to the specified offset position. |whence| may be any one of SEEK_CUR, + // SEEK_END or SEEK_SET. Return zero on success and non-zero on failure. + /// + int (CEF_CALLBACK *seek)(struct _cef_write_handler_t* self, int64 offset, + int whence); + + /// + // Return the current offset position. + /// + int64 (CEF_CALLBACK *tell)(struct _cef_write_handler_t* self); + + /// + // Flush the stream. + /// + int (CEF_CALLBACK *flush)(struct _cef_write_handler_t* self); + + /// + // Return true (1) if this handler performs work like accessing the file + // system which may block. Used as a hint for determining the thread to access + // the handler from. + /// + int (CEF_CALLBACK *may_block)(struct _cef_write_handler_t* self); +} cef_write_handler_t; + + +/// +// Structure used to write data to a stream. The functions of this structure may +// be called on any thread. +/// +typedef struct _cef_stream_writer_t { + /// + // Base structure. + /// + cef_base_t base; + + /// + // Write raw binary data. + /// + size_t (CEF_CALLBACK *write)(struct _cef_stream_writer_t* self, + const void* ptr, size_t size, size_t n); + + /// + // Seek to the specified offset position. |whence| may be any one of SEEK_CUR, + // SEEK_END or SEEK_SET. Returns zero on success and non-zero on failure. + /// + int (CEF_CALLBACK *seek)(struct _cef_stream_writer_t* self, int64 offset, + int whence); + + /// + // Return the current offset position. + /// + int64 (CEF_CALLBACK *tell)(struct _cef_stream_writer_t* self); + + /// + // Flush the stream. + /// + int (CEF_CALLBACK *flush)(struct _cef_stream_writer_t* self); + + /// + // Returns true (1) if this writer performs work like accessing the file + // system which may block. Used as a hint for determining the thread to access + // the writer from. + /// + int (CEF_CALLBACK *may_block)(struct _cef_stream_writer_t* self); +} cef_stream_writer_t; + + +/// +// Create a new cef_stream_writer_t object for a file. +/// +CEF_EXPORT cef_stream_writer_t* cef_stream_writer_create_for_file( + const cef_string_t* fileName); + +/// +// Create a new cef_stream_writer_t object for a custom handler. +/// +CEF_EXPORT cef_stream_writer_t* cef_stream_writer_create_for_handler( + cef_write_handler_t* handler); + + +#ifdef __cplusplus +} +#endif + +#endif // CEF_INCLUDE_CAPI_CEF_STREAM_CAPI_H_ diff --git a/dependencies64/cef/include/capi/cef_string_visitor_capi.h b/dependencies64/cef/include/capi/cef_string_visitor_capi.h new file mode 100644 index 000000000..8fde238b5 --- /dev/null +++ b/dependencies64/cef/include/capi/cef_string_visitor_capi.h @@ -0,0 +1,69 @@ +// Copyright (c) 2015 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool and should not edited +// by hand. See the translator.README.txt file in the tools directory for +// more information. +// + +#ifndef CEF_INCLUDE_CAPI_CEF_STRING_VISITOR_CAPI_H_ +#define CEF_INCLUDE_CAPI_CEF_STRING_VISITOR_CAPI_H_ +#pragma once + +#include "include/capi/cef_base_capi.h" + +#ifdef __cplusplus +extern "C" { +#endif + + +/// +// Implement this structure to receive string values asynchronously. +/// +typedef struct _cef_string_visitor_t { + /// + // Base structure. + /// + cef_base_t base; + + /// + // Method that will be executed. + /// + void (CEF_CALLBACK *visit)(struct _cef_string_visitor_t* self, + const cef_string_t* string); +} cef_string_visitor_t; + + +#ifdef __cplusplus +} +#endif + +#endif // CEF_INCLUDE_CAPI_CEF_STRING_VISITOR_CAPI_H_ diff --git a/dependencies64/cef/include/capi/cef_task_capi.h b/dependencies64/cef/include/capi/cef_task_capi.h new file mode 100644 index 000000000..ea0ff7f08 --- /dev/null +++ b/dependencies64/cef/include/capi/cef_task_capi.h @@ -0,0 +1,159 @@ +// Copyright (c) 2015 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool and should not edited +// by hand. See the translator.README.txt file in the tools directory for +// more information. +// + +#ifndef CEF_INCLUDE_CAPI_CEF_TASK_CAPI_H_ +#define CEF_INCLUDE_CAPI_CEF_TASK_CAPI_H_ +#pragma once + +#include "include/capi/cef_base_capi.h" + +#ifdef __cplusplus +extern "C" { +#endif + + +/// +// Implement this structure for asynchronous task execution. If the task is +// posted successfully and if the associated message loop is still running then +// the execute() function will be called on the target thread. If the task fails +// to post then the task object may be destroyed on the source thread instead of +// the target thread. For this reason be cautious when performing work in the +// task object destructor. +/// +typedef struct _cef_task_t { + /// + // Base structure. + /// + cef_base_t base; + + /// + // Method that will be executed on the target thread. + /// + void (CEF_CALLBACK *execute)(struct _cef_task_t* self); +} cef_task_t; + + +/// +// Structure that asynchronously executes tasks on the associated thread. It is +// safe to call the functions of this structure on any thread. +// +// CEF maintains multiple internal threads that are used for handling different +// types of tasks in different processes. The cef_thread_id_t definitions in +// cef_types.h list the common CEF threads. Task runners are also available for +// other CEF threads as appropriate (for example, V8 WebWorker threads). +/// +typedef struct _cef_task_runner_t { + /// + // Base structure. + /// + cef_base_t base; + + /// + // Returns true (1) if this object is pointing to the same task runner as + // |that| object. + /// + int (CEF_CALLBACK *is_same)(struct _cef_task_runner_t* self, + struct _cef_task_runner_t* that); + + /// + // Returns true (1) if this task runner belongs to the current thread. + /// + int (CEF_CALLBACK *belongs_to_current_thread)( + struct _cef_task_runner_t* self); + + /// + // Returns true (1) if this task runner is for the specified CEF thread. + /// + int (CEF_CALLBACK *belongs_to_thread)(struct _cef_task_runner_t* self, + cef_thread_id_t threadId); + + /// + // Post a task for execution on the thread associated with this task runner. + // Execution will occur asynchronously. + /// + int (CEF_CALLBACK *post_task)(struct _cef_task_runner_t* self, + struct _cef_task_t* task); + + /// + // Post a task for delayed execution on the thread associated with this task + // runner. Execution will occur asynchronously. Delayed tasks are not + // supported on V8 WebWorker threads and will be executed without the + // specified delay. + /// + int (CEF_CALLBACK *post_delayed_task)(struct _cef_task_runner_t* self, + struct _cef_task_t* task, int64 delay_ms); +} cef_task_runner_t; + + +/// +// Returns the task runner for the current thread. Only CEF threads will have +// task runners. An NULL reference will be returned if this function is called +// on an invalid thread. +/// +CEF_EXPORT cef_task_runner_t* cef_task_runner_get_for_current_thread(); + +/// +// Returns the task runner for the specified CEF thread. +/// +CEF_EXPORT cef_task_runner_t* cef_task_runner_get_for_thread( + cef_thread_id_t threadId); + + +/// +// Returns true (1) if called on the specified thread. Equivalent to using +// cef_task_tRunner::GetForThread(threadId)->belongs_to_current_thread(). +/// +CEF_EXPORT int cef_currently_on(cef_thread_id_t threadId); + +/// +// Post a task for execution on the specified thread. Equivalent to using +// cef_task_tRunner::GetForThread(threadId)->PostTask(task). +/// +CEF_EXPORT int cef_post_task(cef_thread_id_t threadId, cef_task_t* task); + +/// +// Post a task for delayed execution on the specified thread. Equivalent to +// using cef_task_tRunner::GetForThread(threadId)->PostDelayedTask(task, +// delay_ms). +/// +CEF_EXPORT int cef_post_delayed_task(cef_thread_id_t threadId, cef_task_t* task, + int64 delay_ms); + +#ifdef __cplusplus +} +#endif + +#endif // CEF_INCLUDE_CAPI_CEF_TASK_CAPI_H_ diff --git a/dependencies64/cef/include/capi/cef_trace_capi.h b/dependencies64/cef/include/capi/cef_trace_capi.h new file mode 100644 index 000000000..92b499916 --- /dev/null +++ b/dependencies64/cef/include/capi/cef_trace_capi.h @@ -0,0 +1,118 @@ +// Copyright (c) 2015 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool and should not edited +// by hand. See the translator.README.txt file in the tools directory for +// more information. +// + +#ifndef CEF_INCLUDE_CAPI_CEF_TRACE_CAPI_H_ +#define CEF_INCLUDE_CAPI_CEF_TRACE_CAPI_H_ +#pragma once + +#include "include/capi/cef_base_capi.h" +#include "include/capi/cef_callback_capi.h" + +#ifdef __cplusplus +extern "C" { +#endif + + +/// +// Implement this structure to receive notification when tracing has completed. +// The functions of this structure will be called on the browser process UI +// thread. +/// +typedef struct _cef_end_tracing_callback_t { + /// + // Base structure. + /// + cef_base_t base; + + /// + // Called after all processes have sent their trace data. |tracing_file| is + // the path at which tracing data was written. The client is responsible for + // deleting |tracing_file|. + /// + void (CEF_CALLBACK *on_end_tracing_complete)( + struct _cef_end_tracing_callback_t* self, + const cef_string_t* tracing_file); +} cef_end_tracing_callback_t; + + +/// +// Start tracing events on all processes. Tracing is initialized asynchronously +// and |callback| will be executed on the UI thread after initialization is +// complete. +// +// If CefBeginTracing was called previously, or if a CefEndTracingAsync call is +// pending, CefBeginTracing will fail and return false (0). +// +// |categories| is a comma-delimited list of category wildcards. A category can +// have an optional '-' prefix to make it an excluded category. Having both +// included and excluded categories in the same list is not supported. +// +// Example: "test_MyTest*" Example: "test_MyTest*,test_OtherStuff" Example: +// "-excluded_category1,-excluded_category2" +// +// This function must be called on the browser process UI thread. +/// +CEF_EXPORT int cef_begin_tracing(const cef_string_t* categories, + struct _cef_completion_callback_t* callback); + +/// +// Stop tracing events on all processes. +// +// This function will fail and return false (0) if a previous call to +// CefEndTracingAsync is already pending or if CefBeginTracing was not called. +// +// |tracing_file| is the path at which tracing data will be written and +// |callback| is the callback that will be executed once all processes have sent +// their trace data. If |tracing_file| is NULL a new temporary file path will be +// used. If |callback| is NULL no trace data will be written. +// +// This function must be called on the browser process UI thread. +/// +CEF_EXPORT int cef_end_tracing(const cef_string_t* tracing_file, + cef_end_tracing_callback_t* callback); + +/// +// Returns the current system trace time or, if none is defined, the current +// high-res time. Can be used by clients to synchronize with the time +// information in trace events. +/// +CEF_EXPORT int64 cef_now_from_system_trace_time(); + +#ifdef __cplusplus +} +#endif + +#endif // CEF_INCLUDE_CAPI_CEF_TRACE_CAPI_H_ diff --git a/dependencies64/cef/include/capi/cef_urlrequest_capi.h b/dependencies64/cef/include/capi/cef_urlrequest_capi.h new file mode 100644 index 000000000..63edbd18b --- /dev/null +++ b/dependencies64/cef/include/capi/cef_urlrequest_capi.h @@ -0,0 +1,194 @@ +// Copyright (c) 2015 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool and should not edited +// by hand. See the translator.README.txt file in the tools directory for +// more information. +// + +#ifndef CEF_INCLUDE_CAPI_CEF_URLREQUEST_CAPI_H_ +#define CEF_INCLUDE_CAPI_CEF_URLREQUEST_CAPI_H_ +#pragma once + +#include "include/capi/cef_auth_callback_capi.h" +#include "include/capi/cef_base_capi.h" +#include "include/capi/cef_request_capi.h" +#include "include/capi/cef_request_context_capi.h" +#include "include/capi/cef_response_capi.h" + +#ifdef __cplusplus +extern "C" { +#endif + +struct _cef_urlrequest_client_t; + +/// +// Structure used to make a URL request. URL requests are not associated with a +// browser instance so no cef_client_t callbacks will be executed. URL requests +// can be created on any valid CEF thread in either the browser or render +// process. Once created the functions of the URL request object must be +// accessed on the same thread that created it. +/// +typedef struct _cef_urlrequest_t { + /// + // Base structure. + /// + cef_base_t base; + + /// + // Returns the request object used to create this URL request. The returned + // object is read-only and should not be modified. + /// + struct _cef_request_t* (CEF_CALLBACK *get_request)( + struct _cef_urlrequest_t* self); + + /// + // Returns the client. + /// + struct _cef_urlrequest_client_t* (CEF_CALLBACK *get_client)( + struct _cef_urlrequest_t* self); + + /// + // Returns the request status. + /// + cef_urlrequest_status_t (CEF_CALLBACK *get_request_status)( + struct _cef_urlrequest_t* self); + + /// + // Returns the request error if status is UR_CANCELED or UR_FAILED, or 0 + // otherwise. + /// + cef_errorcode_t (CEF_CALLBACK *get_request_error)( + struct _cef_urlrequest_t* self); + + /// + // Returns the response, or NULL if no response information is available. + // Response information will only be available after the upload has completed. + // The returned object is read-only and should not be modified. + /// + struct _cef_response_t* (CEF_CALLBACK *get_response)( + struct _cef_urlrequest_t* self); + + /// + // Cancel the request. + /// + void (CEF_CALLBACK *cancel)(struct _cef_urlrequest_t* self); +} cef_urlrequest_t; + + +/// +// Create a new URL request. Only GET, POST, HEAD, DELETE and PUT request +// functions are supported. Multiple post data elements are not supported and +// elements of type PDE_TYPE_FILE are only supported for requests originating +// from the browser process. Requests originating from the render process will +// receive the same handling as requests originating from Web content -- if the +// response contains Content-Disposition or Mime-Type header values that would +// not normally be rendered then the response may receive special handling +// inside the browser (for example, via the file download code path instead of +// the URL request code path). The |request| object will be marked as read-only +// after calling this function. In the browser process if |request_context| is +// NULL the global request context will be used. In the render process +// |request_context| must be NULL and the context associated with the current +// renderer process' browser will be used. +/// +CEF_EXPORT cef_urlrequest_t* cef_urlrequest_create( + struct _cef_request_t* request, struct _cef_urlrequest_client_t* client, + struct _cef_request_context_t* request_context); + + +/// +// Structure that should be implemented by the cef_urlrequest_t client. The +// functions of this structure will be called on the same thread that created +// the request unless otherwise documented. +/// +typedef struct _cef_urlrequest_client_t { + /// + // Base structure. + /// + cef_base_t base; + + /// + // Notifies the client that the request has completed. Use the + // cef_urlrequest_t::GetRequestStatus function to determine if the request was + // successful or not. + /// + void (CEF_CALLBACK *on_request_complete)( + struct _cef_urlrequest_client_t* self, + struct _cef_urlrequest_t* request); + + /// + // Notifies the client of upload progress. |current| denotes the number of + // bytes sent so far and |total| is the total size of uploading data (or -1 if + // chunked upload is enabled). This function will only be called if the + // UR_FLAG_REPORT_UPLOAD_PROGRESS flag is set on the request. + /// + void (CEF_CALLBACK *on_upload_progress)(struct _cef_urlrequest_client_t* self, + struct _cef_urlrequest_t* request, int64 current, int64 total); + + /// + // Notifies the client of download progress. |current| denotes the number of + // bytes received up to the call and |total| is the expected total size of the + // response (or -1 if not determined). + /// + void (CEF_CALLBACK *on_download_progress)( + struct _cef_urlrequest_client_t* self, struct _cef_urlrequest_t* request, + int64 current, int64 total); + + /// + // Called when some part of the response is read. |data| contains the current + // bytes received since the last call. This function will not be called if the + // UR_FLAG_NO_DOWNLOAD_DATA flag is set on the request. + /// + void (CEF_CALLBACK *on_download_data)(struct _cef_urlrequest_client_t* self, + struct _cef_urlrequest_t* request, const void* data, + size_t data_length); + + /// + // Called on the IO thread when the browser needs credentials from the user. + // |isProxy| indicates whether the host is a proxy server. |host| contains the + // hostname and |port| contains the port number. Return true (1) to continue + // the request and call cef_auth_callback_t::cont() when the authentication + // information is available. Return false (0) to cancel the request. This + // function will only be called for requests initiated from the browser + // process. + /// + int (CEF_CALLBACK *get_auth_credentials)( + struct _cef_urlrequest_client_t* self, int isProxy, + const cef_string_t* host, int port, const cef_string_t* realm, + const cef_string_t* scheme, struct _cef_auth_callback_t* callback); +} cef_urlrequest_client_t; + + +#ifdef __cplusplus +} +#endif + +#endif // CEF_INCLUDE_CAPI_CEF_URLREQUEST_CAPI_H_ diff --git a/dependencies64/cef/include/capi/cef_v8_capi.h b/dependencies64/cef/include/capi/cef_v8_capi.h new file mode 100644 index 000000000..d679432f0 --- /dev/null +++ b/dependencies64/cef/include/capi/cef_v8_capi.h @@ -0,0 +1,852 @@ +// Copyright (c) 2015 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool and should not edited +// by hand. See the translator.README.txt file in the tools directory for +// more information. +// + +#ifndef CEF_INCLUDE_CAPI_CEF_V8_CAPI_H_ +#define CEF_INCLUDE_CAPI_CEF_V8_CAPI_H_ +#pragma once + +#include "include/capi/cef_base_capi.h" +#include "include/capi/cef_browser_capi.h" +#include "include/capi/cef_frame_capi.h" +#include "include/capi/cef_task_capi.h" + +#ifdef __cplusplus +extern "C" { +#endif + +struct _cef_v8exception_t; +struct _cef_v8handler_t; +struct _cef_v8stack_frame_t; +struct _cef_v8value_t; + +/// +// Structure representing a V8 context handle. V8 handles can only be accessed +// from the thread on which they are created. Valid threads for creating a V8 +// handle include the render process main thread (TID_RENDERER) and WebWorker +// threads. A task runner for posting tasks on the associated thread can be +// retrieved via the cef_v8context_t::get_task_runner() function. +/// +typedef struct _cef_v8context_t { + /// + // Base structure. + /// + cef_base_t base; + + /// + // Returns the task runner associated with this context. V8 handles can only + // be accessed from the thread on which they are created. This function can be + // called on any render process thread. + /// + struct _cef_task_runner_t* (CEF_CALLBACK *get_task_runner)( + struct _cef_v8context_t* self); + + /// + // Returns true (1) if the underlying handle is valid and it can be accessed + // on the current thread. Do not call any other functions if this function + // returns false (0). + /// + int (CEF_CALLBACK *is_valid)(struct _cef_v8context_t* self); + + /// + // Returns the browser for this context. This function will return an NULL + // reference for WebWorker contexts. + /// + struct _cef_browser_t* (CEF_CALLBACK *get_browser)( + struct _cef_v8context_t* self); + + /// + // Returns the frame for this context. This function will return an NULL + // reference for WebWorker contexts. + /// + struct _cef_frame_t* (CEF_CALLBACK *get_frame)(struct _cef_v8context_t* self); + + /// + // Returns the global object for this context. The context must be entered + // before calling this function. + /// + struct _cef_v8value_t* (CEF_CALLBACK *get_global)( + struct _cef_v8context_t* self); + + /// + // Enter this context. A context must be explicitly entered before creating a + // V8 Object, Array, Function or Date asynchronously. exit() must be called + // the same number of times as enter() before releasing this context. V8 + // objects belong to the context in which they are created. Returns true (1) + // if the scope was entered successfully. + /// + int (CEF_CALLBACK *enter)(struct _cef_v8context_t* self); + + /// + // Exit this context. Call this function only after calling enter(). Returns + // true (1) if the scope was exited successfully. + /// + int (CEF_CALLBACK *exit)(struct _cef_v8context_t* self); + + /// + // Returns true (1) if this object is pointing to the same handle as |that| + // object. + /// + int (CEF_CALLBACK *is_same)(struct _cef_v8context_t* self, + struct _cef_v8context_t* that); + + /// + // Evaluates the specified JavaScript code using this context's global object. + // On success |retval| will be set to the return value, if any, and the + // function will return true (1). On failure |exception| will be set to the + // exception, if any, and the function will return false (0). + /// + int (CEF_CALLBACK *eval)(struct _cef_v8context_t* self, + const cef_string_t* code, struct _cef_v8value_t** retval, + struct _cef_v8exception_t** exception); +} cef_v8context_t; + + +/// +// Returns the current (top) context object in the V8 context stack. +/// +CEF_EXPORT cef_v8context_t* cef_v8context_get_current_context(); + +/// +// Returns the entered (bottom) context object in the V8 context stack. +/// +CEF_EXPORT cef_v8context_t* cef_v8context_get_entered_context(); + +/// +// Returns true (1) if V8 is currently inside a context. +/// +CEF_EXPORT int cef_v8context_in_context(); + + +/// +// Structure that should be implemented to handle V8 function calls. The +// functions of this structure will be called on the thread associated with the +// V8 function. +/// +typedef struct _cef_v8handler_t { + /// + // Base structure. + /// + cef_base_t base; + + /// + // Handle execution of the function identified by |name|. |object| is the + // receiver ('this' object) of the function. |arguments| is the list of + // arguments passed to the function. If execution succeeds set |retval| to the + // function return value. If execution fails set |exception| to the exception + // that will be thrown. Return true (1) if execution was handled. + /// + int (CEF_CALLBACK *execute)(struct _cef_v8handler_t* self, + const cef_string_t* name, struct _cef_v8value_t* object, + size_t argumentsCount, struct _cef_v8value_t* const* arguments, + struct _cef_v8value_t** retval, cef_string_t* exception); +} cef_v8handler_t; + + +/// +// Structure that should be implemented to handle V8 accessor calls. Accessor +// identifiers are registered by calling cef_v8value_t::set_value(). The +// functions of this structure will be called on the thread associated with the +// V8 accessor. +/// +typedef struct _cef_v8accessor_t { + /// + // Base structure. + /// + cef_base_t base; + + /// + // Handle retrieval the accessor value identified by |name|. |object| is the + // receiver ('this' object) of the accessor. If retrieval succeeds set + // |retval| to the return value. If retrieval fails set |exception| to the + // exception that will be thrown. Return true (1) if accessor retrieval was + // handled. + /// + int (CEF_CALLBACK *get)(struct _cef_v8accessor_t* self, + const cef_string_t* name, struct _cef_v8value_t* object, + struct _cef_v8value_t** retval, cef_string_t* exception); + + /// + // Handle assignment of the accessor value identified by |name|. |object| is + // the receiver ('this' object) of the accessor. |value| is the new value + // being assigned to the accessor. If assignment fails set |exception| to the + // exception that will be thrown. Return true (1) if accessor assignment was + // handled. + /// + int (CEF_CALLBACK *set)(struct _cef_v8accessor_t* self, + const cef_string_t* name, struct _cef_v8value_t* object, + struct _cef_v8value_t* value, cef_string_t* exception); +} cef_v8accessor_t; + + +/// +// Structure representing a V8 exception. The functions of this structure may be +// called on any render process thread. +/// +typedef struct _cef_v8exception_t { + /// + // Base structure. + /// + cef_base_t base; + + /// + // Returns the exception message. + /// + // The resulting string must be freed by calling cef_string_userfree_free(). + cef_string_userfree_t (CEF_CALLBACK *get_message)( + struct _cef_v8exception_t* self); + + /// + // Returns the line of source code that the exception occurred within. + /// + // The resulting string must be freed by calling cef_string_userfree_free(). + cef_string_userfree_t (CEF_CALLBACK *get_source_line)( + struct _cef_v8exception_t* self); + + /// + // Returns the resource name for the script from where the function causing + // the error originates. + /// + // The resulting string must be freed by calling cef_string_userfree_free(). + cef_string_userfree_t (CEF_CALLBACK *get_script_resource_name)( + struct _cef_v8exception_t* self); + + /// + // Returns the 1-based number of the line where the error occurred or 0 if the + // line number is unknown. + /// + int (CEF_CALLBACK *get_line_number)(struct _cef_v8exception_t* self); + + /// + // Returns the index within the script of the first character where the error + // occurred. + /// + int (CEF_CALLBACK *get_start_position)(struct _cef_v8exception_t* self); + + /// + // Returns the index within the script of the last character where the error + // occurred. + /// + int (CEF_CALLBACK *get_end_position)(struct _cef_v8exception_t* self); + + /// + // Returns the index within the line of the first character where the error + // occurred. + /// + int (CEF_CALLBACK *get_start_column)(struct _cef_v8exception_t* self); + + /// + // Returns the index within the line of the last character where the error + // occurred. + /// + int (CEF_CALLBACK *get_end_column)(struct _cef_v8exception_t* self); +} cef_v8exception_t; + + +/// +// Structure representing a V8 value handle. V8 handles can only be accessed +// from the thread on which they are created. Valid threads for creating a V8 +// handle include the render process main thread (TID_RENDERER) and WebWorker +// threads. A task runner for posting tasks on the associated thread can be +// retrieved via the cef_v8context_t::get_task_runner() function. +/// +typedef struct _cef_v8value_t { + /// + // Base structure. + /// + cef_base_t base; + + /// + // Returns true (1) if the underlying handle is valid and it can be accessed + // on the current thread. Do not call any other functions if this function + // returns false (0). + /// + int (CEF_CALLBACK *is_valid)(struct _cef_v8value_t* self); + + /// + // True if the value type is undefined. + /// + int (CEF_CALLBACK *is_undefined)(struct _cef_v8value_t* self); + + /// + // True if the value type is null. + /// + int (CEF_CALLBACK *is_null)(struct _cef_v8value_t* self); + + /// + // True if the value type is bool. + /// + int (CEF_CALLBACK *is_bool)(struct _cef_v8value_t* self); + + /// + // True if the value type is int. + /// + int (CEF_CALLBACK *is_int)(struct _cef_v8value_t* self); + + /// + // True if the value type is unsigned int. + /// + int (CEF_CALLBACK *is_uint)(struct _cef_v8value_t* self); + + /// + // True if the value type is double. + /// + int (CEF_CALLBACK *is_double)(struct _cef_v8value_t* self); + + /// + // True if the value type is Date. + /// + int (CEF_CALLBACK *is_date)(struct _cef_v8value_t* self); + + /// + // True if the value type is string. + /// + int (CEF_CALLBACK *is_string)(struct _cef_v8value_t* self); + + /// + // True if the value type is object. + /// + int (CEF_CALLBACK *is_object)(struct _cef_v8value_t* self); + + /// + // True if the value type is array. + /// + int (CEF_CALLBACK *is_array)(struct _cef_v8value_t* self); + + /// + // True if the value type is function. + /// + int (CEF_CALLBACK *is_function)(struct _cef_v8value_t* self); + + /// + // Returns true (1) if this object is pointing to the same handle as |that| + // object. + /// + int (CEF_CALLBACK *is_same)(struct _cef_v8value_t* self, + struct _cef_v8value_t* that); + + /// + // Return a bool value. The underlying data will be converted to if + // necessary. + /// + int (CEF_CALLBACK *get_bool_value)(struct _cef_v8value_t* self); + + /// + // Return an int value. The underlying data will be converted to if + // necessary. + /// + int32 (CEF_CALLBACK *get_int_value)(struct _cef_v8value_t* self); + + /// + // Return an unisgned int value. The underlying data will be converted to if + // necessary. + /// + uint32 (CEF_CALLBACK *get_uint_value)(struct _cef_v8value_t* self); + + /// + // Return a double value. The underlying data will be converted to if + // necessary. + /// + double (CEF_CALLBACK *get_double_value)(struct _cef_v8value_t* self); + + /// + // Return a Date value. The underlying data will be converted to if + // necessary. + /// + cef_time_t (CEF_CALLBACK *get_date_value)(struct _cef_v8value_t* self); + + /// + // Return a string value. The underlying data will be converted to if + // necessary. + /// + // The resulting string must be freed by calling cef_string_userfree_free(). + cef_string_userfree_t (CEF_CALLBACK *get_string_value)( + struct _cef_v8value_t* self); + + + // OBJECT METHODS - These functions are only available on objects. Arrays and + // functions are also objects. String- and integer-based keys can be used + // interchangably with the framework converting between them as necessary. + + /// + // Returns true (1) if this is a user created object. + /// + int (CEF_CALLBACK *is_user_created)(struct _cef_v8value_t* self); + + /// + // Returns true (1) if the last function call resulted in an exception. This + // attribute exists only in the scope of the current CEF value object. + /// + int (CEF_CALLBACK *has_exception)(struct _cef_v8value_t* self); + + /// + // Returns the exception resulting from the last function call. This attribute + // exists only in the scope of the current CEF value object. + /// + struct _cef_v8exception_t* (CEF_CALLBACK *get_exception)( + struct _cef_v8value_t* self); + + /// + // Clears the last exception and returns true (1) on success. + /// + int (CEF_CALLBACK *clear_exception)(struct _cef_v8value_t* self); + + /// + // Returns true (1) if this object will re-throw future exceptions. This + // attribute exists only in the scope of the current CEF value object. + /// + int (CEF_CALLBACK *will_rethrow_exceptions)(struct _cef_v8value_t* self); + + /// + // Set whether this object will re-throw future exceptions. By default + // exceptions are not re-thrown. If a exception is re-thrown the current + // context should not be accessed again until after the exception has been + // caught and not re-thrown. Returns true (1) on success. This attribute + // exists only in the scope of the current CEF value object. + /// + int (CEF_CALLBACK *set_rethrow_exceptions)(struct _cef_v8value_t* self, + int rethrow); + + /// + // Returns true (1) if the object has a value with the specified identifier. + /// + int (CEF_CALLBACK *has_value_bykey)(struct _cef_v8value_t* self, + const cef_string_t* key); + + /// + // Returns true (1) if the object has a value with the specified identifier. + /// + int (CEF_CALLBACK *has_value_byindex)(struct _cef_v8value_t* self, int index); + + /// + // Deletes the value with the specified identifier and returns true (1) on + // success. Returns false (0) if this function is called incorrectly or an + // exception is thrown. For read-only and don't-delete values this function + // will return true (1) even though deletion failed. + /// + int (CEF_CALLBACK *delete_value_bykey)(struct _cef_v8value_t* self, + const cef_string_t* key); + + /// + // Deletes the value with the specified identifier and returns true (1) on + // success. Returns false (0) if this function is called incorrectly, deletion + // fails or an exception is thrown. For read-only and don't-delete values this + // function will return true (1) even though deletion failed. + /// + int (CEF_CALLBACK *delete_value_byindex)(struct _cef_v8value_t* self, + int index); + + /// + // Returns the value with the specified identifier on success. Returns NULL if + // this function is called incorrectly or an exception is thrown. + /// + struct _cef_v8value_t* (CEF_CALLBACK *get_value_bykey)( + struct _cef_v8value_t* self, const cef_string_t* key); + + /// + // Returns the value with the specified identifier on success. Returns NULL if + // this function is called incorrectly or an exception is thrown. + /// + struct _cef_v8value_t* (CEF_CALLBACK *get_value_byindex)( + struct _cef_v8value_t* self, int index); + + /// + // Associates a value with the specified identifier and returns true (1) on + // success. Returns false (0) if this function is called incorrectly or an + // exception is thrown. For read-only values this function will return true + // (1) even though assignment failed. + /// + int (CEF_CALLBACK *set_value_bykey)(struct _cef_v8value_t* self, + const cef_string_t* key, struct _cef_v8value_t* value, + cef_v8_propertyattribute_t attribute); + + /// + // Associates a value with the specified identifier and returns true (1) on + // success. Returns false (0) if this function is called incorrectly or an + // exception is thrown. For read-only values this function will return true + // (1) even though assignment failed. + /// + int (CEF_CALLBACK *set_value_byindex)(struct _cef_v8value_t* self, int index, + struct _cef_v8value_t* value); + + /// + // Registers an identifier and returns true (1) on success. Access to the + // identifier will be forwarded to the cef_v8accessor_t instance passed to + // cef_v8value_t::cef_v8value_create_object(). Returns false (0) if this + // function is called incorrectly or an exception is thrown. For read-only + // values this function will return true (1) even though assignment failed. + /// + int (CEF_CALLBACK *set_value_byaccessor)(struct _cef_v8value_t* self, + const cef_string_t* key, cef_v8_accesscontrol_t settings, + cef_v8_propertyattribute_t attribute); + + /// + // Read the keys for the object's values into the specified vector. Integer- + // based keys will also be returned as strings. + /// + int (CEF_CALLBACK *get_keys)(struct _cef_v8value_t* self, + cef_string_list_t keys); + + /// + // Sets the user data for this object and returns true (1) on success. Returns + // false (0) if this function is called incorrectly. This function can only be + // called on user created objects. + /// + int (CEF_CALLBACK *set_user_data)(struct _cef_v8value_t* self, + struct _cef_base_t* user_data); + + /// + // Returns the user data, if any, assigned to this object. + /// + struct _cef_base_t* (CEF_CALLBACK *get_user_data)( + struct _cef_v8value_t* self); + + /// + // Returns the amount of externally allocated memory registered for the + // object. + /// + int (CEF_CALLBACK *get_externally_allocated_memory)( + struct _cef_v8value_t* self); + + /// + // Adjusts the amount of registered external memory for the object. Used to + // give V8 an indication of the amount of externally allocated memory that is + // kept alive by JavaScript objects. V8 uses this information to decide when + // to perform global garbage collection. Each cef_v8value_t tracks the amount + // of external memory associated with it and automatically decreases the + // global total by the appropriate amount on its destruction. + // |change_in_bytes| specifies the number of bytes to adjust by. This function + // returns the number of bytes associated with the object after the + // adjustment. This function can only be called on user created objects. + /// + int (CEF_CALLBACK *adjust_externally_allocated_memory)( + struct _cef_v8value_t* self, int change_in_bytes); + + + // ARRAY METHODS - These functions are only available on arrays. + + /// + // Returns the number of elements in the array. + /// + int (CEF_CALLBACK *get_array_length)(struct _cef_v8value_t* self); + + + // FUNCTION METHODS - These functions are only available on functions. + + /// + // Returns the function name. + /// + // The resulting string must be freed by calling cef_string_userfree_free(). + cef_string_userfree_t (CEF_CALLBACK *get_function_name)( + struct _cef_v8value_t* self); + + /// + // Returns the function handler or NULL if not a CEF-created function. + /// + struct _cef_v8handler_t* (CEF_CALLBACK *get_function_handler)( + struct _cef_v8value_t* self); + + /// + // Execute the function using the current V8 context. This function should + // only be called from within the scope of a cef_v8handler_t or + // cef_v8accessor_t callback, or in combination with calling enter() and + // exit() on a stored cef_v8context_t reference. |object| is the receiver + // ('this' object) of the function. If |object| is NULL the current context's + // global object will be used. |arguments| is the list of arguments that will + // be passed to the function. Returns the function return value on success. + // Returns NULL if this function is called incorrectly or an exception is + // thrown. + /// + struct _cef_v8value_t* (CEF_CALLBACK *execute_function)( + struct _cef_v8value_t* self, struct _cef_v8value_t* object, + size_t argumentsCount, struct _cef_v8value_t* const* arguments); + + /// + // Execute the function using the specified V8 context. |object| is the + // receiver ('this' object) of the function. If |object| is NULL the specified + // context's global object will be used. |arguments| is the list of arguments + // that will be passed to the function. Returns the function return value on + // success. Returns NULL if this function is called incorrectly or an + // exception is thrown. + /// + struct _cef_v8value_t* (CEF_CALLBACK *execute_function_with_context)( + struct _cef_v8value_t* self, struct _cef_v8context_t* context, + struct _cef_v8value_t* object, size_t argumentsCount, + struct _cef_v8value_t* const* arguments); +} cef_v8value_t; + + +/// +// Create a new cef_v8value_t object of type undefined. +/// +CEF_EXPORT cef_v8value_t* cef_v8value_create_undefined(); + +/// +// Create a new cef_v8value_t object of type null. +/// +CEF_EXPORT cef_v8value_t* cef_v8value_create_null(); + +/// +// Create a new cef_v8value_t object of type bool. +/// +CEF_EXPORT cef_v8value_t* cef_v8value_create_bool(int value); + +/// +// Create a new cef_v8value_t object of type int. +/// +CEF_EXPORT cef_v8value_t* cef_v8value_create_int(int32 value); + +/// +// Create a new cef_v8value_t object of type unsigned int. +/// +CEF_EXPORT cef_v8value_t* cef_v8value_create_uint(uint32 value); + +/// +// Create a new cef_v8value_t object of type double. +/// +CEF_EXPORT cef_v8value_t* cef_v8value_create_double(double value); + +/// +// Create a new cef_v8value_t object of type Date. This function should only be +// called from within the scope of a cef_render_process_handler_t, +// cef_v8handler_t or cef_v8accessor_t callback, or in combination with calling +// enter() and exit() on a stored cef_v8context_t reference. +/// +CEF_EXPORT cef_v8value_t* cef_v8value_create_date(const cef_time_t* date); + +/// +// Create a new cef_v8value_t object of type string. +/// +CEF_EXPORT cef_v8value_t* cef_v8value_create_string(const cef_string_t* value); + +/// +// Create a new cef_v8value_t object of type object with optional accessor. This +// function should only be called from within the scope of a +// cef_render_process_handler_t, cef_v8handler_t or cef_v8accessor_t callback, +// or in combination with calling enter() and exit() on a stored cef_v8context_t +// reference. +/// +CEF_EXPORT cef_v8value_t* cef_v8value_create_object(cef_v8accessor_t* accessor); + +/// +// Create a new cef_v8value_t object of type array with the specified |length|. +// If |length| is negative the returned array will have length 0. This function +// should only be called from within the scope of a +// cef_render_process_handler_t, cef_v8handler_t or cef_v8accessor_t callback, +// or in combination with calling enter() and exit() on a stored cef_v8context_t +// reference. +/// +CEF_EXPORT cef_v8value_t* cef_v8value_create_array(int length); + +/// +// Create a new cef_v8value_t object of type function. This function should only +// be called from within the scope of a cef_render_process_handler_t, +// cef_v8handler_t or cef_v8accessor_t callback, or in combination with calling +// enter() and exit() on a stored cef_v8context_t reference. +/// +CEF_EXPORT cef_v8value_t* cef_v8value_create_function(const cef_string_t* name, + cef_v8handler_t* handler); + + +/// +// Structure representing a V8 stack trace handle. V8 handles can only be +// accessed from the thread on which they are created. Valid threads for +// creating a V8 handle include the render process main thread (TID_RENDERER) +// and WebWorker threads. A task runner for posting tasks on the associated +// thread can be retrieved via the cef_v8context_t::get_task_runner() function. +/// +typedef struct _cef_v8stack_trace_t { + /// + // Base structure. + /// + cef_base_t base; + + /// + // Returns true (1) if the underlying handle is valid and it can be accessed + // on the current thread. Do not call any other functions if this function + // returns false (0). + /// + int (CEF_CALLBACK *is_valid)(struct _cef_v8stack_trace_t* self); + + /// + // Returns the number of stack frames. + /// + int (CEF_CALLBACK *get_frame_count)(struct _cef_v8stack_trace_t* self); + + /// + // Returns the stack frame at the specified 0-based index. + /// + struct _cef_v8stack_frame_t* (CEF_CALLBACK *get_frame)( + struct _cef_v8stack_trace_t* self, int index); +} cef_v8stack_trace_t; + + +/// +// Returns the stack trace for the currently active context. |frame_limit| is +// the maximum number of frames that will be captured. +/// +CEF_EXPORT cef_v8stack_trace_t* cef_v8stack_trace_get_current(int frame_limit); + + +/// +// Structure representing a V8 stack frame handle. V8 handles can only be +// accessed from the thread on which they are created. Valid threads for +// creating a V8 handle include the render process main thread (TID_RENDERER) +// and WebWorker threads. A task runner for posting tasks on the associated +// thread can be retrieved via the cef_v8context_t::get_task_runner() function. +/// +typedef struct _cef_v8stack_frame_t { + /// + // Base structure. + /// + cef_base_t base; + + /// + // Returns true (1) if the underlying handle is valid and it can be accessed + // on the current thread. Do not call any other functions if this function + // returns false (0). + /// + int (CEF_CALLBACK *is_valid)(struct _cef_v8stack_frame_t* self); + + /// + // Returns the name of the resource script that contains the function. + /// + // The resulting string must be freed by calling cef_string_userfree_free(). + cef_string_userfree_t (CEF_CALLBACK *get_script_name)( + struct _cef_v8stack_frame_t* self); + + /// + // Returns the name of the resource script that contains the function or the + // sourceURL value if the script name is undefined and its source ends with a + // "//@ sourceURL=..." string. + /// + // The resulting string must be freed by calling cef_string_userfree_free(). + cef_string_userfree_t (CEF_CALLBACK *get_script_name_or_source_url)( + struct _cef_v8stack_frame_t* self); + + /// + // Returns the name of the function. + /// + // The resulting string must be freed by calling cef_string_userfree_free(). + cef_string_userfree_t (CEF_CALLBACK *get_function_name)( + struct _cef_v8stack_frame_t* self); + + /// + // Returns the 1-based line number for the function call or 0 if unknown. + /// + int (CEF_CALLBACK *get_line_number)(struct _cef_v8stack_frame_t* self); + + /// + // Returns the 1-based column offset on the line for the function call or 0 if + // unknown. + /// + int (CEF_CALLBACK *get_column)(struct _cef_v8stack_frame_t* self); + + /// + // Returns true (1) if the function was compiled using eval(). + /// + int (CEF_CALLBACK *is_eval)(struct _cef_v8stack_frame_t* self); + + /// + // Returns true (1) if the function was called as a constructor via "new". + /// + int (CEF_CALLBACK *is_constructor)(struct _cef_v8stack_frame_t* self); +} cef_v8stack_frame_t; + + +/// +// Register a new V8 extension with the specified JavaScript extension code and +// handler. Functions implemented by the handler are prototyped using the +// keyword 'native'. The calling of a native function is restricted to the scope +// in which the prototype of the native function is defined. This function may +// only be called on the render process main thread. +// +// Example JavaScript extension code:
+//   // create the 'example' global object if it doesn't already exist.
+//   if (!example)
+//     example = {};
+//   // create the 'example.test' global object if it doesn't already exist.
+//   if (!example.test)
+//     example.test = {};
+//   (function() {
+//     // Define the function 'example.test.myfunction'.
+//     example.test.myfunction = function() {
+//       // Call CefV8Handler::Execute() with the function name 'MyFunction'
+//       // and no arguments.
+//       native function MyFunction();
+//       return MyFunction();
+//     };
+//     // Define the getter function for parameter 'example.test.myparam'.
+//     example.test.__defineGetter__('myparam', function() {
+//       // Call CefV8Handler::Execute() with the function name 'GetMyParam'
+//       // and no arguments.
+//       native function GetMyParam();
+//       return GetMyParam();
+//     });
+//     // Define the setter function for parameter 'example.test.myparam'.
+//     example.test.__defineSetter__('myparam', function(b) {
+//       // Call CefV8Handler::Execute() with the function name 'SetMyParam'
+//       // and a single argument.
+//       native function SetMyParam();
+//       if(b) SetMyParam(b);
+//     });
+//
+//     // Extension definitions can also contain normal JavaScript variables
+//     // and functions.
+//     var myint = 0;
+//     example.test.increment = function() {
+//       myint += 1;
+//       return myint;
+//     };
+//   })();
+// 
Example usage in the page:
+//   // Call the function.
+//   example.test.myfunction();
+//   // Set the parameter.
+//   example.test.myparam = value;
+//   // Get the parameter.
+//   value = example.test.myparam;
+//   // Call another function.
+//   example.test.increment();
+// 
+/// +CEF_EXPORT int cef_register_extension(const cef_string_t* extension_name, + const cef_string_t* javascript_code, cef_v8handler_t* handler); + +#ifdef __cplusplus +} +#endif + +#endif // CEF_INCLUDE_CAPI_CEF_V8_CAPI_H_ diff --git a/dependencies64/cef/include/capi/cef_values_capi.h b/dependencies64/cef/include/capi/cef_values_capi.h new file mode 100644 index 000000000..c48cd078b --- /dev/null +++ b/dependencies64/cef/include/capi/cef_values_capi.h @@ -0,0 +1,734 @@ +// Copyright (c) 2015 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool and should not edited +// by hand. See the translator.README.txt file in the tools directory for +// more information. +// + +#ifndef CEF_INCLUDE_CAPI_CEF_VALUES_CAPI_H_ +#define CEF_INCLUDE_CAPI_CEF_VALUES_CAPI_H_ +#pragma once + +#include "include/capi/cef_base_capi.h" + +#ifdef __cplusplus +extern "C" { +#endif + +struct _cef_binary_value_t; +struct _cef_dictionary_value_t; +struct _cef_list_value_t; + +/// +// Structure that wraps other data value types. Complex types (binary, +// dictionary and list) will be referenced but not owned by this object. Can be +// used on any process and thread. +/// +typedef struct _cef_value_t { + /// + // Base structure. + /// + cef_base_t base; + + /// + // Returns true (1) if the underlying data is valid. This will always be true + // (1) for simple types. For complex types (binary, dictionary and list) the + // underlying data may become invalid if owned by another object (e.g. list or + // dictionary) and that other object is then modified or destroyed. This value + // object can be re-used by calling Set*() even if the underlying data is + // invalid. + /// + int (CEF_CALLBACK *is_valid)(struct _cef_value_t* self); + + /// + // Returns true (1) if the underlying data is owned by another object. + /// + int (CEF_CALLBACK *is_owned)(struct _cef_value_t* self); + + /// + // Returns true (1) if the underlying data is read-only. Some APIs may expose + // read-only objects. + /// + int (CEF_CALLBACK *is_read_only)(struct _cef_value_t* self); + + /// + // Returns true (1) if this object and |that| object have the same underlying + // data. If true (1) modifications to this object will also affect |that| + // object and vice-versa. + /// + int (CEF_CALLBACK *is_same)(struct _cef_value_t* self, + struct _cef_value_t* that); + + /// + // Returns true (1) if this object and |that| object have an equivalent + // underlying value but are not necessarily the same object. + /// + int (CEF_CALLBACK *is_equal)(struct _cef_value_t* self, + struct _cef_value_t* that); + + /// + // Returns a copy of this object. The underlying data will also be copied. + /// + struct _cef_value_t* (CEF_CALLBACK *copy)(struct _cef_value_t* self); + + /// + // Returns the underlying value type. + /// + cef_value_type_t (CEF_CALLBACK *get_type)(struct _cef_value_t* self); + + /// + // Returns the underlying value as type bool. + /// + int (CEF_CALLBACK *get_bool)(struct _cef_value_t* self); + + /// + // Returns the underlying value as type int. + /// + int (CEF_CALLBACK *get_int)(struct _cef_value_t* self); + + /// + // Returns the underlying value as type double. + /// + double (CEF_CALLBACK *get_double)(struct _cef_value_t* self); + + /// + // Returns the underlying value as type string. + /// + // The resulting string must be freed by calling cef_string_userfree_free(). + cef_string_userfree_t (CEF_CALLBACK *get_string)(struct _cef_value_t* self); + + /// + // Returns the underlying value as type binary. The returned reference may + // become invalid if the value is owned by another object or if ownership is + // transferred to another object in the future. To maintain a reference to the + // value after assigning ownership to a dictionary or list pass this object to + // the set_value() function instead of passing the returned reference to + // set_binary(). + /// + struct _cef_binary_value_t* (CEF_CALLBACK *get_binary)( + struct _cef_value_t* self); + + /// + // Returns the underlying value as type dictionary. The returned reference may + // become invalid if the value is owned by another object or if ownership is + // transferred to another object in the future. To maintain a reference to the + // value after assigning ownership to a dictionary or list pass this object to + // the set_value() function instead of passing the returned reference to + // set_dictionary(). + /// + struct _cef_dictionary_value_t* (CEF_CALLBACK *get_dictionary)( + struct _cef_value_t* self); + + /// + // Returns the underlying value as type list. The returned reference may + // become invalid if the value is owned by another object or if ownership is + // transferred to another object in the future. To maintain a reference to the + // value after assigning ownership to a dictionary or list pass this object to + // the set_value() function instead of passing the returned reference to + // set_list(). + /// + struct _cef_list_value_t* (CEF_CALLBACK *get_list)(struct _cef_value_t* self); + + /// + // Sets the underlying value as type null. Returns true (1) if the value was + // set successfully. + /// + int (CEF_CALLBACK *set_null)(struct _cef_value_t* self); + + /// + // Sets the underlying value as type bool. Returns true (1) if the value was + // set successfully. + /// + int (CEF_CALLBACK *set_bool)(struct _cef_value_t* self, int value); + + /// + // Sets the underlying value as type int. Returns true (1) if the value was + // set successfully. + /// + int (CEF_CALLBACK *set_int)(struct _cef_value_t* self, int value); + + /// + // Sets the underlying value as type double. Returns true (1) if the value was + // set successfully. + /// + int (CEF_CALLBACK *set_double)(struct _cef_value_t* self, double value); + + /// + // Sets the underlying value as type string. Returns true (1) if the value was + // set successfully. + /// + int (CEF_CALLBACK *set_string)(struct _cef_value_t* self, + const cef_string_t* value); + + /// + // Sets the underlying value as type binary. Returns true (1) if the value was + // set successfully. This object keeps a reference to |value| and ownership of + // the underlying data remains unchanged. + /// + int (CEF_CALLBACK *set_binary)(struct _cef_value_t* self, + struct _cef_binary_value_t* value); + + /// + // Sets the underlying value as type dict. Returns true (1) if the value was + // set successfully. This object keeps a reference to |value| and ownership of + // the underlying data remains unchanged. + /// + int (CEF_CALLBACK *set_dictionary)(struct _cef_value_t* self, + struct _cef_dictionary_value_t* value); + + /// + // Sets the underlying value as type list. Returns true (1) if the value was + // set successfully. This object keeps a reference to |value| and ownership of + // the underlying data remains unchanged. + /// + int (CEF_CALLBACK *set_list)(struct _cef_value_t* self, + struct _cef_list_value_t* value); +} cef_value_t; + + +/// +// Creates a new object. +/// +CEF_EXPORT cef_value_t* cef_value_create(); + + +/// +// Structure representing a binary value. Can be used on any process and thread. +/// +typedef struct _cef_binary_value_t { + /// + // Base structure. + /// + cef_base_t base; + + /// + // Returns true (1) if this object is valid. This object may become invalid if + // the underlying data is owned by another object (e.g. list or dictionary) + // and that other object is then modified or destroyed. Do not call any other + // functions if this function returns false (0). + /// + int (CEF_CALLBACK *is_valid)(struct _cef_binary_value_t* self); + + /// + // Returns true (1) if this object is currently owned by another object. + /// + int (CEF_CALLBACK *is_owned)(struct _cef_binary_value_t* self); + + /// + // Returns true (1) if this object and |that| object have the same underlying + // data. + /// + int (CEF_CALLBACK *is_same)(struct _cef_binary_value_t* self, + struct _cef_binary_value_t* that); + + /// + // Returns true (1) if this object and |that| object have an equivalent + // underlying value but are not necessarily the same object. + /// + int (CEF_CALLBACK *is_equal)(struct _cef_binary_value_t* self, + struct _cef_binary_value_t* that); + + /// + // Returns a copy of this object. The data in this object will also be copied. + /// + struct _cef_binary_value_t* (CEF_CALLBACK *copy)( + struct _cef_binary_value_t* self); + + /// + // Returns the data size. + /// + size_t (CEF_CALLBACK *get_size)(struct _cef_binary_value_t* self); + + /// + // Read up to |buffer_size| number of bytes into |buffer|. Reading begins at + // the specified byte |data_offset|. Returns the number of bytes read. + /// + size_t (CEF_CALLBACK *get_data)(struct _cef_binary_value_t* self, + void* buffer, size_t buffer_size, size_t data_offset); +} cef_binary_value_t; + + +/// +// Creates a new object that is not owned by any other object. The specified +// |data| will be copied. +/// +CEF_EXPORT cef_binary_value_t* cef_binary_value_create(const void* data, + size_t data_size); + + +/// +// Structure representing a dictionary value. Can be used on any process and +// thread. +/// +typedef struct _cef_dictionary_value_t { + /// + // Base structure. + /// + cef_base_t base; + + /// + // Returns true (1) if this object is valid. This object may become invalid if + // the underlying data is owned by another object (e.g. list or dictionary) + // and that other object is then modified or destroyed. Do not call any other + // functions if this function returns false (0). + /// + int (CEF_CALLBACK *is_valid)(struct _cef_dictionary_value_t* self); + + /// + // Returns true (1) if this object is currently owned by another object. + /// + int (CEF_CALLBACK *is_owned)(struct _cef_dictionary_value_t* self); + + /// + // Returns true (1) if the values of this object are read-only. Some APIs may + // expose read-only objects. + /// + int (CEF_CALLBACK *is_read_only)(struct _cef_dictionary_value_t* self); + + /// + // Returns true (1) if this object and |that| object have the same underlying + // data. If true (1) modifications to this object will also affect |that| + // object and vice-versa. + /// + int (CEF_CALLBACK *is_same)(struct _cef_dictionary_value_t* self, + struct _cef_dictionary_value_t* that); + + /// + // Returns true (1) if this object and |that| object have an equivalent + // underlying value but are not necessarily the same object. + /// + int (CEF_CALLBACK *is_equal)(struct _cef_dictionary_value_t* self, + struct _cef_dictionary_value_t* that); + + /// + // Returns a writable copy of this object. If |exclude_NULL_children| is true + // (1) any NULL dictionaries or lists will be excluded from the copy. + /// + struct _cef_dictionary_value_t* (CEF_CALLBACK *copy)( + struct _cef_dictionary_value_t* self, int exclude_empty_children); + + /// + // Returns the number of values. + /// + size_t (CEF_CALLBACK *get_size)(struct _cef_dictionary_value_t* self); + + /// + // Removes all values. Returns true (1) on success. + /// + int (CEF_CALLBACK *clear)(struct _cef_dictionary_value_t* self); + + /// + // Returns true (1) if the current dictionary has a value for the given key. + /// + int (CEF_CALLBACK *has_key)(struct _cef_dictionary_value_t* self, + const cef_string_t* key); + + /// + // Reads all keys for this dictionary into the specified vector. + /// + int (CEF_CALLBACK *get_keys)(struct _cef_dictionary_value_t* self, + cef_string_list_t keys); + + /// + // Removes the value at the specified key. Returns true (1) is the value was + // removed successfully. + /// + int (CEF_CALLBACK *remove)(struct _cef_dictionary_value_t* self, + const cef_string_t* key); + + /// + // Returns the value type for the specified key. + /// + cef_value_type_t (CEF_CALLBACK *get_type)( + struct _cef_dictionary_value_t* self, const cef_string_t* key); + + /// + // Returns the value at the specified key. For simple types the returned value + // will copy existing data and modifications to the value will not modify this + // object. For complex types (binary, dictionary and list) the returned value + // will reference existing data and modifications to the value will modify + // this object. + /// + struct _cef_value_t* (CEF_CALLBACK *get_value)( + struct _cef_dictionary_value_t* self, const cef_string_t* key); + + /// + // Returns the value at the specified key as type bool. + /// + int (CEF_CALLBACK *get_bool)(struct _cef_dictionary_value_t* self, + const cef_string_t* key); + + /// + // Returns the value at the specified key as type int. + /// + int (CEF_CALLBACK *get_int)(struct _cef_dictionary_value_t* self, + const cef_string_t* key); + + /// + // Returns the value at the specified key as type double. + /// + double (CEF_CALLBACK *get_double)(struct _cef_dictionary_value_t* self, + const cef_string_t* key); + + /// + // Returns the value at the specified key as type string. + /// + // The resulting string must be freed by calling cef_string_userfree_free(). + cef_string_userfree_t (CEF_CALLBACK *get_string)( + struct _cef_dictionary_value_t* self, const cef_string_t* key); + + /// + // Returns the value at the specified key as type binary. The returned value + // will reference existing data. + /// + struct _cef_binary_value_t* (CEF_CALLBACK *get_binary)( + struct _cef_dictionary_value_t* self, const cef_string_t* key); + + /// + // Returns the value at the specified key as type dictionary. The returned + // value will reference existing data and modifications to the value will + // modify this object. + /// + struct _cef_dictionary_value_t* (CEF_CALLBACK *get_dictionary)( + struct _cef_dictionary_value_t* self, const cef_string_t* key); + + /// + // Returns the value at the specified key as type list. The returned value + // will reference existing data and modifications to the value will modify + // this object. + /// + struct _cef_list_value_t* (CEF_CALLBACK *get_list)( + struct _cef_dictionary_value_t* self, const cef_string_t* key); + + /// + // Sets the value at the specified key. Returns true (1) if the value was set + // successfully. If |value| represents simple data then the underlying data + // will be copied and modifications to |value| will not modify this object. If + // |value| represents complex data (binary, dictionary or list) then the + // underlying data will be referenced and modifications to |value| will modify + // this object. + /// + int (CEF_CALLBACK *set_value)(struct _cef_dictionary_value_t* self, + const cef_string_t* key, struct _cef_value_t* value); + + /// + // Sets the value at the specified key as type null. Returns true (1) if the + // value was set successfully. + /// + int (CEF_CALLBACK *set_null)(struct _cef_dictionary_value_t* self, + const cef_string_t* key); + + /// + // Sets the value at the specified key as type bool. Returns true (1) if the + // value was set successfully. + /// + int (CEF_CALLBACK *set_bool)(struct _cef_dictionary_value_t* self, + const cef_string_t* key, int value); + + /// + // Sets the value at the specified key as type int. Returns true (1) if the + // value was set successfully. + /// + int (CEF_CALLBACK *set_int)(struct _cef_dictionary_value_t* self, + const cef_string_t* key, int value); + + /// + // Sets the value at the specified key as type double. Returns true (1) if the + // value was set successfully. + /// + int (CEF_CALLBACK *set_double)(struct _cef_dictionary_value_t* self, + const cef_string_t* key, double value); + + /// + // Sets the value at the specified key as type string. Returns true (1) if the + // value was set successfully. + /// + int (CEF_CALLBACK *set_string)(struct _cef_dictionary_value_t* self, + const cef_string_t* key, const cef_string_t* value); + + /// + // Sets the value at the specified key as type binary. Returns true (1) if the + // value was set successfully. If |value| is currently owned by another object + // then the value will be copied and the |value| reference will not change. + // Otherwise, ownership will be transferred to this object and the |value| + // reference will be invalidated. + /// + int (CEF_CALLBACK *set_binary)(struct _cef_dictionary_value_t* self, + const cef_string_t* key, struct _cef_binary_value_t* value); + + /// + // Sets the value at the specified key as type dict. Returns true (1) if the + // value was set successfully. If |value| is currently owned by another object + // then the value will be copied and the |value| reference will not change. + // Otherwise, ownership will be transferred to this object and the |value| + // reference will be invalidated. + /// + int (CEF_CALLBACK *set_dictionary)(struct _cef_dictionary_value_t* self, + const cef_string_t* key, struct _cef_dictionary_value_t* value); + + /// + // Sets the value at the specified key as type list. Returns true (1) if the + // value was set successfully. If |value| is currently owned by another object + // then the value will be copied and the |value| reference will not change. + // Otherwise, ownership will be transferred to this object and the |value| + // reference will be invalidated. + /// + int (CEF_CALLBACK *set_list)(struct _cef_dictionary_value_t* self, + const cef_string_t* key, struct _cef_list_value_t* value); +} cef_dictionary_value_t; + + +/// +// Creates a new object that is not owned by any other object. +/// +CEF_EXPORT cef_dictionary_value_t* cef_dictionary_value_create(); + + +/// +// Structure representing a list value. Can be used on any process and thread. +/// +typedef struct _cef_list_value_t { + /// + // Base structure. + /// + cef_base_t base; + + /// + // Returns true (1) if this object is valid. This object may become invalid if + // the underlying data is owned by another object (e.g. list or dictionary) + // and that other object is then modified or destroyed. Do not call any other + // functions if this function returns false (0). + /// + int (CEF_CALLBACK *is_valid)(struct _cef_list_value_t* self); + + /// + // Returns true (1) if this object is currently owned by another object. + /// + int (CEF_CALLBACK *is_owned)(struct _cef_list_value_t* self); + + /// + // Returns true (1) if the values of this object are read-only. Some APIs may + // expose read-only objects. + /// + int (CEF_CALLBACK *is_read_only)(struct _cef_list_value_t* self); + + /// + // Returns true (1) if this object and |that| object have the same underlying + // data. If true (1) modifications to this object will also affect |that| + // object and vice-versa. + /// + int (CEF_CALLBACK *is_same)(struct _cef_list_value_t* self, + struct _cef_list_value_t* that); + + /// + // Returns true (1) if this object and |that| object have an equivalent + // underlying value but are not necessarily the same object. + /// + int (CEF_CALLBACK *is_equal)(struct _cef_list_value_t* self, + struct _cef_list_value_t* that); + + /// + // Returns a writable copy of this object. + /// + struct _cef_list_value_t* (CEF_CALLBACK *copy)( + struct _cef_list_value_t* self); + + /// + // Sets the number of values. If the number of values is expanded all new + // value slots will default to type null. Returns true (1) on success. + /// + int (CEF_CALLBACK *set_size)(struct _cef_list_value_t* self, size_t size); + + /// + // Returns the number of values. + /// + size_t (CEF_CALLBACK *get_size)(struct _cef_list_value_t* self); + + /// + // Removes all values. Returns true (1) on success. + /// + int (CEF_CALLBACK *clear)(struct _cef_list_value_t* self); + + /// + // Removes the value at the specified index. + /// + int (CEF_CALLBACK *remove)(struct _cef_list_value_t* self, int index); + + /// + // Returns the value type at the specified index. + /// + cef_value_type_t (CEF_CALLBACK *get_type)(struct _cef_list_value_t* self, + int index); + + /// + // Returns the value at the specified index. For simple types the returned + // value will copy existing data and modifications to the value will not + // modify this object. For complex types (binary, dictionary and list) the + // returned value will reference existing data and modifications to the value + // will modify this object. + /// + struct _cef_value_t* (CEF_CALLBACK *get_value)(struct _cef_list_value_t* self, + int index); + + /// + // Returns the value at the specified index as type bool. + /// + int (CEF_CALLBACK *get_bool)(struct _cef_list_value_t* self, int index); + + /// + // Returns the value at the specified index as type int. + /// + int (CEF_CALLBACK *get_int)(struct _cef_list_value_t* self, int index); + + /// + // Returns the value at the specified index as type double. + /// + double (CEF_CALLBACK *get_double)(struct _cef_list_value_t* self, int index); + + /// + // Returns the value at the specified index as type string. + /// + // The resulting string must be freed by calling cef_string_userfree_free(). + cef_string_userfree_t (CEF_CALLBACK *get_string)( + struct _cef_list_value_t* self, int index); + + /// + // Returns the value at the specified index as type binary. The returned value + // will reference existing data. + /// + struct _cef_binary_value_t* (CEF_CALLBACK *get_binary)( + struct _cef_list_value_t* self, int index); + + /// + // Returns the value at the specified index as type dictionary. The returned + // value will reference existing data and modifications to the value will + // modify this object. + /// + struct _cef_dictionary_value_t* (CEF_CALLBACK *get_dictionary)( + struct _cef_list_value_t* self, int index); + + /// + // Returns the value at the specified index as type list. The returned value + // will reference existing data and modifications to the value will modify + // this object. + /// + struct _cef_list_value_t* (CEF_CALLBACK *get_list)( + struct _cef_list_value_t* self, int index); + + /// + // Sets the value at the specified index. Returns true (1) if the value was + // set successfully. If |value| represents simple data then the underlying + // data will be copied and modifications to |value| will not modify this + // object. If |value| represents complex data (binary, dictionary or list) + // then the underlying data will be referenced and modifications to |value| + // will modify this object. + /// + int (CEF_CALLBACK *set_value)(struct _cef_list_value_t* self, int index, + struct _cef_value_t* value); + + /// + // Sets the value at the specified index as type null. Returns true (1) if the + // value was set successfully. + /// + int (CEF_CALLBACK *set_null)(struct _cef_list_value_t* self, int index); + + /// + // Sets the value at the specified index as type bool. Returns true (1) if the + // value was set successfully. + /// + int (CEF_CALLBACK *set_bool)(struct _cef_list_value_t* self, int index, + int value); + + /// + // Sets the value at the specified index as type int. Returns true (1) if the + // value was set successfully. + /// + int (CEF_CALLBACK *set_int)(struct _cef_list_value_t* self, int index, + int value); + + /// + // Sets the value at the specified index as type double. Returns true (1) if + // the value was set successfully. + /// + int (CEF_CALLBACK *set_double)(struct _cef_list_value_t* self, int index, + double value); + + /// + // Sets the value at the specified index as type string. Returns true (1) if + // the value was set successfully. + /// + int (CEF_CALLBACK *set_string)(struct _cef_list_value_t* self, int index, + const cef_string_t* value); + + /// + // Sets the value at the specified index as type binary. Returns true (1) if + // the value was set successfully. If |value| is currently owned by another + // object then the value will be copied and the |value| reference will not + // change. Otherwise, ownership will be transferred to this object and the + // |value| reference will be invalidated. + /// + int (CEF_CALLBACK *set_binary)(struct _cef_list_value_t* self, int index, + struct _cef_binary_value_t* value); + + /// + // Sets the value at the specified index as type dict. Returns true (1) if the + // value was set successfully. If |value| is currently owned by another object + // then the value will be copied and the |value| reference will not change. + // Otherwise, ownership will be transferred to this object and the |value| + // reference will be invalidated. + /// + int (CEF_CALLBACK *set_dictionary)(struct _cef_list_value_t* self, int index, + struct _cef_dictionary_value_t* value); + + /// + // Sets the value at the specified index as type list. Returns true (1) if the + // value was set successfully. If |value| is currently owned by another object + // then the value will be copied and the |value| reference will not change. + // Otherwise, ownership will be transferred to this object and the |value| + // reference will be invalidated. + /// + int (CEF_CALLBACK *set_list)(struct _cef_list_value_t* self, int index, + struct _cef_list_value_t* value); +} cef_list_value_t; + + +/// +// Creates a new object that is not owned by any other object. +/// +CEF_EXPORT cef_list_value_t* cef_list_value_create(); + + +#ifdef __cplusplus +} +#endif + +#endif // CEF_INCLUDE_CAPI_CEF_VALUES_CAPI_H_ diff --git a/dependencies64/cef/include/capi/cef_web_plugin_capi.h b/dependencies64/cef/include/capi/cef_web_plugin_capi.h new file mode 100644 index 000000000..05a779a1c --- /dev/null +++ b/dependencies64/cef/include/capi/cef_web_plugin_capi.h @@ -0,0 +1,195 @@ +// Copyright (c) 2015 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool and should not edited +// by hand. See the translator.README.txt file in the tools directory for +// more information. +// + +#ifndef CEF_INCLUDE_CAPI_CEF_WEB_PLUGIN_CAPI_H_ +#define CEF_INCLUDE_CAPI_CEF_WEB_PLUGIN_CAPI_H_ +#pragma once + +#include "include/capi/cef_base_capi.h" +#include "include/capi/cef_browser_capi.h" + +#ifdef __cplusplus +extern "C" { +#endif + + +/// +// Information about a specific web plugin. +/// +typedef struct _cef_web_plugin_info_t { + /// + // Base structure. + /// + cef_base_t base; + + /// + // Returns the plugin name (i.e. Flash). + /// + // The resulting string must be freed by calling cef_string_userfree_free(). + cef_string_userfree_t (CEF_CALLBACK *get_name)( + struct _cef_web_plugin_info_t* self); + + /// + // Returns the plugin file path (DLL/bundle/library). + /// + // The resulting string must be freed by calling cef_string_userfree_free(). + cef_string_userfree_t (CEF_CALLBACK *get_path)( + struct _cef_web_plugin_info_t* self); + + /// + // Returns the version of the plugin (may be OS-specific). + /// + // The resulting string must be freed by calling cef_string_userfree_free(). + cef_string_userfree_t (CEF_CALLBACK *get_version)( + struct _cef_web_plugin_info_t* self); + + /// + // Returns a description of the plugin from the version information. + /// + // The resulting string must be freed by calling cef_string_userfree_free(). + cef_string_userfree_t (CEF_CALLBACK *get_description)( + struct _cef_web_plugin_info_t* self); +} cef_web_plugin_info_t; + + +/// +// Structure to implement for visiting web plugin information. The functions of +// this structure will be called on the browser process UI thread. +/// +typedef struct _cef_web_plugin_info_visitor_t { + /// + // Base structure. + /// + cef_base_t base; + + /// + // Method that will be called once for each plugin. |count| is the 0-based + // index for the current plugin. |total| is the total number of plugins. + // Return false (0) to stop visiting plugins. This function may never be + // called if no plugins are found. + /// + int (CEF_CALLBACK *visit)(struct _cef_web_plugin_info_visitor_t* self, + struct _cef_web_plugin_info_t* info, int count, int total); +} cef_web_plugin_info_visitor_t; + + +/// +// Structure to implement for receiving unstable plugin information. The +// functions of this structure will be called on the browser process IO thread. +/// +typedef struct _cef_web_plugin_unstable_callback_t { + /// + // Base structure. + /// + cef_base_t base; + + /// + // Method that will be called for the requested plugin. |unstable| will be + // true (1) if the plugin has reached the crash count threshold of 3 times in + // 120 seconds. + /// + void (CEF_CALLBACK *is_unstable)( + struct _cef_web_plugin_unstable_callback_t* self, + const cef_string_t* path, int unstable); +} cef_web_plugin_unstable_callback_t; + + +/// +// Visit web plugin information. Can be called on any thread in the browser +// process. +/// +CEF_EXPORT void cef_visit_web_plugin_info( + cef_web_plugin_info_visitor_t* visitor); + +/// +// Cause the plugin list to refresh the next time it is accessed regardless of +// whether it has already been loaded. Can be called on any thread in the +// browser process. +/// +CEF_EXPORT void cef_refresh_web_plugins(); + +/// +// Add a plugin path (directory + file). This change may not take affect until +// after cef_refresh_web_plugins() is called. Can be called on any thread in the +// browser process. +/// +CEF_EXPORT void cef_add_web_plugin_path(const cef_string_t* path); + +/// +// Add a plugin directory. This change may not take affect until after +// cef_refresh_web_plugins() is called. Can be called on any thread in the +// browser process. +/// +CEF_EXPORT void cef_add_web_plugin_directory(const cef_string_t* dir); + +/// +// Remove a plugin path (directory + file). This change may not take affect +// until after cef_refresh_web_plugins() is called. Can be called on any thread +// in the browser process. +/// +CEF_EXPORT void cef_remove_web_plugin_path(const cef_string_t* path); + +/// +// Unregister an internal plugin. This may be undone the next time +// cef_refresh_web_plugins() is called. Can be called on any thread in the +// browser process. +/// +CEF_EXPORT void cef_unregister_internal_web_plugin(const cef_string_t* path); + +/// +// Force a plugin to shutdown. Can be called on any thread in the browser +// process but will be executed on the IO thread. +/// +CEF_EXPORT void cef_force_web_plugin_shutdown(const cef_string_t* path); + +/// +// Register a plugin crash. Can be called on any thread in the browser process +// but will be executed on the IO thread. +/// +CEF_EXPORT void cef_register_web_plugin_crash(const cef_string_t* path); + +/// +// Query if a plugin is unstable. Can be called on any thread in the browser +// process. +/// +CEF_EXPORT void cef_is_web_plugin_unstable(const cef_string_t* path, + cef_web_plugin_unstable_callback_t* callback); + +#ifdef __cplusplus +} +#endif + +#endif // CEF_INCLUDE_CAPI_CEF_WEB_PLUGIN_CAPI_H_ diff --git a/dependencies64/cef/include/capi/cef_xml_reader_capi.h b/dependencies64/cef/include/capi/cef_xml_reader_capi.h new file mode 100644 index 000000000..263bcfe1f --- /dev/null +++ b/dependencies64/cef/include/capi/cef_xml_reader_capi.h @@ -0,0 +1,278 @@ +// Copyright (c) 2015 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool and should not edited +// by hand. See the translator.README.txt file in the tools directory for +// more information. +// + +#ifndef CEF_INCLUDE_CAPI_CEF_XML_READER_CAPI_H_ +#define CEF_INCLUDE_CAPI_CEF_XML_READER_CAPI_H_ +#pragma once + +#include "include/capi/cef_base_capi.h" +#include "include/capi/cef_stream_capi.h" + +#ifdef __cplusplus +extern "C" { +#endif + + +/// +// Structure that supports the reading of XML data via the libxml streaming API. +// The functions of this structure should only be called on the thread that +// creates the object. +/// +typedef struct _cef_xml_reader_t { + /// + // Base structure. + /// + cef_base_t base; + + /// + // Moves the cursor to the next node in the document. This function must be + // called at least once to set the current cursor position. Returns true (1) + // if the cursor position was set successfully. + /// + int (CEF_CALLBACK *move_to_next_node)(struct _cef_xml_reader_t* self); + + /// + // Close the document. This should be called directly to ensure that cleanup + // occurs on the correct thread. + /// + int (CEF_CALLBACK *close)(struct _cef_xml_reader_t* self); + + /// + // Returns true (1) if an error has been reported by the XML parser. + /// + int (CEF_CALLBACK *has_error)(struct _cef_xml_reader_t* self); + + /// + // Returns the error string. + /// + // The resulting string must be freed by calling cef_string_userfree_free(). + cef_string_userfree_t (CEF_CALLBACK *get_error)( + struct _cef_xml_reader_t* self); + + + // The below functions retrieve data for the node at the current cursor + // position. + + /// + // Returns the node type. + /// + cef_xml_node_type_t (CEF_CALLBACK *get_type)(struct _cef_xml_reader_t* self); + + /// + // Returns the node depth. Depth starts at 0 for the root node. + /// + int (CEF_CALLBACK *get_depth)(struct _cef_xml_reader_t* self); + + /// + // Returns the local name. See http://www.w3.org/TR/REC-xml-names/#NT- + // LocalPart for additional details. + /// + // The resulting string must be freed by calling cef_string_userfree_free(). + cef_string_userfree_t (CEF_CALLBACK *get_local_name)( + struct _cef_xml_reader_t* self); + + /// + // Returns the namespace prefix. See http://www.w3.org/TR/REC-xml-names/ for + // additional details. + /// + // The resulting string must be freed by calling cef_string_userfree_free(). + cef_string_userfree_t (CEF_CALLBACK *get_prefix)( + struct _cef_xml_reader_t* self); + + /// + // Returns the qualified name, equal to (Prefix:)LocalName. See + // http://www.w3.org/TR/REC-xml-names/#ns-qualnames for additional details. + /// + // The resulting string must be freed by calling cef_string_userfree_free(). + cef_string_userfree_t (CEF_CALLBACK *get_qualified_name)( + struct _cef_xml_reader_t* self); + + /// + // Returns the URI defining the namespace associated with the node. See + // http://www.w3.org/TR/REC-xml-names/ for additional details. + /// + // The resulting string must be freed by calling cef_string_userfree_free(). + cef_string_userfree_t (CEF_CALLBACK *get_namespace_uri)( + struct _cef_xml_reader_t* self); + + /// + // Returns the base URI of the node. See http://www.w3.org/TR/xmlbase/ for + // additional details. + /// + // The resulting string must be freed by calling cef_string_userfree_free(). + cef_string_userfree_t (CEF_CALLBACK *get_base_uri)( + struct _cef_xml_reader_t* self); + + /// + // Returns the xml:lang scope within which the node resides. See + // http://www.w3.org/TR/REC-xml/#sec-lang-tag for additional details. + /// + // The resulting string must be freed by calling cef_string_userfree_free(). + cef_string_userfree_t (CEF_CALLBACK *get_xml_lang)( + struct _cef_xml_reader_t* self); + + /// + // Returns true (1) if the node represents an NULL element.
is considered + // NULL but is not. + /// + int (CEF_CALLBACK *is_empty_element)(struct _cef_xml_reader_t* self); + + /// + // Returns true (1) if the node has a text value. + /// + int (CEF_CALLBACK *has_value)(struct _cef_xml_reader_t* self); + + /// + // Returns the text value. + /// + // The resulting string must be freed by calling cef_string_userfree_free(). + cef_string_userfree_t (CEF_CALLBACK *get_value)( + struct _cef_xml_reader_t* self); + + /// + // Returns true (1) if the node has attributes. + /// + int (CEF_CALLBACK *has_attributes)(struct _cef_xml_reader_t* self); + + /// + // Returns the number of attributes. + /// + size_t (CEF_CALLBACK *get_attribute_count)(struct _cef_xml_reader_t* self); + + /// + // Returns the value of the attribute at the specified 0-based index. + /// + // The resulting string must be freed by calling cef_string_userfree_free(). + cef_string_userfree_t (CEF_CALLBACK *get_attribute_byindex)( + struct _cef_xml_reader_t* self, int index); + + /// + // Returns the value of the attribute with the specified qualified name. + /// + // The resulting string must be freed by calling cef_string_userfree_free(). + cef_string_userfree_t (CEF_CALLBACK *get_attribute_byqname)( + struct _cef_xml_reader_t* self, const cef_string_t* qualifiedName); + + /// + // Returns the value of the attribute with the specified local name and + // namespace URI. + /// + // The resulting string must be freed by calling cef_string_userfree_free(). + cef_string_userfree_t (CEF_CALLBACK *get_attribute_bylname)( + struct _cef_xml_reader_t* self, const cef_string_t* localName, + const cef_string_t* namespaceURI); + + /// + // Returns an XML representation of the current node's children. + /// + // The resulting string must be freed by calling cef_string_userfree_free(). + cef_string_userfree_t (CEF_CALLBACK *get_inner_xml)( + struct _cef_xml_reader_t* self); + + /// + // Returns an XML representation of the current node including its children. + /// + // The resulting string must be freed by calling cef_string_userfree_free(). + cef_string_userfree_t (CEF_CALLBACK *get_outer_xml)( + struct _cef_xml_reader_t* self); + + /// + // Returns the line number for the current node. + /// + int (CEF_CALLBACK *get_line_number)(struct _cef_xml_reader_t* self); + + + // Attribute nodes are not traversed by default. The below functions can be + // used to move the cursor to an attribute node. move_to_carrying_element() + // can be called afterwards to return the cursor to the carrying element. The + // depth of an attribute node will be 1 + the depth of the carrying element. + + /// + // Moves the cursor to the attribute at the specified 0-based index. Returns + // true (1) if the cursor position was set successfully. + /// + int (CEF_CALLBACK *move_to_attribute_byindex)(struct _cef_xml_reader_t* self, + int index); + + /// + // Moves the cursor to the attribute with the specified qualified name. + // Returns true (1) if the cursor position was set successfully. + /// + int (CEF_CALLBACK *move_to_attribute_byqname)(struct _cef_xml_reader_t* self, + const cef_string_t* qualifiedName); + + /// + // Moves the cursor to the attribute with the specified local name and + // namespace URI. Returns true (1) if the cursor position was set + // successfully. + /// + int (CEF_CALLBACK *move_to_attribute_bylname)(struct _cef_xml_reader_t* self, + const cef_string_t* localName, const cef_string_t* namespaceURI); + + /// + // Moves the cursor to the first attribute in the current element. Returns + // true (1) if the cursor position was set successfully. + /// + int (CEF_CALLBACK *move_to_first_attribute)(struct _cef_xml_reader_t* self); + + /// + // Moves the cursor to the next attribute in the current element. Returns true + // (1) if the cursor position was set successfully. + /// + int (CEF_CALLBACK *move_to_next_attribute)(struct _cef_xml_reader_t* self); + + /// + // Moves the cursor back to the carrying element. Returns true (1) if the + // cursor position was set successfully. + /// + int (CEF_CALLBACK *move_to_carrying_element)(struct _cef_xml_reader_t* self); +} cef_xml_reader_t; + + +/// +// Create a new cef_xml_reader_t object. The returned object's functions can +// only be called from the thread that created the object. +/// +CEF_EXPORT cef_xml_reader_t* cef_xml_reader_create( + struct _cef_stream_reader_t* stream, cef_xml_encoding_type_t encodingType, + const cef_string_t* URI); + + +#ifdef __cplusplus +} +#endif + +#endif // CEF_INCLUDE_CAPI_CEF_XML_READER_CAPI_H_ diff --git a/dependencies64/cef/include/capi/cef_zip_reader_capi.h b/dependencies64/cef/include/capi/cef_zip_reader_capi.h new file mode 100644 index 000000000..eceb32db9 --- /dev/null +++ b/dependencies64/cef/include/capi/cef_zip_reader_capi.h @@ -0,0 +1,149 @@ +// Copyright (c) 2015 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool and should not edited +// by hand. See the translator.README.txt file in the tools directory for +// more information. +// + +#ifndef CEF_INCLUDE_CAPI_CEF_ZIP_READER_CAPI_H_ +#define CEF_INCLUDE_CAPI_CEF_ZIP_READER_CAPI_H_ +#pragma once + +#include "include/capi/cef_base_capi.h" +#include "include/capi/cef_stream_capi.h" + +#ifdef __cplusplus +extern "C" { +#endif + + +/// +// Structure that supports the reading of zip archives via the zlib unzip API. +// The functions of this structure should only be called on the thread that +// creates the object. +/// +typedef struct _cef_zip_reader_t { + /// + // Base structure. + /// + cef_base_t base; + + /// + // Moves the cursor to the first file in the archive. Returns true (1) if the + // cursor position was set successfully. + /// + int (CEF_CALLBACK *move_to_first_file)(struct _cef_zip_reader_t* self); + + /// + // Moves the cursor to the next file in the archive. Returns true (1) if the + // cursor position was set successfully. + /// + int (CEF_CALLBACK *move_to_next_file)(struct _cef_zip_reader_t* self); + + /// + // Moves the cursor to the specified file in the archive. If |caseSensitive| + // is true (1) then the search will be case sensitive. Returns true (1) if the + // cursor position was set successfully. + /// + int (CEF_CALLBACK *move_to_file)(struct _cef_zip_reader_t* self, + const cef_string_t* fileName, int caseSensitive); + + /// + // Closes the archive. This should be called directly to ensure that cleanup + // occurs on the correct thread. + /// + int (CEF_CALLBACK *close)(struct _cef_zip_reader_t* self); + + + // The below functions act on the file at the current cursor position. + + /// + // Returns the name of the file. + /// + // The resulting string must be freed by calling cef_string_userfree_free(). + cef_string_userfree_t (CEF_CALLBACK *get_file_name)( + struct _cef_zip_reader_t* self); + + /// + // Returns the uncompressed size of the file. + /// + int64 (CEF_CALLBACK *get_file_size)(struct _cef_zip_reader_t* self); + + /// + // Returns the last modified timestamp for the file. + /// + time_t (CEF_CALLBACK *get_file_last_modified)(struct _cef_zip_reader_t* self); + + /// + // Opens the file for reading of uncompressed data. A read password may + // optionally be specified. + /// + int (CEF_CALLBACK *open_file)(struct _cef_zip_reader_t* self, + const cef_string_t* password); + + /// + // Closes the file. + /// + int (CEF_CALLBACK *close_file)(struct _cef_zip_reader_t* self); + + /// + // Read uncompressed file contents into the specified buffer. Returns < 0 if + // an error occurred, 0 if at the end of file, or the number of bytes read. + /// + int (CEF_CALLBACK *read_file)(struct _cef_zip_reader_t* self, void* buffer, + size_t bufferSize); + + /// + // Returns the current offset in the uncompressed file contents. + /// + int64 (CEF_CALLBACK *tell)(struct _cef_zip_reader_t* self); + + /// + // Returns true (1) if at end of the file contents. + /// + int (CEF_CALLBACK *eof)(struct _cef_zip_reader_t* self); +} cef_zip_reader_t; + + +/// +// Create a new cef_zip_reader_t object. The returned object's functions can +// only be called from the thread that created the object. +/// +CEF_EXPORT cef_zip_reader_t* cef_zip_reader_create( + struct _cef_stream_reader_t* stream); + + +#ifdef __cplusplus +} +#endif + +#endif // CEF_INCLUDE_CAPI_CEF_ZIP_READER_CAPI_H_ diff --git a/dependencies64/cef/include/cef_app.h b/dependencies64/cef/include/cef_app.h new file mode 100644 index 000000000..bac622812 --- /dev/null +++ b/dependencies64/cef/include/cef_app.h @@ -0,0 +1,192 @@ +// Copyright (c) 2012 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// The contents of this file must follow a specific format in order to +// support the CEF translator tool. See the translator.README.txt file in the +// tools directory for more information. +// + + +#ifndef CEF_INCLUDE_CEF_APP_H_ +#define CEF_INCLUDE_CEF_APP_H_ +#pragma once + +#include "include/cef_base.h" +#include "include/cef_browser_process_handler.h" +#include "include/cef_command_line.h" +#include "include/cef_render_process_handler.h" +#include "include/cef_resource_bundle_handler.h" +#include "include/cef_scheme.h" + +class CefApp; + +/// +// This function should be called from the application entry point function to +// execute a secondary process. It can be used to run secondary processes from +// the browser client executable (default behavior) or from a separate +// executable specified by the CefSettings.browser_subprocess_path value. If +// called for the browser process (identified by no "type" command-line value) +// it will return immediately with a value of -1. If called for a recognized +// secondary process it will block until the process should exit and then return +// the process exit code. The |application| parameter may be empty. The +// |windows_sandbox_info| parameter is only used on Windows and may be NULL (see +// cef_sandbox_win.h for details). +/// +/*--cef(api_hash_check,optional_param=application, + optional_param=windows_sandbox_info)--*/ +int CefExecuteProcess(const CefMainArgs& args, + CefRefPtr application, + void* windows_sandbox_info); + +/// +// This function should be called on the main application thread to initialize +// the CEF browser process. The |application| parameter may be empty. A return +// value of true indicates that it succeeded and false indicates that it failed. +// The |windows_sandbox_info| parameter is only used on Windows and may be NULL +// (see cef_sandbox_win.h for details). +/// +/*--cef(api_hash_check,optional_param=application, + optional_param=windows_sandbox_info)--*/ +bool CefInitialize(const CefMainArgs& args, + const CefSettings& settings, + CefRefPtr application, + void* windows_sandbox_info); + +/// +// This function should be called on the main application thread to shut down +// the CEF browser process before the application exits. +/// +/*--cef()--*/ +void CefShutdown(); + +/// +// Perform a single iteration of CEF message loop processing. This function is +// used to integrate the CEF message loop into an existing application message +// loop. Care must be taken to balance performance against excessive CPU usage. +// This function should only be called on the main application thread and only +// if CefInitialize() is called with a CefSettings.multi_threaded_message_loop +// value of false. This function will not block. +/// +/*--cef()--*/ +void CefDoMessageLoopWork(); + +/// +// Run the CEF message loop. Use this function instead of an application- +// provided message loop to get the best balance between performance and CPU +// usage. This function should only be called on the main application thread and +// only if CefInitialize() is called with a +// CefSettings.multi_threaded_message_loop value of false. This function will +// block until a quit message is received by the system. +/// +/*--cef()--*/ +void CefRunMessageLoop(); + +/// +// Quit the CEF message loop that was started by calling CefRunMessageLoop(). +// This function should only be called on the main application thread and only +// if CefRunMessageLoop() was used. +/// +/*--cef()--*/ +void CefQuitMessageLoop(); + +/// +// Set to true before calling Windows APIs like TrackPopupMenu that enter a +// modal message loop. Set to false after exiting the modal message loop. +/// +/*--cef()--*/ +void CefSetOSModalLoop(bool osModalLoop); + +/// +// Implement this interface to provide handler implementations. Methods will be +// called by the process and/or thread indicated. +/// +/*--cef(source=client,no_debugct_check)--*/ +class CefApp : public virtual CefBase { + public: + /// + // Provides an opportunity to view and/or modify command-line arguments before + // processing by CEF and Chromium. The |process_type| value will be empty for + // the browser process. Do not keep a reference to the CefCommandLine object + // passed to this method. The CefSettings.command_line_args_disabled value + // can be used to start with an empty command-line object. Any values + // specified in CefSettings that equate to command-line arguments will be set + // before this method is called. Be cautious when using this method to modify + // command-line arguments for non-browser processes as this may result in + // undefined behavior including crashes. + /// + /*--cef(optional_param=process_type)--*/ + virtual void OnBeforeCommandLineProcessing( + const CefString& process_type, + CefRefPtr command_line) { + } + + /// + // Provides an opportunity to register custom schemes. Do not keep a reference + // to the |registrar| object. This method is called on the main thread for + // each process and the registered schemes should be the same across all + // processes. + /// + /*--cef()--*/ + virtual void OnRegisterCustomSchemes( + CefRefPtr registrar) { + } + + /// + // Return the handler for resource bundle events. If + // CefSettings.pack_loading_disabled is true a handler must be returned. If no + // handler is returned resources will be loaded from pack files. This method + // is called by the browser and render processes on multiple threads. + /// + /*--cef()--*/ + virtual CefRefPtr GetResourceBundleHandler() { + return NULL; + } + + /// + // Return the handler for functionality specific to the browser process. This + // method is called on multiple threads in the browser process. + /// + /*--cef()--*/ + virtual CefRefPtr GetBrowserProcessHandler() { + return NULL; + } + + /// + // Return the handler for functionality specific to the render process. This + // method is called on the render process main thread. + /// + /*--cef()--*/ + virtual CefRefPtr GetRenderProcessHandler() { + return NULL; + } +}; + +#endif // CEF_INCLUDE_CEF_APP_H_ diff --git a/dependencies64/cef/include/cef_auth_callback.h b/dependencies64/cef/include/cef_auth_callback.h new file mode 100644 index 000000000..86d249ad3 --- /dev/null +++ b/dependencies64/cef/include/cef_auth_callback.h @@ -0,0 +1,64 @@ +// Copyright (c) 2013 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// The contents of this file must follow a specific format in order to +// support the CEF translator tool. See the translator.README.txt file in the +// tools directory for more information. +// + +#ifndef CEF_INCLUDE_CEF_AUTH_CALLBACK_H_ +#define CEF_INCLUDE_CEF_AUTH_CALLBACK_H_ +#pragma once + +#include "include/cef_base.h" + +/// +// Callback interface used for asynchronous continuation of authentication +// requests. +/// +/*--cef(source=library)--*/ +class CefAuthCallback : public virtual CefBase { + public: + /// + // Continue the authentication request. + /// + /*--cef(capi_name=cont)--*/ + virtual void Continue(const CefString& username, + const CefString& password) =0; + + /// + // Cancel the authentication request. + /// + /*--cef()--*/ + virtual void Cancel() =0; +}; + +#endif // CEF_INCLUDE_CEF_AUTH_CALLBACK_H_ diff --git a/dependencies64/cef/include/cef_base.h b/dependencies64/cef/include/cef_base.h new file mode 100644 index 000000000..c237b9e8d --- /dev/null +++ b/dependencies64/cef/include/cef_base.h @@ -0,0 +1,180 @@ +// Copyright (c) 2012 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +#ifndef CEF_INCLUDE_CEF_BASE_H_ +#define CEF_INCLUDE_CEF_BASE_H_ +#pragma once + +#include "include/base/cef_atomic_ref_count.h" +#include "include/base/cef_build.h" +#include "include/base/cef_macros.h" + +// Bring in common C++ type definitions used by CEF consumers. +#include "include/internal/cef_ptr.h" +#include "include/internal/cef_types_wrappers.h" +#if defined(OS_WIN) +#include "include/internal/cef_win.h" +#elif defined(OS_MACOSX) +#include "include/internal/cef_mac.h" +#elif defined(OS_LINUX) +#include "include/internal/cef_linux.h" +#endif + +/// +// Interface defining the reference count implementation methods. All framework +// classes must extend the CefBase class. +/// +class CefBase { + public: + /// + // Called to increment the reference count for the object. Should be called + // for every new copy of a pointer to a given object. + /// + virtual void AddRef() const =0; + + /// + // Called to decrement the reference count for the object. Returns true if + // the reference count is 0, in which case the object should self-delete. + /// + virtual bool Release() const =0; + + /// + // Returns true if the reference count is 1. + /// + virtual bool HasOneRef() const =0; + + protected: + virtual ~CefBase() {} +}; + +/// +// Class that implements atomic reference counting. +/// +class CefRefCount { + public: + CefRefCount() : ref_count_(0) {} + + /// + // Increment the reference count. + /// + void AddRef() const { + base::AtomicRefCountInc(&ref_count_); + } + + /// + // Decrement the reference count. Returns true if the reference count is 0. + /// + bool Release() const { + return !base::AtomicRefCountDec(&ref_count_); + } + + /// + // Returns true if the reference count is 1. + /// + bool HasOneRef() const { + return base::AtomicRefCountIsOne(&ref_count_); + } + + private: + mutable base::AtomicRefCount ref_count_; + DISALLOW_COPY_AND_ASSIGN(CefRefCount); +}; + +/// +// Macro that provides a reference counting implementation for classes extending +// CefBase. +/// +#define IMPLEMENT_REFCOUNTING(ClassName) \ + public: \ + void AddRef() const { \ + ref_count_.AddRef(); \ + } \ + bool Release() const { \ + if (ref_count_.Release()) { \ + delete static_cast(this); \ + return true; \ + } \ + return false; \ + } \ + bool HasOneRef() const { \ + return ref_count_.HasOneRef(); \ + } \ + private: \ + CefRefCount ref_count_; + +/// +// Macro that provides a locking implementation. Use the Lock() and Unlock() +// methods to protect a section of code from simultaneous access by multiple +// threads. The AutoLock class is a helper that will hold the lock while in +// scope. +// +// THIS MACRO IS DEPRECATED. Use an explicit base::Lock member variable and +// base::AutoLock instead. For example: +// +// #include "include/base/cef_lock.h" +// +// // Class declaration. +// class MyClass : public CefBase { +// public: +// MyClass() : value_(0) {} +// // Method that may be called on multiple threads. +// void IncrementValue(); +// private: +// // Value that may be accessed on multiple theads. +// int value_; +// // Lock used to protect access to |value_|. +// base::Lock lock_; +// IMPLEMENT_REFCOUNTING(MyClass); +// }; +// +// // Class implementation. +// void MyClass::IncrementValue() { +// // Acquire the lock for the scope of this method. +// base::AutoLock lock_scope(lock_); +// // |value_| can now be modified safely. +// value_++; +// } +/// +#define IMPLEMENT_LOCKING(ClassName) \ + public: \ + class AutoLock { \ + public: \ + explicit AutoLock(ClassName* base) : base_(base) { base_->Lock(); } \ + ~AutoLock() { base_->Unlock(); } \ + private: \ + ClassName* base_; \ + DISALLOW_COPY_AND_ASSIGN(AutoLock); \ + }; \ + void Lock() { lock_.Acquire(); } \ + void Unlock() { lock_.Release(); } \ + private: \ + base::Lock lock_; + +#endif // CEF_INCLUDE_CEF_BASE_H_ diff --git a/dependencies64/cef/include/cef_browser.h b/dependencies64/cef/include/cef_browser.h new file mode 100644 index 000000000..653053f0e --- /dev/null +++ b/dependencies64/cef/include/cef_browser.h @@ -0,0 +1,645 @@ +// Copyright (c) 2012 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// The contents of this file must follow a specific format in order to +// support the CEF translator tool. See the translator.README.txt file in the +// tools directory for more information. +// + +#ifndef CEF_INCLUDE_CEF_BROWSER_H_ +#define CEF_INCLUDE_CEF_BROWSER_H_ +#pragma once + +#include "include/cef_base.h" +#include "include/cef_drag_data.h" +#include "include/cef_frame.h" +#include "include/cef_navigation_entry.h" +#include "include/cef_process_message.h" +#include "include/cef_request_context.h" +#include + +class CefBrowserHost; +class CefClient; + + +/// +// Class used to represent a browser window. When used in the browser process +// the methods of this class may be called on any thread unless otherwise +// indicated in the comments. When used in the render process the methods of +// this class may only be called on the main thread. +/// +/*--cef(source=library)--*/ +class CefBrowser : public virtual CefBase { + public: + /// + // Returns the browser host object. This method can only be called in the + // browser process. + /// + /*--cef()--*/ + virtual CefRefPtr GetHost() =0; + + /// + // Returns true if the browser can navigate backwards. + /// + /*--cef()--*/ + virtual bool CanGoBack() =0; + + /// + // Navigate backwards. + /// + /*--cef()--*/ + virtual void GoBack() =0; + + /// + // Returns true if the browser can navigate forwards. + /// + /*--cef()--*/ + virtual bool CanGoForward() =0; + + /// + // Navigate forwards. + /// + /*--cef()--*/ + virtual void GoForward() =0; + + /// + // Returns true if the browser is currently loading. + /// + /*--cef()--*/ + virtual bool IsLoading() =0; + + /// + // Reload the current page. + /// + /*--cef()--*/ + virtual void Reload() =0; + + /// + // Reload the current page ignoring any cached data. + /// + /*--cef()--*/ + virtual void ReloadIgnoreCache() =0; + + /// + // Stop loading the page. + /// + /*--cef()--*/ + virtual void StopLoad() =0; + + /// + // Returns the globally unique identifier for this browser. + /// + /*--cef()--*/ + virtual int GetIdentifier() =0; + + /// + // Returns true if this object is pointing to the same handle as |that| + // object. + /// + /*--cef()--*/ + virtual bool IsSame(CefRefPtr that) =0; + + /// + // Returns true if the window is a popup window. + /// + /*--cef()--*/ + virtual bool IsPopup() =0; + + /// + // Returns true if a document has been loaded in the browser. + /// + /*--cef()--*/ + virtual bool HasDocument() =0; + + /// + // Returns the main (top-level) frame for the browser window. + /// + /*--cef()--*/ + virtual CefRefPtr GetMainFrame() =0; + + /// + // Returns the focused frame for the browser window. + /// + /*--cef()--*/ + virtual CefRefPtr GetFocusedFrame() =0; + + /// + // Returns the frame with the specified identifier, or NULL if not found. + /// + /*--cef(capi_name=get_frame_byident)--*/ + virtual CefRefPtr GetFrame(int64 identifier) =0; + + /// + // Returns the frame with the specified name, or NULL if not found. + /// + /*--cef(optional_param=name)--*/ + virtual CefRefPtr GetFrame(const CefString& name) =0; + + /// + // Returns the number of frames that currently exist. + /// + /*--cef()--*/ + virtual size_t GetFrameCount() =0; + + /// + // Returns the identifiers of all existing frames. + /// + /*--cef(count_func=identifiers:GetFrameCount)--*/ + virtual void GetFrameIdentifiers(std::vector& identifiers) =0; + + /// + // Returns the names of all existing frames. + /// + /*--cef()--*/ + virtual void GetFrameNames(std::vector& names) =0; + + // + // Send a message to the specified |target_process|. Returns true if the + // message was sent successfully. + /// + /*--cef()--*/ + virtual bool SendProcessMessage(CefProcessId target_process, + CefRefPtr message) =0; +}; + + +/// +// Callback interface for CefBrowserHost::RunFileDialog. The methods of this +// class will be called on the browser process UI thread. +/// +/*--cef(source=client)--*/ +class CefRunFileDialogCallback : public virtual CefBase { + public: + /// + // Called asynchronously after the file dialog is dismissed. + // |selected_accept_filter| is the 0-based index of the value selected from + // the accept filters array passed to CefBrowserHost::RunFileDialog. + // |file_paths| will be a single value or a list of values depending on the + // dialog mode. If the selection was cancelled |file_paths| will be empty. + /// + /*--cef(index_param=selected_accept_filter,optional_param=file_paths)--*/ + virtual void OnFileDialogDismissed( + int selected_accept_filter, + const std::vector& file_paths) =0; +}; + + +/// +// Callback interface for CefBrowserHost::GetNavigationEntries. The methods of +// this class will be called on the browser process UI thread. +/// +/*--cef(source=client)--*/ +class CefNavigationEntryVisitor : public virtual CefBase { + public: + /// + // Method that will be executed. Do not keep a reference to |entry| outside of + // this callback. Return true to continue visiting entries or false to stop. + // |current| is true if this entry is the currently loaded navigation entry. + // |index| is the 0-based index of this entry and |total| is the total number + // of entries. + /// + /*--cef()--*/ + virtual bool Visit(CefRefPtr entry, + bool current, + int index, + int total) =0; +}; + + +/// +// Class used to represent the browser process aspects of a browser window. The +// methods of this class can only be called in the browser process. They may be +// called on any thread in that process unless otherwise indicated in the +// comments. +/// +/*--cef(source=library)--*/ +class CefBrowserHost : public virtual CefBase { + public: + typedef cef_drag_operations_mask_t DragOperationsMask; + typedef cef_file_dialog_mode_t FileDialogMode; + typedef cef_mouse_button_type_t MouseButtonType; + typedef cef_paint_element_type_t PaintElementType; + + /// + // Create a new browser window using the window parameters specified by + // |windowInfo|. All values will be copied internally and the actual window + // will be created on the UI thread. If |request_context| is empty the + // global request context will be used. This method can be called on any + // browser process thread and will not block. + /// + /*--cef(optional_param=client,optional_param=url, + optional_param=request_context)--*/ + static bool CreateBrowser(const CefWindowInfo& windowInfo, + CefRefPtr client, + const CefString& url, + const CefBrowserSettings& settings, + CefRefPtr request_context); + + /// + // Create a new browser window using the window parameters specified by + // |windowInfo|. If |request_context| is empty the global request context + // will be used. This method can only be called on the browser process UI + // thread. + /// + /*--cef(optional_param=client,optional_param=url, + optional_param=request_context)--*/ + static CefRefPtr CreateBrowserSync( + const CefWindowInfo& windowInfo, + CefRefPtr client, + const CefString& url, + const CefBrowserSettings& settings, + CefRefPtr request_context); + + /// + // Returns the hosted browser object. + /// + /*--cef()--*/ + virtual CefRefPtr GetBrowser() =0; + + /// + // Request that the browser close. The JavaScript 'onbeforeunload' event will + // be fired. If |force_close| is false the event handler, if any, will be + // allowed to prompt the user and the user can optionally cancel the close. + // If |force_close| is true the prompt will not be displayed and the close + // will proceed. Results in a call to CefLifeSpanHandler::DoClose() if the + // event handler allows the close or if |force_close| is true. See + // CefLifeSpanHandler::DoClose() documentation for additional usage + // information. + /// + /*--cef()--*/ + virtual void CloseBrowser(bool force_close) =0; + + /// + // Set whether the browser is focused. + /// + /*--cef()--*/ + virtual void SetFocus(bool focus) =0; + + /// + // Set whether the window containing the browser is visible + // (minimized/unminimized, app hidden/unhidden, etc). Only used on Mac OS X. + /// + /*--cef()--*/ + virtual void SetWindowVisibility(bool visible) =0; + + /// + // Retrieve the window handle for this browser. + /// + /*--cef()--*/ + virtual CefWindowHandle GetWindowHandle() =0; + + /// + // Retrieve the window handle of the browser that opened this browser. Will + // return NULL for non-popup windows. This method can be used in combination + // with custom handling of modal windows. + /// + /*--cef()--*/ + virtual CefWindowHandle GetOpenerWindowHandle() =0; + + /// + // Returns the client for this browser. + /// + /*--cef()--*/ + virtual CefRefPtr GetClient() =0; + + /// + // Returns the request context for this browser. + /// + /*--cef()--*/ + virtual CefRefPtr GetRequestContext() =0; + + /// + // Get the current zoom level. The default zoom level is 0.0. This method can + // only be called on the UI thread. + /// + /*--cef()--*/ + virtual double GetZoomLevel() =0; + + /// + // Change the zoom level to the specified value. Specify 0.0 to reset the + // zoom level. If called on the UI thread the change will be applied + // immediately. Otherwise, the change will be applied asynchronously on the + // UI thread. + /// + /*--cef()--*/ + virtual void SetZoomLevel(double zoomLevel) =0; + + /// + // Call to run a file chooser dialog. Only a single file chooser dialog may be + // pending at any given time. |mode| represents the type of dialog to display. + // |title| to the title to be used for the dialog and may be empty to show the + // default title ("Open" or "Save" depending on the mode). |default_file_path| + // is the path with optional directory and/or file name component that will be + // initially selected in the dialog. |accept_filters| are used to restrict the + // selectable file types and may any combination of (a) valid lower-cased MIME + // types (e.g. "text/*" or "image/*"), (b) individual file extensions (e.g. + // ".txt" or ".png"), or (c) combined description and file extension delimited + // using "|" and ";" (e.g. "Image Types|.png;.gif;.jpg"). + // |selected_accept_filter| is the 0-based index of the filter that will be + // selected by default. |callback| will be executed after the dialog is + // dismissed or immediately if another dialog is already pending. The dialog + // will be initiated asynchronously on the UI thread. + /// + /*--cef(optional_param=title,optional_param=default_file_path, + optional_param=accept_filters,index_param=selected_accept_filter)--*/ + virtual void RunFileDialog(FileDialogMode mode, + const CefString& title, + const CefString& default_file_path, + const std::vector& accept_filters, + int selected_accept_filter, + CefRefPtr callback) =0; + + /// + // Download the file at |url| using CefDownloadHandler. + /// + /*--cef()--*/ + virtual void StartDownload(const CefString& url) =0; + + /// + // Print the current browser contents. + /// + /*--cef()--*/ + virtual void Print() =0; + + /// + // Search for |searchText|. |identifier| can be used to have multiple searches + // running simultaniously. |forward| indicates whether to search forward or + // backward within the page. |matchCase| indicates whether the search should + // be case-sensitive. |findNext| indicates whether this is the first request + // or a follow-up. The CefFindHandler instance, if any, returned via + // CefClient::GetFindHandler will be called to report find results. + /// + /*--cef()--*/ + virtual void Find(int identifier, const CefString& searchText, + bool forward, bool matchCase, bool findNext) =0; + + /// + // Cancel all searches that are currently going on. + /// + /*--cef()--*/ + virtual void StopFinding(bool clearSelection) =0; + + /// + // Open developer tools in its own window. If |inspect_element_at| is non- + // empty the element at the specified (x,y) location will be inspected. + /// + /*--cef(optional_param=inspect_element_at)--*/ + virtual void ShowDevTools(const CefWindowInfo& windowInfo, + CefRefPtr client, + const CefBrowserSettings& settings, + const CefPoint& inspect_element_at) =0; + + /// + // Explicitly close the developer tools window if one exists for this browser + // instance. + /// + /*--cef()--*/ + virtual void CloseDevTools() =0; + + /// + // Retrieve a snapshot of current navigation entries as values sent to the + // specified visitor. If |current_only| is true only the current navigation + // entry will be sent, otherwise all navigation entries will be sent. + /// + /// + /*--cef()--*/ + virtual void GetNavigationEntries( + CefRefPtr visitor, + bool current_only) =0; + + /// + // Set whether mouse cursor change is disabled. + /// + /*--cef()--*/ + virtual void SetMouseCursorChangeDisabled(bool disabled) =0; + + /// + // Returns true if mouse cursor change is disabled. + /// + /*--cef()--*/ + virtual bool IsMouseCursorChangeDisabled() =0; + + /// + // If a misspelled word is currently selected in an editable node calling + // this method will replace it with the specified |word|. + /// + /*--cef()--*/ + virtual void ReplaceMisspelling(const CefString& word) =0; + + /// + // Add the specified |word| to the spelling dictionary. + /// + /*--cef()--*/ + virtual void AddWordToDictionary(const CefString& word) =0; + + /// + // Returns true if window rendering is disabled. + /// + /*--cef()--*/ + virtual bool IsWindowRenderingDisabled() =0; + + /// + // Notify the browser that the widget has been resized. The browser will first + // call CefRenderHandler::GetViewRect to get the new size and then call + // CefRenderHandler::OnPaint asynchronously with the updated regions. This + // method is only used when window rendering is disabled. + /// + /*--cef()--*/ + virtual void WasResized() =0; + + /// + // Notify the browser that it has been hidden or shown. Layouting and + // CefRenderHandler::OnPaint notification will stop when the browser is + // hidden. This method is only used when window rendering is disabled. + /// + /*--cef()--*/ + virtual void WasHidden(bool hidden) =0; + + /// + // Send a notification to the browser that the screen info has changed. The + // browser will then call CefRenderHandler::GetScreenInfo to update the + // screen information with the new values. This simulates moving the webview + // window from one display to another, or changing the properties of the + // current display. This method is only used when window rendering is + // disabled. + /// + /*--cef()--*/ + virtual void NotifyScreenInfoChanged() =0; + + /// + // Invalidate the view. The browser will call CefRenderHandler::OnPaint + // asynchronously. This method is only used when window rendering is + // disabled. + /// + /*--cef()--*/ + virtual void Invalidate(PaintElementType type) =0; + + /// + // Send a key event to the browser. + /// + /*--cef()--*/ + virtual void SendKeyEvent(const CefKeyEvent& event) =0; + + /// + // Send a mouse click event to the browser. The |x| and |y| coordinates are + // relative to the upper-left corner of the view. + /// + /*--cef()--*/ + virtual void SendMouseClickEvent(const CefMouseEvent& event, + MouseButtonType type, + bool mouseUp, int clickCount) =0; + + /// + // Send a mouse move event to the browser. The |x| and |y| coordinates are + // relative to the upper-left corner of the view. + /// + /*--cef()--*/ + virtual void SendMouseMoveEvent(const CefMouseEvent& event, + bool mouseLeave) =0; + + /// + // Send a mouse wheel event to the browser. The |x| and |y| coordinates are + // relative to the upper-left corner of the view. The |deltaX| and |deltaY| + // values represent the movement delta in the X and Y directions respectively. + // In order to scroll inside select popups with window rendering disabled + // CefRenderHandler::GetScreenPoint should be implemented properly. + /// + /*--cef()--*/ + virtual void SendMouseWheelEvent(const CefMouseEvent& event, + int deltaX, int deltaY) =0; + + /// + // Send a focus event to the browser. + /// + /*--cef()--*/ + virtual void SendFocusEvent(bool setFocus) =0; + + /// + // Send a capture lost event to the browser. + /// + /*--cef()--*/ + virtual void SendCaptureLostEvent() =0; + + /// + // Notify the browser that the window hosting it is about to be moved or + // resized. This method is only used on Windows and Linux. + /// + /*--cef()--*/ + virtual void NotifyMoveOrResizeStarted() =0; + + /// + // Get the NSTextInputContext implementation for enabling IME on Mac when + // window rendering is disabled. + /// + /*--cef(default_retval=NULL)--*/ + virtual CefTextInputContext GetNSTextInputContext() =0; + + /// + // Handles a keyDown event prior to passing it through the NSTextInputClient + // machinery. + /// + /*--cef()--*/ + virtual void HandleKeyEventBeforeTextInputClient(CefEventHandle keyEvent) =0; + + /// + // Performs any additional actions after NSTextInputClient handles the event. + /// + /*--cef()--*/ + virtual void HandleKeyEventAfterTextInputClient(CefEventHandle keyEvent) =0; + + /// + // Call this method when the user drags the mouse into the web view (before + // calling DragTargetDragOver/DragTargetLeave/DragTargetDrop). + // |drag_data| should not contain file contents as this type of data is not + // allowed to be dragged into the web view. File contents can be removed using + // CefDragData::ResetFileContents (for example, if |drag_data| comes from + // CefRenderHandler::StartDragging). + // This method is only used when window rendering is disabled. + /// + /*--cef()--*/ + virtual void DragTargetDragEnter(CefRefPtr drag_data, + const CefMouseEvent& event, + DragOperationsMask allowed_ops) =0; + + /// + // Call this method each time the mouse is moved across the web view during + // a drag operation (after calling DragTargetDragEnter and before calling + // DragTargetDragLeave/DragTargetDrop). + // This method is only used when window rendering is disabled. + /// + /*--cef()--*/ + virtual void DragTargetDragOver(const CefMouseEvent& event, + DragOperationsMask allowed_ops) =0; + + /// + // Call this method when the user drags the mouse out of the web view (after + // calling DragTargetDragEnter). + // This method is only used when window rendering is disabled. + /// + /*--cef()--*/ + virtual void DragTargetDragLeave() =0; + + /// + // Call this method when the user completes the drag operation by dropping + // the object onto the web view (after calling DragTargetDragEnter). + // The object being dropped is |drag_data|, given as an argument to + // the previous DragTargetDragEnter call. + // This method is only used when window rendering is disabled. + /// + /*--cef()--*/ + virtual void DragTargetDrop(const CefMouseEvent& event) =0; + + /// + // Call this method when the drag operation started by a + // CefRenderHandler::StartDragging call has ended either in a drop or + // by being cancelled. |x| and |y| are mouse coordinates relative to the + // upper-left corner of the view. If the web view is both the drag source + // and the drag target then all DragTarget* methods should be called before + // DragSource* mthods. + // This method is only used when window rendering is disabled. + /// + /*--cef()--*/ + virtual void DragSourceEndedAt(int x, int y, DragOperationsMask op) =0; + + /// + // Call this method when the drag operation started by a + // CefRenderHandler::StartDragging call has completed. This method may be + // called immediately without first calling DragSourceEndedAt to cancel a + // drag operation. If the web view is both the drag source and the drag + // target then all DragTarget* methods should be called before DragSource* + // mthods. + // This method is only used when window rendering is disabled. + /// + /*--cef()--*/ + virtual void DragSourceSystemDragEnded() =0; +}; + +#endif // CEF_INCLUDE_CEF_BROWSER_H_ diff --git a/dependencies64/cef/include/cef_browser_process_handler.h b/dependencies64/cef/include/cef_browser_process_handler.h new file mode 100644 index 000000000..5d62cb30c --- /dev/null +++ b/dependencies64/cef/include/cef_browser_process_handler.h @@ -0,0 +1,92 @@ +// Copyright (c) 2012 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// The contents of this file must follow a specific format in order to +// support the CEF translator tool. See the translator.README.txt file in the +// tools directory for more information. +// + +#ifndef CEF_INCLUDE_CEF_BROWSER_PROCESS_HANDLER_H_ +#define CEF_INCLUDE_CEF_BROWSER_PROCESS_HANDLER_H_ +#pragma once + +#include "include/cef_base.h" +#include "include/cef_command_line.h" +#include "include/cef_print_handler.h" +#include "include/cef_values.h" + +/// +// Class used to implement browser process callbacks. The methods of this class +// will be called on the browser process main thread unless otherwise indicated. +/// +/*--cef(source=client)--*/ +class CefBrowserProcessHandler : public virtual CefBase { + public: + /// + // Called on the browser process UI thread immediately after the CEF context + // has been initialized. + /// + /*--cef()--*/ + virtual void OnContextInitialized() {} + + /// + // Called before a child process is launched. Will be called on the browser + // process UI thread when launching a render process and on the browser + // process IO thread when launching a GPU or plugin process. Provides an + // opportunity to modify the child process command line. Do not keep a + // reference to |command_line| outside of this method. + /// + /*--cef()--*/ + virtual void OnBeforeChildProcessLaunch( + CefRefPtr command_line) {} + + /// + // Called on the browser process IO thread after the main thread has been + // created for a new render process. Provides an opportunity to specify extra + // information that will be passed to + // CefRenderProcessHandler::OnRenderThreadCreated() in the render process. Do + // not keep a reference to |extra_info| outside of this method. + /// + /*--cef()--*/ + virtual void OnRenderProcessThreadCreated( + CefRefPtr extra_info) {} + + /// + // Return the handler for printing on Linux. If a print handler is not + // provided then printing will not be supported on the Linux platform. + /// + /*--cef()--*/ + virtual CefRefPtr GetPrintHandler() { + return NULL; + } +}; + +#endif // CEF_INCLUDE_CEF_BROWSER_PROCESS_HANDLER_H_ diff --git a/dependencies64/cef/include/cef_callback.h b/dependencies64/cef/include/cef_callback.h new file mode 100644 index 000000000..e5efebd2d --- /dev/null +++ b/dependencies64/cef/include/cef_callback.h @@ -0,0 +1,75 @@ +// Copyright (c) 2012 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// The contents of this file must follow a specific format in order to +// support the CEF translator tool. See the translator.README.txt file in the +// tools directory for more information. +// + +#ifndef CEF_INCLUDE_CEF_CALLBACK_H_ +#define CEF_INCLUDE_CEF_CALLBACK_H_ +#pragma once + +#include "include/cef_base.h" + +/// +// Generic callback interface used for asynchronous continuation. +/// +/*--cef(source=library)--*/ +class CefCallback : public virtual CefBase { + public: + /// + // Continue processing. + /// + /*--cef(capi_name=cont)--*/ + virtual void Continue() =0; + + /// + // Cancel processing. + /// + /*--cef()--*/ + virtual void Cancel() =0; +}; + +/// +// Generic callback interface used for asynchronous completion. +/// +/*--cef(source=client)--*/ +class CefCompletionCallback : public virtual CefBase { + public: + /// + // Method that will be called once the task is complete. + /// + /*--cef()--*/ + virtual void OnComplete() =0; +}; + +#endif // CEF_INCLUDE_CEF_CALLBACK_H_ diff --git a/dependencies64/cef/include/cef_client.h b/dependencies64/cef/include/cef_client.h new file mode 100644 index 000000000..81a67ebae --- /dev/null +++ b/dependencies64/cef/include/cef_client.h @@ -0,0 +1,194 @@ +// Copyright (c) 2012 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// The contents of this file must follow a specific format in order to +// support the CEF translator tool. See the translator.README.txt file in the +// tools directory for more information. +// + +#ifndef CEF_INCLUDE_CEF_CLIENT_H_ +#define CEF_INCLUDE_CEF_CLIENT_H_ +#pragma once + +#include "include/cef_base.h" +#include "include/cef_context_menu_handler.h" +#include "include/cef_dialog_handler.h" +#include "include/cef_display_handler.h" +#include "include/cef_download_handler.h" +#include "include/cef_drag_handler.h" +#include "include/cef_find_handler.h" +#include "include/cef_focus_handler.h" +#include "include/cef_geolocation_handler.h" +#include "include/cef_jsdialog_handler.h" +#include "include/cef_keyboard_handler.h" +#include "include/cef_life_span_handler.h" +#include "include/cef_load_handler.h" +#include "include/cef_process_message.h" +#include "include/cef_render_handler.h" +#include "include/cef_request_handler.h" + +/// +// Implement this interface to provide handler implementations. +/// +/*--cef(source=client,no_debugct_check)--*/ +class CefClient : public virtual CefBase { + public: + /// + // Return the handler for context menus. If no handler is provided the default + // implementation will be used. + /// + /*--cef()--*/ + virtual CefRefPtr GetContextMenuHandler() { + return NULL; + } + + /// + // Return the handler for dialogs. If no handler is provided the default + // implementation will be used. + /// + /*--cef()--*/ + virtual CefRefPtr GetDialogHandler() { + return NULL; + } + + /// + // Return the handler for browser display state events. + /// + /*--cef()--*/ + virtual CefRefPtr GetDisplayHandler() { + return NULL; + } + + /// + // Return the handler for download events. If no handler is returned downloads + // will not be allowed. + /// + /*--cef()--*/ + virtual CefRefPtr GetDownloadHandler() { + return NULL; + } + + /// + // Return the handler for drag events. + /// + /*--cef()--*/ + virtual CefRefPtr GetDragHandler() { + return NULL; + } + + /// + // Return the handler for find result events. + /// + /*--cef()--*/ + virtual CefRefPtr GetFindHandler() { + return NULL; + } + + /// + // Return the handler for focus events. + /// + /*--cef()--*/ + virtual CefRefPtr GetFocusHandler() { + return NULL; + } + + /// + // Return the handler for geolocation permissions requests. If no handler is + // provided geolocation access will be denied by default. + /// + /*--cef()--*/ + virtual CefRefPtr GetGeolocationHandler() { + return NULL; + } + + /// + // Return the handler for JavaScript dialogs. If no handler is provided the + // default implementation will be used. + /// + /*--cef()--*/ + virtual CefRefPtr GetJSDialogHandler() { + return NULL; + } + + /// + // Return the handler for keyboard events. + /// + /*--cef()--*/ + virtual CefRefPtr GetKeyboardHandler() { + return NULL; + } + + /// + // Return the handler for browser life span events. + /// + /*--cef()--*/ + virtual CefRefPtr GetLifeSpanHandler() { + return NULL; + } + + /// + // Return the handler for browser load status events. + /// + /*--cef()--*/ + virtual CefRefPtr GetLoadHandler() { + return NULL; + } + + /// + // Return the handler for off-screen rendering events. + /// + /*--cef()--*/ + virtual CefRefPtr GetRenderHandler() { + return NULL; + } + + /// + // Return the handler for browser request events. + /// + /*--cef()--*/ + virtual CefRefPtr GetRequestHandler() { + return NULL; + } + + /// + // Called when a new message is received from a different process. Return true + // if the message was handled or false otherwise. Do not keep a reference to + // or attempt to access the message outside of this callback. + /// + /*--cef()--*/ + virtual bool OnProcessMessageReceived(CefRefPtr browser, + CefProcessId source_process, + CefRefPtr message) { + return false; + } +}; + +#endif // CEF_INCLUDE_CEF_CLIENT_H_ diff --git a/dependencies64/cef/include/cef_command_line.h b/dependencies64/cef/include/cef_command_line.h new file mode 100644 index 000000000..96241cf43 --- /dev/null +++ b/dependencies64/cef/include/cef_command_line.h @@ -0,0 +1,208 @@ +// Copyright (c) 2012 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// The contents of this file must follow a specific format in order to +// support the CEF translator tool. See the translator.README.txt file in the +// tools directory for more information. +// + +#ifndef CEF_INCLUDE_CEF_COMMAND_LINE_H_ +#define CEF_INCLUDE_CEF_COMMAND_LINE_H_ +#pragma once + +#include "include/cef_base.h" +#include +#include + +/// +// Class used to create and/or parse command line arguments. Arguments with +// '--', '-' and, on Windows, '/' prefixes are considered switches. Switches +// will always precede any arguments without switch prefixes. Switches can +// optionally have a value specified using the '=' delimiter (e.g. +// "-switch=value"). An argument of "--" will terminate switch parsing with all +// subsequent tokens, regardless of prefix, being interpreted as non-switch +// arguments. Switch names are considered case-insensitive. This class can be +// used before CefInitialize() is called. +/// +/*--cef(source=library,no_debugct_check)--*/ +class CefCommandLine : public virtual CefBase { + public: + typedef std::vector ArgumentList; + typedef std::map SwitchMap; + + /// + // Create a new CefCommandLine instance. + /// + /*--cef(api_hash_check)--*/ + static CefRefPtr CreateCommandLine(); + + /// + // Returns the singleton global CefCommandLine object. The returned object + // will be read-only. + /// + /*--cef(api_hash_check)--*/ + static CefRefPtr GetGlobalCommandLine(); + + /// + // Returns true if this object is valid. Do not call any other methods if this + // function returns false. + /// + /*--cef()--*/ + virtual bool IsValid() =0; + + /// + // Returns true if the values of this object are read-only. Some APIs may + // expose read-only objects. + /// + /*--cef()--*/ + virtual bool IsReadOnly() =0; + + /// + // Returns a writable copy of this object. + /// + /*--cef()--*/ + virtual CefRefPtr Copy() =0; + + /// + // Initialize the command line with the specified |argc| and |argv| values. + // The first argument must be the name of the program. This method is only + // supported on non-Windows platforms. + /// + /*--cef()--*/ + virtual void InitFromArgv(int argc, const char* const* argv) =0; + + /// + // Initialize the command line with the string returned by calling + // GetCommandLineW(). This method is only supported on Windows. + /// + /*--cef()--*/ + virtual void InitFromString(const CefString& command_line) =0; + + /// + // Reset the command-line switches and arguments but leave the program + // component unchanged. + /// + /*--cef()--*/ + virtual void Reset() =0; + + /// + // Retrieve the original command line string as a vector of strings. + // The argv array: { program, [(--|-|/)switch[=value]]*, [--], [argument]* } + /// + /*--cef()--*/ + virtual void GetArgv(std::vector& argv) =0; + + /// + // Constructs and returns the represented command line string. Use this method + // cautiously because quoting behavior is unclear. + /// + /*--cef()--*/ + virtual CefString GetCommandLineString() =0; + + /// + // Get the program part of the command line string (the first item). + /// + /*--cef()--*/ + virtual CefString GetProgram() =0; + + /// + // Set the program part of the command line string (the first item). + /// + /*--cef()--*/ + virtual void SetProgram(const CefString& program) =0; + + /// + // Returns true if the command line has switches. + /// + /*--cef()--*/ + virtual bool HasSwitches() =0; + + /// + // Returns true if the command line contains the given switch. + /// + /*--cef()--*/ + virtual bool HasSwitch(const CefString& name) =0; + + /// + // Returns the value associated with the given switch. If the switch has no + // value or isn't present this method returns the empty string. + /// + /*--cef()--*/ + virtual CefString GetSwitchValue(const CefString& name) =0; + + /// + // Returns the map of switch names and values. If a switch has no value an + // empty string is returned. + /// + /*--cef()--*/ + virtual void GetSwitches(SwitchMap& switches) =0; + + /// + // Add a switch to the end of the command line. If the switch has no value + // pass an empty value string. + /// + /*--cef()--*/ + virtual void AppendSwitch(const CefString& name) =0; + + /// + // Add a switch with the specified value to the end of the command line. + /// + /*--cef()--*/ + virtual void AppendSwitchWithValue(const CefString& name, + const CefString& value) =0; + + /// + // True if there are remaining command line arguments. + /// + /*--cef()--*/ + virtual bool HasArguments() =0; + + /// + // Get the remaining command line arguments. + /// + /*--cef()--*/ + virtual void GetArguments(ArgumentList& arguments) =0; + + /// + // Add an argument to the end of the command line. + /// + /*--cef()--*/ + virtual void AppendArgument(const CefString& argument) =0; + + /// + // Insert a command before the current command. + // Common for debuggers, like "valgrind" or "gdb --args". + /// + /*--cef()--*/ + virtual void PrependWrapper(const CefString& wrapper) =0; +}; + +#endif // CEF_INCLUDE_CEF_COMMAND_LINE_H_ diff --git a/dependencies64/cef/include/cef_context_menu_handler.h b/dependencies64/cef/include/cef_context_menu_handler.h new file mode 100644 index 000000000..d8751be6b --- /dev/null +++ b/dependencies64/cef/include/cef_context_menu_handler.h @@ -0,0 +1,231 @@ +// Copyright (c) 2012 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// The contents of this file must follow a specific format in order to +// support the CEF translator tool. See the translator.README.txt file in the +// tools directory for more information. +// + +#ifndef CEF_INCLUDE_CEF_CONTEXT_MENU_HANDLER_H_ +#define CEF_INCLUDE_CEF_CONTEXT_MENU_HANDLER_H_ +#pragma once + +#include "include/cef_base.h" +#include "include/cef_browser.h" +#include "include/cef_frame.h" +#include "include/cef_menu_model.h" + +class CefContextMenuParams; + +/// +// Implement this interface to handle context menu events. The methods of this +// class will be called on the UI thread. +/// +/*--cef(source=client)--*/ +class CefContextMenuHandler : public virtual CefBase { + public: + typedef cef_event_flags_t EventFlags; + + /// + // Called before a context menu is displayed. |params| provides information + // about the context menu state. |model| initially contains the default + // context menu. The |model| can be cleared to show no context menu or + // modified to show a custom menu. Do not keep references to |params| or + // |model| outside of this callback. + /// + /*--cef()--*/ + virtual void OnBeforeContextMenu(CefRefPtr browser, + CefRefPtr frame, + CefRefPtr params, + CefRefPtr model) {} + + /// + // Called to execute a command selected from the context menu. Return true if + // the command was handled or false for the default implementation. See + // cef_menu_id_t for the command ids that have default implementations. All + // user-defined command ids should be between MENU_ID_USER_FIRST and + // MENU_ID_USER_LAST. |params| will have the same values as what was passed to + // OnBeforeContextMenu(). Do not keep a reference to |params| outside of this + // callback. + /// + /*--cef()--*/ + virtual bool OnContextMenuCommand(CefRefPtr browser, + CefRefPtr frame, + CefRefPtr params, + int command_id, + EventFlags event_flags) { return false; } + + /// + // Called when the context menu is dismissed irregardless of whether the menu + // was empty or a command was selected. + /// + /*--cef()--*/ + virtual void OnContextMenuDismissed(CefRefPtr browser, + CefRefPtr frame) {} +}; + + +/// +// Provides information about the context menu state. The ethods of this class +// can only be accessed on browser process the UI thread. +/// +/*--cef(source=library)--*/ +class CefContextMenuParams : public virtual CefBase { + public: + typedef cef_context_menu_type_flags_t TypeFlags; + typedef cef_context_menu_media_type_t MediaType; + typedef cef_context_menu_media_state_flags_t MediaStateFlags; + typedef cef_context_menu_edit_state_flags_t EditStateFlags; + + /// + // Returns the X coordinate of the mouse where the context menu was invoked. + // Coords are relative to the associated RenderView's origin. + /// + /*--cef()--*/ + virtual int GetXCoord() =0; + + /// + // Returns the Y coordinate of the mouse where the context menu was invoked. + // Coords are relative to the associated RenderView's origin. + /// + /*--cef()--*/ + virtual int GetYCoord() =0; + + /// + // Returns flags representing the type of node that the context menu was + // invoked on. + /// + /*--cef(default_retval=CM_TYPEFLAG_NONE)--*/ + virtual TypeFlags GetTypeFlags() =0; + + /// + // Returns the URL of the link, if any, that encloses the node that the + // context menu was invoked on. + /// + /*--cef()--*/ + virtual CefString GetLinkUrl() =0; + + /// + // Returns the link URL, if any, to be used ONLY for "copy link address". We + // don't validate this field in the frontend process. + /// + /*--cef()--*/ + virtual CefString GetUnfilteredLinkUrl() =0; + + /// + // Returns the source URL, if any, for the element that the context menu was + // invoked on. Example of elements with source URLs are img, audio, and video. + /// + /*--cef()--*/ + virtual CefString GetSourceUrl() =0; + + /// + // Returns true if the context menu was invoked on an image which has + // non-empty contents. + /// + /*--cef()--*/ + virtual bool HasImageContents() =0; + + /// + // Returns the URL of the top level page that the context menu was invoked on. + /// + /*--cef()--*/ + virtual CefString GetPageUrl() =0; + + /// + // Returns the URL of the subframe that the context menu was invoked on. + /// + /*--cef()--*/ + virtual CefString GetFrameUrl() =0; + + /// + // Returns the character encoding of the subframe that the context menu was + // invoked on. + /// + /*--cef()--*/ + virtual CefString GetFrameCharset() =0; + + /// + // Returns the type of context node that the context menu was invoked on. + /// + /*--cef(default_retval=CM_MEDIATYPE_NONE)--*/ + virtual MediaType GetMediaType() =0; + + /// + // Returns flags representing the actions supported by the media element, if + // any, that the context menu was invoked on. + /// + /*--cef(default_retval=CM_MEDIAFLAG_NONE)--*/ + virtual MediaStateFlags GetMediaStateFlags() =0; + + /// + // Returns the text of the selection, if any, that the context menu was + // invoked on. + /// + /*--cef()--*/ + virtual CefString GetSelectionText() =0; + + /// + // Returns the text of the misspelled word, if any, that the context menu was + // invoked on. + /// + /*--cef()--*/ + virtual CefString GetMisspelledWord() =0; + + /// + // Returns true if suggestions exist, false otherwise. Fills in |suggestions| + // from the spell check service for the misspelled word if there is one. + /// + /*--cef()--*/ + virtual bool GetDictionarySuggestions(std::vector& suggestions) =0; + + /// + // Returns true if the context menu was invoked on an editable node. + /// + /*--cef()--*/ + virtual bool IsEditable() =0; + + /// + // Returns true if the context menu was invoked on an editable node where + // spell-check is enabled. + /// + /*--cef()--*/ + virtual bool IsSpellCheckEnabled() =0; + + /// + // Returns flags representing the actions supported by the editable node, if + // any, that the context menu was invoked on. + /// + /*--cef(default_retval=CM_EDITFLAG_NONE)--*/ + virtual EditStateFlags GetEditStateFlags() =0; +}; + +#endif // CEF_INCLUDE_CEF_CONTEXT_MENU_HANDLER_H_ diff --git a/dependencies64/cef/include/cef_cookie.h b/dependencies64/cef/include/cef_cookie.h new file mode 100644 index 000000000..e1eb0e4bf --- /dev/null +++ b/dependencies64/cef/include/cef_cookie.h @@ -0,0 +1,220 @@ +// Copyright (c) 2012 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// The contents of this file must follow a specific format in order to +// support the CEF translator tool. See the translator.README.txt file in the +// tools directory for more information. +// + +#ifndef CEF_INCLUDE_CEF_COOKIE_H_ +#define CEF_INCLUDE_CEF_COOKIE_H_ +#pragma once + +#include "include/cef_base.h" +#include "include/cef_callback.h" +#include + +class CefCookieVisitor; +class CefSetCookieCallback; +class CefDeleteCookiesCallback; + +/// +// Class used for managing cookies. The methods of this class may be called on +// any thread unless otherwise indicated. +/// +/*--cef(source=library,no_debugct_check)--*/ +class CefCookieManager : public virtual CefBase { + public: + /// + // Returns the global cookie manager. By default data will be stored at + // CefSettings.cache_path if specified or in memory otherwise. If |callback| + // is non-NULL it will be executed asnychronously on the IO thread after the + // manager's storage has been initialized. Using this method is equivalent to + // calling CefRequestContext::GetGlobalContext()->GetDefaultCookieManager(). + /// + /*--cef(optional_param=callback)--*/ + static CefRefPtr GetGlobalManager( + CefRefPtr callback); + + /// + // Creates a new cookie manager. If |path| is empty data will be stored in + // memory only. Otherwise, data will be stored at the specified |path|. To + // persist session cookies (cookies without an expiry date or validity + // interval) set |persist_session_cookies| to true. Session cookies are + // generally intended to be transient and most Web browsers do not persist + // them. If |callback| is non-NULL it will be executed asnychronously on the + // IO thread after the manager's storage has been initialized. + /// + /*--cef(optional_param=path,optional_param=callback)--*/ + static CefRefPtr CreateManager( + const CefString& path, + bool persist_session_cookies, + CefRefPtr callback); + + /// + // Set the schemes supported by this manager. By default only "http" and + // "https" schemes are supported. If |callback| is non-NULL it will be + // executed asnychronously on the IO thread after the change has been applied. + // Must be called before any cookies are accessed. + /// + /*--cef(optional_param=callback)--*/ + virtual void SetSupportedSchemes( + const std::vector& schemes, + CefRefPtr callback) =0; + + /// + // Visit all cookies on the IO thread. The returned cookies are ordered by + // longest path, then by earliest creation date. Returns false if cookies + // cannot be accessed. + /// + /*--cef()--*/ + virtual bool VisitAllCookies(CefRefPtr visitor) =0; + + /// + // Visit a subset of cookies on the IO thread. The results are filtered by the + // given url scheme, host, domain and path. If |includeHttpOnly| is true + // HTTP-only cookies will also be included in the results. The returned + // cookies are ordered by longest path, then by earliest creation date. + // Returns false if cookies cannot be accessed. + /// + /*--cef()--*/ + virtual bool VisitUrlCookies(const CefString& url, + bool includeHttpOnly, + CefRefPtr visitor) =0; + + /// + // Sets a cookie given a valid URL and explicit user-provided cookie + // attributes. This function expects each attribute to be well-formed. It will + // check for disallowed characters (e.g. the ';' character is disallowed + // within the cookie value attribute) and fail without setting the cookie if + // such characters are found. If |callback| is non-NULL it will be executed + // asnychronously on the IO thread after the cookie has been set. Returns + // false if an invalid URL is specified or if cookies cannot be accessed. + /// + /*--cef(optional_param=callback)--*/ + virtual bool SetCookie(const CefString& url, + const CefCookie& cookie, + CefRefPtr callback) =0; + + /// + // Delete all cookies that match the specified parameters. If both |url| and + // |cookie_name| values are specified all host and domain cookies matching + // both will be deleted. If only |url| is specified all host cookies (but not + // domain cookies) irrespective of path will be deleted. If |url| is empty all + // cookies for all hosts and domains will be deleted. If |callback| is + // non-NULL it will be executed asnychronously on the IO thread after the + // cookies have been deleted. Returns false if a non-empty invalid URL is + // specified or if cookies cannot be accessed. Cookies can alternately be + // deleted using the Visit*Cookies() methods. + /// + /*--cef(optional_param=url,optional_param=cookie_name, + optional_param=callback)--*/ + virtual bool DeleteCookies(const CefString& url, + const CefString& cookie_name, + CefRefPtr callback) =0; + + /// + // Sets the directory path that will be used for storing cookie data. If + // |path| is empty data will be stored in memory only. Otherwise, data will be + // stored at the specified |path|. To persist session cookies (cookies without + // an expiry date or validity interval) set |persist_session_cookies| to true. + // Session cookies are generally intended to be transient and most Web + // browsers do not persist them. If |callback| is non-NULL it will be executed + // asnychronously on the IO thread after the manager's storage has been + // initialized. Returns false if cookies cannot be accessed. + /// + /*--cef(optional_param=path,optional_param=callback)--*/ + virtual bool SetStoragePath(const CefString& path, + bool persist_session_cookies, + CefRefPtr callback) =0; + + /// + // Flush the backing store (if any) to disk. If |callback| is non-NULL it will + // be executed asnychronously on the IO thread after the flush is complete. + // Returns false if cookies cannot be accessed. + /// + /*--cef(optional_param=callback)--*/ + virtual bool FlushStore(CefRefPtr callback) =0; +}; + + +/// +// Interface to implement for visiting cookie values. The methods of this class +// will always be called on the IO thread. +/// +/*--cef(source=client)--*/ +class CefCookieVisitor : public virtual CefBase { + public: + /// + // Method that will be called once for each cookie. |count| is the 0-based + // index for the current cookie. |total| is the total number of cookies. + // Set |deleteCookie| to true to delete the cookie currently being visited. + // Return false to stop visiting cookies. This method may never be called if + // no cookies are found. + /// + /*--cef()--*/ + virtual bool Visit(const CefCookie& cookie, int count, int total, + bool& deleteCookie) =0; +}; + + +/// +// Interface to implement to be notified of asynchronous completion via +// CefCookieManager::SetCookie(). +/// +/*--cef(source=client)--*/ +class CefSetCookieCallback : public virtual CefBase { + public: + /// + // Method that will be called upon completion. |success| will be true if the + // cookie was set successfully. + /// + /*--cef()--*/ + virtual void OnComplete(bool success) =0; +}; + + +/// +// Interface to implement to be notified of asynchronous completion via +// CefCookieManager::DeleteCookies(). +/// +/*--cef(source=client)--*/ +class CefDeleteCookiesCallback : public virtual CefBase { + public: + /// + // Method that will be called upon completion. |num_deleted| will be the + // number of cookies that were deleted or -1 if unknown. + /// + /*--cef()--*/ + virtual void OnComplete(int num_deleted) =0; +}; + +#endif // CEF_INCLUDE_CEF_COOKIE_H_ diff --git a/dependencies64/cef/include/cef_dialog_handler.h b/dependencies64/cef/include/cef_dialog_handler.h new file mode 100644 index 000000000..93cd5de7c --- /dev/null +++ b/dependencies64/cef/include/cef_dialog_handler.h @@ -0,0 +1,107 @@ +// Copyright (c) 2012 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// The contents of this file must follow a specific format in order to +// support the CEF translator tool. See the translator.README.txt file in the +// tools directory for more information. +// + +#ifndef CEF_INCLUDE_CEF_DIALOG_HANDLER_H_ +#define CEF_INCLUDE_CEF_DIALOG_HANDLER_H_ +#pragma once + +#include "include/cef_base.h" +#include "include/cef_browser.h" + +/// +// Callback interface for asynchronous continuation of file dialog requests. +/// +/*--cef(source=library)--*/ +class CefFileDialogCallback : public virtual CefBase { + public: + /// + // Continue the file selection. |selected_accept_filter| should be the 0-based + // index of the value selected from the accept filters array passed to + // CefDialogHandler::OnFileDialog. |file_paths| should be a single value or a + // list of values depending on the dialog mode. An empty |file_paths| value is + // treated the same as calling Cancel(). + /// + /*--cef(capi_name=cont,index_param=selected_accept_filter, + optional_param=file_paths)--*/ + virtual void Continue(int selected_accept_filter, + const std::vector& file_paths) =0; + + /// + // Cancel the file selection. + /// + /*--cef()--*/ + virtual void Cancel() =0; +}; + + +/// +// Implement this interface to handle dialog events. The methods of this class +// will be called on the browser process UI thread. +/// +/*--cef(source=client)--*/ +class CefDialogHandler : public virtual CefBase { + public: + typedef cef_file_dialog_mode_t FileDialogMode; + + /// + // Called to run a file chooser dialog. |mode| represents the type of dialog + // to display. |title| to the title to be used for the dialog and may be empty + // to show the default title ("Open" or "Save" depending on the mode). + // |default_file_path| is the path with optional directory and/or file name + // component that should be initially selected in the dialog. |accept_filters| + // are used to restrict the selectable file types and may any combination of + // (a) valid lower-cased MIME types (e.g. "text/*" or "image/*"), + // (b) individual file extensions (e.g. ".txt" or ".png"), or (c) combined + // description and file extension delimited using "|" and ";" (e.g. + // "Image Types|.png;.gif;.jpg"). |selected_accept_filter| is the 0-based + // index of the filter that should be selected by default. To display a custom + // dialog return true and execute |callback| either inline or at a later time. + // To display the default dialog return false. + /// + /*--cef(optional_param=title,optional_param=default_file_path, + optional_param=accept_filters,index_param=selected_accept_filter)--*/ + virtual bool OnFileDialog(CefRefPtr browser, + FileDialogMode mode, + const CefString& title, + const CefString& default_file_path, + const std::vector& accept_filters, + int selected_accept_filter, + CefRefPtr callback) { + return false; + } +}; + +#endif // CEF_INCLUDE_CEF_DIALOG_HANDLER_H_ diff --git a/dependencies64/cef/include/cef_display_handler.h b/dependencies64/cef/include/cef_display_handler.h new file mode 100644 index 000000000..69917886f --- /dev/null +++ b/dependencies64/cef/include/cef_display_handler.h @@ -0,0 +1,105 @@ +// Copyright (c) 2012 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// The contents of this file must follow a specific format in order to +// support the CEF translator tool. See the translator.README.txt file in the +// tools directory for more information. +// + +#ifndef CEF_INCLUDE_CEF_DISPLAY_HANDLER_H_ +#define CEF_INCLUDE_CEF_DISPLAY_HANDLER_H_ +#pragma once + +#include "include/cef_base.h" +#include "include/cef_browser.h" +#include "include/cef_frame.h" + +/// +// Implement this interface to handle events related to browser display state. +// The methods of this class will be called on the UI thread. +/// +/*--cef(source=client)--*/ +class CefDisplayHandler : public virtual CefBase { + public: + /// + // Called when a frame's address has changed. + /// + /*--cef()--*/ + virtual void OnAddressChange(CefRefPtr browser, + CefRefPtr frame, + const CefString& url) {} + + /// + // Called when the page title changes. + /// + /*--cef(optional_param=title)--*/ + virtual void OnTitleChange(CefRefPtr browser, + const CefString& title) {} + + /// + // Called when the page icon changes. + /// + /*--cef(optional_param=icon_urls)--*/ + virtual void OnFaviconURLChange(CefRefPtr browser, + const std::vector& icon_urls) {} + + /// + // Called when the browser is about to display a tooltip. |text| contains the + // text that will be displayed in the tooltip. To handle the display of the + // tooltip yourself return true. Otherwise, you can optionally modify |text| + // and then return false to allow the browser to display the tooltip. + // When window rendering is disabled the application is responsible for + // drawing tooltips and the return value is ignored. + /// + /*--cef(optional_param=text)--*/ + virtual bool OnTooltip(CefRefPtr browser, + CefString& text) { return false; } + + /// + // Called when the browser receives a status message. |value| contains the + // text that will be displayed in the status message. + /// + /*--cef(optional_param=value)--*/ + virtual void OnStatusMessage(CefRefPtr browser, + const CefString& value) {} + + /// + // Called to display a console message. Return true to stop the message from + // being output to the console. + /// + /*--cef(optional_param=message,optional_param=source)--*/ + virtual bool OnConsoleMessage(CefRefPtr browser, + const CefString& message, + const CefString& source, + int line) { return false; } +}; + +#endif // CEF_INCLUDE_CEF_DISPLAY_HANDLER_H_ diff --git a/dependencies64/cef/include/cef_dom.h b/dependencies64/cef/include/cef_dom.h new file mode 100644 index 000000000..9f9a3d5ae --- /dev/null +++ b/dependencies64/cef/include/cef_dom.h @@ -0,0 +1,328 @@ +// Copyright (c) 2012 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// The contents of this file must follow a specific format in order to +// support the CEF translator tool. See the translator.README.txt file in the +// tools directory for more information. +// + +#ifndef CEF_INCLUDE_CEF_DOM_H_ +#define CEF_INCLUDE_CEF_DOM_H_ +#pragma once + +#include "include/cef_base.h" +#include + +class CefDOMDocument; +class CefDOMNode; + +/// +// Interface to implement for visiting the DOM. The methods of this class will +// be called on the render process main thread. +/// +/*--cef(source=client)--*/ +class CefDOMVisitor : public virtual CefBase { + public: + /// + // Method executed for visiting the DOM. The document object passed to this + // method represents a snapshot of the DOM at the time this method is + // executed. DOM objects are only valid for the scope of this method. Do not + // keep references to or attempt to access any DOM objects outside the scope + // of this method. + /// + /*--cef()--*/ + virtual void Visit(CefRefPtr document) =0; +}; + + +/// +// Class used to represent a DOM document. The methods of this class should only +// be called on the render process main thread thread. +/// +/*--cef(source=library)--*/ +class CefDOMDocument : public virtual CefBase { + public: + typedef cef_dom_document_type_t Type; + + /// + // Returns the document type. + /// + /*--cef(default_retval=DOM_DOCUMENT_TYPE_UNKNOWN)--*/ + virtual Type GetType() =0; + + /// + // Returns the root document node. + /// + /*--cef()--*/ + virtual CefRefPtr GetDocument() =0; + + /// + // Returns the BODY node of an HTML document. + /// + /*--cef()--*/ + virtual CefRefPtr GetBody() =0; + + /// + // Returns the HEAD node of an HTML document. + /// + /*--cef()--*/ + virtual CefRefPtr GetHead() =0; + + /// + // Returns the title of an HTML document. + /// + /*--cef()--*/ + virtual CefString GetTitle() =0; + + /// + // Returns the document element with the specified ID value. + /// + /*--cef()--*/ + virtual CefRefPtr GetElementById(const CefString& id) =0; + + /// + // Returns the node that currently has keyboard focus. + /// + /*--cef()--*/ + virtual CefRefPtr GetFocusedNode() =0; + + /// + // Returns true if a portion of the document is selected. + /// + /*--cef()--*/ + virtual bool HasSelection() =0; + + /// + // Returns the selection offset within the start node. + /// + /*--cef()--*/ + virtual int GetSelectionStartOffset() =0; + + /// + // Returns the selection offset within the end node. + /// + /*--cef()--*/ + virtual int GetSelectionEndOffset() =0; + + /// + // Returns the contents of this selection as markup. + /// + /*--cef()--*/ + virtual CefString GetSelectionAsMarkup() =0; + + /// + // Returns the contents of this selection as text. + /// + /*--cef()--*/ + virtual CefString GetSelectionAsText() =0; + + /// + // Returns the base URL for the document. + /// + /*--cef()--*/ + virtual CefString GetBaseURL() =0; + + /// + // Returns a complete URL based on the document base URL and the specified + // partial URL. + /// + /*--cef()--*/ + virtual CefString GetCompleteURL(const CefString& partialURL) =0; +}; + + +/// +// Class used to represent a DOM node. The methods of this class should only be +// called on the render process main thread. +/// +/*--cef(source=library)--*/ +class CefDOMNode : public virtual CefBase { + public: + typedef std::map AttributeMap; + typedef cef_dom_node_type_t Type; + + /// + // Returns the type for this node. + /// + /*--cef(default_retval=DOM_NODE_TYPE_UNSUPPORTED)--*/ + virtual Type GetType() =0; + + /// + // Returns true if this is a text node. + /// + /*--cef()--*/ + virtual bool IsText() =0; + + /// + // Returns true if this is an element node. + /// + /*--cef()--*/ + virtual bool IsElement() =0; + + /// + // Returns true if this is an editable node. + /// + /*--cef()--*/ + virtual bool IsEditable() =0; + + /// + // Returns true if this is a form control element node. + /// + /*--cef()--*/ + virtual bool IsFormControlElement() =0; + + /// + // Returns the type of this form control element node. + /// + /*--cef()--*/ + virtual CefString GetFormControlElementType() =0; + + /// + // Returns true if this object is pointing to the same handle as |that| + // object. + /// + /*--cef()--*/ + virtual bool IsSame(CefRefPtr that) =0; + + /// + // Returns the name of this node. + /// + /*--cef()--*/ + virtual CefString GetName() =0; + + /// + // Returns the value of this node. + /// + /*--cef()--*/ + virtual CefString GetValue() =0; + + /// + // Set the value of this node. Returns true on success. + /// + /*--cef()--*/ + virtual bool SetValue(const CefString& value) =0; + + /// + // Returns the contents of this node as markup. + /// + /*--cef()--*/ + virtual CefString GetAsMarkup() =0; + + /// + // Returns the document associated with this node. + /// + /*--cef()--*/ + virtual CefRefPtr GetDocument() =0; + + /// + // Returns the parent node. + /// + /*--cef()--*/ + virtual CefRefPtr GetParent() =0; + + /// + // Returns the previous sibling node. + /// + /*--cef()--*/ + virtual CefRefPtr GetPreviousSibling() =0; + + /// + // Returns the next sibling node. + /// + /*--cef()--*/ + virtual CefRefPtr GetNextSibling() =0; + + /// + // Returns true if this node has child nodes. + /// + /*--cef()--*/ + virtual bool HasChildren() =0; + + /// + // Return the first child node. + /// + /*--cef()--*/ + virtual CefRefPtr GetFirstChild() =0; + + /// + // Returns the last child node. + /// + /*--cef()--*/ + virtual CefRefPtr GetLastChild() =0; + + // The following methods are valid only for element nodes. + + /// + // Returns the tag name of this element. + /// + /*--cef()--*/ + virtual CefString GetElementTagName() =0; + + /// + // Returns true if this element has attributes. + /// + /*--cef()--*/ + virtual bool HasElementAttributes() =0; + + /// + // Returns true if this element has an attribute named |attrName|. + /// + /*--cef()--*/ + virtual bool HasElementAttribute(const CefString& attrName) =0; + + /// + // Returns the element attribute named |attrName|. + /// + /*--cef()--*/ + virtual CefString GetElementAttribute(const CefString& attrName) =0; + + /// + // Returns a map of all element attributes. + /// + /*--cef()--*/ + virtual void GetElementAttributes(AttributeMap& attrMap) =0; + + /// + // Set the value for the element attribute named |attrName|. Returns true on + // success. + /// + /*--cef()--*/ + virtual bool SetElementAttribute(const CefString& attrName, + const CefString& value) =0; + + /// + // Returns the inner text of the element. + /// + /*--cef()--*/ + virtual CefString GetElementInnerText() =0; +}; + +#endif // CEF_INCLUDE_CEF_DOM_H_ diff --git a/dependencies64/cef/include/cef_download_handler.h b/dependencies64/cef/include/cef_download_handler.h new file mode 100644 index 000000000..4f58af485 --- /dev/null +++ b/dependencies64/cef/include/cef_download_handler.h @@ -0,0 +1,124 @@ +// Copyright (c) 2012 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// The contents of this file must follow a specific format in order to +// support the CEF translator tool. See the translator.README.txt file in the +// tools directory for more information. +// + +#ifndef CEF_INCLUDE_CEF_DOWNLOAD_HANDLER_H_ +#define CEF_INCLUDE_CEF_DOWNLOAD_HANDLER_H_ +#pragma once + +#include "include/cef_base.h" +#include "include/cef_browser.h" +#include "include/cef_download_item.h" + + +/// +// Callback interface used to asynchronously continue a download. +/// +/*--cef(source=library)--*/ +class CefBeforeDownloadCallback : public virtual CefBase { + public: + /// + // Call to continue the download. Set |download_path| to the full file path + // for the download including the file name or leave blank to use the + // suggested name and the default temp directory. Set |show_dialog| to true + // if you do wish to show the default "Save As" dialog. + /// + /*--cef(capi_name=cont,optional_param=download_path)--*/ + virtual void Continue(const CefString& download_path, bool show_dialog) =0; +}; + + +/// +// Callback interface used to asynchronously cancel a download. +/// +/*--cef(source=library)--*/ +class CefDownloadItemCallback : public virtual CefBase { + public: + /// + // Call to cancel the download. + /// + /*--cef()--*/ + virtual void Cancel() =0; + + /// + // Call to pause the download. + /// + /*--cef()--*/ + virtual void Pause() =0; + + /// + // Call to resume the download. + /// + /*--cef()--*/ + virtual void Resume() =0; +}; + + +/// +// Class used to handle file downloads. The methods of this class will called +// on the browser process UI thread. +/// +/*--cef(source=client)--*/ +class CefDownloadHandler : public virtual CefBase { + public: + /// + // Called before a download begins. |suggested_name| is the suggested name for + // the download file. By default the download will be canceled. Execute + // |callback| either asynchronously or in this method to continue the download + // if desired. Do not keep a reference to |download_item| outside of this + // method. + /// + /*--cef()--*/ + virtual void OnBeforeDownload( + CefRefPtr browser, + CefRefPtr download_item, + const CefString& suggested_name, + CefRefPtr callback) =0; + + /// + // Called when a download's status or progress information has been updated. + // This may be called multiple times before and after OnBeforeDownload(). + // Execute |callback| either asynchronously or in this method to cancel the + // download if desired. Do not keep a reference to |download_item| outside of + // this method. + /// + /*--cef()--*/ + virtual void OnDownloadUpdated( + CefRefPtr browser, + CefRefPtr download_item, + CefRefPtr callback) {} +}; + +#endif // CEF_INCLUDE_CEF_DOWNLOAD_HANDLER_H_ diff --git a/dependencies64/cef/include/cef_download_item.h b/dependencies64/cef/include/cef_download_item.h new file mode 100644 index 000000000..988ef6bde --- /dev/null +++ b/dependencies64/cef/include/cef_download_item.h @@ -0,0 +1,154 @@ +// Copyright (c) 2012 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// The contents of this file must follow a specific format in order to +// support the CEF translator tool. See the translator.README.txt file in the +// tools directory for more information. +// + +#ifndef CEF_INCLUDE_CEF_DOWNLOAD_ITEM_H_ +#define CEF_INCLUDE_CEF_DOWNLOAD_ITEM_H_ +#pragma once + +#include "include/cef_base.h" + +/// +// Class used to represent a download item. +/// +/*--cef(source=library)--*/ +class CefDownloadItem : public virtual CefBase { + public: + /// + // Returns true if this object is valid. Do not call any other methods if this + // function returns false. + /// + /*--cef()--*/ + virtual bool IsValid() =0; + + /// + // Returns true if the download is in progress. + /// + /*--cef()--*/ + virtual bool IsInProgress() =0; + + /// + // Returns true if the download is complete. + /// + /*--cef()--*/ + virtual bool IsComplete() =0; + + /// + // Returns true if the download has been canceled or interrupted. + /// + /*--cef()--*/ + virtual bool IsCanceled() =0; + + /// + // Returns a simple speed estimate in bytes/s. + /// + /*--cef()--*/ + virtual int64 GetCurrentSpeed() =0; + + /// + // Returns the rough percent complete or -1 if the receive total size is + // unknown. + /// + /*--cef()--*/ + virtual int GetPercentComplete() =0; + + /// + // Returns the total number of bytes. + /// + /*--cef()--*/ + virtual int64 GetTotalBytes() =0; + + /// + // Returns the number of received bytes. + /// + /*--cef()--*/ + virtual int64 GetReceivedBytes() =0; + + /// + // Returns the time that the download started. + /// + /*--cef()--*/ + virtual CefTime GetStartTime() =0; + + /// + // Returns the time that the download ended. + /// + /*--cef()--*/ + virtual CefTime GetEndTime() =0; + + /// + // Returns the full path to the downloaded or downloading file. + /// + /*--cef()--*/ + virtual CefString GetFullPath() =0; + + /// + // Returns the unique identifier for this download. + /// + /*--cef()--*/ + virtual uint32 GetId() =0; + + /// + // Returns the URL. + /// + /*--cef()--*/ + virtual CefString GetURL() =0; + + /// + // Returns the original URL before any redirections. + /// + /*--cef()--*/ + virtual CefString GetOriginalUrl() =0; + + /// + // Returns the suggested file name. + /// + /*--cef()--*/ + virtual CefString GetSuggestedFileName() =0; + + /// + // Returns the content disposition. + /// + /*--cef()--*/ + virtual CefString GetContentDisposition() =0; + + /// + // Returns the mime type. + /// + /*--cef()--*/ + virtual CefString GetMimeType() =0; +}; + +#endif // CEF_INCLUDE_CEF_DOWNLOAD_ITEM_H_ diff --git a/dependencies64/cef/include/cef_drag_data.h b/dependencies64/cef/include/cef_drag_data.h new file mode 100644 index 000000000..8f8094b44 --- /dev/null +++ b/dependencies64/cef/include/cef_drag_data.h @@ -0,0 +1,198 @@ +// Copyright (c) 2013 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// The contents of this file must follow a specific format in order to +// support the CEF translator tool. See the translator.README.txt file in the +// tools directory for more information. +// + +#ifndef CEF_INCLUDE_CEF_DRAG_DATA_H_ +#define CEF_INCLUDE_CEF_DRAG_DATA_H_ +#pragma once + +#include "include/cef_base.h" +#include "include/cef_stream.h" +#include + +/// +// Class used to represent drag data. The methods of this class may be called +// on any thread. +/// +/*--cef(source=library)--*/ +class CefDragData : public virtual CefBase { + public: + /// + // Create a new CefDragData object. + /// + /*--cef()--*/ + static CefRefPtr Create(); + + /// + // Returns a copy of the current object. + /// + /*--cef()--*/ + virtual CefRefPtr Clone() =0; + + /// + // Returns true if this object is read-only. + /// + /*--cef()--*/ + virtual bool IsReadOnly() =0; + + /// + // Returns true if the drag data is a link. + /// + /*--cef()--*/ + virtual bool IsLink() =0; + + /// + // Returns true if the drag data is a text or html fragment. + /// + /*--cef()--*/ + virtual bool IsFragment() =0; + + /// + // Returns true if the drag data is a file. + /// + /*--cef()--*/ + virtual bool IsFile() =0; + + /// + // Return the link URL that is being dragged. + /// + /*--cef()--*/ + virtual CefString GetLinkURL() =0; + + /// + // Return the title associated with the link being dragged. + /// + /*--cef()--*/ + virtual CefString GetLinkTitle() =0; + + /// + // Return the metadata, if any, associated with the link being dragged. + /// + /*--cef()--*/ + virtual CefString GetLinkMetadata() =0; + + /// + // Return the plain text fragment that is being dragged. + /// + /*--cef()--*/ + virtual CefString GetFragmentText() =0; + + /// + // Return the text/html fragment that is being dragged. + /// + /*--cef()--*/ + virtual CefString GetFragmentHtml() =0; + + /// + // Return the base URL that the fragment came from. This value is used for + // resolving relative URLs and may be empty. + /// + /*--cef()--*/ + virtual CefString GetFragmentBaseURL() =0; + + /// + // Return the name of the file being dragged out of the browser window. + /// + /*--cef()--*/ + virtual CefString GetFileName() =0; + + /// + // Write the contents of the file being dragged out of the web view into + // |writer|. Returns the number of bytes sent to |writer|. If |writer| is + // NULL this method will return the size of the file contents in bytes. + // Call GetFileName() to get a suggested name for the file. + /// + /*--cef(optional_param=writer)--*/ + virtual size_t GetFileContents(CefRefPtr writer) =0; + + /// + // Retrieve the list of file names that are being dragged into the browser + // window. + /// + /*--cef()--*/ + virtual bool GetFileNames(std::vector& names) =0; + + /// + // Set the link URL that is being dragged. + /// + /*--cef(optional_param=url)--*/ + virtual void SetLinkURL(const CefString& url) =0; + + /// + // Set the title associated with the link being dragged. + /// + /*--cef(optional_param=title)--*/ + virtual void SetLinkTitle(const CefString& title) =0; + + /// + // Set the metadata associated with the link being dragged. + /// + /*--cef(optional_param=data)--*/ + virtual void SetLinkMetadata(const CefString& data) =0; + + /// + // Set the plain text fragment that is being dragged. + /// + /*--cef(optional_param=text)--*/ + virtual void SetFragmentText(const CefString& text) =0; + + /// + // Set the text/html fragment that is being dragged. + /// + /*--cef(optional_param=html)--*/ + virtual void SetFragmentHtml(const CefString& html) =0; + + /// + // Set the base URL that the fragment came from. + /// + /*--cef(optional_param=base_url)--*/ + virtual void SetFragmentBaseURL(const CefString& base_url) =0; + + /// + // Reset the file contents. You should do this before calling + // CefBrowserHost::DragTargetDragEnter as the web view does not allow us to + // drag in this kind of data. + /// + /*--cef()--*/ + virtual void ResetFileContents() =0; + + /// + // Add a file that is being dragged into the webview. + /// + /*--cef(optional_param=display_name)--*/ + virtual void AddFile(const CefString& path, const CefString& display_name) =0; +}; + +#endif // CEF_INCLUDE_CEF_DRAG_DATA_H_ diff --git a/dependencies64/cef/include/cef_drag_handler.h b/dependencies64/cef/include/cef_drag_handler.h new file mode 100644 index 000000000..7cfc40ba5 --- /dev/null +++ b/dependencies64/cef/include/cef_drag_handler.h @@ -0,0 +1,66 @@ +// Copyright (c) 2013 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// The contents of this file must follow a specific format in order to +// support the CEF translator tool. See the translator.README.txt file in the +// tools directory for more information. +// + +#ifndef CEF_INCLUDE_CEF_DRAG_HANDLER_H_ +#define CEF_INCLUDE_CEF_DRAG_HANDLER_H_ +#pragma once + +#include "include/cef_base.h" +#include "include/cef_drag_data.h" +#include "include/cef_browser.h" + +/// +// Implement this interface to handle events related to dragging. The methods of +// this class will be called on the UI thread. +/// +/*--cef(source=client)--*/ +class CefDragHandler : public virtual CefBase { + public: + typedef cef_drag_operations_mask_t DragOperationsMask; + + /// + // Called when an external drag event enters the browser window. |dragData| + // contains the drag event data and |mask| represents the type of drag + // operation. Return false for default drag handling behavior or true to + // cancel the drag event. + /// + /*--cef()--*/ + virtual bool OnDragEnter(CefRefPtr browser, + CefRefPtr dragData, + DragOperationsMask mask) { return false; } +}; + +#endif // CEF_INCLUDE_CEF_DRAG_HANDLER_H_ diff --git a/dependencies64/cef/include/cef_find_handler.h b/dependencies64/cef/include/cef_find_handler.h new file mode 100644 index 000000000..410cf5fec --- /dev/null +++ b/dependencies64/cef/include/cef_find_handler.h @@ -0,0 +1,68 @@ +// Copyright (c) 2015 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// The contents of this file must follow a specific format in order to +// support the CEF translator tool. See the translator.README.txt file in the +// tools directory for more information. +// + +#ifndef CEF_INCLUDE_CEF_FIND_HANDLER_H_ +#define CEF_INCLUDE_CEF_FIND_HANDLER_H_ +#pragma once + +#include "include/cef_base.h" +#include "include/cef_browser.h" + +/// +// Implement this interface to handle events related to find results. The +// methods of this class will be called on the UI thread. +/// +/*--cef(source=client)--*/ +class CefFindHandler : public virtual CefBase { + public: + /// + // Called to report find results returned by CefBrowserHost::Find(). + // |identifer| is the identifier passed to Find(), |count| is the number of + // matches currently identified, |selectionRect| is the location of where the + // match was found (in window coordinates), |activeMatchOrdinal| is the + // current position in the search results, and |finalUpdate| is true if this + // is the last find notification. + /// + /*--cef()--*/ + virtual void OnFindResult(CefRefPtr browser, + int identifier, + int count, + const CefRect& selectionRect, + int activeMatchOrdinal, + bool finalUpdate) {} +}; + +#endif // CEF_INCLUDE_CEF_FIND_HANDLER_H_ diff --git a/dependencies64/cef/include/cef_focus_handler.h b/dependencies64/cef/include/cef_focus_handler.h new file mode 100644 index 000000000..1d91c42ab --- /dev/null +++ b/dependencies64/cef/include/cef_focus_handler.h @@ -0,0 +1,81 @@ +// Copyright (c) 2012 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// The contents of this file must follow a specific format in order to +// support the CEF translator tool. See the translator.README.txt file in the +// tools directory for more information. +// + +#ifndef CEF_INCLUDE_CEF_FOCUS_HANDLER_H_ +#define CEF_INCLUDE_CEF_FOCUS_HANDLER_H_ +#pragma once + +#include "include/cef_base.h" +#include "include/cef_browser.h" +#include "include/cef_dom.h" +#include "include/cef_frame.h" + +/// +// Implement this interface to handle events related to focus. The methods of +// this class will be called on the UI thread. +/// +/*--cef(source=client)--*/ +class CefFocusHandler : public virtual CefBase { + public: + typedef cef_focus_source_t FocusSource; + + /// + // Called when the browser component is about to loose focus. For instance, if + // focus was on the last HTML element and the user pressed the TAB key. |next| + // will be true if the browser is giving focus to the next component and false + // if the browser is giving focus to the previous component. + /// + /*--cef()--*/ + virtual void OnTakeFocus(CefRefPtr browser, + bool next) {} + + /// + // Called when the browser component is requesting focus. |source| indicates + // where the focus request is originating from. Return false to allow the + // focus to be set or true to cancel setting the focus. + /// + /*--cef()--*/ + virtual bool OnSetFocus(CefRefPtr browser, + FocusSource source) { return false; } + + /// + // Called when the browser component has received focus. + /// + /*--cef()--*/ + virtual void OnGotFocus(CefRefPtr browser) {} +}; + +#endif // CEF_INCLUDE_CEF_FOCUS_HANDLER_H_ diff --git a/dependencies64/cef/include/cef_frame.h b/dependencies64/cef/include/cef_frame.h new file mode 100644 index 000000000..adba66f1e --- /dev/null +++ b/dependencies64/cef/include/cef_frame.h @@ -0,0 +1,224 @@ +// Copyright (c) 2012 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// The contents of this file must follow a specific format in order to +// support the CEF translator tool. See the translator.README.txt file in the +// tools directory for more information. +// + +#ifndef CEF_INCLUDE_CEF_FRAME_H_ +#define CEF_INCLUDE_CEF_FRAME_H_ +#pragma once + +#include "include/cef_base.h" +#include "include/cef_dom.h" +#include "include/cef_request.h" +#include "include/cef_stream.h" +#include "include/cef_string_visitor.h" + +class CefBrowser; +class CefV8Context; + +/// +// Class used to represent a frame in the browser window. When used in the +// browser process the methods of this class may be called on any thread unless +// otherwise indicated in the comments. When used in the render process the +// methods of this class may only be called on the main thread. +/// +/*--cef(source=library)--*/ +class CefFrame : public virtual CefBase { + public: + /// + // True if this object is currently attached to a valid frame. + /// + /*--cef()--*/ + virtual bool IsValid() =0; + + /// + // Execute undo in this frame. + /// + /*--cef()--*/ + virtual void Undo() =0; + + /// + // Execute redo in this frame. + /// + /*--cef()--*/ + virtual void Redo() =0; + + /// + // Execute cut in this frame. + /// + /*--cef()--*/ + virtual void Cut() =0; + + /// + // Execute copy in this frame. + /// + /*--cef()--*/ + virtual void Copy() =0; + + /// + // Execute paste in this frame. + /// + /*--cef()--*/ + virtual void Paste() =0; + + /// + // Execute delete in this frame. + /// + /*--cef(capi_name=del)--*/ + virtual void Delete() =0; + + /// + // Execute select all in this frame. + /// + /*--cef()--*/ + virtual void SelectAll() =0; + + /// + // Save this frame's HTML source to a temporary file and open it in the + // default text viewing application. This method can only be called from the + // browser process. + /// + /*--cef()--*/ + virtual void ViewSource() =0; + + /// + // Retrieve this frame's HTML source as a string sent to the specified + // visitor. + /// + /*--cef()--*/ + virtual void GetSource(CefRefPtr visitor) =0; + + /// + // Retrieve this frame's display text as a string sent to the specified + // visitor. + /// + /*--cef()--*/ + virtual void GetText(CefRefPtr visitor) =0; + + /// + // Load the request represented by the |request| object. + /// + /*--cef()--*/ + virtual void LoadRequest(CefRefPtr request) =0; + + /// + // Load the specified |url|. + /// + /*--cef()--*/ + virtual void LoadURL(const CefString& url) =0; + + /// + // Load the contents of |string_val| with the specified dummy |url|. |url| + // should have a standard scheme (for example, http scheme) or behaviors like + // link clicks and web security restrictions may not behave as expected. + /// + /*--cef()--*/ + virtual void LoadString(const CefString& string_val, + const CefString& url) =0; + + /// + // Execute a string of JavaScript code in this frame. The |script_url| + // parameter is the URL where the script in question can be found, if any. + // The renderer may request this URL to show the developer the source of the + // error. The |start_line| parameter is the base line number to use for error + // reporting. + /// + /*--cef(optional_param=script_url)--*/ + virtual void ExecuteJavaScript(const CefString& code, + const CefString& script_url, + int start_line) =0; + + /// + // Returns true if this is the main (top-level) frame. + /// + /*--cef()--*/ + virtual bool IsMain() =0; + + /// + // Returns true if this is the focused frame. + /// + /*--cef()--*/ + virtual bool IsFocused() =0; + + /// + // Returns the name for this frame. If the frame has an assigned name (for + // example, set via the iframe "name" attribute) then that value will be + // returned. Otherwise a unique name will be constructed based on the frame + // parent hierarchy. The main (top-level) frame will always have an empty name + // value. + /// + /*--cef()--*/ + virtual CefString GetName() =0; + + /// + // Returns the globally unique identifier for this frame. + /// + /*--cef()--*/ + virtual int64 GetIdentifier() =0; + + /// + // Returns the parent of this frame or NULL if this is the main (top-level) + // frame. + /// + /*--cef()--*/ + virtual CefRefPtr GetParent() =0; + + /// + // Returns the URL currently loaded in this frame. + /// + /*--cef()--*/ + virtual CefString GetURL() =0; + + /// + // Returns the browser that this frame belongs to. + /// + /*--cef()--*/ + virtual CefRefPtr GetBrowser() =0; + + /// + // Get the V8 context associated with the frame. This method can only be + // called from the render process. + /// + /*--cef()--*/ + virtual CefRefPtr GetV8Context() =0; + + /// + // Visit the DOM document. This method can only be called from the render + // process. + /// + /*--cef()--*/ + virtual void VisitDOM(CefRefPtr visitor) =0; +}; + +#endif // CEF_INCLUDE_CEF_FRAME_H_ diff --git a/dependencies64/cef/include/cef_geolocation.h b/dependencies64/cef/include/cef_geolocation.h new file mode 100644 index 000000000..69c08779c --- /dev/null +++ b/dependencies64/cef/include/cef_geolocation.h @@ -0,0 +1,66 @@ +// Copyright (c) 2012 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// The contents of this file must follow a specific format in order to +// support the CEF translator tool. See the translator.README.txt file in the +// tools directory for more information. +// + +#ifndef CEF_INCLUDE_CEF_GEOLOCATION_H_ +#define CEF_INCLUDE_CEF_GEOLOCATION_H_ +#pragma once + +#include "include/cef_base.h" + +/// +// Implement this interface to receive geolocation updates. The methods of this +// class will be called on the browser process UI thread. +/// +/*--cef(source=client)--*/ +class CefGetGeolocationCallback : public virtual CefBase { + public: + /// + // Called with the 'best available' location information or, if the location + // update failed, with error information. + /// + /*--cef()--*/ + virtual void OnLocationUpdate(const CefGeoposition& position) =0; +}; + +/// +// Request a one-time geolocation update. This function bypasses any user +// permission checks so should only be used by code that is allowed to access +// location information. +/// +/*--cef()--*/ +bool CefGetGeolocation(CefRefPtr callback); + +#endif // CEF_INCLUDE_CEF_GEOLOCATION_H_ diff --git a/dependencies64/cef/include/cef_geolocation_handler.h b/dependencies64/cef/include/cef_geolocation_handler.h new file mode 100644 index 000000000..679621a1f --- /dev/null +++ b/dependencies64/cef/include/cef_geolocation_handler.h @@ -0,0 +1,97 @@ +// Copyright (c) 2012 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// The contents of this file must follow a specific format in order to +// support the CEF translator tool. See the translator.README.txt file in the +// tools directory for more information. +// + +#ifndef CEF_INCLUDE_CEF_GEOLOCATION_HANDLER_H_ +#define CEF_INCLUDE_CEF_GEOLOCATION_HANDLER_H_ +#pragma once + +#include "include/cef_base.h" +#include "include/cef_browser.h" + +/// +// Callback interface used for asynchronous continuation of geolocation +// permission requests. +/// +/*--cef(source=library)--*/ +class CefGeolocationCallback : public virtual CefBase { + public: + /// + // Call to allow or deny geolocation access. + /// + /*--cef(capi_name=cont)--*/ + virtual void Continue(bool allow) =0; +}; + + +/// +// Implement this interface to handle events related to geolocation permission +// requests. The methods of this class will be called on the browser process UI +// thread. +/// +/*--cef(source=client)--*/ +class CefGeolocationHandler : public virtual CefBase { + public: + /// + // Called when a page requests permission to access geolocation information. + // |requesting_url| is the URL requesting permission and |request_id| is the + // unique ID for the permission request. Return true and call + // CefGeolocationCallback::Continue() either in this method or at a later + // time to continue or cancel the request. Return false to cancel the request + // immediately. + /// + /*--cef()--*/ + virtual bool OnRequestGeolocationPermission( + CefRefPtr browser, + const CefString& requesting_url, + int request_id, + CefRefPtr callback) { + return false; + } + + /// + // Called when a geolocation access request is canceled. |requesting_url| is + // the URL that originally requested permission and |request_id| is the unique + // ID for the permission request. + /// + /*--cef()--*/ + virtual void OnCancelGeolocationPermission( + CefRefPtr browser, + const CefString& requesting_url, + int request_id) { + } +}; + +#endif // CEF_INCLUDE_CEF_GEOLOCATION_HANDLER_H_ diff --git a/dependencies64/cef/include/cef_jsdialog_handler.h b/dependencies64/cef/include/cef_jsdialog_handler.h new file mode 100644 index 000000000..29548966e --- /dev/null +++ b/dependencies64/cef/include/cef_jsdialog_handler.h @@ -0,0 +1,128 @@ +// Copyright (c) 2012 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// The contents of this file must follow a specific format in order to +// support the CEF translator tool. See the translator.README.txt file in the +// tools directory for more information. +// + +#ifndef CEF_INCLUDE_CEF_JSDIALOG_HANDLER_H_ +#define CEF_INCLUDE_CEF_JSDIALOG_HANDLER_H_ +#pragma once + +#include "include/cef_base.h" +#include "include/cef_browser.h" + +/// +// Callback interface used for asynchronous continuation of JavaScript dialog +// requests. +/// +/*--cef(source=library)--*/ +class CefJSDialogCallback : public virtual CefBase { + public: + /// + // Continue the JS dialog request. Set |success| to true if the OK button was + // pressed. The |user_input| value should be specified for prompt dialogs. + /// + /*--cef(capi_name=cont,optional_param=user_input)--*/ + virtual void Continue(bool success, + const CefString& user_input) =0; +}; + + +/// +// Implement this interface to handle events related to JavaScript dialogs. The +// methods of this class will be called on the UI thread. +/// +/*--cef(source=client)--*/ +class CefJSDialogHandler : public virtual CefBase { + public: + typedef cef_jsdialog_type_t JSDialogType; + + /// + // Called to run a JavaScript dialog. The |default_prompt_text| value will be + // specified for prompt dialogs only. Set |suppress_message| to true and + // return false to suppress the message (suppressing messages is preferable + // to immediately executing the callback as this is used to detect presumably + // malicious behavior like spamming alert messages in onbeforeunload). Set + // |suppress_message| to false and return false to use the default + // implementation (the default implementation will show one modal dialog at a + // time and suppress any additional dialog requests until the displayed dialog + // is dismissed). Return true if the application will use a custom dialog or + // if the callback has been executed immediately. Custom dialogs may be either + // modal or modeless. If a custom dialog is used the application must execute + // |callback| once the custom dialog is dismissed. + /// + /*--cef(optional_param=origin_url,optional_param=accept_lang, + optional_param=message_text,optional_param=default_prompt_text)--*/ + virtual bool OnJSDialog(CefRefPtr browser, + const CefString& origin_url, + const CefString& accept_lang, + JSDialogType dialog_type, + const CefString& message_text, + const CefString& default_prompt_text, + CefRefPtr callback, + bool& suppress_message) { + return false; + } + + /// + // Called to run a dialog asking the user if they want to leave a page. Return + // false to use the default dialog implementation. Return true if the + // application will use a custom dialog or if the callback has been executed + // immediately. Custom dialogs may be either modal or modeless. If a custom + // dialog is used the application must execute |callback| once the custom + // dialog is dismissed. + /// + /*--cef(optional_param=message_text)--*/ + virtual bool OnBeforeUnloadDialog(CefRefPtr browser, + const CefString& message_text, + bool is_reload, + CefRefPtr callback) { + return false; + } + + /// + // Called to cancel any pending dialogs and reset any saved dialog state. Will + // be called due to events like page navigation irregardless of whether any + // dialogs are currently pending. + /// + /*--cef()--*/ + virtual void OnResetDialogState(CefRefPtr browser) {} + + /// + // Called when the default implementation dialog is closed. + /// + /*--cef()--*/ + virtual void OnDialogClosed(CefRefPtr browser) {} +}; + +#endif // CEF_INCLUDE_CEF_JSDIALOG_HANDLER_H_ diff --git a/dependencies64/cef/include/cef_keyboard_handler.h b/dependencies64/cef/include/cef_keyboard_handler.h new file mode 100644 index 000000000..55cb57ef8 --- /dev/null +++ b/dependencies64/cef/include/cef_keyboard_handler.h @@ -0,0 +1,74 @@ +// Copyright (c) 2012 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// The contents of this file must follow a specific format in order to +// support the CEF translator tool. See the translator.README.txt file in the +// tools directory for more information. +// + +#ifndef CEF_INCLUDE_CEF_KEYBOARD_HANDLER_H_ +#define CEF_INCLUDE_CEF_KEYBOARD_HANDLER_H_ +#pragma once + +#include "include/cef_base.h" +#include "include/cef_browser.h" + +/// +// Implement this interface to handle events related to keyboard input. The +// methods of this class will be called on the UI thread. +/// +/*--cef(source=client)--*/ +class CefKeyboardHandler : public virtual CefBase { + public: + // Called before a keyboard event is sent to the renderer. |event| contains + // information about the keyboard event. |os_event| is the operating system + // event message, if any. Return true if the event was handled or false + // otherwise. If the event will be handled in OnKeyEvent() as a keyboard + // shortcut set |is_keyboard_shortcut| to true and return false. + /*--cef()--*/ + virtual bool OnPreKeyEvent(CefRefPtr browser, + const CefKeyEvent& event, + CefEventHandle os_event, + bool* is_keyboard_shortcut) { return false; } + + /// + // Called after the renderer and JavaScript in the page has had a chance to + // handle the event. |event| contains information about the keyboard event. + // |os_event| is the operating system event message, if any. Return true if + // the keyboard event was handled or false otherwise. + /// + /*--cef()--*/ + virtual bool OnKeyEvent(CefRefPtr browser, + const CefKeyEvent& event, + CefEventHandle os_event) { return false; } +}; + +#endif // CEF_INCLUDE_CEF_KEYBOARD_HANDLER_H_ diff --git a/dependencies64/cef/include/cef_life_span_handler.h b/dependencies64/cef/include/cef_life_span_handler.h new file mode 100644 index 000000000..70bd70fa2 --- /dev/null +++ b/dependencies64/cef/include/cef_life_span_handler.h @@ -0,0 +1,173 @@ +// Copyright (c) 2012 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// The contents of this file must follow a specific format in order to +// support the CEF translator tool. See the translator.README.txt file in the +// tools directory for more information. +// + +#ifndef CEF_INCLUDE_CEF_LIFE_SPAN_HANDLER_H_ +#define CEF_INCLUDE_CEF_LIFE_SPAN_HANDLER_H_ +#pragma once + +#include "include/cef_base.h" +#include "include/cef_browser.h" + +class CefClient; + +/// +// Implement this interface to handle events related to browser life span. The +// methods of this class will be called on the UI thread unless otherwise +// indicated. +/// +/*--cef(source=client)--*/ +class CefLifeSpanHandler : public virtual CefBase { + public: + typedef cef_window_open_disposition_t WindowOpenDisposition; + + /// + // Called on the IO thread before a new popup browser is created. The + // |browser| and |frame| values represent the source of the popup request. The + // |target_url| and |target_frame_name| values indicate where the popup + // browser should navigate and may be empty if not specified with the request. + // The |target_disposition| value indicates where the user intended to open + // the popup (e.g. current tab, new tab, etc). The |user_gesture| value will + // be true if the popup was opened via explicit user gesture (e.g. clicking a + // link) or false if the popup opened automatically (e.g. via the + // DomContentLoaded event). The |popupFeatures| structure contains additional + // information about the requested popup window. To allow creation of the + // popup browser optionally modify |windowInfo|, |client|, |settings| and + // |no_javascript_access| and return false. To cancel creation of the popup + // browser return true. The |client| and |settings| values will default to the + // source browser's values. If the |no_javascript_access| value is set to + // false the new browser will not be scriptable and may not be hosted in the + // same renderer process as the source browser. + /*--cef(optional_param=target_url,optional_param=target_frame_name)--*/ + virtual bool OnBeforePopup(CefRefPtr browser, + CefRefPtr frame, + const CefString& target_url, + const CefString& target_frame_name, + WindowOpenDisposition target_disposition, + bool user_gesture, + const CefPopupFeatures& popupFeatures, + CefWindowInfo& windowInfo, + CefRefPtr& client, + CefBrowserSettings& settings, + bool* no_javascript_access) { + return false; + } + + /// + // Called after a new browser is created. + /// + /*--cef()--*/ + virtual void OnAfterCreated(CefRefPtr browser) {} + + /// + // Called when a modal window is about to display and the modal loop should + // begin running. Return false to use the default modal loop implementation or + // true to use a custom implementation. + /// + /*--cef()--*/ + virtual bool RunModal(CefRefPtr browser) { return false; } + + /// + // Called when a browser has recieved a request to close. This may result + // directly from a call to CefBrowserHost::CloseBrowser() or indirectly if the + // browser is a top-level OS window created by CEF and the user attempts to + // close the window. This method will be called after the JavaScript + // 'onunload' event has been fired. It will not be called for browsers after + // the associated OS window has been destroyed (for those browsers it is no + // longer possible to cancel the close). + // + // If CEF created an OS window for the browser returning false will send an OS + // close notification to the browser window's top-level owner (e.g. WM_CLOSE + // on Windows, performClose: on OS-X and "delete_event" on Linux). If no OS + // window exists (window rendering disabled) returning false will cause the + // browser object to be destroyed immediately. Return true if the browser is + // parented to another window and that other window needs to receive close + // notification via some non-standard technique. + // + // If an application provides its own top-level window it should handle OS + // close notifications by calling CefBrowserHost::CloseBrowser(false) instead + // of immediately closing (see the example below). This gives CEF an + // opportunity to process the 'onbeforeunload' event and optionally cancel the + // close before DoClose() is called. + // + // The CefLifeSpanHandler::OnBeforeClose() method will be called immediately + // before the browser object is destroyed. The application should only exit + // after OnBeforeClose() has been called for all existing browsers. + // + // If the browser represents a modal window and a custom modal loop + // implementation was provided in CefLifeSpanHandler::RunModal() this callback + // should be used to restore the opener window to a usable state. + // + // By way of example consider what should happen during window close when the + // browser is parented to an application-provided top-level OS window. + // 1. User clicks the window close button which sends an OS close + // notification (e.g. WM_CLOSE on Windows, performClose: on OS-X and + // "delete_event" on Linux). + // 2. Application's top-level window receives the close notification and: + // A. Calls CefBrowserHost::CloseBrowser(false). + // B. Cancels the window close. + // 3. JavaScript 'onbeforeunload' handler executes and shows the close + // confirmation dialog (which can be overridden via + // CefJSDialogHandler::OnBeforeUnloadDialog()). + // 4. User approves the close. + // 5. JavaScript 'onunload' handler executes. + // 6. Application's DoClose() handler is called. Application will: + // A. Set a flag to indicate that the next close attempt will be allowed. + // B. Return false. + // 7. CEF sends an OS close notification. + // 8. Application's top-level window receives the OS close notification and + // allows the window to close based on the flag from #6B. + // 9. Browser OS window is destroyed. + // 10. Application's CefLifeSpanHandler::OnBeforeClose() handler is called and + // the browser object is destroyed. + // 11. Application exits by calling CefQuitMessageLoop() if no other browsers + // exist. + /// + /*--cef()--*/ + virtual bool DoClose(CefRefPtr browser) { return false; } + + /// + // Called just before a browser is destroyed. Release all references to the + // browser object and do not attempt to execute any methods on the browser + // object after this callback returns. If this is a modal window and a custom + // modal loop implementation was provided in RunModal() this callback should + // be used to exit the custom modal loop. See DoClose() documentation for + // additional usage information. + /// + /*--cef()--*/ + virtual void OnBeforeClose(CefRefPtr browser) {} +}; + +#endif // CEF_INCLUDE_CEF_LIFE_SPAN_HANDLER_H_ diff --git a/dependencies64/cef/include/cef_load_handler.h b/dependencies64/cef/include/cef_load_handler.h new file mode 100644 index 000000000..02d9d9f1a --- /dev/null +++ b/dependencies64/cef/include/cef_load_handler.h @@ -0,0 +1,107 @@ +// Copyright (c) 2012 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// The contents of this file must follow a specific format in order to +// support the CEF translator tool. See the translator.README.txt file in the +// tools directory for more information. +// + +#ifndef CEF_INCLUDE_CEF_LOAD_HANDLER_H_ +#define CEF_INCLUDE_CEF_LOAD_HANDLER_H_ +#pragma once + +#include "include/cef_base.h" +#include "include/cef_browser.h" +#include "include/cef_frame.h" + +/// +// Implement this interface to handle events related to browser load status. The +// methods of this class will be called on the browser process UI thread or +// render process main thread (TID_RENDERER). +/// +/*--cef(source=client)--*/ +class CefLoadHandler : public virtual CefBase { + public: + typedef cef_errorcode_t ErrorCode; + + /// + // Called when the loading state has changed. This callback will be executed + // twice -- once when loading is initiated either programmatically or by user + // action, and once when loading is terminated due to completion, cancellation + // of failure. + /// + /*--cef()--*/ + virtual void OnLoadingStateChange(CefRefPtr browser, + bool isLoading, + bool canGoBack, + bool canGoForward) {} + + /// + // Called when the browser begins loading a frame. The |frame| value will + // never be empty -- call the IsMain() method to check if this frame is the + // main frame. Multiple frames may be loading at the same time. Sub-frames may + // start or continue loading after the main frame load has ended. This method + // may not be called for a particular frame if the load request for that frame + // fails. For notification of overall browser load status use + // OnLoadingStateChange instead. + /// + /*--cef()--*/ + virtual void OnLoadStart(CefRefPtr browser, + CefRefPtr frame) {} + + /// + // Called when the browser is done loading a frame. The |frame| value will + // never be empty -- call the IsMain() method to check if this frame is the + // main frame. Multiple frames may be loading at the same time. Sub-frames may + // start or continue loading after the main frame load has ended. This method + // will always be called for all frames irrespective of whether the request + // completes successfully. + /// + /*--cef()--*/ + virtual void OnLoadEnd(CefRefPtr browser, + CefRefPtr frame, + int httpStatusCode) {} + + /// + // Called when the resource load for a navigation fails or is canceled. + // |errorCode| is the error code number, |errorText| is the error text and + // |failedUrl| is the URL that failed to load. See net\base\net_error_list.h + // for complete descriptions of the error codes. + /// + /*--cef(optional_param=errorText)--*/ + virtual void OnLoadError(CefRefPtr browser, + CefRefPtr frame, + ErrorCode errorCode, + const CefString& errorText, + const CefString& failedUrl) {} +}; + +#endif // CEF_INCLUDE_CEF_LOAD_HANDLER_H_ diff --git a/dependencies64/cef/include/cef_menu_model.h b/dependencies64/cef/include/cef_menu_model.h new file mode 100644 index 000000000..84728c58b --- /dev/null +++ b/dependencies64/cef/include/cef_menu_model.h @@ -0,0 +1,402 @@ +// Copyright (c) 2012 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// The contents of this file must follow a specific format in order to +// support the CEF translator tool. See the translator.README.txt file in the +// tools directory for more information. +// + +#ifndef CEF_INCLUDE_CEF_MENU_MODEL_H_ +#define CEF_INCLUDE_CEF_MENU_MODEL_H_ +#pragma once + +#include "include/cef_base.h" + +/// +// Supports creation and modification of menus. See cef_menu_id_t for the +// command ids that have default implementations. All user-defined command ids +// should be between MENU_ID_USER_FIRST and MENU_ID_USER_LAST. The methods of +// this class can only be accessed on the browser process the UI thread. +/// +/*--cef(source=library)--*/ +class CefMenuModel : public virtual CefBase { + public: + typedef cef_menu_item_type_t MenuItemType; + + /// + // Clears the menu. Returns true on success. + /// + /*--cef()--*/ + virtual bool Clear() =0; + + /// + // Returns the number of items in this menu. + /// + /*--cef()--*/ + virtual int GetCount() =0; + + // + // Add a separator to the menu. Returns true on success. + /// + /*--cef()--*/ + virtual bool AddSeparator() =0; + + // + // Add an item to the menu. Returns true on success. + /// + /*--cef()--*/ + virtual bool AddItem(int command_id, + const CefString& label) =0; + + // + // Add a check item to the menu. Returns true on success. + /// + /*--cef()--*/ + virtual bool AddCheckItem(int command_id, + const CefString& label) =0; + // + // Add a radio item to the menu. Only a single item with the specified + // |group_id| can be checked at a time. Returns true on success. + /// + /*--cef()--*/ + virtual bool AddRadioItem(int command_id, + const CefString& label, + int group_id) =0; + + // + // Add a sub-menu to the menu. The new sub-menu is returned. + /// + /*--cef()--*/ + virtual CefRefPtr AddSubMenu(int command_id, + const CefString& label) =0; + + // + // Insert a separator in the menu at the specified |index|. Returns true on + // success. + /// + /*--cef()--*/ + virtual bool InsertSeparatorAt(int index) =0; + + // + // Insert an item in the menu at the specified |index|. Returns true on + // success. + /// + /*--cef()--*/ + virtual bool InsertItemAt(int index, + int command_id, + const CefString& label) =0; + + // + // Insert a check item in the menu at the specified |index|. Returns true on + // success. + /// + /*--cef()--*/ + virtual bool InsertCheckItemAt(int index, + int command_id, + const CefString& label) =0; + + // + // Insert a radio item in the menu at the specified |index|. Only a single + // item with the specified |group_id| can be checked at a time. Returns true + // on success. + /// + /*--cef()--*/ + virtual bool InsertRadioItemAt(int index, + int command_id, + const CefString& label, + int group_id) =0; + + // + // Insert a sub-menu in the menu at the specified |index|. The new sub-menu + // is returned. + /// + /*--cef()--*/ + virtual CefRefPtr InsertSubMenuAt(int index, + int command_id, + const CefString& label) =0; + + /// + // Removes the item with the specified |command_id|. Returns true on success. + /// + /*--cef()--*/ + virtual bool Remove(int command_id) =0; + + /// + // Removes the item at the specified |index|. Returns true on success. + /// + /*--cef()--*/ + virtual bool RemoveAt(int index) =0; + + /// + // Returns the index associated with the specified |command_id| or -1 if not + // found due to the command id not existing in the menu. + /// + /*--cef()--*/ + virtual int GetIndexOf(int command_id) =0; + + /// + // Returns the command id at the specified |index| or -1 if not found due to + // invalid range or the index being a separator. + /// + /*--cef()--*/ + virtual int GetCommandIdAt(int index) =0; + + /// + // Sets the command id at the specified |index|. Returns true on success. + /// + /*--cef()--*/ + virtual bool SetCommandIdAt(int index, int command_id) =0; + + /// + // Returns the label for the specified |command_id| or empty if not found. + /// + /*--cef()--*/ + virtual CefString GetLabel(int command_id) =0; + + /// + // Returns the label at the specified |index| or empty if not found due to + // invalid range or the index being a separator. + /// + /*--cef()--*/ + virtual CefString GetLabelAt(int index) =0; + + /// + // Sets the label for the specified |command_id|. Returns true on success. + /// + /*--cef()--*/ + virtual bool SetLabel(int command_id, const CefString& label) =0; + + /// + // Set the label at the specified |index|. Returns true on success. + /// + /*--cef()--*/ + virtual bool SetLabelAt(int index, const CefString& label) =0; + + /// + // Returns the item type for the specified |command_id|. + /// + /*--cef(default_retval=MENUITEMTYPE_NONE)--*/ + virtual MenuItemType GetType(int command_id) =0; + + /// + // Returns the item type at the specified |index|. + /// + /*--cef(default_retval=MENUITEMTYPE_NONE)--*/ + virtual MenuItemType GetTypeAt(int index) =0; + + /// + // Returns the group id for the specified |command_id| or -1 if invalid. + /// + /*--cef()--*/ + virtual int GetGroupId(int command_id) =0; + + /// + // Returns the group id at the specified |index| or -1 if invalid. + /// + /*--cef()--*/ + virtual int GetGroupIdAt(int index) =0; + + /// + // Sets the group id for the specified |command_id|. Returns true on success. + /// + /*--cef()--*/ + virtual bool SetGroupId(int command_id, int group_id) =0; + + /// + // Sets the group id at the specified |index|. Returns true on success. + /// + /*--cef()--*/ + virtual bool SetGroupIdAt(int index, int group_id) =0; + + /// + // Returns the submenu for the specified |command_id| or empty if invalid. + /// + /*--cef()--*/ + virtual CefRefPtr GetSubMenu(int command_id) =0; + + /// + // Returns the submenu at the specified |index| or empty if invalid. + /// + /*--cef()--*/ + virtual CefRefPtr GetSubMenuAt(int index) =0; + + // + // Returns true if the specified |command_id| is visible. + /// + /*--cef()--*/ + virtual bool IsVisible(int command_id) =0; + + // + // Returns true if the specified |index| is visible. + /// + /*--cef()--*/ + virtual bool IsVisibleAt(int index) =0; + + // + // Change the visibility of the specified |command_id|. Returns true on + // success. + /// + /*--cef()--*/ + virtual bool SetVisible(int command_id, bool visible) =0; + + // + // Change the visibility at the specified |index|. Returns true on success. + /// + /*--cef()--*/ + virtual bool SetVisibleAt(int index, bool visible) =0; + + // + // Returns true if the specified |command_id| is enabled. + /// + /*--cef()--*/ + virtual bool IsEnabled(int command_id) =0; + + // + // Returns true if the specified |index| is enabled. + /// + /*--cef()--*/ + virtual bool IsEnabledAt(int index) =0; + + // + // Change the enabled status of the specified |command_id|. Returns true on + // success. + /// + /*--cef()--*/ + virtual bool SetEnabled(int command_id, bool enabled) =0; + + // + // Change the enabled status at the specified |index|. Returns true on + // success. + /// + /*--cef()--*/ + virtual bool SetEnabledAt(int index, bool enabled) =0; + + // + // Returns true if the specified |command_id| is checked. Only applies to + // check and radio items. + /// + /*--cef()--*/ + virtual bool IsChecked(int command_id) =0; + + // + // Returns true if the specified |index| is checked. Only applies to check + // and radio items. + /// + /*--cef()--*/ + virtual bool IsCheckedAt(int index) =0; + + // + // Check the specified |command_id|. Only applies to check and radio items. + // Returns true on success. + /// + /*--cef()--*/ + virtual bool SetChecked(int command_id, bool checked) =0; + + // + // Check the specified |index|. Only applies to check and radio items. Returns + // true on success. + /// + /*--cef()--*/ + virtual bool SetCheckedAt(int index, bool checked) =0; + + // + // Returns true if the specified |command_id| has a keyboard accelerator + // assigned. + /// + /*--cef()--*/ + virtual bool HasAccelerator(int command_id) =0; + + // + // Returns true if the specified |index| has a keyboard accelerator assigned. + /// + /*--cef()--*/ + virtual bool HasAcceleratorAt(int index) =0; + + // + // Set the keyboard accelerator for the specified |command_id|. |key_code| can + // be any virtual key or character value. Returns true on success. + /// + /*--cef()--*/ + virtual bool SetAccelerator(int command_id, + int key_code, + bool shift_pressed, + bool ctrl_pressed, + bool alt_pressed) =0; + + // + // Set the keyboard accelerator at the specified |index|. |key_code| can be + // any virtual key or character value. Returns true on success. + /// + /*--cef()--*/ + virtual bool SetAcceleratorAt(int index, + int key_code, + bool shift_pressed, + bool ctrl_pressed, + bool alt_pressed) =0; + + // + // Remove the keyboard accelerator for the specified |command_id|. Returns + // true on success. + /// + /*--cef()--*/ + virtual bool RemoveAccelerator(int command_id) =0; + + // + // Remove the keyboard accelerator at the specified |index|. Returns true on + // success. + /// + /*--cef()--*/ + virtual bool RemoveAcceleratorAt(int index) =0; + + // + // Retrieves the keyboard accelerator for the specified |command_id|. Returns + // true on success. + /// + /*--cef()--*/ + virtual bool GetAccelerator(int command_id, + int& key_code, + bool& shift_pressed, + bool& ctrl_pressed, + bool& alt_pressed) =0; + + // + // Retrieves the keyboard accelerator for the specified |index|. Returns true + // on success. + /// + /*--cef()--*/ + virtual bool GetAcceleratorAt(int index, + int& key_code, + bool& shift_pressed, + bool& ctrl_pressed, + bool& alt_pressed) =0; +}; + +#endif // CEF_INCLUDE_CEF_MENU_MODEL_H_ diff --git a/dependencies64/cef/include/cef_navigation_entry.h b/dependencies64/cef/include/cef_navigation_entry.h new file mode 100644 index 000000000..708e39819 --- /dev/null +++ b/dependencies64/cef/include/cef_navigation_entry.h @@ -0,0 +1,120 @@ +// Copyright (c) 2014 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// The contents of this file must follow a specific format in order to +// support the CEF translator tool. See the translator.README.txt file in the +// tools directory for more information. +// + +#ifndef CEF_INCLUDE_CEF_NAVIGATION_ENTRY_H_ +#define CEF_INCLUDE_CEF_NAVIGATION_ENTRY_H_ +#pragma once + +#include "include/cef_base.h" + +/// +// Class used to represent an entry in navigation history. +/// +/*--cef(source=library)--*/ +class CefNavigationEntry : public virtual CefBase { + public: + typedef cef_transition_type_t TransitionType; + + /// + // Returns true if this object is valid. Do not call any other methods if this + // function returns false. + /// + /*--cef()--*/ + virtual bool IsValid() =0; + + /// + // Returns the actual URL of the page. For some pages this may be data: URL or + // similar. Use GetDisplayURL() to return a display-friendly version. + /// + /*--cef()--*/ + virtual CefString GetURL() =0; + + /// + // Returns a display-friendly version of the URL. + /// + /*--cef()--*/ + virtual CefString GetDisplayURL() =0; + + /// + // Returns the original URL that was entered by the user before any redirects. + /// + /*--cef()--*/ + virtual CefString GetOriginalURL() =0; + + /// + // Returns the title set by the page. This value may be empty. + /// + /*--cef()--*/ + virtual CefString GetTitle() =0; + + /// + // Returns the transition type which indicates what the user did to move to + // this page from the previous page. + /// + /*--cef(default_retval=TT_EXPLICIT)--*/ + virtual TransitionType GetTransitionType() =0; + + /// + // Returns true if this navigation includes post data. + /// + /*--cef()--*/ + virtual bool HasPostData() =0; + + /// + // Returns the name of the sub-frame that navigated or an empty value if the + // main frame navigated. + /// + /*--cef()--*/ + virtual CefString GetFrameName() =0; + + /// + // Returns the time for the last known successful navigation completion. A + // navigation may be completed more than once if the page is reloaded. May be + // 0 if the navigation has not yet completed. + /// + /*--cef()--*/ + virtual CefTime GetCompletionTime() =0; + + /// + // Returns the HTTP status code for the last known successful navigation + // response. May be 0 if the response has not yet been received or if the + // navigation has not yet completed. + /// + /*--cef()--*/ + virtual int GetHttpStatusCode() =0; +}; + +#endif // CEF_INCLUDE_CEF_NAVIGATION_ENTRY_H_ diff --git a/dependencies64/cef/include/cef_origin_whitelist.h b/dependencies64/cef/include/cef_origin_whitelist.h new file mode 100644 index 000000000..7fed3453a --- /dev/null +++ b/dependencies64/cef/include/cef_origin_whitelist.h @@ -0,0 +1,103 @@ +// Copyright (c) 2012 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// The contents of this file must follow a specific format in order to +// support the CEF translator tool. See the translator.README.txt file in the +// tools directory for more information. +// + +#ifndef CEF_INCLUDE_CEF_ORIGIN_WHITELIST_H_ +#define CEF_INCLUDE_CEF_ORIGIN_WHITELIST_H_ +#pragma once + +#include "include/cef_base.h" + + +/// +// Add an entry to the cross-origin access whitelist. +// +// The same-origin policy restricts how scripts hosted from different origins +// (scheme + domain + port) can communicate. By default, scripts can only access +// resources with the same origin. Scripts hosted on the HTTP and HTTPS schemes +// (but no other schemes) can use the "Access-Control-Allow-Origin" header to +// allow cross-origin requests. For example, https://source.example.com can make +// XMLHttpRequest requests on http://target.example.com if the +// http://target.example.com request returns an "Access-Control-Allow-Origin: +// https://source.example.com" response header. +// +// Scripts in separate frames or iframes and hosted from the same protocol and +// domain suffix can execute cross-origin JavaScript if both pages set the +// document.domain value to the same domain suffix. For example, +// scheme://foo.example.com and scheme://bar.example.com can communicate using +// JavaScript if both domains set document.domain="example.com". +// +// This method is used to allow access to origins that would otherwise violate +// the same-origin policy. Scripts hosted underneath the fully qualified +// |source_origin| URL (like http://www.example.com) will be allowed access to +// all resources hosted on the specified |target_protocol| and |target_domain|. +// If |target_domain| is non-empty and |allow_target_subdomains| if false only +// exact domain matches will be allowed. If |target_domain| contains a top- +// level domain component (like "example.com") and |allow_target_subdomains| is +// true sub-domain matches will be allowed. If |target_domain| is empty and +// |allow_target_subdomains| if true all domains and IP addresses will be +// allowed. +// +// This method cannot be used to bypass the restrictions on local or display +// isolated schemes. See the comments on CefRegisterCustomScheme for more +// information. +// +// This function may be called on any thread. Returns false if |source_origin| +// is invalid or the whitelist cannot be accessed. +/// +/*--cef(optional_param=target_domain)--*/ +bool CefAddCrossOriginWhitelistEntry(const CefString& source_origin, + const CefString& target_protocol, + const CefString& target_domain, + bool allow_target_subdomains); + +/// +// Remove an entry from the cross-origin access whitelist. Returns false if +// |source_origin| is invalid or the whitelist cannot be accessed. +/// +/*--cef(optional_param=target_domain)--*/ +bool CefRemoveCrossOriginWhitelistEntry(const CefString& source_origin, + const CefString& target_protocol, + const CefString& target_domain, + bool allow_target_subdomains); + +/// +// Remove all entries from the cross-origin access whitelist. Returns false if +// the whitelist cannot be accessed. +/// +/*--cef()--*/ +bool CefClearCrossOriginWhitelist(); + +#endif // CEF_INCLUDE_CEF_ORIGIN_WHITELIST_H_ diff --git a/dependencies64/cef/include/cef_pack_resources.h b/dependencies64/cef/include/cef_pack_resources.h new file mode 100644 index 000000000..7715efb4c --- /dev/null +++ b/dependencies64/cef/include/cef_pack_resources.h @@ -0,0 +1,971 @@ +// Copyright (c) 2015 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// This file is generated by the make_pack_header.py tool. +// + +#ifndef CEF_INCLUDE_CEF_PACK_RESOURCES_H_ +#define CEF_INCLUDE_CEF_PACK_RESOURCES_H_ +#pragma once + +// --------------------------------------------------------------------------- +// From blink_resources.h: + +#define IDR_UASTYLE_HTML_CSS 30350 +#define IDR_UASTYLE_QUIRKS_CSS 30351 +#define IDR_UASTYLE_VIEW_SOURCE_CSS 30352 +#define IDR_UASTYLE_THEME_CHROMIUM_CSS 30353 +#define IDR_UASTYLE_THEME_CHROMIUM_ANDROID_CSS 30354 +#define IDR_UASTYLE_MEDIA_CONTROLS_ANDROID_CSS 30355 +#define IDR_UASTYLE_THEME_CHROMIUM_LINUX_CSS 30356 +#define IDR_UASTYLE_THEME_MAC_CSS 30357 +#define IDR_UASTYLE_THEME_CHROMIUM_SKIA_CSS 30358 +#define IDR_UASTYLE_THEME_INPUT_MULTIPLE_FIELDS_CSS 30359 +#define IDR_UASTYLE_THEME_WIN_CSS 30360 +#define IDR_UASTYLE_THEME_WIN_QUIRKS_CSS 30361 +#define IDR_UASTYLE_SVG_CSS 30362 +#define IDR_UASTYLE_NAVIGATION_TRANSITIONS_CSS 30363 +#define IDR_UASTYLE_MATHML_CSS 30364 +#define IDR_UASTYLE_MEDIA_CONTROLS_CSS 30365 +#define IDR_UASTYLE_FULLSCREEN_CSS 30366 +#define IDR_UASTYLE_XHTMLMP_CSS 30367 +#define IDR_UASTYLE_VIEWPORT_ANDROID_CSS 30368 +#define IDR_INSPECTOR_OVERLAY_PAGE_HTML 30369 +#define IDR_INSPECTOR_INJECTED_SCRIPT_SOURCE_JS 30370 +#define IDR_INSPECTOR_DEBUGGER_SCRIPT_SOURCE_JS 30371 +#define IDR_PRIVATE_SCRIPT_DOCUMENTEXECCOMMAND_JS 30372 +#define IDR_PRIVATE_SCRIPT_DOCUMENTXMLTREEVIEWER_CSS 30373 +#define IDR_PRIVATE_SCRIPT_DOCUMENTXMLTREEVIEWER_JS 30374 +#define IDR_PRIVATE_SCRIPT_HTMLMARQUEEELEMENT_JS 30375 +#define IDR_PRIVATE_SCRIPT_PLUGINPLACEHOLDERELEMENT_JS 30376 +#define IDR_PRIVATE_SCRIPT_PRIVATESCRIPTRUNNER_JS 30377 +#define IDR_PICKER_COMMON_JS 30378 +#define IDR_PICKER_COMMON_CSS 30379 +#define IDR_CALENDAR_PICKER_CSS 30380 +#define IDR_CALENDAR_PICKER_JS 30381 +#define IDR_PICKER_BUTTON_CSS 30382 +#define IDR_SUGGESTION_PICKER_CSS 30383 +#define IDR_SUGGESTION_PICKER_JS 30384 +#define IDR_COLOR_SUGGESTION_PICKER_CSS 30385 +#define IDR_COLOR_SUGGESTION_PICKER_JS 30386 +#define IDR_LIST_PICKER_CSS 30387 +#define IDR_LIST_PICKER_JS 30388 +#define IDR_AUDIO_SPATIALIZATION_COMPOSITE 30389 +#define IDR_AUDIO_SPATIALIZATION_T000_P000 30390 +#define IDR_AUDIO_SPATIALIZATION_T000_P015 30391 +#define IDR_AUDIO_SPATIALIZATION_T000_P030 30392 +#define IDR_AUDIO_SPATIALIZATION_T000_P045 30393 +#define IDR_AUDIO_SPATIALIZATION_T000_P060 30394 +#define IDR_AUDIO_SPATIALIZATION_T000_P075 30395 +#define IDR_AUDIO_SPATIALIZATION_T000_P090 30396 +#define IDR_AUDIO_SPATIALIZATION_T000_P315 30397 +#define IDR_AUDIO_SPATIALIZATION_T000_P330 30398 +#define IDR_AUDIO_SPATIALIZATION_T000_P345 30399 +#define IDR_AUDIO_SPATIALIZATION_T015_P000 30400 +#define IDR_AUDIO_SPATIALIZATION_T015_P015 30401 +#define IDR_AUDIO_SPATIALIZATION_T015_P030 30402 +#define IDR_AUDIO_SPATIALIZATION_T015_P045 30403 +#define IDR_AUDIO_SPATIALIZATION_T015_P060 30404 +#define IDR_AUDIO_SPATIALIZATION_T015_P075 30405 +#define IDR_AUDIO_SPATIALIZATION_T015_P090 30406 +#define IDR_AUDIO_SPATIALIZATION_T015_P315 30407 +#define IDR_AUDIO_SPATIALIZATION_T015_P330 30408 +#define IDR_AUDIO_SPATIALIZATION_T015_P345 30409 +#define IDR_AUDIO_SPATIALIZATION_T030_P000 30410 +#define IDR_AUDIO_SPATIALIZATION_T030_P015 30411 +#define IDR_AUDIO_SPATIALIZATION_T030_P030 30412 +#define IDR_AUDIO_SPATIALIZATION_T030_P045 30413 +#define IDR_AUDIO_SPATIALIZATION_T030_P060 30414 +#define IDR_AUDIO_SPATIALIZATION_T030_P075 30415 +#define IDR_AUDIO_SPATIALIZATION_T030_P090 30416 +#define IDR_AUDIO_SPATIALIZATION_T030_P315 30417 +#define IDR_AUDIO_SPATIALIZATION_T030_P330 30418 +#define IDR_AUDIO_SPATIALIZATION_T030_P345 30419 +#define IDR_AUDIO_SPATIALIZATION_T045_P000 30420 +#define IDR_AUDIO_SPATIALIZATION_T045_P015 30421 +#define IDR_AUDIO_SPATIALIZATION_T045_P030 30422 +#define IDR_AUDIO_SPATIALIZATION_T045_P045 30423 +#define IDR_AUDIO_SPATIALIZATION_T045_P060 30424 +#define IDR_AUDIO_SPATIALIZATION_T045_P075 30425 +#define IDR_AUDIO_SPATIALIZATION_T045_P090 30426 +#define IDR_AUDIO_SPATIALIZATION_T045_P315 30427 +#define IDR_AUDIO_SPATIALIZATION_T045_P330 30428 +#define IDR_AUDIO_SPATIALIZATION_T045_P345 30429 +#define IDR_AUDIO_SPATIALIZATION_T060_P000 30430 +#define IDR_AUDIO_SPATIALIZATION_T060_P015 30431 +#define IDR_AUDIO_SPATIALIZATION_T060_P030 30432 +#define IDR_AUDIO_SPATIALIZATION_T060_P045 30433 +#define IDR_AUDIO_SPATIALIZATION_T060_P060 30434 +#define IDR_AUDIO_SPATIALIZATION_T060_P075 30435 +#define IDR_AUDIO_SPATIALIZATION_T060_P090 30436 +#define IDR_AUDIO_SPATIALIZATION_T060_P315 30437 +#define IDR_AUDIO_SPATIALIZATION_T060_P330 30438 +#define IDR_AUDIO_SPATIALIZATION_T060_P345 30439 +#define IDR_AUDIO_SPATIALIZATION_T075_P000 30440 +#define IDR_AUDIO_SPATIALIZATION_T075_P015 30441 +#define IDR_AUDIO_SPATIALIZATION_T075_P030 30442 +#define IDR_AUDIO_SPATIALIZATION_T075_P045 30443 +#define IDR_AUDIO_SPATIALIZATION_T075_P060 30444 +#define IDR_AUDIO_SPATIALIZATION_T075_P075 30445 +#define IDR_AUDIO_SPATIALIZATION_T075_P090 30446 +#define IDR_AUDIO_SPATIALIZATION_T075_P315 30447 +#define IDR_AUDIO_SPATIALIZATION_T075_P330 30448 +#define IDR_AUDIO_SPATIALIZATION_T075_P345 30449 +#define IDR_AUDIO_SPATIALIZATION_T090_P000 30450 +#define IDR_AUDIO_SPATIALIZATION_T090_P015 30451 +#define IDR_AUDIO_SPATIALIZATION_T090_P030 30452 +#define IDR_AUDIO_SPATIALIZATION_T090_P045 30453 +#define IDR_AUDIO_SPATIALIZATION_T090_P060 30454 +#define IDR_AUDIO_SPATIALIZATION_T090_P075 30455 +#define IDR_AUDIO_SPATIALIZATION_T090_P090 30456 +#define IDR_AUDIO_SPATIALIZATION_T090_P315 30457 +#define IDR_AUDIO_SPATIALIZATION_T090_P330 30458 +#define IDR_AUDIO_SPATIALIZATION_T090_P345 30459 +#define IDR_AUDIO_SPATIALIZATION_T105_P000 30460 +#define IDR_AUDIO_SPATIALIZATION_T105_P015 30461 +#define IDR_AUDIO_SPATIALIZATION_T105_P030 30462 +#define IDR_AUDIO_SPATIALIZATION_T105_P045 30463 +#define IDR_AUDIO_SPATIALIZATION_T105_P060 30464 +#define IDR_AUDIO_SPATIALIZATION_T105_P075 30465 +#define IDR_AUDIO_SPATIALIZATION_T105_P090 30466 +#define IDR_AUDIO_SPATIALIZATION_T105_P315 30467 +#define IDR_AUDIO_SPATIALIZATION_T105_P330 30468 +#define IDR_AUDIO_SPATIALIZATION_T105_P345 30469 +#define IDR_AUDIO_SPATIALIZATION_T120_P000 30470 +#define IDR_AUDIO_SPATIALIZATION_T120_P015 30471 +#define IDR_AUDIO_SPATIALIZATION_T120_P030 30472 +#define IDR_AUDIO_SPATIALIZATION_T120_P045 30473 +#define IDR_AUDIO_SPATIALIZATION_T120_P060 30474 +#define IDR_AUDIO_SPATIALIZATION_T120_P075 30475 +#define IDR_AUDIO_SPATIALIZATION_T120_P090 30476 +#define IDR_AUDIO_SPATIALIZATION_T120_P315 30477 +#define IDR_AUDIO_SPATIALIZATION_T120_P330 30478 +#define IDR_AUDIO_SPATIALIZATION_T120_P345 30479 +#define IDR_AUDIO_SPATIALIZATION_T135_P000 30480 +#define IDR_AUDIO_SPATIALIZATION_T135_P015 30481 +#define IDR_AUDIO_SPATIALIZATION_T135_P030 30482 +#define IDR_AUDIO_SPATIALIZATION_T135_P045 30483 +#define IDR_AUDIO_SPATIALIZATION_T135_P060 30484 +#define IDR_AUDIO_SPATIALIZATION_T135_P075 30485 +#define IDR_AUDIO_SPATIALIZATION_T135_P090 30486 +#define IDR_AUDIO_SPATIALIZATION_T135_P315 30487 +#define IDR_AUDIO_SPATIALIZATION_T135_P330 30488 +#define IDR_AUDIO_SPATIALIZATION_T135_P345 30489 +#define IDR_AUDIO_SPATIALIZATION_T150_P000 30490 +#define IDR_AUDIO_SPATIALIZATION_T150_P015 30491 +#define IDR_AUDIO_SPATIALIZATION_T150_P030 30492 +#define IDR_AUDIO_SPATIALIZATION_T150_P045 30493 +#define IDR_AUDIO_SPATIALIZATION_T150_P060 30494 +#define IDR_AUDIO_SPATIALIZATION_T150_P075 30495 +#define IDR_AUDIO_SPATIALIZATION_T150_P090 30496 +#define IDR_AUDIO_SPATIALIZATION_T150_P315 30497 +#define IDR_AUDIO_SPATIALIZATION_T150_P330 30498 +#define IDR_AUDIO_SPATIALIZATION_T150_P345 30499 +#define IDR_AUDIO_SPATIALIZATION_T165_P000 30500 +#define IDR_AUDIO_SPATIALIZATION_T165_P015 30501 +#define IDR_AUDIO_SPATIALIZATION_T165_P030 30502 +#define IDR_AUDIO_SPATIALIZATION_T165_P045 30503 +#define IDR_AUDIO_SPATIALIZATION_T165_P060 30504 +#define IDR_AUDIO_SPATIALIZATION_T165_P075 30505 +#define IDR_AUDIO_SPATIALIZATION_T165_P090 30506 +#define IDR_AUDIO_SPATIALIZATION_T165_P315 30507 +#define IDR_AUDIO_SPATIALIZATION_T165_P330 30508 +#define IDR_AUDIO_SPATIALIZATION_T165_P345 30509 +#define IDR_AUDIO_SPATIALIZATION_T180_P000 30510 +#define IDR_AUDIO_SPATIALIZATION_T180_P015 30511 +#define IDR_AUDIO_SPATIALIZATION_T180_P030 30512 +#define IDR_AUDIO_SPATIALIZATION_T180_P045 30513 +#define IDR_AUDIO_SPATIALIZATION_T180_P060 30514 +#define IDR_AUDIO_SPATIALIZATION_T180_P075 30515 +#define IDR_AUDIO_SPATIALIZATION_T180_P090 30516 +#define IDR_AUDIO_SPATIALIZATION_T180_P315 30517 +#define IDR_AUDIO_SPATIALIZATION_T180_P330 30518 +#define IDR_AUDIO_SPATIALIZATION_T180_P345 30519 +#define IDR_AUDIO_SPATIALIZATION_T195_P000 30520 +#define IDR_AUDIO_SPATIALIZATION_T195_P015 30521 +#define IDR_AUDIO_SPATIALIZATION_T195_P030 30522 +#define IDR_AUDIO_SPATIALIZATION_T195_P045 30523 +#define IDR_AUDIO_SPATIALIZATION_T195_P060 30524 +#define IDR_AUDIO_SPATIALIZATION_T195_P075 30525 +#define IDR_AUDIO_SPATIALIZATION_T195_P090 30526 +#define IDR_AUDIO_SPATIALIZATION_T195_P315 30527 +#define IDR_AUDIO_SPATIALIZATION_T195_P330 30528 +#define IDR_AUDIO_SPATIALIZATION_T195_P345 30529 +#define IDR_AUDIO_SPATIALIZATION_T210_P000 30530 +#define IDR_AUDIO_SPATIALIZATION_T210_P015 30531 +#define IDR_AUDIO_SPATIALIZATION_T210_P030 30532 +#define IDR_AUDIO_SPATIALIZATION_T210_P045 30533 +#define IDR_AUDIO_SPATIALIZATION_T210_P060 30534 +#define IDR_AUDIO_SPATIALIZATION_T210_P075 30535 +#define IDR_AUDIO_SPATIALIZATION_T210_P090 30536 +#define IDR_AUDIO_SPATIALIZATION_T210_P315 30537 +#define IDR_AUDIO_SPATIALIZATION_T210_P330 30538 +#define IDR_AUDIO_SPATIALIZATION_T210_P345 30539 +#define IDR_AUDIO_SPATIALIZATION_T225_P000 30540 +#define IDR_AUDIO_SPATIALIZATION_T225_P015 30541 +#define IDR_AUDIO_SPATIALIZATION_T225_P030 30542 +#define IDR_AUDIO_SPATIALIZATION_T225_P045 30543 +#define IDR_AUDIO_SPATIALIZATION_T225_P060 30544 +#define IDR_AUDIO_SPATIALIZATION_T225_P075 30545 +#define IDR_AUDIO_SPATIALIZATION_T225_P090 30546 +#define IDR_AUDIO_SPATIALIZATION_T225_P315 30547 +#define IDR_AUDIO_SPATIALIZATION_T225_P330 30548 +#define IDR_AUDIO_SPATIALIZATION_T225_P345 30549 +#define IDR_AUDIO_SPATIALIZATION_T240_P000 30550 +#define IDR_AUDIO_SPATIALIZATION_T240_P015 30551 +#define IDR_AUDIO_SPATIALIZATION_T240_P030 30552 +#define IDR_AUDIO_SPATIALIZATION_T240_P045 30553 +#define IDR_AUDIO_SPATIALIZATION_T240_P060 30554 +#define IDR_AUDIO_SPATIALIZATION_T240_P075 30555 +#define IDR_AUDIO_SPATIALIZATION_T240_P090 30556 +#define IDR_AUDIO_SPATIALIZATION_T240_P315 30557 +#define IDR_AUDIO_SPATIALIZATION_T240_P330 30558 +#define IDR_AUDIO_SPATIALIZATION_T240_P345 30559 +#define IDR_AUDIO_SPATIALIZATION_T255_P000 30560 +#define IDR_AUDIO_SPATIALIZATION_T255_P015 30561 +#define IDR_AUDIO_SPATIALIZATION_T255_P030 30562 +#define IDR_AUDIO_SPATIALIZATION_T255_P045 30563 +#define IDR_AUDIO_SPATIALIZATION_T255_P060 30564 +#define IDR_AUDIO_SPATIALIZATION_T255_P075 30565 +#define IDR_AUDIO_SPATIALIZATION_T255_P090 30566 +#define IDR_AUDIO_SPATIALIZATION_T255_P315 30567 +#define IDR_AUDIO_SPATIALIZATION_T255_P330 30568 +#define IDR_AUDIO_SPATIALIZATION_T255_P345 30569 +#define IDR_AUDIO_SPATIALIZATION_T270_P000 30570 +#define IDR_AUDIO_SPATIALIZATION_T270_P015 30571 +#define IDR_AUDIO_SPATIALIZATION_T270_P030 30572 +#define IDR_AUDIO_SPATIALIZATION_T270_P045 30573 +#define IDR_AUDIO_SPATIALIZATION_T270_P060 30574 +#define IDR_AUDIO_SPATIALIZATION_T270_P075 30575 +#define IDR_AUDIO_SPATIALIZATION_T270_P090 30576 +#define IDR_AUDIO_SPATIALIZATION_T270_P315 30577 +#define IDR_AUDIO_SPATIALIZATION_T270_P330 30578 +#define IDR_AUDIO_SPATIALIZATION_T270_P345 30579 +#define IDR_AUDIO_SPATIALIZATION_T285_P000 30580 +#define IDR_AUDIO_SPATIALIZATION_T285_P015 30581 +#define IDR_AUDIO_SPATIALIZATION_T285_P030 30582 +#define IDR_AUDIO_SPATIALIZATION_T285_P045 30583 +#define IDR_AUDIO_SPATIALIZATION_T285_P060 30584 +#define IDR_AUDIO_SPATIALIZATION_T285_P075 30585 +#define IDR_AUDIO_SPATIALIZATION_T285_P090 30586 +#define IDR_AUDIO_SPATIALIZATION_T285_P315 30587 +#define IDR_AUDIO_SPATIALIZATION_T285_P330 30588 +#define IDR_AUDIO_SPATIALIZATION_T285_P345 30589 +#define IDR_AUDIO_SPATIALIZATION_T300_P000 30590 +#define IDR_AUDIO_SPATIALIZATION_T300_P015 30591 +#define IDR_AUDIO_SPATIALIZATION_T300_P030 30592 +#define IDR_AUDIO_SPATIALIZATION_T300_P045 30593 +#define IDR_AUDIO_SPATIALIZATION_T300_P060 30594 +#define IDR_AUDIO_SPATIALIZATION_T300_P075 30595 +#define IDR_AUDIO_SPATIALIZATION_T300_P090 30596 +#define IDR_AUDIO_SPATIALIZATION_T300_P315 30597 +#define IDR_AUDIO_SPATIALIZATION_T300_P330 30598 +#define IDR_AUDIO_SPATIALIZATION_T300_P345 30599 +#define IDR_AUDIO_SPATIALIZATION_T315_P000 30600 +#define IDR_AUDIO_SPATIALIZATION_T315_P015 30601 +#define IDR_AUDIO_SPATIALIZATION_T315_P030 30602 +#define IDR_AUDIO_SPATIALIZATION_T315_P045 30603 +#define IDR_AUDIO_SPATIALIZATION_T315_P060 30604 +#define IDR_AUDIO_SPATIALIZATION_T315_P075 30605 +#define IDR_AUDIO_SPATIALIZATION_T315_P090 30606 +#define IDR_AUDIO_SPATIALIZATION_T315_P315 30607 +#define IDR_AUDIO_SPATIALIZATION_T315_P330 30608 +#define IDR_AUDIO_SPATIALIZATION_T315_P345 30609 +#define IDR_AUDIO_SPATIALIZATION_T330_P000 30610 +#define IDR_AUDIO_SPATIALIZATION_T330_P015 30611 +#define IDR_AUDIO_SPATIALIZATION_T330_P030 30612 +#define IDR_AUDIO_SPATIALIZATION_T330_P045 30613 +#define IDR_AUDIO_SPATIALIZATION_T330_P060 30614 +#define IDR_AUDIO_SPATIALIZATION_T330_P075 30615 +#define IDR_AUDIO_SPATIALIZATION_T330_P090 30616 +#define IDR_AUDIO_SPATIALIZATION_T330_P315 30617 +#define IDR_AUDIO_SPATIALIZATION_T330_P330 30618 +#define IDR_AUDIO_SPATIALIZATION_T330_P345 30619 +#define IDR_AUDIO_SPATIALIZATION_T345_P000 30620 +#define IDR_AUDIO_SPATIALIZATION_T345_P015 30621 +#define IDR_AUDIO_SPATIALIZATION_T345_P030 30622 +#define IDR_AUDIO_SPATIALIZATION_T345_P045 30623 +#define IDR_AUDIO_SPATIALIZATION_T345_P060 30624 +#define IDR_AUDIO_SPATIALIZATION_T345_P075 30625 +#define IDR_AUDIO_SPATIALIZATION_T345_P090 30626 +#define IDR_AUDIO_SPATIALIZATION_T345_P315 30627 +#define IDR_AUDIO_SPATIALIZATION_T345_P330 30628 +#define IDR_AUDIO_SPATIALIZATION_T345_P345 30629 + +// --------------------------------------------------------------------------- +// From cef_resources.h: + +#define IDR_CEF_DEVTOOLS_DISCOVERY_PAGE 27500 +#define IDR_CEF_CREDITS_HTML 27501 +#define IDR_CEF_CREDITS_JS 27502 +#define IDR_CEF_LICENSE_TXT 27503 +#define IDR_CEF_VERSION_HTML 27504 +#define IDR_PRINT_PREVIEW_PAGE 27505 + +// --------------------------------------------------------------------------- +// From content_resources.h: + +#define IDR_ACCESSIBILITY_HTML 25000 +#define IDR_ACCESSIBILITY_CSS 25001 +#define IDR_ACCESSIBILITY_JS 25002 +#define IDR_DEVTOOLS_PINCH_CURSOR_ICON 25003 +#define IDR_DEVTOOLS_PINCH_CURSOR_ICON_2X 25004 +#define IDR_DEVTOOLS_TOUCH_CURSOR_ICON 25005 +#define IDR_DEVTOOLS_TOUCH_CURSOR_ICON_2X 25006 +#define IDR_GPU_INTERNALS_HTML 25007 +#define IDR_GPU_INTERNALS_JS 25008 +#define IDR_INDEXED_DB_INTERNALS_HTML 25009 +#define IDR_INDEXED_DB_INTERNALS_JS 25010 +#define IDR_INDEXED_DB_INTERNALS_CSS 25011 +#define IDR_MEDIA_INTERNALS_HTML 25012 +#define IDR_MEDIA_INTERNALS_JS 25013 +#define IDR_SERVICE_WORKER_INTERNALS_HTML 25014 +#define IDR_SERVICE_WORKER_INTERNALS_JS 25015 +#define IDR_SERVICE_WORKER_INTERNALS_CSS 25016 +#define IDR_WEBRTC_INTERNALS_HTML 25017 +#define IDR_WEBRTC_INTERNALS_JS 25018 +#define IDR_GPU_SANDBOX_PROFILE 25019 +#define IDR_COMMON_SANDBOX_PROFILE 25020 +#define IDR_PPAPI_SANDBOX_PROFILE 25021 +#define IDR_RENDERER_SANDBOX_PROFILE 25022 +#define IDR_UTILITY_SANDBOX_PROFILE 25023 +#define IDR_MOJO_BINDINGS_JS 25024 +#define IDR_MOJO_BUFFER_JS 25025 +#define IDR_MOJO_CODEC_JS 25026 +#define IDR_MOJO_CONNECTION_JS 25027 +#define IDR_MOJO_CONNECTOR_JS 25028 +#define IDR_MOJO_ROUTER_JS 25029 +#define IDR_MOJO_UNICODE_JS 25030 +#define IDR_MOJO_VALIDATOR_JS 25031 + +// --------------------------------------------------------------------------- +// From devtools_resources.h: + +#define DEVTOOLS_CSS 22000 +#define DEVTOOLS_HTML 22001 +#define DEVTOOLS_JS 22002 +#define INSPECTOR_CSS 22003 +#define INSPECTOR_HTML 22004 +#define INSPECTOR_JS 22005 +#define TOOLBOX_CSS 22006 +#define TOOLBOX_HTML 22007 +#define TOOLBOX_JS 22008 +#define ACCESSIBILITY_MODULE_JS 22009 +#define AUDITS_MODULE_JS 22010 +#define COMPONENTS_LAZY_MODULE_JS 22011 +#define CONSOLE_MODULE_JS 22012 +#define ELEMENTS_MODULE_JS 22013 +#define HEAP_SNAPSHOT_WORKER_MODULE_JS 22014 +#define LAYERS_MODULE_JS 22015 +#define NETWORK_MODULE_JS 22016 +#define PROFILER_MODULE_JS 22017 +#define PROMISES_MODULE_JS 22018 +#define RESOURCES_MODULE_JS 22019 +#define SCREENCAST_MODULE_JS 22020 +#define SCRIPT_FORMATTER_WORKER_MODULE_JS 22021 +#define SETTINGS_MODULE_JS 22022 +#define SNIPPETS_MODULE_JS 22023 +#define SOURCE_FRAME_MODULE_JS 22024 +#define SOURCES_MODULE_JS 22025 +#define TEMP_STORAGE_SHARED_WORKER_MODULE_JS 22026 +#define TIMELINE_MODULE_JS 22027 +#define UI_LAZY_MODULE_JS 22028 +#define DEVTOOLS_EXTENSION_API_JS 22029 +#define IMAGES_APPLICATIONCACHE_PNG 22030 +#define IMAGES_BREAKPOINT_PNG 22031 +#define IMAGES_BREAKPOINTCONDITIONAL_PNG 22032 +#define IMAGES_BREAKPOINTCONDITIONAL_2X_PNG 22033 +#define IMAGES_BREAKPOINT_2X_PNG 22034 +#define IMAGES_CHECKER_PNG 22035 +#define IMAGES_CHROMEDISABLEDSELECT_PNG 22036 +#define IMAGES_CHROMEDISABLEDSELECT_2X_PNG 22037 +#define IMAGES_CHROMELEFT_PNG 22038 +#define IMAGES_CHROMEMIDDLE_PNG 22039 +#define IMAGES_CHROMERIGHT_PNG 22040 +#define IMAGES_CHROMESELECT_PNG 22041 +#define IMAGES_CHROMESELECT_2X_PNG 22042 +#define IMAGES_COOKIE_PNG 22043 +#define IMAGES_DATABASE_PNG 22044 +#define IMAGES_DATABASETABLE_PNG 22045 +#define IMAGES_DELETEICON_PNG 22046 +#define IMAGES_DOMAIN_PNG 22047 +#define IMAGES_ERRORWAVE_PNG 22048 +#define IMAGES_ERRORWAVE_2X_PNG 22049 +#define IMAGES_FILESYSTEM_PNG 22050 +#define IMAGES_FORWARD_PNG 22051 +#define IMAGES_FRAME_PNG 22052 +#define IMAGES_GRAPHLABELCALLOUTLEFT_PNG 22053 +#define IMAGES_GRAPHLABELCALLOUTRIGHT_PNG 22054 +#define IMAGES_INDEXEDDB_PNG 22055 +#define IMAGES_INDEXEDDBINDEX_PNG 22056 +#define IMAGES_INDEXEDDBOBJECTSTORE_PNG 22057 +#define IMAGES_LOCALSTORAGE_PNG 22058 +#define IMAGES_NAVIGATIONCONTROLS_PNG 22059 +#define IMAGES_NAVIGATIONCONTROLS_2X_PNG 22060 +#define IMAGES_NOTIFICATIONS_SVG 22061 +#define IMAGES_PANEADDBUTTONS_PNG 22062 +#define IMAGES_PANEANIMATIONSBUTTONS_PNG 22063 +#define IMAGES_PANEELEMENTSTATEBUTTONS_PNG 22064 +#define IMAGES_PANEFILTERBUTTONS_PNG 22065 +#define IMAGES_PANEREFRESHBUTTONS_PNG 22066 +#define IMAGES_POPOVERARROWS_PNG 22067 +#define IMAGES_PROFILEGROUPICON_PNG 22068 +#define IMAGES_PROFILEICON_PNG 22069 +#define IMAGES_PROFILESMALLICON_PNG 22070 +#define IMAGES_RADIODOT_PNG 22071 +#define IMAGES_RESOURCECSSICON_PNG 22072 +#define IMAGES_RESOURCEDOCUMENTICON_PNG 22073 +#define IMAGES_RESOURCEDOCUMENTICONSMALL_PNG 22074 +#define IMAGES_RESOURCEJSICON_PNG 22075 +#define IMAGES_RESOURCEPLAINICON_PNG 22076 +#define IMAGES_RESOURCEPLAINICONSMALL_PNG 22077 +#define IMAGES_RESOURCESTIMEGRAPHICON_PNG 22078 +#define IMAGES_RESPONSIVEDESIGN_PNG 22079 +#define IMAGES_RESPONSIVEDESIGN_2X_PNG 22080 +#define IMAGES_SEARCHNEXT_PNG 22081 +#define IMAGES_SEARCHPREV_PNG 22082 +#define IMAGES_SERVICEWORKER_SVG 22083 +#define IMAGES_SESSIONSTORAGE_PNG 22084 +#define IMAGES_SETTINGSLISTREMOVE_PNG 22085 +#define IMAGES_SETTINGSLISTREMOVE_2X_PNG 22086 +#define IMAGES_SPEECH_PNG 22087 +#define IMAGES_SPINNER_SVG 22088 +#define IMAGES_STATUSBARBUTTONGLYPHS_PNG 22089 +#define IMAGES_STATUSBARBUTTONGLYPHS_2X_PNG 22090 +#define IMAGES_THUMBACTIVEHORIZ_PNG 22091 +#define IMAGES_THUMBACTIVEVERT_PNG 22092 +#define IMAGES_THUMBHORIZ_PNG 22093 +#define IMAGES_THUMBHOVERHORIZ_PNG 22094 +#define IMAGES_THUMBHOVERVERT_PNG 22095 +#define IMAGES_THUMBVERT_PNG 22096 +#define IMAGES_TOOLBARBUTTONGLYPHS_PNG 22097 +#define IMAGES_TOOLBARBUTTONGLYPHS_2X_PNG 22098 +#define IMAGES_TOOLBARITEMSELECTED_PNG 22099 +#define IMAGES_TOOLBARRESIZERHORIZONTAL_PNG 22100 +#define IMAGES_TOOLBARRESIZERVERTICAL_PNG 22101 +#define IMAGES_TOUCHCURSOR_PNG 22102 +#define IMAGES_TOUCHCURSOR_2X_PNG 22103 +#define IMAGES_TRANSFORMCONTROLS_PNG 22104 +#define IMAGES_TRANSFORMCONTROLS_2X_PNG 22105 +#define IMAGES_UPDATESERVICEWORKER_SVG 22106 + +// --------------------------------------------------------------------------- +// From net_resources.h: + +#define IDR_DIR_HEADER_HTML 4000 + +// --------------------------------------------------------------------------- +// From ui_resources.h: + +#define IDR_APP_LIST_ITEM_PROGRESS_BACKGROUND 5500 +#define IDR_APP_LIST_ITEM_PROGRESS_LEFT 5501 +#define IDR_APP_LIST_ITEM_PROGRESS_CENTER 5502 +#define IDR_APP_LIST_ITEM_PROGRESS_RIGHT 5503 +#define IDR_APP_LIST_TOOLS_HOVER 5504 +#define IDR_APP_LIST_TOOLS_NORMAL 5505 +#define IDR_APP_LIST_TOOLS_PRESSED 5506 +#define IDR_APP_LIST_FOLDER_BACK_NORMAL 5507 +#define IDR_APP_LIST_SPEECH_MIC_ON 5508 +#define IDR_APP_LIST_SPEECH_MIC_OFF 5509 +#define IDR_APP_LIST_SPEECH_MIC_RECORDING 5510 +#define IDR_APP_LIST_USER_INDICATOR 5511 +#define IDR_APP_TOP_CENTER 5512 +#define IDR_APP_TOP_LEFT 5513 +#define IDR_APP_TOP_RIGHT 5514 +#define IDR_AURA_CURSOR_BIG_ALIAS 5515 +#define IDR_AURA_CURSOR_BIG_CELL 5516 +#define IDR_AURA_CURSOR_BIG_COL_RESIZE 5517 +#define IDR_AURA_CURSOR_BIG_CONTEXT_MENU 5518 +#define IDR_AURA_CURSOR_BIG_COPY 5519 +#define IDR_AURA_CURSOR_BIG_CROSSHAIR 5520 +#define IDR_AURA_CURSOR_BIG_EAST_RESIZE 5521 +#define IDR_AURA_CURSOR_BIG_EAST_WEST_RESIZE 5522 +#define IDR_AURA_CURSOR_BIG_HAND 5523 +#define IDR_AURA_CURSOR_BIG_HELP 5524 +#define IDR_AURA_CURSOR_BIG_IBEAM 5525 +#define IDR_AURA_CURSOR_BIG_MOVE 5526 +#define IDR_AURA_CURSOR_BIG_NORTH_EAST_RESIZE 5527 +#define IDR_AURA_CURSOR_BIG_NORTH_EAST_SOUTH_WEST_RESIZE 5528 +#define IDR_AURA_CURSOR_BIG_NORTH_RESIZE 5529 +#define IDR_AURA_CURSOR_BIG_NORTH_SOUTH_RESIZE 5530 +#define IDR_AURA_CURSOR_BIG_NORTH_WEST_RESIZE 5531 +#define IDR_AURA_CURSOR_BIG_NORTH_WEST_SOUTH_EAST_RESIZE 5532 +#define IDR_AURA_CURSOR_BIG_NO_DROP 5533 +#define IDR_AURA_CURSOR_BIG_PTR 5534 +#define IDR_AURA_CURSOR_BIG_ROW_RESIZE 5535 +#define IDR_AURA_CURSOR_BIG_SOUTH_EAST_RESIZE 5536 +#define IDR_AURA_CURSOR_BIG_SOUTH_RESIZE 5537 +#define IDR_AURA_CURSOR_BIG_SOUTH_WEST_RESIZE 5538 +#define IDR_AURA_CURSOR_BIG_WEST_RESIZE 5539 +#define IDR_AURA_CURSOR_BIG_XTERM_HORIZ 5540 +#define IDR_AURA_CURSOR_BIG_ZOOM_IN 5541 +#define IDR_AURA_CURSOR_BIG_ZOOM_OUT 5542 +#define IDR_AURA_CURSOR_BIG_GRAB 5543 +#define IDR_AURA_CURSOR_BIG_GRABBING 5544 +#define IDR_AURA_CURSOR_ALIAS 5545 +#define IDR_AURA_CURSOR_CELL 5546 +#define IDR_AURA_CURSOR_COL_RESIZE 5547 +#define IDR_AURA_CURSOR_CONTEXT_MENU 5548 +#define IDR_AURA_CURSOR_COPY 5549 +#define IDR_AURA_CURSOR_CROSSHAIR 5550 +#define IDR_AURA_CURSOR_EAST_RESIZE 5551 +#define IDR_AURA_CURSOR_EAST_WEST_RESIZE 5552 +#define IDR_AURA_CURSOR_HAND 5553 +#define IDR_AURA_CURSOR_HELP 5554 +#define IDR_AURA_CURSOR_IBEAM 5555 +#define IDR_AURA_CURSOR_MOVE 5556 +#define IDR_AURA_CURSOR_NORTH_EAST_RESIZE 5557 +#define IDR_AURA_CURSOR_NORTH_EAST_SOUTH_WEST_RESIZE 5558 +#define IDR_AURA_CURSOR_NORTH_RESIZE 5559 +#define IDR_AURA_CURSOR_NORTH_SOUTH_RESIZE 5560 +#define IDR_AURA_CURSOR_NORTH_WEST_RESIZE 5561 +#define IDR_AURA_CURSOR_NORTH_WEST_SOUTH_EAST_RESIZE 5562 +#define IDR_AURA_CURSOR_NO_DROP 5563 +#define IDR_AURA_CURSOR_PTR 5564 +#define IDR_AURA_CURSOR_ROW_RESIZE 5565 +#define IDR_AURA_CURSOR_SOUTH_EAST_RESIZE 5566 +#define IDR_AURA_CURSOR_SOUTH_RESIZE 5567 +#define IDR_AURA_CURSOR_SOUTH_WEST_RESIZE 5568 +#define IDR_AURA_CURSOR_WEST_RESIZE 5569 +#define IDR_AURA_CURSOR_XTERM_HORIZ 5570 +#define IDR_AURA_CURSOR_ZOOM_IN 5571 +#define IDR_AURA_CURSOR_ZOOM_OUT 5572 +#define IDR_AURA_CURSOR_GRAB 5573 +#define IDR_AURA_CURSOR_GRABBING 5574 +#define IDR_AURA_SHADOW_ACTIVE 5575 +#define IDR_AURA_SHADOW_INACTIVE 5576 +#define IDR_BACK_ARROW 5577 +#define IDR_FORWARD_ARROW 5578 +#define IDR_BROWSER_ACTION_BADGE_CENTER 5579 +#define IDR_BROWSER_ACTION_BADGE_LEFT 5580 +#define IDR_BROWSER_ACTION_BADGE_RIGHT 5581 +#define IDR_BUBBLE_B 5582 +#define IDR_BUBBLE_BL 5583 +#define IDR_BUBBLE_BR 5584 +#define IDR_BUBBLE_B_ARROW 5585 +#define IDR_BUBBLE_L 5586 +#define IDR_BUBBLE_L_ARROW 5587 +#define IDR_BUBBLE_R 5588 +#define IDR_BUBBLE_R_ARROW 5589 +#define IDR_BUBBLE_T 5590 +#define IDR_BUBBLE_TL 5591 +#define IDR_BUBBLE_TR 5592 +#define IDR_BUBBLE_T_ARROW 5593 +#define IDR_BUTTON_DISABLED 5594 +#define IDR_BUTTON_FOCUSED_HOVER 5595 +#define IDR_BUTTON_FOCUSED_NORMAL 5596 +#define IDR_BUTTON_FOCUSED_PRESSED 5597 +#define IDR_BUTTON_HOVER 5598 +#define IDR_BUTTON_NORMAL 5599 +#define IDR_BUTTON_PRESSED 5600 +#define IDR_BLUE_BUTTON_DISABLED 5601 +#define IDR_BLUE_BUTTON_FOCUSED_HOVER 5602 +#define IDR_BLUE_BUTTON_FOCUSED_NORMAL 5603 +#define IDR_BLUE_BUTTON_FOCUSED_PRESSED 5604 +#define IDR_BLUE_BUTTON_HOVER 5605 +#define IDR_BLUE_BUTTON_NORMAL 5606 +#define IDR_BLUE_BUTTON_PRESSED 5607 +#define IDR_CHECKBOX 5608 +#define IDR_CHECKBOX_CHECKED 5609 +#define IDR_CHECKBOX_CHECKED_DISABLED 5610 +#define IDR_CHECKBOX_CHECKED_HOVER 5611 +#define IDR_CHECKBOX_CHECKED_PRESSED 5612 +#define IDR_CHECKBOX_DISABLED 5613 +#define IDR_CHECKBOX_FOCUSED 5614 +#define IDR_CHECKBOX_FOCUSED_CHECKED 5615 +#define IDR_CHECKBOX_FOCUSED_CHECKED_HOVER 5616 +#define IDR_CHECKBOX_FOCUSED_CHECKED_PRESSED 5617 +#define IDR_CHECKBOX_FOCUSED_HOVER 5618 +#define IDR_CHECKBOX_FOCUSED_PRESSED 5619 +#define IDR_CHECKBOX_HOVER 5620 +#define IDR_CHECKBOX_PRESSED 5621 +#define IDR_CHECKMARK 5622 +#define IDR_CLOSE 5623 +#define IDR_CLOSE_2 5624 +#define IDR_CLOSE_2_H 5625 +#define IDR_CLOSE_2_MASK 5626 +#define IDR_CLOSE_2_P 5627 +#define IDR_CLOSE_3_MASK 5628 +#define IDR_CLOSE_4_BUTTON 5629 +#define IDR_CLOSE_DIALOG 5630 +#define IDR_CLOSE_DIALOG_H 5631 +#define IDR_CLOSE_DIALOG_P 5632 +#define IDR_DISABLE 5633 +#define IDR_DISABLE_H 5634 +#define IDR_DISABLE_P 5635 +#define IDR_CLOSE_H 5636 +#define IDR_CLOSE_P 5637 +#define IDR_COMBOBOX_BUTTON_BOTTOM 5638 +#define IDR_COMBOBOX_BUTTON_H_BOTTOM 5639 +#define IDR_COMBOBOX_BUTTON_P_BOTTOM 5640 +#define IDR_COMBOBOX_BUTTON_BOTTOM_LEFT 5641 +#define IDR_COMBOBOX_BUTTON_H_BOTTOM_LEFT 5642 +#define IDR_COMBOBOX_BUTTON_P_BOTTOM_LEFT 5643 +#define IDR_COMBOBOX_BUTTON_BOTTOM_RIGHT 5644 +#define IDR_COMBOBOX_BUTTON_H_BOTTOM_RIGHT 5645 +#define IDR_COMBOBOX_BUTTON_P_BOTTOM_RIGHT 5646 +#define IDR_COMBOBOX_BUTTON_CENTER 5647 +#define IDR_COMBOBOX_BUTTON_H_CENTER 5648 +#define IDR_COMBOBOX_BUTTON_P_CENTER 5649 +#define IDR_COMBOBOX_BUTTON_LEFT 5650 +#define IDR_COMBOBOX_BUTTON_H_LEFT 5651 +#define IDR_COMBOBOX_BUTTON_P_LEFT 5652 +#define IDR_COMBOBOX_BUTTON_RIGHT 5653 +#define IDR_COMBOBOX_BUTTON_H_RIGHT 5654 +#define IDR_COMBOBOX_BUTTON_P_RIGHT 5655 +#define IDR_COMBOBOX_BUTTON_MENU_BOTTOM 5656 +#define IDR_COMBOBOX_BUTTON_H_MENU_BOTTOM 5657 +#define IDR_COMBOBOX_BUTTON_P_MENU_BOTTOM 5658 +#define IDR_COMBOBOX_BUTTON_MENU_CENTER 5659 +#define IDR_COMBOBOX_BUTTON_H_MENU_CENTER 5660 +#define IDR_COMBOBOX_BUTTON_P_MENU_CENTER 5661 +#define IDR_COMBOBOX_BUTTON_MENU_TOP 5662 +#define IDR_COMBOBOX_BUTTON_H_MENU_TOP 5663 +#define IDR_COMBOBOX_BUTTON_P_MENU_TOP 5664 +#define IDR_COMBOBOX_BUTTON_TOP 5665 +#define IDR_COMBOBOX_BUTTON_H_TOP 5666 +#define IDR_COMBOBOX_BUTTON_P_TOP 5667 +#define IDR_COMBOBOX_BUTTON_TOP_LEFT 5668 +#define IDR_COMBOBOX_BUTTON_H_TOP_LEFT 5669 +#define IDR_COMBOBOX_BUTTON_P_TOP_LEFT 5670 +#define IDR_COMBOBOX_BUTTON_TOP_RIGHT 5671 +#define IDR_COMBOBOX_BUTTON_H_TOP_RIGHT 5672 +#define IDR_COMBOBOX_BUTTON_P_TOP_RIGHT 5673 +#define IDR_COMBOBOX_BUTTON_F_BOTTOM 5674 +#define IDR_COMBOBOX_BUTTON_F_H_BOTTOM 5675 +#define IDR_COMBOBOX_BUTTON_F_P_BOTTOM 5676 +#define IDR_COMBOBOX_BUTTON_F_BOTTOM_LEFT 5677 +#define IDR_COMBOBOX_BUTTON_F_H_BOTTOM_LEFT 5678 +#define IDR_COMBOBOX_BUTTON_F_P_BOTTOM_LEFT 5679 +#define IDR_COMBOBOX_BUTTON_F_BOTTOM_RIGHT 5680 +#define IDR_COMBOBOX_BUTTON_F_H_BOTTOM_RIGHT 5681 +#define IDR_COMBOBOX_BUTTON_F_P_BOTTOM_RIGHT 5682 +#define IDR_COMBOBOX_BUTTON_F_CENTER 5683 +#define IDR_COMBOBOX_BUTTON_F_H_CENTER 5684 +#define IDR_COMBOBOX_BUTTON_F_P_CENTER 5685 +#define IDR_COMBOBOX_BUTTON_F_LEFT 5686 +#define IDR_COMBOBOX_BUTTON_F_H_LEFT 5687 +#define IDR_COMBOBOX_BUTTON_F_P_LEFT 5688 +#define IDR_COMBOBOX_BUTTON_F_RIGHT 5689 +#define IDR_COMBOBOX_BUTTON_F_H_RIGHT 5690 +#define IDR_COMBOBOX_BUTTON_F_P_RIGHT 5691 +#define IDR_COMBOBOX_BUTTON_F_MENU_BOTTOM 5692 +#define IDR_COMBOBOX_BUTTON_F_H_MENU_BOTTOM 5693 +#define IDR_COMBOBOX_BUTTON_F_P_MENU_BOTTOM 5694 +#define IDR_COMBOBOX_BUTTON_F_MENU_CENTER 5695 +#define IDR_COMBOBOX_BUTTON_F_H_MENU_CENTER 5696 +#define IDR_COMBOBOX_BUTTON_F_P_MENU_CENTER 5697 +#define IDR_COMBOBOX_BUTTON_F_MENU_TOP 5698 +#define IDR_COMBOBOX_BUTTON_F_H_MENU_TOP 5699 +#define IDR_COMBOBOX_BUTTON_F_P_MENU_TOP 5700 +#define IDR_COMBOBOX_BUTTON_F_TOP 5701 +#define IDR_COMBOBOX_BUTTON_F_H_TOP 5702 +#define IDR_COMBOBOX_BUTTON_F_P_TOP 5703 +#define IDR_COMBOBOX_BUTTON_F_TOP_LEFT 5704 +#define IDR_COMBOBOX_BUTTON_F_H_TOP_LEFT 5705 +#define IDR_COMBOBOX_BUTTON_F_P_TOP_LEFT 5706 +#define IDR_COMBOBOX_BUTTON_F_TOP_RIGHT 5707 +#define IDR_COMBOBOX_BUTTON_F_H_TOP_RIGHT 5708 +#define IDR_COMBOBOX_BUTTON_F_P_TOP_RIGHT 5709 +#define IDR_CONTENT_BOTTOM_CENTER 5710 +#define IDR_CONTENT_BOTTOM_LEFT_CORNER 5711 +#define IDR_CONTENT_BOTTOM_RIGHT_CORNER 5712 +#define IDR_CONTENT_LEFT_SIDE 5713 +#define IDR_CONTENT_RIGHT_SIDE 5714 +#define IDR_DEFAULT_FAVICON 5715 +#define IDR_DEFAULT_FAVICON_32 5716 +#define IDR_DEFAULT_FAVICON_64 5717 +#define IDR_EASY_UNLOCK_HARDLOCKED 5718 +#define IDR_EASY_UNLOCK_HARDLOCKED_HOVER 5719 +#define IDR_EASY_UNLOCK_HARDLOCKED_PRESSED 5720 +#define IDR_EASY_UNLOCK_LOCKED 5721 +#define IDR_EASY_UNLOCK_LOCKED_HOVER 5722 +#define IDR_EASY_UNLOCK_LOCKED_PRESSED 5723 +#define IDR_EASY_UNLOCK_LOCKED_TO_BE_ACTIVATED 5724 +#define IDR_EASY_UNLOCK_LOCKED_TO_BE_ACTIVATED_HOVER 5725 +#define IDR_EASY_UNLOCK_LOCKED_TO_BE_ACTIVATED_PRESSED 5726 +#define IDR_EASY_UNLOCK_LOCKED_WITH_PROXIMITY_HINT 5727 +#define IDR_EASY_UNLOCK_LOCKED_WITH_PROXIMITY_HINT_HOVER 5728 +#define IDR_EASY_UNLOCK_LOCKED_WITH_PROXIMITY_HINT_PRESSED 5729 +#define IDR_EASY_UNLOCK_SPINNER 5730 +#define IDR_EASY_UNLOCK_UNLOCKED 5731 +#define IDR_EASY_UNLOCK_UNLOCKED_HOVER 5732 +#define IDR_EASY_UNLOCK_UNLOCKED_PRESSED 5733 +#define IDR_FOLDER_CLOSED 5734 +#define IDR_FOLDER_CLOSED_RTL 5735 +#define IDR_FOLDER_OPEN 5736 +#define IDR_FOLDER_OPEN_RTL 5737 +#define IDR_FRAME 5738 +#define IDR_FRAME_APP_PANEL 5739 +#define IDR_FRAME_INACTIVE 5740 +#define IDR_MAXIMIZE 5741 +#define IDR_MAXIMIZE_H 5742 +#define IDR_MAXIMIZE_P 5743 +#define IDR_MENU_HIERARCHY_ARROW_DARK_BACKGROUND 5744 +#define IDR_MENU_HIERARCHY_ARROW 5745 +#define IDR_MENU_CHECK_CHECKED 5746 +#define IDR_MENU_CHECK 5747 +#define IDR_MENU_CHECK_CHECKED_DARK_BACKGROUND 5748 +#define IDR_MENU_RADIO_EMPTY 5749 +#define IDR_MENU_RADIO_SELECTED 5750 +#define IDR_SLIDER_ACTIVE_LEFT 5751 +#define IDR_SLIDER_ACTIVE_RIGHT 5752 +#define IDR_SLIDER_ACTIVE_CENTER 5753 +#define IDR_SLIDER_DISABLED_LEFT 5754 +#define IDR_SLIDER_DISABLED_RIGHT 5755 +#define IDR_SLIDER_DISABLED_CENTER 5756 +#define IDR_SLIDER_PRESSED_LEFT 5757 +#define IDR_SLIDER_PRESSED_RIGHT 5758 +#define IDR_SLIDER_PRESSED_CENTER 5759 +#define IDR_SLIDER_ACTIVE_THUMB 5760 +#define IDR_SLIDER_DISABLED_THUMB 5761 +#define IDR_MENU_DROPARROW 5762 +#define IDR_MESSAGE_CLOSE 5763 +#define IDR_MINIMIZE 5764 +#define IDR_MINIMIZE_H 5765 +#define IDR_MINIMIZE_P 5766 +#define IDR_NOTIFICATION_ARROW 5767 +#define IDR_NOTIFICATION_ARROW_HOVER 5768 +#define IDR_NOTIFICATION_ARROW_PRESSED 5769 +#define IDR_NOTIFICATION_ADVANCED_SETTINGS 5770 +#define IDR_NOTIFICATION_ADVANCED_SETTINGS_HOVER 5771 +#define IDR_NOTIFICATION_ADVANCED_SETTINGS_PRESSED 5772 +#define IDR_NOTIFICATION_CLEAR_ALL 5773 +#define IDR_NOTIFICATION_CLEAR_ALL_DISABLED 5774 +#define IDR_NOTIFICATION_CLEAR_ALL_HOVER 5775 +#define IDR_NOTIFICATION_CLEAR_ALL_PRESSED 5776 +#define IDR_NOTIFICATION_CLOSE 5777 +#define IDR_NOTIFICATION_CLOSE_HOVER 5778 +#define IDR_NOTIFICATION_CLOSE_PRESSED 5779 +#define IDR_NOTIFICATION_BUBBLE_CLOSE 5780 +#define IDR_NOTIFICATION_BUBBLE_CLOSE_HOVER 5781 +#define IDR_NOTIFICATION_BUBBLE_CLOSE_PRESSED 5782 +#define IDR_NOTIFICATION_DO_NOT_DISTURB 5783 +#define IDR_NOTIFICATION_DO_NOT_DISTURB_HOVER 5784 +#define IDR_NOTIFICATION_DO_NOT_DISTURB_PRESSED 5785 +#define IDR_NOTIFICATION_SETTINGS 5786 +#define IDR_NOTIFICATION_SETTINGS_HOVER 5787 +#define IDR_NOTIFICATION_SETTINGS_PRESSED 5788 +#define IDR_LOCAL_NTP_IMAGES_LOGO_PNG 5789 +#define IDR_LOCAL_NTP_IMAGES_WHITE_LOGO_PNG 5790 +#define IDR_NTP_DEFAULT_FAVICON 5791 +#define IDR_OOBE_ACTION_BOX_BUTTON_HOVER 5792 +#define IDR_OOBE_ACTION_BOX_BUTTON_NORMAL 5793 +#define IDR_OOBE_ACTION_BOX_BUTTON_PRESSED 5794 +#define IDR_PANEL_TOP_LEFT_CORNER 5795 +#define IDR_PANEL_TOP_RIGHT_CORNER 5796 +#define IDR_PANEL_BOTTOM_LEFT_CORNER 5797 +#define IDR_PANEL_BOTTOM_RIGHT_CORNER 5798 +#define IDR_PROGRESS_BAR 5799 +#define IDR_PROGRESS_BORDER_LEFT 5800 +#define IDR_PROGRESS_BORDER_RIGHT 5801 +#define IDR_PROGRESS_VALUE 5802 +#define IDR_RADIO 5803 +#define IDR_RADIO_CHECKED 5804 +#define IDR_RADIO_CHECKED_DISABLED 5805 +#define IDR_RADIO_CHECKED_HOVER 5806 +#define IDR_RADIO_CHECKED_PRESSED 5807 +#define IDR_RADIO_DISABLED 5808 +#define IDR_RADIO_FOCUSED 5809 +#define IDR_RADIO_FOCUSED_CHECKED 5810 +#define IDR_RADIO_FOCUSED_CHECKED_HOVER 5811 +#define IDR_RADIO_FOCUSED_CHECKED_PRESSED 5812 +#define IDR_RADIO_FOCUSED_HOVER 5813 +#define IDR_RADIO_FOCUSED_PRESSED 5814 +#define IDR_RADIO_HOVER 5815 +#define IDR_RADIO_PRESSED 5816 +#define IDR_RESTORE 5817 +#define IDR_RESTORE_H 5818 +#define IDR_RESTORE_P 5819 +#define IDR_SCROLLBAR_ARROW_BUTTON_BASE_HOVER_BOTTOM 5820 +#define IDR_SCROLLBAR_ARROW_BUTTON_BASE_HOVER_BOTTOM_LEFT 5821 +#define IDR_SCROLLBAR_ARROW_BUTTON_BASE_HOVER_BOTTOM_RIGHT 5822 +#define IDR_SCROLLBAR_ARROW_BUTTON_BASE_HOVER_CENTER 5823 +#define IDR_SCROLLBAR_ARROW_BUTTON_BASE_HOVER_LEFT 5824 +#define IDR_SCROLLBAR_ARROW_BUTTON_BASE_HOVER_RIGHT 5825 +#define IDR_SCROLLBAR_ARROW_BUTTON_BASE_HOVER_TOP 5826 +#define IDR_SCROLLBAR_ARROW_BUTTON_BASE_HOVER_TOP_LEFT 5827 +#define IDR_SCROLLBAR_ARROW_BUTTON_BASE_HOVER_TOP_RIGHT 5828 +#define IDR_SCROLLBAR_ARROW_BUTTON_BASE_NORMAL_BOTTOM 5829 +#define IDR_SCROLLBAR_ARROW_BUTTON_BASE_NORMAL_BOTTOM_LEFT 5830 +#define IDR_SCROLLBAR_ARROW_BUTTON_BASE_NORMAL_BOTTOM_RIGHT 5831 +#define IDR_SCROLLBAR_ARROW_BUTTON_BASE_NORMAL_CENTER 5832 +#define IDR_SCROLLBAR_ARROW_BUTTON_BASE_NORMAL_LEFT 5833 +#define IDR_SCROLLBAR_ARROW_BUTTON_BASE_NORMAL_RIGHT 5834 +#define IDR_SCROLLBAR_ARROW_BUTTON_BASE_NORMAL_TOP 5835 +#define IDR_SCROLLBAR_ARROW_BUTTON_BASE_NORMAL_TOP_LEFT 5836 +#define IDR_SCROLLBAR_ARROW_BUTTON_BASE_NORMAL_TOP_RIGHT 5837 +#define IDR_SCROLLBAR_ARROW_BUTTON_BASE_PRESSED_BOTTOM 5838 +#define IDR_SCROLLBAR_ARROW_BUTTON_BASE_PRESSED_BOTTOM_LEFT 5839 +#define IDR_SCROLLBAR_ARROW_BUTTON_BASE_PRESSED_BOTTOM_RIGHT 5840 +#define IDR_SCROLLBAR_ARROW_BUTTON_BASE_PRESSED_CENTER 5841 +#define IDR_SCROLLBAR_ARROW_BUTTON_BASE_PRESSED_LEFT 5842 +#define IDR_SCROLLBAR_ARROW_BUTTON_BASE_PRESSED_RIGHT 5843 +#define IDR_SCROLLBAR_ARROW_BUTTON_BASE_PRESSED_TOP 5844 +#define IDR_SCROLLBAR_ARROW_BUTTON_BASE_PRESSED_TOP_LEFT 5845 +#define IDR_SCROLLBAR_ARROW_BUTTON_BASE_PRESSED_TOP_RIGHT 5846 +#define IDR_SCROLLBAR_BASE_BOTTOM 5847 +#define IDR_SCROLLBAR_BASE_BOTTOM_LEFT 5848 +#define IDR_SCROLLBAR_BASE_BOTTOM_RIGHT 5849 +#define IDR_SCROLLBAR_BASE_CENTER 5850 +#define IDR_SCROLLBAR_BASE_LEFT 5851 +#define IDR_SCROLLBAR_BASE_RIGHT 5852 +#define IDR_SCROLLBAR_BASE_TOP 5853 +#define IDR_SCROLLBAR_BASE_TOP_LEFT 5854 +#define IDR_SCROLLBAR_BASE_TOP_RIGHT 5855 +#define IDR_SCROLLBAR_OVERLAY_THUMB_FILL_BOTTOM 5856 +#define IDR_SCROLLBAR_OVERLAY_THUMB_FILL_BOTTOM_LEFT 5857 +#define IDR_SCROLLBAR_OVERLAY_THUMB_FILL_BOTTOM_RIGHT 5858 +#define IDR_SCROLLBAR_OVERLAY_THUMB_FILL_CENTER 5859 +#define IDR_SCROLLBAR_OVERLAY_THUMB_FILL_LEFT 5860 +#define IDR_SCROLLBAR_OVERLAY_THUMB_FILL_RIGHT 5861 +#define IDR_SCROLLBAR_OVERLAY_THUMB_FILL_TOP 5862 +#define IDR_SCROLLBAR_OVERLAY_THUMB_FILL_TOP_LEFT 5863 +#define IDR_SCROLLBAR_OVERLAY_THUMB_FILL_TOP_RIGHT 5864 +#define IDR_SCROLLBAR_OVERLAY_THUMB_STROKE_BOTTOM 5865 +#define IDR_SCROLLBAR_OVERLAY_THUMB_STROKE_BOTTOM_LEFT 5866 +#define IDR_SCROLLBAR_OVERLAY_THUMB_STROKE_BOTTOM_RIGHT 5867 +#define IDR_SCROLLBAR_OVERLAY_THUMB_STROKE_LEFT 5868 +#define IDR_SCROLLBAR_OVERLAY_THUMB_STROKE_RIGHT 5869 +#define IDR_SCROLLBAR_OVERLAY_THUMB_STROKE_TOP 5870 +#define IDR_SCROLLBAR_OVERLAY_THUMB_STROKE_TOP_LEFT 5871 +#define IDR_SCROLLBAR_OVERLAY_THUMB_STROKE_TOP_RIGHT 5872 +#define IDR_SCROLLBAR_THUMB_BASE_HOVER_BOTTOM 5873 +#define IDR_SCROLLBAR_THUMB_BASE_HOVER_BOTTOM_LEFT 5874 +#define IDR_SCROLLBAR_THUMB_BASE_HOVER_BOTTOM_RIGHT 5875 +#define IDR_SCROLLBAR_THUMB_BASE_HOVER_CENTER 5876 +#define IDR_SCROLLBAR_THUMB_BASE_HOVER_LEFT 5877 +#define IDR_SCROLLBAR_THUMB_BASE_HOVER_RIGHT 5878 +#define IDR_SCROLLBAR_THUMB_BASE_HOVER_TOP 5879 +#define IDR_SCROLLBAR_THUMB_BASE_HOVER_TOP_LEFT 5880 +#define IDR_SCROLLBAR_THUMB_BASE_HOVER_TOP_RIGHT 5881 +#define IDR_SCROLLBAR_THUMB_BASE_NORMAL_BOTTOM 5882 +#define IDR_SCROLLBAR_THUMB_BASE_NORMAL_BOTTOM_LEFT 5883 +#define IDR_SCROLLBAR_THUMB_BASE_NORMAL_BOTTOM_RIGHT 5884 +#define IDR_SCROLLBAR_THUMB_BASE_NORMAL_CENTER 5885 +#define IDR_SCROLLBAR_THUMB_BASE_NORMAL_LEFT 5886 +#define IDR_SCROLLBAR_THUMB_BASE_NORMAL_RIGHT 5887 +#define IDR_SCROLLBAR_THUMB_BASE_NORMAL_TOP 5888 +#define IDR_SCROLLBAR_THUMB_BASE_NORMAL_TOP_LEFT 5889 +#define IDR_SCROLLBAR_THUMB_BASE_NORMAL_TOP_RIGHT 5890 +#define IDR_SCROLLBAR_THUMB_BASE_PRESSED_BOTTOM 5891 +#define IDR_SCROLLBAR_THUMB_BASE_PRESSED_BOTTOM_LEFT 5892 +#define IDR_SCROLLBAR_THUMB_BASE_PRESSED_BOTTOM_RIGHT 5893 +#define IDR_SCROLLBAR_THUMB_BASE_PRESSED_CENTER 5894 +#define IDR_SCROLLBAR_THUMB_BASE_PRESSED_LEFT 5895 +#define IDR_SCROLLBAR_THUMB_BASE_PRESSED_RIGHT 5896 +#define IDR_SCROLLBAR_THUMB_BASE_PRESSED_TOP 5897 +#define IDR_SCROLLBAR_THUMB_BASE_PRESSED_TOP_LEFT 5898 +#define IDR_SCROLLBAR_THUMB_BASE_PRESSED_TOP_RIGHT 5899 +#define IDR_TEXTBUTTON_HOVER_BOTTOM 5900 +#define IDR_TEXTBUTTON_HOVER_BOTTOM_LEFT 5901 +#define IDR_TEXTBUTTON_HOVER_BOTTOM_RIGHT 5902 +#define IDR_TEXTBUTTON_HOVER_CENTER 5903 +#define IDR_TEXTBUTTON_HOVER_LEFT 5904 +#define IDR_TEXTBUTTON_HOVER_RIGHT 5905 +#define IDR_TEXTBUTTON_HOVER_TOP 5906 +#define IDR_TEXTBUTTON_HOVER_TOP_LEFT 5907 +#define IDR_TEXTBUTTON_HOVER_TOP_RIGHT 5908 +#define IDR_TEXTBUTTON_PRESSED_BOTTOM 5909 +#define IDR_TEXTBUTTON_PRESSED_BOTTOM_LEFT 5910 +#define IDR_TEXTBUTTON_PRESSED_BOTTOM_RIGHT 5911 +#define IDR_TEXTBUTTON_PRESSED_CENTER 5912 +#define IDR_TEXTBUTTON_PRESSED_LEFT 5913 +#define IDR_TEXTBUTTON_PRESSED_RIGHT 5914 +#define IDR_TEXTBUTTON_PRESSED_TOP 5915 +#define IDR_TEXTBUTTON_PRESSED_TOP_LEFT 5916 +#define IDR_TEXTBUTTON_PRESSED_TOP_RIGHT 5917 +#define IDR_TEXTBUTTON_RAISED_BOTTOM 5918 +#define IDR_TEXTBUTTON_RAISED_BOTTOM_LEFT 5919 +#define IDR_TEXTBUTTON_RAISED_BOTTOM_RIGHT 5920 +#define IDR_TEXTBUTTON_RAISED_CENTER 5921 +#define IDR_TEXTBUTTON_RAISED_LEFT 5922 +#define IDR_TEXTBUTTON_RAISED_RIGHT 5923 +#define IDR_TEXTBUTTON_RAISED_TOP 5924 +#define IDR_TEXTBUTTON_RAISED_TOP_LEFT 5925 +#define IDR_TEXTBUTTON_RAISED_TOP_RIGHT 5926 +#define IDR_TEXT_SELECTION_HANDLE_CENTER 5927 +#define IDR_TEXT_SELECTION_HANDLE_LEFT 5928 +#define IDR_TEXT_SELECTION_HANDLE_RIGHT 5929 +#define IDR_THROBBER 5930 +#define IDR_TOUCH_DRAG_TIP_COPY 5931 +#define IDR_TOUCH_DRAG_TIP_MOVE 5932 +#define IDR_TOUCH_DRAG_TIP_LINK 5933 +#define IDR_TOUCH_DRAG_TIP_NODROP 5934 +#define IDR_DARK_TRAY_ATTENTION 5935 +#define IDR_DARK_TRAY_PRESSED 5936 +#define IDR_DARK_TRAY_DO_NOT_DISTURB_ATTENTION 5937 +#define IDR_DARK_TRAY_DO_NOT_DISTURB_PRESSED 5938 +#define IDR_DARK_TRAY_DO_NOT_DISTURB_EMPTY 5939 +#define IDR_DARK_TRAY_EMPTY 5940 +#define IDR_TRAY_ATTENTION 5941 +#define IDR_TRAY_ATTENTION_PRESSED 5942 +#define IDR_TRAY_DO_NOT_DISTURB_ATTENTION 5943 +#define IDR_TRAY_DO_NOT_DISTURB_ATTENTION_PRESSED 5944 +#define IDR_TRAY_DO_NOT_DISTURB_EMPTY 5945 +#define IDR_TRAY_DO_NOT_DISTURB_EMPTY_PRESSED 5946 +#define IDR_TRAY_EMPTY 5947 +#define IDR_TRAY_EMPTY_PRESSED 5948 +#define IDR_WINDOW_BOTTOM_CENTER 5949 +#define IDR_WINDOW_BOTTOM_LEFT_CORNER 5950 +#define IDR_WINDOW_BOTTOM_RIGHT_CORNER 5951 +#define IDR_WINDOW_LEFT_SIDE 5952 +#define IDR_WINDOW_RIGHT_SIDE 5953 +#define IDR_WINDOW_TOP_CENTER 5954 +#define IDR_WINDOW_TOP_LEFT_CORNER 5955 +#define IDR_WINDOW_TOP_RIGHT_CORNER 5956 +#define IDR_WINDOW_BUBBLE_SHADOW_BIG_BOTTOM 5957 +#define IDR_WINDOW_BUBBLE_SHADOW_BIG_BOTTOM_LEFT 5958 +#define IDR_WINDOW_BUBBLE_SHADOW_BIG_BOTTOM_RIGHT 5959 +#define IDR_WINDOW_BUBBLE_SHADOW_BIG_LEFT 5960 +#define IDR_WINDOW_BUBBLE_SHADOW_BIG_RIGHT 5961 +#define IDR_WINDOW_BUBBLE_SHADOW_BIG_TOP 5962 +#define IDR_WINDOW_BUBBLE_SHADOW_BIG_TOP_LEFT 5963 +#define IDR_WINDOW_BUBBLE_SHADOW_BIG_TOP_RIGHT 5964 +#define IDR_WINDOW_BUBBLE_SHADOW_SPIKE_BIG_BOTTOM 5965 +#define IDR_WINDOW_BUBBLE_SHADOW_SPIKE_BIG_LEFT 5966 +#define IDR_WINDOW_BUBBLE_SHADOW_SPIKE_BIG_RIGHT 5967 +#define IDR_WINDOW_BUBBLE_SHADOW_SPIKE_BIG_TOP 5968 +#define IDR_WINDOW_BUBBLE_SHADOW_SMALL 5969 +#define IDR_WINDOW_BUBBLE_SHADOW_SMALL_BOTTOM 5970 +#define IDR_WINDOW_BUBBLE_SHADOW_SMALL_BOTTOM_LEFT 5971 +#define IDR_WINDOW_BUBBLE_SHADOW_SMALL_BOTTOM_RIGHT 5972 +#define IDR_WINDOW_BUBBLE_SHADOW_SMALL_LEFT 5973 +#define IDR_WINDOW_BUBBLE_SHADOW_SMALL_RIGHT 5974 +#define IDR_WINDOW_BUBBLE_SHADOW_SMALL_TOP 5975 +#define IDR_WINDOW_BUBBLE_SHADOW_SMALL_TOP_LEFT 5976 +#define IDR_WINDOW_BUBBLE_SHADOW_SMALL_TOP_RIGHT 5977 +#define IDR_WINDOW_BUBBLE_SHADOW_SPIKE_SMALL_BOTTOM 5978 +#define IDR_WINDOW_BUBBLE_SHADOW_SPIKE_SMALL_LEFT 5979 +#define IDR_WINDOW_BUBBLE_SHADOW_SPIKE_SMALL_RIGHT 5980 +#define IDR_WINDOW_BUBBLE_SHADOW_SPIKE_SMALL_TOP 5981 + +#endif // CEF_INCLUDE_CEF_PACK_RESOURCES_H_ diff --git a/dependencies64/cef/include/cef_pack_strings.h b/dependencies64/cef/include/cef_pack_strings.h new file mode 100644 index 000000000..9a5d5e562 --- /dev/null +++ b/dependencies64/cef/include/cef_pack_strings.h @@ -0,0 +1,590 @@ +// Copyright (c) 2015 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// This file is generated by the make_pack_header.py tool. +// + +#ifndef CEF_INCLUDE_CEF_PACK_STRINGS_H_ +#define CEF_INCLUDE_CEF_PACK_STRINGS_H_ +#pragma once + +// --------------------------------------------------------------------------- +// From cef_strings.h: + +#define IDS_MENU_BACK 28000 +#define IDS_MENU_FORWARD 28001 +#define IDS_MENU_RELOAD 28002 +#define IDS_MENU_RELOAD_NOCACHE 28003 +#define IDS_MENU_STOPLOAD 28004 +#define IDS_MENU_UNDO 28005 +#define IDS_MENU_REDO 28006 +#define IDS_MENU_CUT 28007 +#define IDS_MENU_COPY 28008 +#define IDS_MENU_PASTE 28009 +#define IDS_MENU_DELETE 28010 +#define IDS_MENU_SELECT_ALL 28011 +#define IDS_MENU_FIND 28012 +#define IDS_MENU_PRINT 28013 +#define IDS_MENU_VIEW_SOURCE 28014 +#define IDS_APP_AUDIO_FILES 28015 +#define IDS_APP_IMAGE_FILES 28016 +#define IDS_APP_TEXT_FILES 28017 +#define IDS_APP_VIDEO_FILES 28018 +#define IDS_DEFAULT_PRINT_DOCUMENT_TITLE 28019 +#define IDS_PRINT_SPOOL_FAILED_TITLE_TEXT 28020 +#define IDS_PRINT_SPOOL_FAILED_ERROR_TEXT 28021 +#define IDS_PRINT_INVALID_PRINTER_SETTINGS 28022 +#define IDS_UTILITY_PROCESS_EMF_CONVERTOR_NAME 28023 +#define IDS_UTILITY_PROCESS_PROXY_RESOLVER_NAME 28024 +#define IDS_SPELLCHECK_DICTIONARY 28025 +#define IDS_CONTENT_CONTEXT_ADD_TO_DICTIONARY 28026 +#define IDS_CONTENT_CONTEXT_NO_SPELLING_SUGGESTIONS 28027 + +// --------------------------------------------------------------------------- +// From components_strings.h: + +#define IDS_JAVASCRIPT_ALERT_DEFAULT_TITLE 30000 +#define IDS_JAVASCRIPT_MESSAGEBOX_DEFAULT_TITLE 30001 +#define IDS_JAVASCRIPT_ALERT_TITLE 30002 +#define IDS_JAVASCRIPT_MESSAGEBOX_TITLE 30003 +#define IDS_JAVASCRIPT_MESSAGEBOX_SUPPRESS_OPTION 30004 +#define IDS_BEFOREUNLOAD_MESSAGEBOX_TITLE 30005 +#define IDS_BEFOREUNLOAD_MESSAGEBOX_FOOTER 30006 +#define IDS_BEFOREUNLOAD_MESSAGEBOX_OK_BUTTON_LABEL 30007 +#define IDS_BEFOREUNLOAD_MESSAGEBOX_CANCEL_BUTTON_LABEL 30008 +#define IDS_BEFORERELOAD_MESSAGEBOX_TITLE 30009 +#define IDS_BEFORERELOAD_MESSAGEBOX_FOOTER 30010 +#define IDS_BEFORERELOAD_MESSAGEBOX_OK_BUTTON_LABEL 30011 +#define IDS_BEFORERELOAD_MESSAGEBOX_CANCEL_BUTTON_LABEL 30012 +#define IDS_AUTOFILL_CLEAR_FORM_MENU_ITEM 30013 +#define IDS_AUTOFILL_WARNING_FORM_DISABLED 30014 +#define IDS_AUTOFILL_WARNING_INSECURE_CONNECTION 30015 +#define IDS_AUTOFILL_CC_AMEX 30016 +#define IDS_AUTOFILL_CC_AMEX_SHORT 30017 +#define IDS_AUTOFILL_CC_DINERS 30018 +#define IDS_AUTOFILL_CC_DISCOVER 30019 +#define IDS_AUTOFILL_CC_JCB 30020 +#define IDS_AUTOFILL_CC_MASTERCARD 30021 +#define IDS_AUTOFILL_CC_UNION_PAY 30022 +#define IDS_AUTOFILL_CC_VISA 30023 +#define IDS_AUTOFILL_CC_GENERIC 30024 +#define IDS_AUTOFILL_ADDRESS_LINE_SEPARATOR 30025 +#define IDS_AUTOFILL_ADDRESS_SUMMARY_SEPARATOR 30026 +#define IDS_AUTOFILL_FIELD_LABEL_STATE 30027 +#define IDS_AUTOFILL_FIELD_LABEL_AREA 30028 +#define IDS_AUTOFILL_FIELD_LABEL_COUNTY 30029 +#define IDS_AUTOFILL_FIELD_LABEL_DEPARTMENT 30030 +#define IDS_AUTOFILL_FIELD_LABEL_DISTRICT 30031 +#define IDS_AUTOFILL_FIELD_LABEL_EMIRATE 30032 +#define IDS_AUTOFILL_FIELD_LABEL_ISLAND 30033 +#define IDS_AUTOFILL_FIELD_LABEL_PARISH 30034 +#define IDS_AUTOFILL_FIELD_LABEL_PREFECTURE 30035 +#define IDS_AUTOFILL_FIELD_LABEL_PROVINCE 30036 +#define IDS_AUTOFILL_FIELD_LABEL_ZIP_CODE 30037 +#define IDS_AUTOFILL_FIELD_LABEL_POSTAL_CODE 30038 +#define IDS_AUTOFILL_FIELD_LABEL_COUNTRY 30039 +#define IDS_AUTOFILL_SHOW_PREDICTIONS_TITLE 30040 +#define IDS_AUTOFILL_DIALOG_PRIVACY_POLICY_LINK 30041 +#define IDS_AUTOFILL_OPTIONS_POPUP 30042 +#define IDS_AUTOFILL_CREDIT_CARD_NOT_SUPPORTED_BY_WALLET 30043 +#define IDS_AUTOFILL_CREDIT_CARD_NOT_SUPPORTED_BY_WALLET_FOR_MERCHANT 30044 +#define IDS_AUTOFILL_SCAN_CREDIT_CARD 30046 +#define IDS_AUTOFILL_PASSWORD_FIELD_SUGGESTIONS_TITLE 30047 +#define IDS_AUTOFILL_CC_INFOBAR_ACCEPT 30048 +#define IDS_AUTOFILL_CC_INFOBAR_DENY 30049 +#define IDS_AUTOFILL_CC_INFOBAR_TEXT 30050 +#define IDS_BOOKMARK_BAR_FOLDER_NAME 30051 +#define IDS_BOOKMARK_BAR_MOBILE_FOLDER_NAME 30053 +#define IDS_BOOKMARK_BAR_OTHER_FOLDER_NAME 30054 +#define IDS_BOOKMARK_BAR_MANAGED_FOLDER_DOMAIN_NAME 30055 +#define IDS_BOOKMARK_BAR_MANAGED_FOLDER_DEFAULT_NAME 30056 +#define IDS_BOOKMARK_BAR_SUPERVISED_FOLDER_DEFAULT_NAME 30057 +#define IDS_DATA_REDUCTION_PROXY_TITLE 30058 +#define IDS_DATA_REDUCTION_PROXY_BACK_BUTTON 30059 +#define IDS_DATA_REDUCTION_PROXY_CONTINUE_BUTTON 30060 +#define IDS_DATA_REDUCTION_PROXY_CANNOT_PROXY_HEADING 30061 +#define IDS_DATA_REDUCTION_PROXY_CANNOT_PROXY_PRIMARY_PARAGRAPH 30062 +#define IDS_DATA_REDUCTION_PROXY_CANNOT_PROXY_SECONDARY_PARAGRAPH 30063 +#define IDS_DOM_DISTILLER_WEBUI_ENTRY_URL 30064 +#define IDS_DOM_DISTILLER_WEBUI_ENTRY_ADD 30065 +#define IDS_DOM_DISTILLER_WEBUI_ENTRY_ADD_FAILED 30066 +#define IDS_DOM_DISTILLER_WEBUI_VIEW_URL 30067 +#define IDS_DOM_DISTILLER_WEBUI_VIEW_URL_FAILED 30068 +#define IDS_DOM_DISTILLER_WEBUI_REFRESH 30069 +#define IDS_DOM_DISTILLER_WEBUI_FETCHING_ENTRIES 30070 +#define IDS_DOM_DISTILLER_VIEWER_FAILED_TO_FIND_ARTICLE_TITLE 30071 +#define IDS_DOM_DISTILLER_VIEWER_FAILED_TO_FIND_ARTICLE_CONTENT 30072 +#define IDS_DOM_DISTILLER_VIEWER_NO_DATA_TITLE 30073 +#define IDS_DOM_DISTILLER_VIEWER_NO_DATA_CONTENT 30074 +#define IDS_DOM_DISTILLER_VIEWER_VIEW_ORIGINAL 30075 +#define IDS_DOM_DISTILLER_VIEWER_LOADING_STRING 30076 +#define IDS_DOM_DISTILLER_QUALITY_QUESTION 30077 +#define IDS_DOM_DISTILLER_QUALITY_ANSWER_YES 30078 +#define IDS_DOM_DISTILLER_QUALITY_ANSWER_NO 30079 +#define IDS_DOM_DISTILLER_WEBUI_TITLE 30080 +#define IDS_ERRORPAGES_SUGGESTION_VISIT_GOOGLE_CACHE 30081 +#define IDS_ERRORPAGES_SUGGESTION_CORRECTED_URL 30082 +#define IDS_ERRORPAGES_SUGGESTION_ALTERNATE_URL 30083 +#define IDS_AUTOCOMPLETE_SEARCH_DESCRIPTION 30084 +#define IDS_KEYWORD_SEARCH 30085 +#define IDS_EXTENSION_KEYWORD_COMMAND 30086 +#define IDS_EMPTY_KEYWORD_VALUE 30087 +#define IDS_LINK_FROM_CLIPBOARD 30088 +#define IDS_PASSWORD_MANAGER_EMPTY_LOGIN 30089 +#define IDS_PDF_NEED_PASSWORD 30090 +#define IDS_PDF_PAGE_LOADING 30091 +#define IDS_PDF_PAGE_LOAD_FAILED 30092 +#define IDS_PDF_PROGRESS_LOADING 30093 +#define IDS_POLICY_DM_STATUS_SUCCESS 30094 +#define IDS_POLICY_DM_STATUS_REQUEST_INVALID 30095 +#define IDS_POLICY_DM_STATUS_REQUEST_FAILED 30096 +#define IDS_POLICY_DM_STATUS_TEMPORARY_UNAVAILABLE 30097 +#define IDS_POLICY_DM_STATUS_HTTP_STATUS_ERROR 30098 +#define IDS_POLICY_DM_STATUS_RESPONSE_DECODING_ERROR 30099 +#define IDS_POLICY_DM_STATUS_SERVICE_MANAGEMENT_NOT_SUPPORTED 30100 +#define IDS_POLICY_DM_STATUS_SERVICE_DEVICE_NOT_FOUND 30101 +#define IDS_POLICY_DM_STATUS_SERVICE_MANAGEMENT_TOKEN_INVALID 30102 +#define IDS_POLICY_DM_STATUS_SERVICE_ACTIVATION_PENDING 30103 +#define IDS_POLICY_DM_STATUS_SERVICE_INVALID_SERIAL_NUMBER 30104 +#define IDS_POLICY_DM_STATUS_SERVICE_DEVICE_ID_CONFLICT 30105 +#define IDS_POLICY_DM_STATUS_SERVICE_MISSING_LICENSES 30106 +#define IDS_POLICY_DM_STATUS_SERVICE_DEPROVISIONED 30107 +#define IDS_POLICY_DM_STATUS_SERVICE_POLICY_NOT_FOUND 30108 +#define IDS_POLICY_DM_STATUS_UNKNOWN_ERROR 30109 +#define IDS_POLICY_DM_STATUS_SERVICE_DOMAIN_MISMATCH 30110 +#define IDS_POLICY_VALIDATION_OK 30111 +#define IDS_POLICY_VALIDATION_BAD_INITIAL_SIGNATURE 30112 +#define IDS_POLICY_VALIDATION_BAD_SIGNATURE 30113 +#define IDS_POLICY_VALIDATION_ERROR_CODE_PRESENT 30114 +#define IDS_POLICY_VALIDATION_PAYLOAD_PARSE_ERROR 30115 +#define IDS_POLICY_VALIDATION_WRONG_POLICY_TYPE 30116 +#define IDS_POLICY_VALIDATION_WRONG_SETTINGS_ENTITY_ID 30117 +#define IDS_POLICY_VALIDATION_BAD_TIMESTAMP 30118 +#define IDS_POLICY_VALIDATION_WRONG_TOKEN 30119 +#define IDS_POLICY_VALIDATION_BAD_USERNAME 30120 +#define IDS_POLICY_VALIDATION_POLICY_PARSE_ERROR 30121 +#define IDS_POLICY_VALIDATION_BAD_KEY_VERIFICATION_SIGNATURE 30122 +#define IDS_POLICY_VALIDATION_UNKNOWN_ERROR 30123 +#define IDS_POLICY_STORE_STATUS_OK 30124 +#define IDS_POLICY_STORE_STATUS_LOAD_ERROR 30125 +#define IDS_POLICY_STORE_STATUS_STORE_ERROR 30126 +#define IDS_POLICY_STORE_STATUS_PARSE_ERROR 30127 +#define IDS_POLICY_STORE_STATUS_SERIALIZE_ERROR 30128 +#define IDS_POLICY_STORE_STATUS_VALIDATION_ERROR 30129 +#define IDS_POLICY_STORE_STATUS_BAD_STATE 30130 +#define IDS_POLICY_STORE_STATUS_UNKNOWN_ERROR 30131 +#define IDS_POLICY_ASSOCIATION_STATE_ACTIVE 30132 +#define IDS_POLICY_ASSOCIATION_STATE_UNMANAGED 30133 +#define IDS_POLICY_ASSOCIATION_STATE_DEPROVISIONED 30134 +#define IDS_POLICY_TYPE_ERROR 30135 +#define IDS_POLICY_OUT_OF_RANGE_ERROR 30136 +#define IDS_POLICY_VALUE_FORMAT_ERROR 30137 +#define IDS_POLICY_DEFAULT_SEARCH_DISABLED 30138 +#define IDS_POLICY_NOT_SPECIFIED_ERROR 30139 +#define IDS_POLICY_SUBKEY_ERROR 30140 +#define IDS_POLICY_LIST_ENTRY_ERROR 30141 +#define IDS_POLICY_SCHEMA_VALIDATION_ERROR 30142 +#define IDS_POLICY_INVALID_SEARCH_URL_ERROR 30143 +#define IDS_POLICY_INVALID_PROXY_MODE_ERROR 30144 +#define IDS_POLICY_INVALID_UPDATE_URL_ERROR 30145 +#define IDS_POLICY_PROXY_MODE_DISABLED_ERROR 30146 +#define IDS_POLICY_PROXY_MODE_AUTO_DETECT_ERROR 30147 +#define IDS_POLICY_PROXY_MODE_PAC_URL_ERROR 30148 +#define IDS_POLICY_PROXY_MODE_FIXED_SERVERS_ERROR 30149 +#define IDS_POLICY_PROXY_MODE_SYSTEM_ERROR 30150 +#define IDS_POLICY_PROXY_BOTH_SPECIFIED_ERROR 30151 +#define IDS_POLICY_PROXY_NEITHER_SPECIFIED_ERROR 30152 +#define IDS_POLICY_OVERRIDDEN 30153 +#define IDS_POLICY_DEPRECATED 30154 +#define IDS_POLICY_VALUE_DEPRECATED 30155 +#define IDS_POLICY_LEVEL_ERROR 30160 +#define IDS_POLICY_OK 30161 +#define IDS_POLICY_UNSET 30162 +#define IDS_POLICY_UNKNOWN 30163 +#define IDS_POLICY_TITLE 30164 +#define IDS_POLICY_FILTER_PLACEHOLDER 30165 +#define IDS_POLICY_RELOAD_POLICIES 30166 +#define IDS_POLICY_STATUS 30167 +#define IDS_POLICY_STATUS_DEVICE 30168 +#define IDS_POLICY_STATUS_USER 30169 +#define IDS_POLICY_LABEL_DOMAIN 30170 +#define IDS_POLICY_LABEL_USERNAME 30171 +#define IDS_POLICY_LABEL_CLIENT_ID 30172 +#define IDS_POLICY_LABEL_ASSET_ID 30173 +#define IDS_POLICY_LABEL_LOCATION 30174 +#define IDS_POLICY_LABEL_DIRECTORY_API_ID 30175 +#define IDS_POLICY_LABEL_TIME_SINCE_LAST_REFRESH 30176 +#define IDS_POLICY_NOT_SPECIFIED 30177 +#define IDS_POLICY_NEVER_FETCHED 30178 +#define IDS_POLICY_LABEL_REFRESH_INTERVAL 30179 +#define IDS_POLICY_LABEL_STATUS 30180 +#define IDS_POLICY_SHOW_UNSET 30181 +#define IDS_POLICY_NO_POLICIES_SET 30182 +#define IDS_POLICY_HEADER_SCOPE 30183 +#define IDS_POLICY_HEADER_LEVEL 30184 +#define IDS_POLICY_HEADER_NAME 30185 +#define IDS_POLICY_HEADER_VALUE 30186 +#define IDS_POLICY_HEADER_STATUS 30187 +#define IDS_POLICY_SHOW_EXPANDED_VALUE 30188 +#define IDS_POLICY_HIDE_EXPANDED_VALUE 30189 +#define IDS_POLICY_SCOPE_USER 30190 +#define IDS_POLICY_SCOPE_DEVICE 30191 +#define IDS_POLICY_LEVEL_RECOMMENDED 30192 +#define IDS_POLICY_LEVEL_MANDATORY 30193 +#define IDS_POLICY_INVALID_BOOKMARK 30194 +#define IDS_TRANSLATE_INFOBAR_OPTIONS 30195 +#define IDS_TRANSLATE_INFOBAR_OPTIONS_NEVER_TRANSLATE_LANG 30196 +#define IDS_TRANSLATE_INFOBAR_OPTIONS_NEVER_TRANSLATE_SITE 30197 +#define IDS_TRANSLATE_INFOBAR_OPTIONS_ALWAYS 30198 +#define IDS_TRANSLATE_INFOBAR_OPTIONS_REPORT_ERROR 30199 +#define IDS_TRANSLATE_INFOBAR_OPTIONS_ABOUT 30200 +#define IDS_TRANSLATE_INFOBAR_BEFORE_MESSAGE 30201 +#define IDS_TRANSLATE_INFOBAR_ACCEPT 30204 +#define IDS_TRANSLATE_INFOBAR_DENY 30205 +#define IDS_TRANSLATE_INFOBAR_NEVER_TRANSLATE 30206 +#define IDS_TRANSLATE_INFOBAR_ALWAYS_TRANSLATE 30208 +#define IDS_TRANSLATE_INFOBAR_TRANSLATING_TO 30209 +#define IDS_TRANSLATE_INFOBAR_AFTER_MESSAGE 30210 +#define IDS_TRANSLATE_INFOBAR_AFTER_MESSAGE_AUTODETERMINED_SOURCE_LANGUAGE 30211 +#define IDS_TRANSLATE_INFOBAR_REVERT 30213 +#define IDS_TRANSLATE_INFOBAR_RETRY 30214 +#define IDS_TRANSLATE_INFOBAR_ERROR_CANT_CONNECT 30215 +#define IDS_TRANSLATE_INFOBAR_ERROR_CANT_TRANSLATE 30216 +#define IDS_TRANSLATE_INFOBAR_UNKNOWN_PAGE_LANGUAGE 30217 +#define IDS_TRANSLATE_INFOBAR_ERROR_SAME_LANGUAGE 30218 +#define IDS_TRANSLATE_INFOBAR_UNSUPPORTED_PAGE_LANGUAGE 30219 +#define IDS_BOOKMARK_BAR_UNDO 30221 +#define IDS_BOOKMARK_BAR_REDO 30222 +#define IDS_BOOKMARK_BAR_UNDO_ADD 30223 +#define IDS_BOOKMARK_BAR_REDO_ADD 30224 +#define IDS_BOOKMARK_BAR_UNDO_DELETE 30225 +#define IDS_BOOKMARK_BAR_REDO_DELETE 30226 +#define IDS_BOOKMARK_BAR_UNDO_EDIT 30227 +#define IDS_BOOKMARK_BAR_REDO_EDIT 30228 +#define IDS_BOOKMARK_BAR_UNDO_MOVE 30229 +#define IDS_BOOKMARK_BAR_REDO_MOVE 30230 +#define IDS_BOOKMARK_BAR_UNDO_REORDER 30231 +#define IDS_BOOKMARK_BAR_REDO_REORDER 30232 +#define IDS_LEARN_MORE 30233 + +// --------------------------------------------------------------------------- +// From content_strings.h: + +#define IDS_DETAILS_WITHOUT_SUMMARY_LABEL 19000 +#define IDS_SEARCHABLE_INDEX_INTRO 19001 +#define IDS_FORM_CALENDAR_CLEAR 19002 +#define IDS_FORM_CALENDAR_TODAY 19003 +#define IDS_FORM_DATE_FORMAT_DAY_IN_MONTH 19004 +#define IDS_FORM_DATE_FORMAT_MONTH 19005 +#define IDS_FORM_DATE_FORMAT_YEAR 19006 +#define IDS_FORM_SUBMIT_LABEL 19007 +#define IDS_FORM_INPUT_ALT 19008 +#define IDS_FORM_RESET_LABEL 19009 +#define IDS_FORM_FILE_BUTTON_LABEL 19010 +#define IDS_FORM_MULTIPLE_FILES_BUTTON_LABEL 19011 +#define IDS_FORM_FILE_NO_FILE_LABEL 19012 +#define IDS_FORM_FILE_MULTIPLE_UPLOAD 19013 +#define IDS_FORM_OTHER_COLOR_LABEL 19014 +#define IDS_FORM_OTHER_DATE_LABEL 19015 +#define IDS_FORM_OTHER_MONTH_LABEL 19016 +#define IDS_FORM_OTHER_TIME_LABEL 19017 +#define IDS_FORM_OTHER_WEEK_LABEL 19018 +#define IDS_FORM_PLACEHOLDER_FOR_DAY_OF_MONTH_FIELD 19019 +#define IDS_FORM_PLACEHOLDER_FOR_MONTH_FIELD 19020 +#define IDS_FORM_PLACEHOLDER_FOR_YEAR_FIELD 19021 +#define IDS_FORM_SELECT_MENU_LIST_TEXT 19022 +#define IDS_FORM_THIS_MONTH_LABEL 19023 +#define IDS_FORM_THIS_WEEK_LABEL 19024 +#define IDS_FORM_WEEK_NUMBER_LABEL 19025 +#define IDS_RECENT_SEARCHES_NONE 19026 +#define IDS_RECENT_SEARCHES 19027 +#define IDS_RECENT_SEARCHES_CLEAR 19028 +#define IDS_AX_CALENDAR_SHOW_MONTH_SELECTOR 19029 +#define IDS_AX_CALENDAR_SHOW_NEXT_MONTH 19030 +#define IDS_AX_CALENDAR_SHOW_PREVIOUS_MONTH 19031 +#define IDS_AX_CALENDAR_WEEK_DESCRIPTION 19032 +#define IDS_AX_ROLE_ARTICLE 19033 +#define IDS_AX_ROLE_BANNER 19034 +#define IDS_AX_ROLE_COMPLEMENTARY 19035 +#define IDS_AX_ROLE_DESCRIPTION_DETAIL 19036 +#define IDS_AX_ROLE_DESCRIPTION_LIST 19037 +#define IDS_AX_ROLE_DESCRIPTION_TERM 19038 +#define IDS_AX_ROLE_WEB_AREA 19039 +#define IDS_AX_ROLE_LINK 19040 +#define IDS_AX_ROLE_LIST_MARKER 19041 +#define IDS_AX_ROLE_IMAGE_MAP 19042 +#define IDS_AX_ROLE_HEADING 19043 +#define IDS_AX_ROLE_FIGURE 19044 +#define IDS_AX_ROLE_REGION 19045 +#define IDS_AX_ROLE_ADDRESS 19049 +#define IDS_AX_ROLE_MAIN_CONTENT 19050 +#define IDS_AX_ROLE_NAVIGATIONAL_LINK 19051 +#define IDS_AX_ROLE_FORM 19052 +#define IDS_AX_ROLE_MATH 19053 +#define IDS_AX_ROLE_STATUS 19054 +#define IDS_AX_ROLE_SEARCH_BOX 19055 +#define IDS_AX_ROLE_SWITCH 19056 +#define IDS_AX_BUTTON_ACTION_VERB 19057 +#define IDS_AX_RADIO_BUTTON_ACTION_VERB 19058 +#define IDS_AX_TEXT_FIELD_ACTION_VERB 19059 +#define IDS_AX_CHECKED_CHECK_BOX_ACTION_VERB 19060 +#define IDS_AX_UNCHECKED_CHECK_BOX_ACTION_VERB 19061 +#define IDS_AX_LINK_ACTION_VERB 19062 +#define IDS_AX_AM_PM_FIELD_TEXT 19063 +#define IDS_AX_DAY_OF_MONTH_FIELD_TEXT 19064 +#define IDS_AX_DATE_TIME_FIELD_EMPTY_VALUE_TEXT 19065 +#define IDS_AX_HOUR_FIELD_TEXT 19066 +#define IDS_AX_MEDIA_DEFAULT 19067 +#define IDS_AX_MEDIA_AUDIO_ELEMENT 19068 +#define IDS_AX_MEDIA_VIDEO_ELEMENT 19069 +#define IDS_AX_MEDIA_MUTE_BUTTON 19070 +#define IDS_AX_MEDIA_UNMUTE_BUTTON 19071 +#define IDS_AX_MEDIA_PLAY_BUTTON 19072 +#define IDS_AX_MEDIA_PAUSE_BUTTON 19073 +#define IDS_AX_MEDIA_SLIDER 19074 +#define IDS_AX_MEDIA_SLIDER_THUMB 19075 +#define IDS_AX_MEDIA_CURRENT_TIME_DISPLAY 19076 +#define IDS_AX_MEDIA_TIME_REMAINING_DISPLAY 19077 +#define IDS_AX_MEDIA_STATUS_DISPLAY 19078 +#define IDS_AX_MEDIA_ENTER_FULL_SCREEN_BUTTON 19079 +#define IDS_AX_MEDIA_EXIT_FULL_SCREEN_BUTTON 19080 +#define IDS_AX_MEDIA_SHOW_CLOSED_CAPTIONS_BUTTON 19081 +#define IDS_AX_MEDIA_HIDE_CLOSED_CAPTIONS_BUTTON 19082 +#define IDS_AX_MEDIA_CAST_OFF_BUTTON 19083 +#define IDS_AX_MEDIA_CAST_ON_BUTTON 19084 +#define IDS_AX_MEDIA_AUDIO_ELEMENT_HELP 19085 +#define IDS_AX_MEDIA_VIDEO_ELEMENT_HELP 19086 +#define IDS_AX_MEDIA_MUTE_BUTTON_HELP 19087 +#define IDS_AX_MEDIA_UNMUTE_BUTTON_HELP 19088 +#define IDS_AX_MEDIA_PLAY_BUTTON_HELP 19089 +#define IDS_AX_MEDIA_PAUSE_BUTTON_HELP 19090 +#define IDS_AX_MEDIA_AUDIO_SLIDER_HELP 19091 +#define IDS_AX_MEDIA_VIDEO_SLIDER_HELP 19092 +#define IDS_AX_MEDIA_SLIDER_THUMB_HELP 19093 +#define IDS_AX_MEDIA_CURRENT_TIME_DISPLAY_HELP 19094 +#define IDS_AX_MEDIA_TIME_REMAINING_DISPLAY_HELP 19095 +#define IDS_AX_MEDIA_STATUS_DISPLAY_HELP 19096 +#define IDS_AX_MEDIA_ENTER_FULL_SCREEN_BUTTON_HELP 19097 +#define IDS_AX_MEDIA_EXIT_FULL_SCREEN_BUTTON_HELP 19098 +#define IDS_AX_MEDIA_SHOW_CLOSED_CAPTIONS_BUTTON_HELP 19099 +#define IDS_AX_MEDIA_HIDE_CLOSED_CAPTIONS_BUTTON_HELP 19100 +#define IDS_AX_MEDIA_CAST_OFF_BUTTON_HELP 19101 +#define IDS_AX_MEDIA_CAST_ON_BUTTON_HELP 19102 +#define IDS_AX_MILLISECOND_FIELD_TEXT 19103 +#define IDS_AX_MINUTE_FIELD_TEXT 19104 +#define IDS_AX_MONTH_FIELD_TEXT 19105 +#define IDS_AX_SECOND_FIELD_TEXT 19106 +#define IDS_AX_WEEK_OF_YEAR_FIELD_TEXT 19107 +#define IDS_AX_YEAR_FIELD_TEXT 19108 +#define IDS_KEYGEN_HIGH_GRADE_KEY 19109 +#define IDS_KEYGEN_MED_GRADE_KEY 19110 +#define IDS_FORM_INPUT_WEEK_TEMPLATE 19111 +#define IDS_FORM_VALIDATION_VALUE_MISSING_MULTIPLE_FILE 19112 +#define IDS_FORM_VALIDATION_TYPE_MISMATCH 19113 +#define IDS_FORM_VALIDATION_TYPE_MISMATCH_EMAIL_EMPTY 19114 +#define IDS_FORM_VALIDATION_TYPE_MISMATCH_EMAIL_EMPTY_DOMAIN 19115 +#define IDS_FORM_VALIDATION_TYPE_MISMATCH_EMAIL_EMPTY_LOCAL 19116 +#define IDS_FORM_VALIDATION_TYPE_MISMATCH_EMAIL_INVALID_DOMAIN 19117 +#define IDS_FORM_VALIDATION_TYPE_MISMATCH_EMAIL_INVALID_DOTS 19118 +#define IDS_FORM_VALIDATION_TYPE_MISMATCH_EMAIL_INVALID_LOCAL 19119 +#define IDS_FORM_VALIDATION_TYPE_MISMATCH_EMAIL_NO_AT_SIGN 19120 +#define IDS_FORM_VALIDATION_TYPE_MISMATCH_MULTIPLE_EMAIL 19121 +#define IDS_FORM_VALIDATION_RANGE_UNDERFLOW 19122 +#define IDS_FORM_VALIDATION_RANGE_UNDERFLOW_DATETIME 19123 +#define IDS_FORM_VALIDATION_RANGE_OVERFLOW 19124 +#define IDS_FORM_VALIDATION_RANGE_OVERFLOW_DATETIME 19125 +#define IDS_FORM_VALIDATION_BAD_INPUT_DATETIME 19126 +#define IDS_FORM_VALIDATION_BAD_INPUT_NUMBER 19127 +#define IDS_FORM_VALIDATION_VALUE_MISSING 19128 +#define IDS_FORM_VALIDATION_VALUE_MISSING_CHECKBOX 19129 +#define IDS_FORM_VALIDATION_VALUE_MISSING_FILE 19130 +#define IDS_FORM_VALIDATION_VALUE_MISSING_RADIO 19131 +#define IDS_FORM_VALIDATION_VALUE_MISSING_SELECT 19132 +#define IDS_FORM_VALIDATION_TYPE_MISMATCH_EMAIL 19133 +#define IDS_FORM_VALIDATION_TYPE_MISMATCH_URL 19134 +#define IDS_FORM_VALIDATION_PATTERN_MISMATCH 19135 +#define IDS_FORM_VALIDATION_STEP_MISMATCH 19136 +#define IDS_FORM_VALIDATION_STEP_MISMATCH_CLOSE_TO_LIMIT 19137 +#define IDS_FORM_VALIDATION_TOO_LONG 19138 +#define IDS_FORM_VALIDATION_TOO_SHORT 19139 +#define IDS_PLUGIN_INITIALIZATION_ERROR 19140 + +// --------------------------------------------------------------------------- +// From ui_strings.h: + +#define IDS_TIME_SECS 11000 +#define IDS_TIME_LONG_SECS 11001 +#define IDS_TIME_LONG_SECS_2ND 11002 +#define IDS_TIME_MINS 11003 +#define IDS_TIME_LONG_MINS 11004 +#define IDS_TIME_LONG_MINS_1ST 11005 +#define IDS_TIME_LONG_MINS_2ND 11006 +#define IDS_TIME_HOURS 11007 +#define IDS_TIME_HOURS_1ST 11008 +#define IDS_TIME_HOURS_2ND 11009 +#define IDS_TIME_DAYS 11010 +#define IDS_TIME_DAYS_1ST 11011 +#define IDS_TIME_REMAINING_SECS 11012 +#define IDS_TIME_REMAINING_LONG_SECS 11013 +#define IDS_TIME_REMAINING_MINS 11014 +#define IDS_TIME_REMAINING_LONG_MINS 11015 +#define IDS_TIME_REMAINING_HOURS 11016 +#define IDS_TIME_REMAINING_DAYS 11017 +#define IDS_TIME_ELAPSED_SECS 11018 +#define IDS_TIME_ELAPSED_MINS 11019 +#define IDS_TIME_ELAPSED_HOURS 11020 +#define IDS_TIME_ELAPSED_DAYS 11021 +#define IDS_PAST_TIME_TODAY 11022 +#define IDS_PAST_TIME_YESTERDAY 11023 +#define IDS_APP_MENU_EMPTY_SUBMENU 11024 +#define IDS_APP_UNTITLED_SHORTCUT_FILE_NAME 11025 +#define IDS_APP_SAVEAS_ALL_FILES 11026 +#define IDS_APP_SAVEAS_EXTENSION_FORMAT 11027 +#define IDS_SELECT_UPLOAD_FOLDER_DIALOG_TITLE 11028 +#define IDS_SELECT_FOLDER_DIALOG_TITLE 11031 +#define IDS_SAVE_AS_DIALOG_TITLE 11032 +#define IDS_OPEN_FILE_DIALOG_TITLE 11033 +#define IDS_OPEN_FILES_DIALOG_TITLE 11034 +#define IDS_SAVEAS_ALL_FILES 11035 +#define IDS_SELECT_UPLOAD_FOLDER_DIALOG_UPLOAD_BUTTON 11036 +#define IDS_APP_ACCACTION_PRESS 11037 +#define IDS_APP_ACCNAME_CLOSE 11038 +#define IDS_APP_ACCNAME_MINIMIZE 11039 +#define IDS_APP_ACCNAME_MAXIMIZE 11040 +#define IDS_APP_ACCNAME_RESTORE 11041 +#define IDS_APP_SCROLLBAR_CXMENU_SCROLLHERE 11042 +#define IDS_APP_SCROLLBAR_CXMENU_SCROLLLEFTEDGE 11043 +#define IDS_APP_SCROLLBAR_CXMENU_SCROLLRIGHTEDGE 11044 +#define IDS_APP_SCROLLBAR_CXMENU_SCROLLHOME 11045 +#define IDS_APP_SCROLLBAR_CXMENU_SCROLLEND 11046 +#define IDS_APP_SCROLLBAR_CXMENU_SCROLLPAGEUP 11047 +#define IDS_APP_SCROLLBAR_CXMENU_SCROLLPAGEDOWN 11048 +#define IDS_APP_SCROLLBAR_CXMENU_SCROLLLEFT 11049 +#define IDS_APP_SCROLLBAR_CXMENU_SCROLLRIGHT 11050 +#define IDS_APP_SCROLLBAR_CXMENU_SCROLLUP 11051 +#define IDS_APP_SCROLLBAR_CXMENU_SCROLLDOWN 11052 +#define IDS_APP_UNDO 11053 +#define IDS_APP_CUT 11054 +#define IDS_APP_COPY 11055 +#define IDS_APP_PASTE 11056 +#define IDS_APP_DELETE 11057 +#define IDS_APP_SELECT_ALL 11058 +#define IDS_DELETE_BACKWARD 11059 +#define IDS_DELETE_FORWARD 11060 +#define IDS_DELETE_TO_BEGINNING_OF_LINE 11061 +#define IDS_DELETE_TO_END_OF_LINE 11062 +#define IDS_DELETE_WORD_BACKWARD 11063 +#define IDS_DELETE_WORD_FORWARD 11064 +#define IDS_MOVE_DOWN 11065 +#define IDS_MOVE_LEFT 11066 +#define IDS_MOVE_LEFT_AND_MODIFY_SELECTION 11067 +#define IDS_MOVE_RIGHT 11068 +#define IDS_MOVE_RIGHT_AND_MODIFY_SELECTION 11069 +#define IDS_MOVE_WORD_LEFT 11070 +#define IDS_MOVE_WORD_LEFT_AND_MODIFY_SELECTION 11071 +#define IDS_MOVE_WORD_RIGHT 11072 +#define IDS_MOVE_WORD_RIGHT_AND_MODIFY_SELECTION 11073 +#define IDS_MOVE_TO_BEGINNING_OF_LINE 11074 +#define IDS_MOVE_TO_BEGINNING_OF_LINE_AND_MODIFY_SELECTION 11075 +#define IDS_MOVE_TO_END_OF_LINE 11076 +#define IDS_MOVE_TO_END_OF_LINE_AND_MODIFY_SELECTION 11077 +#define IDS_MOVE_UP 11078 +#define IDS_APP_REDO 11079 +#define IDS_APP_OK 11080 +#define IDS_APP_CANCEL 11081 +#define IDS_APP_CLOSE 11082 +#define IDS_APP_ESC_KEY 11083 +#define IDS_APP_TAB_KEY 11084 +#define IDS_APP_INSERT_KEY 11085 +#define IDS_APP_HOME_KEY 11086 +#define IDS_APP_DELETE_KEY 11087 +#define IDS_APP_END_KEY 11088 +#define IDS_APP_PAGEUP_KEY 11089 +#define IDS_APP_PAGEDOWN_KEY 11090 +#define IDS_APP_LEFT_ARROW_KEY 11091 +#define IDS_APP_RIGHT_ARROW_KEY 11092 +#define IDS_APP_UP_ARROW_KEY 11093 +#define IDS_APP_DOWN_ARROW_KEY 11094 +#define IDS_APP_ENTER_KEY 11095 +#define IDS_APP_SPACE_KEY 11096 +#define IDS_APP_F1_KEY 11097 +#define IDS_APP_F11_KEY 11098 +#define IDS_APP_BACKSPACE_KEY 11099 +#define IDS_APP_COMMA_KEY 11100 +#define IDS_APP_PERIOD_KEY 11101 +#define IDS_APP_MEDIA_NEXT_TRACK_KEY 11102 +#define IDS_APP_MEDIA_PLAY_PAUSE_KEY 11103 +#define IDS_APP_MEDIA_PREV_TRACK_KEY 11104 +#define IDS_APP_MEDIA_STOP_KEY 11105 +#define IDS_APP_CONTROL_MODIFIER 11106 +#define IDS_APP_ALT_MODIFIER 11107 +#define IDS_APP_SHIFT_MODIFIER 11108 +#define IDS_APP_COMMAND_MODIFIER 11109 +#define IDS_APP_SEARCH_MODIFIER 11110 +#define IDS_APP_BYTES 11111 +#define IDS_APP_KIBIBYTES 11112 +#define IDS_APP_MEBIBYTES 11113 +#define IDS_APP_GIBIBYTES 11114 +#define IDS_APP_TEBIBYTES 11115 +#define IDS_APP_PEBIBYTES 11116 +#define IDS_APP_BYTES_PER_SECOND 11117 +#define IDS_APP_KIBIBYTES_PER_SECOND 11118 +#define IDS_APP_MEBIBYTES_PER_SECOND 11119 +#define IDS_APP_GIBIBYTES_PER_SECOND 11120 +#define IDS_APP_TEBIBYTES_PER_SECOND 11121 +#define IDS_APP_PEBIBYTES_PER_SECOND 11122 +#define IDS_MESSAGE_CENTER_ACCESSIBLE_NAME 11123 +#define IDS_MESSAGE_CENTER_NOTIFIER_DISABLE 11124 +#define IDS_MESSAGE_CENTER_FOOTER_TITLE 11125 +#define IDS_MESSAGE_CENTER_SETTINGS_BUTTON_LABEL 11126 +#define IDS_MESSAGE_CENTER_SETTINGS_DIALOG_DESCRIPTION 11128 +#define IDS_MESSAGE_CENTER_SETTINGS_DESCRIPTION_MULTIUSER 11129 +#define IDS_MESSAGE_CENTER_SETTINGS 11130 +#define IDS_MESSAGE_CENTER_CLEAR_ALL 11131 +#define IDS_MESSAGE_CENTER_QUIET_MODE_BUTTON_TOOLTIP 11132 +#define IDS_MESSAGE_CENTER_NO_MESSAGES 11133 +#define IDS_MESSAGE_CENTER_QUIET_MODE 11134 +#define IDS_MESSAGE_CENTER_QUIET_MODE_1HOUR 11135 +#define IDS_MESSAGE_CENTER_QUIET_MODE_1DAY 11136 +#define IDS_MESSAGE_CENTER_CLOSE_NOTIFICATION_BUTTON_ACCESSIBLE_NAME 11137 +#define IDS_APP_LIST_HELP 11140 +#define IDS_APP_LIST_OPEN_SETTINGS 11141 +#define IDS_APP_LIST_OPEN_FEEDBACK 11142 +#define IDS_APP_LIST_BACK 11143 +#define IDS_APP_LIST_ALL_APPS 11144 +#define IDS_APP_LIST_FOLDER_NAME_PLACEHOLDER 11145 +#define IDS_APP_LIST_FOLDER_BUTTON_ACCESSIBILE_NAME 11146 +#define IDS_APP_LIST_FOLDER_OPEN_FOLDER_ACCESSIBILE_NAME 11147 +#define IDS_APP_LIST_FOLDER_CLOSE_FOLDER_ACCESSIBILE_NAME 11148 +#define IDS_APP_LIST_SPEECH_HINT_TEXT 11149 +#define IDS_APP_LIST_SPEECH_NETWORK_ERROR_HINT_TEXT 11150 + +#endif // CEF_INCLUDE_CEF_PACK_STRINGS_H_ diff --git a/dependencies64/cef/include/cef_parser.h b/dependencies64/cef/include/cef_parser.h new file mode 100644 index 000000000..92f46c6ab --- /dev/null +++ b/dependencies64/cef/include/cef_parser.h @@ -0,0 +1,126 @@ +// Copyright (c) 2012 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// The contents of this file must follow a specific format in order to +// support the CEF translator tool. See the translator.README.txt file in the +// tools directory for more information. +// + +#ifndef CEF_INCLUDE_CEF_PARSER_H_ +#define CEF_INCLUDE_CEF_PARSER_H_ +#pragma once + +#include + +#include "include/cef_base.h" +#include "include/cef_values.h" + +/// +// Parse the specified |url| into its component parts. +// Returns false if the URL is empty or invalid. +/// +/*--cef()--*/ +bool CefParseURL(const CefString& url, + CefURLParts& parts); + +/// +// Creates a URL from the specified |parts|, which must contain a non-empty +// spec or a non-empty host and path (at a minimum), but not both. +// Returns false if |parts| isn't initialized as described. +/// +/*--cef()--*/ +bool CefCreateURL(const CefURLParts& parts, + CefString& url); + +/// +// Returns the mime type for the specified file extension or an empty string if +// unknown. +/// +/*--cef()--*/ +CefString CefGetMimeType(const CefString& extension); + +// Get the extensions associated with the given mime type. This should be passed +// in lower case. There could be multiple extensions for a given mime type, like +// "html,htm" for "text/html", or "txt,text,html,..." for "text/*". Any existing +// elements in the provided vector will not be erased. +/*--cef()--*/ +void CefGetExtensionsForMimeType(const CefString& mime_type, + std::vector& extensions); + +/// +// Encodes |data| as a base64 string. +/// +/*--cef()--*/ +CefString CefBase64Encode(const void* data, size_t data_size); + +/// +// Decodes the base64 encoded string |data|. The returned value will be NULL if +// the decoding fails. +/// +/*--cef()--*/ +CefRefPtr CefBase64Decode(const CefString& data); + +/// +// Escapes characters in |text| which are unsuitable for use as a query +// parameter value. Everything except alphanumerics and -_.!~*'() will be +// converted to "%XX". If |use_plus| is true spaces will change to "+". The +// result is basically the same as encodeURIComponent in Javacript. +/// +/*--cef()--*/ +CefString CefURIEncode(const CefString& text, bool use_plus); + +/// +// Unescapes |text| and returns the result. Unescaping consists of looking for +// the exact pattern "%XX" where each X is a hex digit and converting to the +// character with the numerical value of those digits (e.g. "i%20=%203%3b" +// unescapes to "i = 3;"). If |convert_to_utf8| is true this function will +// attempt to interpret the initial decoded result as UTF-8. If the result is +// convertable into UTF-8 it will be returned as converted. Otherwise the +// initial decoded result will be returned. The |unescape_rule| parameter +// supports further customization the decoding process. +/// +/*--cef()--*/ +CefString CefURIDecode(const CefString& text, + bool convert_to_utf8, + cef_uri_unescape_rule_t unescape_rule); + +/// +// Parses |string| which represents a CSS color value. If |strict| is true +// strict parsing rules will be applied. Returns true on success or false on +// error. If parsing succeeds |color| will be set to the color value otherwise +// |color| will remain unchanged. +/// +/*--cef()--*/ +bool CefParseCSSColor(const CefString& string, + bool strict, + cef_color_t& color); + +#endif // CEF_INCLUDE_CEF_PARSER_H_ diff --git a/dependencies64/cef/include/cef_path_util.h b/dependencies64/cef/include/cef_path_util.h new file mode 100644 index 000000000..552f4ba59 --- /dev/null +++ b/dependencies64/cef/include/cef_path_util.h @@ -0,0 +1,52 @@ +// Copyright (c) 2012 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// The contents of this file must follow a specific format in order to +// support the CEF translator tool. See the translator.README.txt file in the +// tools directory for more information. +// + +#ifndef CEF_INCLUDE_CEF_PATH_UTIL_H_ +#define CEF_INCLUDE_CEF_PATH_UTIL_H_ +#pragma once + +#include "include/cef_base.h" + +typedef cef_path_key_t PathKey; + +/// +// Retrieve the path associated with the specified |key|. Returns true on +// success. Can be called on any thread in the browser process. +/// +/*--cef()--*/ +bool CefGetPath(PathKey key, CefString& path); + +#endif // CEF_INCLUDE_CEF_PATH_UTIL_H_ diff --git a/dependencies64/cef/include/cef_print_handler.h b/dependencies64/cef/include/cef_print_handler.h new file mode 100644 index 000000000..a157cbbd6 --- /dev/null +++ b/dependencies64/cef/include/cef_print_handler.h @@ -0,0 +1,120 @@ +// Copyright (c) 2014 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// The contents of this file must follow a specific format in order to +// support the CEF translator tool. See the translator.README.txt file in the +// tools directory for more information. +// + +#ifndef CEF_INCLUDE_CEF_PRINT_HANDLER_H_ +#define CEF_INCLUDE_CEF_PRINT_HANDLER_H_ +#pragma once + +#include "include/cef_base.h" +#include "include/cef_browser.h" +#include "include/cef_print_settings.h" + +/// +// Callback interface for asynchronous continuation of print dialog requests. +/// +/*--cef(source=library)--*/ +class CefPrintDialogCallback : public virtual CefBase { + public: + /// + // Continue printing with the specified |settings|. + /// + /*--cef(capi_name=cont)--*/ + virtual void Continue(CefRefPtr settings) =0; + + /// + // Cancel the printing. + /// + /*--cef()--*/ + virtual void Cancel() =0; +}; + +/// +// Callback interface for asynchronous continuation of print job requests. +/// +/*--cef(source=library)--*/ +class CefPrintJobCallback : public virtual CefBase { + public: + /// + // Indicate completion of the print job. + /// + /*--cef(capi_name=cont)--*/ + virtual void Continue() =0; +}; + + +/// +// Implement this interface to handle printing on Linux. The methods of this +// class will be called on the browser process UI thread. +/// +/*--cef(source=client)--*/ +class CefPrintHandler : public virtual CefBase { + public: + /// + // Synchronize |settings| with client state. If |get_defaults| is true then + // populate |settings| with the default print settings. Do not keep a + // reference to |settings| outside of this callback. + /// + /*--cef()--*/ + virtual void OnPrintSettings(CefRefPtr settings, + bool get_defaults) =0; + + /// + // Show the print dialog. Execute |callback| once the dialog is dismissed. + // Return true if the dialog will be displayed or false to cancel the + // printing immediately. + /// + /*--cef()--*/ + virtual bool OnPrintDialog(bool has_selection, + CefRefPtr callback) =0; + + /// + // Send the print job to the printer. Execute |callback| once the job is + // completed. Return true if the job will proceed or false to cancel the job + // immediately. + /// + /*--cef()--*/ + virtual bool OnPrintJob(const CefString& document_name, + const CefString& pdf_file_path, + CefRefPtr callback) =0; + + /// + // Reset client state related to printing. + /// + /*--cef()--*/ + virtual void OnPrintReset() =0; +}; + +#endif // CEF_INCLUDE_CEF_PRINT_HANDLER_H_ diff --git a/dependencies64/cef/include/cef_print_settings.h b/dependencies64/cef/include/cef_print_settings.h new file mode 100644 index 000000000..af3fff4f5 --- /dev/null +++ b/dependencies64/cef/include/cef_print_settings.h @@ -0,0 +1,208 @@ +// Copyright (c) 2014 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// The contents of this file must follow a specific format in order to +// support the CEF translator tool. See the translator.README.txt file in the +// tools directory for more information. +// + +#ifndef CEF_INCLUDE_CEF_PRINT_SETTINGS_H_ +#define CEF_INCLUDE_CEF_PRINT_SETTINGS_H_ +#pragma once + +#include + +#include "include/cef_base.h" + +/// +// Class representing print settings. +/// +/*--cef(source=library)--*/ +class CefPrintSettings : public virtual CefBase { + public: + typedef cef_color_model_t ColorModel; + typedef cef_duplex_mode_t DuplexMode; + typedef std::vector PageRangeList; + + /// + // Create a new CefPrintSettings object. + /// + /*--cef()--*/ + static CefRefPtr Create(); + + /// + // Returns true if this object is valid. Do not call any other methods if this + // function returns false. + /// + /*--cef()--*/ + virtual bool IsValid() =0; + + /// + // Returns true if the values of this object are read-only. Some APIs may + // expose read-only objects. + /// + /*--cef()--*/ + virtual bool IsReadOnly() =0; + + /// + // Returns a writable copy of this object. + /// + /*--cef()--*/ + virtual CefRefPtr Copy() =0; + + /// + // Set the page orientation. + /// + /*--cef()--*/ + virtual void SetOrientation(bool landscape) =0; + + /// + // Returns true if the orientation is landscape. + /// + /*--cef()--*/ + virtual bool IsLandscape() =0; + + /// + // Set the printer printable area in device units. + // Some platforms already provide flipped area. Set |landscape_needs_flip| + // to false on those platforms to avoid double flipping. + /// + /*--cef()--*/ + virtual void SetPrinterPrintableArea( + const CefSize& physical_size_device_units, + const CefRect& printable_area_device_units, + bool landscape_needs_flip) =0; + + /// + // Set the device name. + /// + /*--cef(optional_param=name)--*/ + virtual void SetDeviceName(const CefString& name) =0; + + /// + // Get the device name. + /// + /*--cef()--*/ + virtual CefString GetDeviceName() =0; + + /// + // Set the DPI (dots per inch). + /// + /*--cef()--*/ + virtual void SetDPI(int dpi) =0; + + /// + // Get the DPI (dots per inch). + /// + /*--cef()--*/ + virtual int GetDPI() =0; + + /// + // Set the page ranges. + /// + /*--cef()--*/ + virtual void SetPageRanges(const PageRangeList& ranges) =0; + + /// + // Returns the number of page ranges that currently exist. + /// + /*--cef()--*/ + virtual size_t GetPageRangesCount() =0; + + /// + // Retrieve the page ranges. + /// + /*--cef(count_func=ranges:GetPageRangesCount)--*/ + virtual void GetPageRanges(PageRangeList& ranges) =0; + + /// + // Set whether only the selection will be printed. + /// + /*--cef()--*/ + virtual void SetSelectionOnly(bool selection_only) =0; + + /// + // Returns true if only the selection will be printed. + /// + /*--cef()--*/ + virtual bool IsSelectionOnly() =0; + + /// + // Set whether pages will be collated. + /// + /*--cef()--*/ + virtual void SetCollate(bool collate) =0; + + /// + // Returns true if pages will be collated. + /// + /*--cef()--*/ + virtual bool WillCollate() =0; + + /// + // Set the color model. + /// + /*--cef()--*/ + virtual void SetColorModel(ColorModel model) =0; + + /// + // Get the color model. + /// + /*--cef(default_retval=COLOR_MODEL_UNKNOWN)--*/ + virtual ColorModel GetColorModel() =0; + + /// + // Set the number of copies. + /// + /*--cef()--*/ + virtual void SetCopies(int copies) =0; + + /// + // Get the number of copies. + /// + /*--cef()--*/ + virtual int GetCopies() =0; + + /// + // Set the duplex mode. + /// + /*--cef()--*/ + virtual void SetDuplexMode(DuplexMode mode) =0; + + /// + // Get the duplex mode. + /// + /*--cef(default_retval=DUPLEX_MODE_UNKNOWN)--*/ + virtual DuplexMode GetDuplexMode() =0; +}; + +#endif // CEF_INCLUDE_CEF_PRINT_SETTINGS_H_ + diff --git a/dependencies64/cef/include/cef_process_message.h b/dependencies64/cef/include/cef_process_message.h new file mode 100644 index 000000000..1e27bd681 --- /dev/null +++ b/dependencies64/cef/include/cef_process_message.h @@ -0,0 +1,91 @@ +// Copyright (c) 2012 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// The contents of this file must follow a specific format in order to +// support the CEF translator tool. See the translator.README.txt file in the +// tools directory for more information. +// + +#ifndef CEF_INCLUDE_CEF_MESSAGE_H_ +#define CEF_INCLUDE_CEF_MESSAGE_H_ +#pragma once + +#include "include/cef_base.h" +#include "include/cef_values.h" + +typedef cef_process_id_t CefProcessId; + +/// +// Class representing a message. Can be used on any process and thread. +/// +/*--cef(source=library)--*/ +class CefProcessMessage : public virtual CefBase { + public: + /// + // Create a new CefProcessMessage object with the specified name. + /// + /*--cef()--*/ + static CefRefPtr Create(const CefString& name); + + /// + // Returns true if this object is valid. Do not call any other methods if this + // function returns false. + /// + /*--cef()--*/ + virtual bool IsValid() =0; + + /// + // Returns true if the values of this object are read-only. Some APIs may + // expose read-only objects. + /// + /*--cef()--*/ + virtual bool IsReadOnly() =0; + + /// + // Returns a writable copy of this object. + /// + /*--cef()--*/ + virtual CefRefPtr Copy() =0; + + /// + // Returns the message name. + /// + /*--cef()--*/ + virtual CefString GetName() =0; + + /// + // Returns the list of arguments. + /// + /*--cef()--*/ + virtual CefRefPtr GetArgumentList() =0; +}; + +#endif // CEF_INCLUDE_CEF_MESSAGE_H_ diff --git a/dependencies64/cef/include/cef_process_util.h b/dependencies64/cef/include/cef_process_util.h new file mode 100644 index 000000000..4fce778e7 --- /dev/null +++ b/dependencies64/cef/include/cef_process_util.h @@ -0,0 +1,57 @@ +// Copyright (c) 2012 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// The contents of this file must follow a specific format in order to +// support the CEF translator tool. See the translator.README.txt file in the +// tools directory for more information. +// + +#ifndef CEF_INCLUDE_CEF_PROCESS_UTIL_H_ +#define CEF_INCLUDE_CEF_PROCESS_UTIL_H_ +#pragma once + +#include "include/cef_base.h" +#include "include/cef_command_line.h" + +/// +// Launches the process specified via |command_line|. Returns true upon +// success. Must be called on the browser process TID_PROCESS_LAUNCHER thread. +// +// Unix-specific notes: +// - All file descriptors open in the parent process will be closed in the +// child process except for stdin, stdout, and stderr. +// - If the first argument on the command line does not contain a slash, +// PATH will be searched. (See man execvp.) +/// +/*--cef()--*/ +bool CefLaunchProcess(CefRefPtr command_line); + +#endif // CEF_INCLUDE_CEF_PROCESS_UTIL_H_ diff --git a/dependencies64/cef/include/cef_render_handler.h b/dependencies64/cef/include/cef_render_handler.h new file mode 100644 index 000000000..636d72ea0 --- /dev/null +++ b/dependencies64/cef/include/cef_render_handler.h @@ -0,0 +1,180 @@ +// Copyright (c) 2012 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// The contents of this file must follow a specific format in order to +// support the CEF translator tool. See the translator.README.txt file in the +// tools directory for more information. +// + +#ifndef CEF_INCLUDE_CEF_RENDER_HANDLER_H_ +#define CEF_INCLUDE_CEF_RENDER_HANDLER_H_ +#pragma once + +#include "include/cef_base.h" +#include "include/cef_browser.h" +#include "include/cef_drag_data.h" +#include + +/// +// Implement this interface to handle events when window rendering is disabled. +// The methods of this class will be called on the UI thread. +/// +/*--cef(source=client)--*/ +class CefRenderHandler : public virtual CefBase { + public: + typedef cef_cursor_type_t CursorType; + typedef cef_drag_operations_mask_t DragOperation; + typedef cef_drag_operations_mask_t DragOperationsMask; + typedef cef_paint_element_type_t PaintElementType; + typedef std::vector RectList; + + /// + // Called to retrieve the root window rectangle in screen coordinates. Return + // true if the rectangle was provided. + /// + /*--cef()--*/ + virtual bool GetRootScreenRect(CefRefPtr browser, + CefRect& rect) { return false; } + + /// + // Called to retrieve the view rectangle which is relative to screen + // coordinates. Return true if the rectangle was provided. + /// + /*--cef()--*/ + virtual bool GetViewRect(CefRefPtr browser, CefRect& rect) =0; + + /// + // Called to retrieve the translation from view coordinates to actual screen + // coordinates. Return true if the screen coordinates were provided. + /// + /*--cef()--*/ + virtual bool GetScreenPoint(CefRefPtr browser, + int viewX, + int viewY, + int& screenX, + int& screenY) { return false; } + + /// + // Called to allow the client to fill in the CefScreenInfo object with + // appropriate values. Return true if the |screen_info| structure has been + // modified. + // + // If the screen info rectangle is left empty the rectangle from GetViewRect + // will be used. If the rectangle is still empty or invalid popups may not be + // drawn correctly. + /// + /*--cef()--*/ + virtual bool GetScreenInfo(CefRefPtr browser, + CefScreenInfo& screen_info) { return false; } + + /// + // Called when the browser wants to show or hide the popup widget. The popup + // should be shown if |show| is true and hidden if |show| is false. + /// + /*--cef()--*/ + virtual void OnPopupShow(CefRefPtr browser, + bool show) {} + + /// + // Called when the browser wants to move or resize the popup widget. |rect| + // contains the new location and size in view coordinates. + /// + /*--cef()--*/ + virtual void OnPopupSize(CefRefPtr browser, + const CefRect& rect) {} + + /// + // Called when an element should be painted. Pixel values passed to this + // method are scaled relative to view coordinates based on the value of + // CefScreenInfo.device_scale_factor returned from GetScreenInfo. |type| + // indicates whether the element is the view or the popup widget. |buffer| + // contains the pixel data for the whole image. |dirtyRects| contains the set + // of rectangles in pixel coordinates that need to be repainted. |buffer| will + // be |width|*|height|*4 bytes in size and represents a BGRA image with an + // upper-left origin. + /// + /*--cef()--*/ + virtual void OnPaint(CefRefPtr browser, + PaintElementType type, + const RectList& dirtyRects, + const void* buffer, + int width, int height) =0; + + /// + // Called when the browser's cursor has changed. If |type| is CT_CUSTOM then + // |custom_cursor_info| will be populated with the custom cursor information. + /// + /*--cef()--*/ + virtual void OnCursorChange(CefRefPtr browser, + CefCursorHandle cursor, + CursorType type, + const CefCursorInfo& custom_cursor_info) {} + + /// + // Called when the user starts dragging content in the web view. Contextual + // information about the dragged content is supplied by |drag_data|. + // (|x|, |y|) is the drag start location in screen coordinates. + // OS APIs that run a system message loop may be used within the + // StartDragging call. + // + // Return false to abort the drag operation. Don't call any of + // CefBrowserHost::DragSource*Ended* methods after returning false. + // + // Return true to handle the drag operation. Call + // CefBrowserHost::DragSourceEndedAt and DragSourceSystemDragEnded either + // synchronously or asynchronously to inform the web view that the drag + // operation has ended. + /// + /*--cef()--*/ + virtual bool StartDragging(CefRefPtr browser, + CefRefPtr drag_data, + DragOperationsMask allowed_ops, + int x, int y) { return false; } + + /// + // Called when the web view wants to update the mouse cursor during a + // drag & drop operation. |operation| describes the allowed operation + // (none, move, copy, link). + /// + /*--cef()--*/ + virtual void UpdateDragCursor(CefRefPtr browser, + DragOperation operation) {} + + /// + // Called when the scroll offset has changed. + /// + /*--cef()--*/ + virtual void OnScrollOffsetChanged(CefRefPtr browser, + double x, + double y) {} +}; + +#endif // CEF_INCLUDE_CEF_RENDER_HANDLER_H_ diff --git a/dependencies64/cef/include/cef_render_process_handler.h b/dependencies64/cef/include/cef_render_process_handler.h new file mode 100644 index 000000000..98ab391bc --- /dev/null +++ b/dependencies64/cef/include/cef_render_process_handler.h @@ -0,0 +1,168 @@ +// Copyright (c) 2013 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// The contents of this file must follow a specific format in order to +// support the CEF translator tool. See the translator.README.txt file in the +// tools directory for more information. +// + +#ifndef CEF_INCLUDE_CEF_RENDER_PROCESS_HANDLER_H_ +#define CEF_INCLUDE_CEF_RENDER_PROCESS_HANDLER_H_ +#pragma once + +#include "include/cef_base.h" +#include "include/cef_browser.h" +#include "include/cef_dom.h" +#include "include/cef_frame.h" +#include "include/cef_load_handler.h" +#include "include/cef_process_message.h" +#include "include/cef_v8.h" +#include "include/cef_values.h" + +/// +// Class used to implement render process callbacks. The methods of this class +// will be called on the render process main thread (TID_RENDERER) unless +// otherwise indicated. +/// +/*--cef(source=client)--*/ +class CefRenderProcessHandler : public virtual CefBase { + public: + typedef cef_navigation_type_t NavigationType; + + /// + // Called after the render process main thread has been created. |extra_info| + // is a read-only value originating from + // CefBrowserProcessHandler::OnRenderProcessThreadCreated(). Do not keep a + // reference to |extra_info| outside of this method. + /// + /*--cef()--*/ + virtual void OnRenderThreadCreated(CefRefPtr extra_info) {} + + /// + // Called after WebKit has been initialized. + /// + /*--cef()--*/ + virtual void OnWebKitInitialized() {} + + /// + // Called after a browser has been created. When browsing cross-origin a new + // browser will be created before the old browser with the same identifier is + // destroyed. + /// + /*--cef()--*/ + virtual void OnBrowserCreated(CefRefPtr browser) {} + + /// + // Called before a browser is destroyed. + /// + /*--cef()--*/ + virtual void OnBrowserDestroyed(CefRefPtr browser) {} + + /// + // Return the handler for browser load status events. + /// + /*--cef()--*/ + virtual CefRefPtr GetLoadHandler() { + return NULL; + } + + /// + // Called before browser navigation. Return true to cancel the navigation or + // false to allow the navigation to proceed. The |request| object cannot be + // modified in this callback. + /// + /*--cef()--*/ + virtual bool OnBeforeNavigation(CefRefPtr browser, + CefRefPtr frame, + CefRefPtr request, + NavigationType navigation_type, + bool is_redirect) { return false; } + + /// + // Called immediately after the V8 context for a frame has been created. To + // retrieve the JavaScript 'window' object use the CefV8Context::GetGlobal() + // method. V8 handles can only be accessed from the thread on which they are + // created. A task runner for posting tasks on the associated thread can be + // retrieved via the CefV8Context::GetTaskRunner() method. + /// + /*--cef()--*/ + virtual void OnContextCreated(CefRefPtr browser, + CefRefPtr frame, + CefRefPtr context) {} + + /// + // Called immediately before the V8 context for a frame is released. No + // references to the context should be kept after this method is called. + /// + /*--cef()--*/ + virtual void OnContextReleased(CefRefPtr browser, + CefRefPtr frame, + CefRefPtr context) {} + + /// + // Called for global uncaught exceptions in a frame. Execution of this + // callback is disabled by default. To enable set + // CefSettings.uncaught_exception_stack_size > 0. + /// + /*--cef()--*/ + virtual void OnUncaughtException(CefRefPtr browser, + CefRefPtr frame, + CefRefPtr context, + CefRefPtr exception, + CefRefPtr stackTrace) {} + + /// + // Called when a new node in the the browser gets focus. The |node| value may + // be empty if no specific node has gained focus. The node object passed to + // this method represents a snapshot of the DOM at the time this method is + // executed. DOM objects are only valid for the scope of this method. Do not + // keep references to or attempt to access any DOM objects outside the scope + // of this method. + /// + /*--cef(optional_param=frame,optional_param=node)--*/ + virtual void OnFocusedNodeChanged(CefRefPtr browser, + CefRefPtr frame, + CefRefPtr node) {} + + /// + // Called when a new message is received from a different process. Return true + // if the message was handled or false otherwise. Do not keep a reference to + // or attempt to access the message outside of this callback. + /// + /*--cef()--*/ + virtual bool OnProcessMessageReceived(CefRefPtr browser, + CefProcessId source_process, + CefRefPtr message) { + return false; + } +}; + +#endif // CEF_INCLUDE_CEF_RENDER_PROCESS_HANDLER_H_ diff --git a/dependencies64/cef/include/cef_request.h b/dependencies64/cef/include/cef_request.h new file mode 100644 index 000000000..6d13da128 --- /dev/null +++ b/dependencies64/cef/include/cef_request.h @@ -0,0 +1,305 @@ +// Copyright (c) 2012 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// The contents of this file must follow a specific format in order to +// support the CEF translator tool. See the translator.README.txt file in the +// tools directory for more information. +// + +#ifndef CEF_INCLUDE_CEF_REQUEST_H_ +#define CEF_INCLUDE_CEF_REQUEST_H_ +#pragma once + +#include "include/cef_base.h" +#include +#include + +class CefPostData; +class CefPostDataElement; + +/// +// Class used to represent a web request. The methods of this class may be +// called on any thread. +/// +/*--cef(source=library,no_debugct_check)--*/ +class CefRequest : public virtual CefBase { + public: + typedef std::multimap HeaderMap; + typedef cef_resource_type_t ResourceType; + typedef cef_transition_type_t TransitionType; + + /// + // Create a new CefRequest object. + /// + /*--cef()--*/ + static CefRefPtr Create(); + + /// + // Returns true if this object is read-only. + /// + /*--cef()--*/ + virtual bool IsReadOnly() =0; + + /// + // Get the fully qualified URL. + /// + /*--cef()--*/ + virtual CefString GetURL() =0; + + /// + // Set the fully qualified URL. + /// + /*--cef()--*/ + virtual void SetURL(const CefString& url) =0; + + /// + // Get the request method type. The value will default to POST if post data + // is provided and GET otherwise. + /// + /*--cef()--*/ + virtual CefString GetMethod() =0; + + /// + // Set the request method type. + /// + /*--cef()--*/ + virtual void SetMethod(const CefString& method) =0; + + /// + // Get the post data. + /// + /*--cef()--*/ + virtual CefRefPtr GetPostData() =0; + + /// + // Set the post data. + /// + /*--cef()--*/ + virtual void SetPostData(CefRefPtr postData) =0; + + /// + // Get the header values. + /// + /*--cef()--*/ + virtual void GetHeaderMap(HeaderMap& headerMap) =0; + + /// + // Set the header values. + /// + /*--cef()--*/ + virtual void SetHeaderMap(const HeaderMap& headerMap) =0; + + /// + // Set all values at one time. + /// + /*--cef(optional_param=postData)--*/ + virtual void Set(const CefString& url, + const CefString& method, + CefRefPtr postData, + const HeaderMap& headerMap) =0; + + /// + // Get the flags used in combination with CefURLRequest. See + // cef_urlrequest_flags_t for supported values. + /// + /*--cef(default_retval=UR_FLAG_NONE)--*/ + virtual int GetFlags() =0; + + /// + // Set the flags used in combination with CefURLRequest. See + // cef_urlrequest_flags_t for supported values. + /// + /*--cef()--*/ + virtual void SetFlags(int flags) =0; + + /// + // Set the URL to the first party for cookies used in combination with + // CefURLRequest. + /// + /*--cef()--*/ + virtual CefString GetFirstPartyForCookies() =0; + + /// + // Get the URL to the first party for cookies used in combination with + // CefURLRequest. + /// + /*--cef()--*/ + virtual void SetFirstPartyForCookies(const CefString& url) =0; + + /// + // Get the resource type for this request. Only available in the browser + // process. + /// + /*--cef(default_retval=RT_SUB_RESOURCE)--*/ + virtual ResourceType GetResourceType() =0; + + /// + // Get the transition type for this request. Only available in the browser + // process and only applies to requests that represent a main frame or + // sub-frame navigation. + /// + /*--cef(default_retval=TT_EXPLICIT)--*/ + virtual TransitionType GetTransitionType() =0; + + /// + // Returns the globally unique identifier for this request or 0 if not + // specified. Can be used by CefRequestHandler implementations in the browser + // process to track a single request across multiple callbacks. + /// + /*--cef()--*/ + virtual uint64 GetIdentifier() =0; +}; + + +/// +// Class used to represent post data for a web request. The methods of this +// class may be called on any thread. +/// +/*--cef(source=library,no_debugct_check)--*/ +class CefPostData : public virtual CefBase { + public: + typedef std::vector > ElementVector; + + /// + // Create a new CefPostData object. + /// + /*--cef()--*/ + static CefRefPtr Create(); + + /// + // Returns true if this object is read-only. + /// + /*--cef()--*/ + virtual bool IsReadOnly() =0; + + /// + // Returns the number of existing post data elements. + /// + /*--cef()--*/ + virtual size_t GetElementCount() =0; + + /// + // Retrieve the post data elements. + /// + /*--cef(count_func=elements:GetElementCount)--*/ + virtual void GetElements(ElementVector& elements) =0; + + /// + // Remove the specified post data element. Returns true if the removal + // succeeds. + /// + /*--cef()--*/ + virtual bool RemoveElement(CefRefPtr element) =0; + + /// + // Add the specified post data element. Returns true if the add succeeds. + /// + /*--cef()--*/ + virtual bool AddElement(CefRefPtr element) =0; + + /// + // Remove all existing post data elements. + /// + /*--cef()--*/ + virtual void RemoveElements() =0; +}; + + +/// +// Class used to represent a single element in the request post data. The +// methods of this class may be called on any thread. +/// +/*--cef(source=library,no_debugct_check)--*/ +class CefPostDataElement : public virtual CefBase { + public: + /// + // Post data elements may represent either bytes or files. + /// + typedef cef_postdataelement_type_t Type; + + /// + // Create a new CefPostDataElement object. + /// + /*--cef()--*/ + static CefRefPtr Create(); + + /// + // Returns true if this object is read-only. + /// + /*--cef()--*/ + virtual bool IsReadOnly() =0; + + /// + // Remove all contents from the post data element. + /// + /*--cef()--*/ + virtual void SetToEmpty() =0; + + /// + // The post data element will represent a file. + /// + /*--cef()--*/ + virtual void SetToFile(const CefString& fileName) =0; + + /// + // The post data element will represent bytes. The bytes passed + // in will be copied. + /// + /*--cef()--*/ + virtual void SetToBytes(size_t size, const void* bytes) =0; + + /// + // Return the type of this post data element. + /// + /*--cef(default_retval=PDE_TYPE_EMPTY)--*/ + virtual Type GetType() =0; + + /// + // Return the file name. + /// + /*--cef()--*/ + virtual CefString GetFile() =0; + + /// + // Return the number of bytes. + /// + /*--cef()--*/ + virtual size_t GetBytesCount() =0; + + /// + // Read up to |size| bytes into |bytes| and return the number of bytes + // actually read. + /// + /*--cef()--*/ + virtual size_t GetBytes(size_t size, void* bytes) =0; +}; + +#endif // CEF_INCLUDE_CEF_REQUEST_H_ diff --git a/dependencies64/cef/include/cef_request_context.h b/dependencies64/cef/include/cef_request_context.h new file mode 100644 index 000000000..d047c99e1 --- /dev/null +++ b/dependencies64/cef/include/cef_request_context.h @@ -0,0 +1,162 @@ +// Copyright (c) 2013 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// The contents of this file must follow a specific format in order to +// support the CEF translator tool. See the translator.README.txt file in the +// tools directory for more information. +// + +#ifndef CEF_INCLUDE_CEF_REQUEST_CONTEXT_H_ +#define CEF_INCLUDE_CEF_REQUEST_CONTEXT_H_ +#pragma once + +#include "include/cef_cookie.h" +#include "include/cef_request_context_handler.h" + +class CefSchemeHandlerFactory; + +/// +// A request context provides request handling for a set of related browser +// or URL request objects. A request context can be specified when creating a +// new browser via the CefBrowserHost static factory methods or when creating a +// new URL request via the CefURLRequest static factory methods. Browser objects +// with different request contexts will never be hosted in the same render +// process. Browser objects with the same request context may or may not be +// hosted in the same render process depending on the process model. Browser +// objects created indirectly via the JavaScript window.open function or +// targeted links will share the same render process and the same request +// context as the source browser. When running in single-process mode there is +// only a single render process (the main process) and so all browsers created +// in single-process mode will share the same request context. This will be the +// first request context passed into a CefBrowserHost static factory method and +// all other request context objects will be ignored. +/// +/*--cef(source=library,no_debugct_check)--*/ +class CefRequestContext : public virtual CefBase { + public: + /// + // Returns the global context object. + /// + /*--cef()--*/ + static CefRefPtr GetGlobalContext(); + + /// + // Creates a new context object with the specified |settings| and optional + // |handler|. + /// + /*--cef(optional_param=handler)--*/ + static CefRefPtr CreateContext( + const CefRequestContextSettings& settings, + CefRefPtr handler); + + /// + // Creates a new context object that shares storage with |other| and uses an + // optional |handler|. + /// + /*--cef(capi_name=create_context_shared,optional_param=handler)--*/ + static CefRefPtr CreateContext( + CefRefPtr other, + CefRefPtr handler); + + /// + // Returns true if this object is pointing to the same context as |that| + // object. + /// + /*--cef()--*/ + virtual bool IsSame(CefRefPtr other) =0; + + /// + // Returns true if this object is sharing the same storage as |that| object. + /// + /*--cef()--*/ + virtual bool IsSharingWith(CefRefPtr other) =0; + + /// + // Returns true if this object is the global context. The global context is + // used by default when creating a browser or URL request with a NULL context + // argument. + /// + /*--cef()--*/ + virtual bool IsGlobal() =0; + + /// + // Returns the handler for this context if any. + /// + /*--cef()--*/ + virtual CefRefPtr GetHandler() =0; + + /// + // Returns the cache path for this object. If empty an "incognito mode" + // in-memory cache is being used. + /// + /*--cef()--*/ + virtual CefString GetCachePath() =0; + + /// + // Returns the default cookie manager for this object. This will be the global + // cookie manager if this object is the global request context. Otherwise, + // this will be the default cookie manager used when this request context does + // not receive a value via CefRequestContextHandler::GetCookieManager(). If + // |callback| is non-NULL it will be executed asnychronously on the IO thread + // after the manager's storage has been initialized. + /// + /*--cef(optional_param=callback)--*/ + virtual CefRefPtr GetDefaultCookieManager( + CefRefPtr callback) =0; + + /// + // Register a scheme handler factory for the specified |scheme_name| and + // optional |domain_name|. An empty |domain_name| value for a standard scheme + // will cause the factory to match all domain names. The |domain_name| value + // will be ignored for non-standard schemes. If |scheme_name| is a built-in + // scheme and no handler is returned by |factory| then the built-in scheme + // handler factory will be called. If |scheme_name| is a custom scheme then + // you must also implement the CefApp::OnRegisterCustomSchemes() method in all + // processes. This function may be called multiple times to change or remove + // the factory that matches the specified |scheme_name| and optional + // |domain_name|. Returns false if an error occurs. This function may be + // called on any thread in the browser process. + /// + /*--cef(optional_param=domain_name,optional_param=factory)--*/ + virtual bool RegisterSchemeHandlerFactory( + const CefString& scheme_name, + const CefString& domain_name, + CefRefPtr factory) =0; + + /// + // Clear all registered scheme handler factories. Returns false on error. This + // function may be called on any thread in the browser process. + /// + /*--cef()--*/ + virtual bool ClearSchemeHandlerFactories() =0; +}; + +#endif // CEF_INCLUDE_CEF_REQUEST_CONTEXT_H_ diff --git a/dependencies64/cef/include/cef_request_context_handler.h b/dependencies64/cef/include/cef_request_context_handler.h new file mode 100644 index 000000000..c69f119da --- /dev/null +++ b/dependencies64/cef/include/cef_request_context_handler.h @@ -0,0 +1,61 @@ +// Copyright (c) 2013 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// The contents of this file must follow a specific format in order to +// support the CEF translator tool. See the translator.README.txt file in the +// tools directory for more information. +// + +#ifndef CEF_INCLUDE_CEF_REQUEST_CONTEXT_HANDLER_H_ +#define CEF_INCLUDE_CEF_REQUEST_CONTEXT_HANDLER_H_ +#pragma once + +#include "include/cef_base.h" +#include "include/cef_cookie.h" + +/// +// Implement this interface to provide handler implementations. The handler +// instance will not be released until all objects related to the context have +// been destroyed. +/// +/*--cef(source=client,no_debugct_check)--*/ +class CefRequestContextHandler : public virtual CefBase { + public: + /// + // Called on the IO thread to retrieve the cookie manager. If this method + // returns NULL the default cookie manager retrievable via + // CefRequestContext::GetDefaultCookieManager() will be used. + /// + /*--cef()--*/ + virtual CefRefPtr GetCookieManager() { return NULL; } +}; + +#endif // CEF_INCLUDE_CEF_REQUEST_CONTEXT_HANDLER_H_ diff --git a/dependencies64/cef/include/cef_request_handler.h b/dependencies64/cef/include/cef_request_handler.h new file mode 100644 index 000000000..1e252c793 --- /dev/null +++ b/dependencies64/cef/include/cef_request_handler.h @@ -0,0 +1,289 @@ +// Copyright (c) 2011 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// The contents of this file must follow a specific format in order to +// support the CEF translator tool. See the translator.README.txt file in the +// tools directory for more information. +// + +#ifndef CEF_INCLUDE_CEF_REQUEST_HANDLER_H_ +#define CEF_INCLUDE_CEF_REQUEST_HANDLER_H_ +#pragma once + +#include "include/cef_auth_callback.h" +#include "include/cef_base.h" +#include "include/cef_browser.h" +#include "include/cef_frame.h" +#include "include/cef_resource_handler.h" +#include "include/cef_response.h" +#include "include/cef_request.h" +#include "include/cef_ssl_info.h" +#include "include/cef_web_plugin.h" + + +/// +// Callback interface used for asynchronous continuation of url requests. +/// +/*--cef(source=library)--*/ +class CefRequestCallback : public virtual CefBase { + public: + /// + // Continue the url request. If |allow| is true the request will be continued. + // Otherwise, the request will be canceled. + /// + /*--cef(capi_name=cont)--*/ + virtual void Continue(bool allow) =0; + + /// + // Cancel the url request. + /// + /*--cef()--*/ + virtual void Cancel() =0; +}; + + +/// +// Implement this interface to handle events related to browser requests. The +// methods of this class will be called on the thread indicated. +/// +/*--cef(source=client)--*/ +class CefRequestHandler : public virtual CefBase { + public: + typedef cef_return_value_t ReturnValue; + typedef cef_termination_status_t TerminationStatus; + typedef cef_window_open_disposition_t WindowOpenDisposition; + + /// + // Called on the UI thread before browser navigation. Return true to cancel + // the navigation or false to allow the navigation to proceed. The |request| + // object cannot be modified in this callback. + // CefLoadHandler::OnLoadingStateChange will be called twice in all cases. + // If the navigation is allowed CefLoadHandler::OnLoadStart and + // CefLoadHandler::OnLoadEnd will be called. If the navigation is canceled + // CefLoadHandler::OnLoadError will be called with an |errorCode| value of + // ERR_ABORTED. + /// + /*--cef()--*/ + virtual bool OnBeforeBrowse(CefRefPtr browser, + CefRefPtr frame, + CefRefPtr request, + bool is_redirect) { + return false; + } + + /// + // Called on the UI thread before OnBeforeBrowse in certain limited cases + // where navigating a new or different browser might be desirable. This + // includes user-initiated navigation that might open in a special way (e.g. + // links clicked via middle-click or ctrl + left-click) and certain types of + // cross-origin navigation initiated from the renderer process (e.g. + // navigating the top-level frame to/from a file URL). The |browser| and + // |frame| values represent the source of the navigation. The + // |target_disposition| value indicates where the user intended to navigate + // the browser based on standard Chromium behaviors (e.g. current tab, + // new tab, etc). The |user_gesture| value will be true if the browser + // navigated via explicit user gesture (e.g. clicking a link) or false if it + // navigated automatically (e.g. via the DomContentLoaded event). Return true + // to cancel the navigation or false to allow the navigation to proceed in the + // source browser's top-level frame. + /// + /*--cef()--*/ + virtual bool OnOpenURLFromTab(CefRefPtr browser, + CefRefPtr frame, + const CefString& target_url, + WindowOpenDisposition target_disposition, + bool user_gesture) { + return false; + } + + /// + // Called on the IO thread before a resource request is loaded. The |request| + // object may be modified. Return RV_CONTINUE to continue the request + // immediately. Return RV_CONTINUE_ASYNC and call CefRequestCallback:: + // Continue() at a later time to continue or cancel the request + // asynchronously. Return RV_CANCEL to cancel the request immediately. + // + /// + /*--cef(default_retval=RV_CONTINUE)--*/ + virtual ReturnValue OnBeforeResourceLoad( + CefRefPtr browser, + CefRefPtr frame, + CefRefPtr request, + CefRefPtr callback) { + return RV_CONTINUE; + } + + /// + // Called on the IO thread before a resource is loaded. To allow the resource + // to load normally return NULL. To specify a handler for the resource return + // a CefResourceHandler object. The |request| object should not be modified in + // this callback. + /// + /*--cef()--*/ + virtual CefRefPtr GetResourceHandler( + CefRefPtr browser, + CefRefPtr frame, + CefRefPtr request) { + return NULL; + } + + /// + // Called on the IO thread when a resource load is redirected. The |request| + // parameter will contain the old URL and other request-related information. + // The |new_url| parameter will contain the new URL and can be changed if + // desired. The |request| object cannot be modified in this callback. + /// + /*--cef()--*/ + virtual void OnResourceRedirect(CefRefPtr browser, + CefRefPtr frame, + CefRefPtr request, + CefString& new_url) {} + + /// + // Called on the IO thread when a resource response is received. To allow the + // resource to load normally return false. To redirect or retry the resource + // modify |request| (url, headers or post body) and return true. The + // |response| object cannot be modified in this callback. + /// + /*--cef()--*/ + virtual bool OnResourceResponse(CefRefPtr browser, + CefRefPtr frame, + CefRefPtr request, + CefRefPtr response) { + return false; + } + + /// + // Called on the IO thread when the browser needs credentials from the user. + // |isProxy| indicates whether the host is a proxy server. |host| contains the + // hostname and |port| contains the port number. Return true to continue the + // request and call CefAuthCallback::Continue() either in this method or + // at a later time when the authentication information is available. Return + // false to cancel the request immediately. + /// + /*--cef(optional_param=realm)--*/ + virtual bool GetAuthCredentials(CefRefPtr browser, + CefRefPtr frame, + bool isProxy, + const CefString& host, + int port, + const CefString& realm, + const CefString& scheme, + CefRefPtr callback) { + return false; + } + + /// + // Called on the IO thread when JavaScript requests a specific storage quota + // size via the webkitStorageInfo.requestQuota function. |origin_url| is the + // origin of the page making the request. |new_size| is the requested quota + // size in bytes. Return true to continue the request and call + // CefRequestCallback::Continue() either in this method or at a later time to + // grant or deny the request. Return false to cancel the request immediately. + /// + /*--cef()--*/ + virtual bool OnQuotaRequest(CefRefPtr browser, + const CefString& origin_url, + int64 new_size, + CefRefPtr callback) { + return false; + } + + /// + // Called on the UI thread to handle requests for URLs with an unknown + // protocol component. Set |allow_os_execution| to true to attempt execution + // via the registered OS protocol handler, if any. + // SECURITY WARNING: YOU SHOULD USE THIS METHOD TO ENFORCE RESTRICTIONS BASED + // ON SCHEME, HOST OR OTHER URL ANALYSIS BEFORE ALLOWING OS EXECUTION. + /// + /*--cef()--*/ + virtual void OnProtocolExecution(CefRefPtr browser, + const CefString& url, + bool& allow_os_execution) {} + + /// + // Called on the UI thread to handle requests for URLs with an invalid + // SSL certificate. Return true and call CefRequestCallback::Continue() either + // in this method or at a later time to continue or cancel the request. Return + // false to cancel the request immediately. If |callback| is empty the error + // cannot be recovered from and the request will be canceled automatically. + // If CefSettings.ignore_certificate_errors is set all invalid certificates + // will be accepted without calling this method. + /// + /*--cef()--*/ + virtual bool OnCertificateError( + CefRefPtr browser, + cef_errorcode_t cert_error, + const CefString& request_url, + CefRefPtr ssl_info, + CefRefPtr callback) { + return false; + } + + /// + // Called on the browser process IO thread before a plugin is loaded. Return + // true to block loading of the plugin. + /// + /*--cef(optional_param=url,optional_param=policy_url)--*/ + virtual bool OnBeforePluginLoad(CefRefPtr browser, + const CefString& url, + const CefString& policy_url, + CefRefPtr info) { + return false; + } + + /// + // Called on the browser process UI thread when a plugin has crashed. + // |plugin_path| is the path of the plugin that crashed. + /// + /*--cef()--*/ + virtual void OnPluginCrashed(CefRefPtr browser, + const CefString& plugin_path) {} + + /// + // Called on the browser process UI thread when the render view associated + // with |browser| is ready to receive/handle IPC messages in the render + // process. + /// + /*--cef()--*/ + virtual void OnRenderViewReady(CefRefPtr browser) {} + + /// + // Called on the browser process UI thread when the render process + // terminates unexpectedly. |status| indicates how the process + // terminated. + /// + /*--cef()--*/ + virtual void OnRenderProcessTerminated(CefRefPtr browser, + TerminationStatus status) {} +}; + +#endif // CEF_INCLUDE_CEF_REQUEST_HANDLER_H_ diff --git a/dependencies64/cef/include/cef_resource_bundle_handler.h b/dependencies64/cef/include/cef_resource_bundle_handler.h new file mode 100644 index 000000000..2cd39a5eb --- /dev/null +++ b/dependencies64/cef/include/cef_resource_bundle_handler.h @@ -0,0 +1,73 @@ +// Copyright (c) 2012 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// The contents of this file must follow a specific format in order to +// support the CEF translator tool. See the translator.README.txt file in the +// tools directory for more information. +// + +#ifndef CEF_INCLUDE_CEF_RESOURCE_BUNDLE_HANDLER_H_ +#define CEF_INCLUDE_CEF_RESOURCE_BUNDLE_HANDLER_H_ +#pragma once + +#include "include/cef_base.h" + +/// +// Class used to implement a custom resource bundle interface. The methods of +// this class may be called on multiple threads. +/// +/*--cef(source=client)--*/ +class CefResourceBundleHandler : public virtual CefBase { + public: + /// + // Called to retrieve a localized translation for the string specified by + // |message_id|. To provide the translation set |string| to the translation + // string and return true. To use the default translation return false. + // Supported message IDs are listed in cef_pack_strings.h. + /// + /*--cef()--*/ + virtual bool GetLocalizedString(int message_id, + CefString& string) =0; + + /// + // Called to retrieve data for the resource specified by |resource_id|. To + // provide the resource data set |data| and |data_size| to the data pointer + // and size respectively and return true. To use the default resource data + // return false. The resource data will not be copied and must remain resident + // in memory. Supported resource IDs are listed in cef_pack_resources.h. + /// + /*--cef()--*/ + virtual bool GetDataResource(int resource_id, + void*& data, + size_t& data_size) =0; +}; + +#endif // CEF_INCLUDE_CEF_RESOURCE_BUNDLE_HANDLER_H_ diff --git a/dependencies64/cef/include/cef_resource_handler.h b/dependencies64/cef/include/cef_resource_handler.h new file mode 100644 index 000000000..57c8b7fc0 --- /dev/null +++ b/dependencies64/cef/include/cef_resource_handler.h @@ -0,0 +1,116 @@ +// Copyright (c) 2012 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// The contents of this file must follow a specific format in order to +// support the CEF translator tool. See the translator.README.txt file in the +// tools directory for more information. +// + +#ifndef CEF_INCLUDE_CEF_RESOURCE_HANDLER_H_ +#define CEF_INCLUDE_CEF_RESOURCE_HANDLER_H_ +#pragma once + +#include "include/cef_base.h" +#include "include/cef_browser.h" +#include "include/cef_callback.h" +#include "include/cef_cookie.h" +#include "include/cef_request.h" +#include "include/cef_response.h" + +/// +// Class used to implement a custom request handler interface. The methods of +// this class will always be called on the IO thread. +/// +/*--cef(source=client)--*/ +class CefResourceHandler : public virtual CefBase { + public: + /// + // Begin processing the request. To handle the request return true and call + // CefCallback::Continue() once the response header information is available + // (CefCallback::Continue() can also be called from inside this method if + // header information is available immediately). To cancel the request return + // false. + /// + /*--cef()--*/ + virtual bool ProcessRequest(CefRefPtr request, + CefRefPtr callback) =0; + + /// + // Retrieve response header information. If the response length is not known + // set |response_length| to -1 and ReadResponse() will be called until it + // returns false. If the response length is known set |response_length| + // to a positive value and ReadResponse() will be called until it returns + // false or the specified number of bytes have been read. Use the |response| + // object to set the mime type, http status code and other optional header + // values. To redirect the request to a new URL set |redirectUrl| to the new + // URL. + /// + /*--cef()--*/ + virtual void GetResponseHeaders(CefRefPtr response, + int64& response_length, + CefString& redirectUrl) =0; + + /// + // Read response data. If data is available immediately copy up to + // |bytes_to_read| bytes into |data_out|, set |bytes_read| to the number of + // bytes copied, and return true. To read the data at a later time set + // |bytes_read| to 0, return true and call CefCallback::Continue() when the + // data is available. To indicate response completion return false. + /// + /*--cef()--*/ + virtual bool ReadResponse(void* data_out, + int bytes_to_read, + int& bytes_read, + CefRefPtr callback) =0; + + /// + // Return true if the specified cookie can be sent with the request or false + // otherwise. If false is returned for any cookie then no cookies will be sent + // with the request. + /// + /*--cef()--*/ + virtual bool CanGetCookie(const CefCookie& cookie) { return true; } + + /// + // Return true if the specified cookie returned with the response can be set + // or false otherwise. + /// + /*--cef()--*/ + virtual bool CanSetCookie(const CefCookie& cookie) { return true; } + + /// + // Request processing has been canceled. + /// + /*--cef()--*/ + virtual void Cancel() =0; +}; + +#endif // CEF_INCLUDE_CEF_RESOURCE_HANDLER_H_ diff --git a/dependencies64/cef/include/cef_response.h b/dependencies64/cef/include/cef_response.h new file mode 100644 index 000000000..32fbef1b0 --- /dev/null +++ b/dependencies64/cef/include/cef_response.h @@ -0,0 +1,120 @@ +// Copyright (c) 2012 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// The contents of this file must follow a specific format in order to +// support the CEF translator tool. See the translator.README.txt file in the +// tools directory for more information. +// + +#ifndef CEF_INCLUDE_CEF_RESPONSE_H_ +#define CEF_INCLUDE_CEF_RESPONSE_H_ +#pragma once + +#include "include/cef_base.h" +#include + +/// +// Class used to represent a web response. The methods of this class may be +// called on any thread. +/// +/*--cef(source=library,no_debugct_check)--*/ +class CefResponse : public virtual CefBase { + public: + typedef std::multimap HeaderMap; + + /// + // Create a new CefResponse object. + /// + /*--cef()--*/ + static CefRefPtr Create(); + + /// + // Returns true if this object is read-only. + /// + /*--cef()--*/ + virtual bool IsReadOnly() =0; + + /// + // Get the response status code. + /// + /*--cef()--*/ + virtual int GetStatus() =0; + + /// + // Set the response status code. + /// + /*--cef()--*/ + virtual void SetStatus(int status) = 0; + + /// + // Get the response status text. + /// + /*--cef()--*/ + virtual CefString GetStatusText() =0; + + /// + // Set the response status text. + /// + /*--cef()--*/ + virtual void SetStatusText(const CefString& statusText) = 0; + + /// + // Get the response mime type. + /// + /*--cef()--*/ + virtual CefString GetMimeType() = 0; + + /// + // Set the response mime type. + /// + /*--cef()--*/ + virtual void SetMimeType(const CefString& mimeType) = 0; + + /// + // Get the value for the specified response header field. + /// + /*--cef()--*/ + virtual CefString GetHeader(const CefString& name) =0; + + /// + // Get all response header fields. + /// + /*--cef()--*/ + virtual void GetHeaderMap(HeaderMap& headerMap) =0; + + /// + // Set all response header fields. + /// + /*--cef()--*/ + virtual void SetHeaderMap(const HeaderMap& headerMap) =0; +}; + +#endif // CEF_INCLUDE_CEF_RESPONSE_H_ diff --git a/dependencies64/cef/include/cef_runnable.h b/dependencies64/cef/include/cef_runnable.h new file mode 100644 index 000000000..29f13038b --- /dev/null +++ b/dependencies64/cef/include/cef_runnable.h @@ -0,0 +1,349 @@ +// Copyright (c) 2013 Marshall A. Greenblatt. Portions Copyright (c) +// 2006-2011 Google Inc. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// The contents of this file are a modified extract of base/task.h + +#ifndef CEF_INCLUDE_CEF_RUNNABLE_H_ +#define CEF_INCLUDE_CEF_RUNNABLE_H_ +#pragma once + +#if defined(BUILDING_CEF_SHARED) +// The implementation of cef_runnable.h depends on an obsolete version of +// base/tuple.h that is implemented by cef_tuple.h for client applications but +// is not compatible with the version used when building Chromium/CEF. +#error This header cannot be used when building Chromium/CEF. +#endif + +#include "include/base/cef_tuple.h" +#include "include/cef_base.h" +#include "include/cef_task.h" + +// CefRunnableMethodTraits ----------------------------------------------------- +// +// This traits-class is used by CefRunnableMethod to manage the lifetime of the +// callee object. By default, it is assumed that the callee supports AddRef +// and Release methods. A particular class can specialize this template to +// define other lifetime management. For example, if the callee is known to +// live longer than the CefRunnableMethod object, then a CefRunnableMethodTraits +// struct could be defined with empty RetainCallee and ReleaseCallee methods. +// +// The DISABLE_RUNNABLE_METHOD_REFCOUNT macro is provided as a convenient way +// for declaring a CefRunnableMethodTraits that disables refcounting. + +template +struct CefRunnableMethodTraits { + CefRunnableMethodTraits() { + } + + ~CefRunnableMethodTraits() { + } + + void RetainCallee(T* obj) { +#ifndef NDEBUG + // Catch NewCefRunnableMethod being called in an object's constructor. + // This isn't safe since the method can be invoked before the constructor + // completes, causing the object to be deleted. + obj->AddRef(); + obj->Release(); +#endif + obj->AddRef(); + } + + void ReleaseCallee(T* obj) { + obj->Release(); + } +}; + +// Convenience macro for declaring a CefRunnableMethodTraits that disables +// refcounting of a class. This is useful if you know that the callee +// will outlive the CefRunnableMethod object and thus do not need the ref +// counts. +// +// The invocation of DISABLE_RUNNABLE_METHOD_REFCOUNT should be done at the +// global namespace scope. Example: +// +// namespace foo { +// class Bar { +// ... +// }; +// } // namespace foo +// +// DISABLE_RUNNABLE_METHOD_REFCOUNT(foo::Bar); +// +// This is different from DISALLOW_COPY_AND_ASSIGN which is declared inside the +// class. +#define DISABLE_RUNNABLE_METHOD_REFCOUNT(TypeName) \ + template <> \ + struct CefRunnableMethodTraits { \ + void RetainCallee(TypeName* manager) {} \ + void ReleaseCallee(TypeName* manager) {} \ + } + +// CefRunnableMethod and CefRunnableFunction ---------------------------------- +// +// CefRunnable methods are a type of task that call a function on an object +// when they are run. We implement both an object and a set of +// NewCefRunnableMethod and NewCefRunnableFunction functions for convenience. +// These functions are overloaded and will infer the template types, +// simplifying calling code. +// +// The template definitions all use the following names: +// T - the class type of the object you're supplying +// this is not needed for the Static version of the call +// Method/Function - the signature of a pointer to the method or function you +// want to call +// Param - the parameter(s) to the method, possibly packed as a Tuple +// A - the first parameter (if any) to the method +// B - the second parameter (if any) to the method +// +// Put these all together and you get an object that can call a method whose +// signature is: +// R T::MyFunction([A[, B]]) +// +// Usage: +// CefPostTask(TID_UI, NewCefRunnableMethod(object, &Object::method[, a[, b]]) +// CefPostTask(TID_UI, NewCefRunnableFunction(&function[, a[, b]]) + +// CefRunnableMethod and NewCefRunnableMethod implementation ------------------ + +template +class CefRunnableMethod : public CefTask { + public: + CefRunnableMethod(T* obj, Method meth, const Params& params) + : obj_(obj), meth_(meth), params_(params) { + traits_.RetainCallee(obj_); + } + + ~CefRunnableMethod() { + T* obj = obj_; + obj_ = NULL; + if (obj) + traits_.ReleaseCallee(obj); + } + + virtual void Execute() { + if (obj_) + DispatchToMethod(obj_, meth_, params_); + } + + private: + T* obj_; + Method meth_; + Params params_; + CefRunnableMethodTraits traits_; + + IMPLEMENT_REFCOUNTING(CefRunnableMethod); +}; + +template +inline CefRefPtr NewCefRunnableMethod(T* object, Method method) { + return new CefRunnableMethod(object, method, MakeTuple()); +} + +template +inline CefRefPtr NewCefRunnableMethod(T* object, Method method, + const A& a) { + return new CefRunnableMethod >(object, + method, + MakeTuple(a)); +} + +template +inline CefRefPtr NewCefRunnableMethod(T* object, Method method, + const A& a, const B& b) { + return new CefRunnableMethod >(object, method, + MakeTuple(a, b)); +} + +template +inline CefRefPtr NewCefRunnableMethod(T* object, Method method, + const A& a, const B& b, + const C& c) { + return new CefRunnableMethod >(object, method, + MakeTuple(a, b, + c)); +} + +template +inline CefRefPtr NewCefRunnableMethod(T* object, Method method, + const A& a, const B& b, + const C& c, const D& d) { + return new CefRunnableMethod >(object, method, + MakeTuple(a, b, + c, + d)); +} + +template +inline CefRefPtr NewCefRunnableMethod(T* object, Method method, + const A& a, const B& b, + const C& c, const D& d, + const E& e) { + return new CefRunnableMethod >(object, + method, + MakeTuple(a, b, c, d, + e)); +} + +template +inline CefRefPtr NewCefRunnableMethod(T* object, Method method, + const A& a, const B& b, + const C& c, const D& d, + const E& e, const F& f) { + return new CefRunnableMethod >(object, + method, + MakeTuple(a, b, c, d, + e, f)); +} + +template +inline CefRefPtr NewCefRunnableMethod(T* object, Method method, + const A& a, const B& b, + const C& c, const D& d, + const E& e, const F& f, + const G& g) { + return new CefRunnableMethod >(object, + method, + MakeTuple(a, b, c, + d, e, f, + g)); +} + +// CefRunnableFunction and NewCefRunnableFunction implementation -------------- + +template +class CefRunnableFunction : public CefTask { + public: + CefRunnableFunction(Function function, const Params& params) + : function_(function), params_(params) { + } + + ~CefRunnableFunction() { + } + + virtual void Execute() { + if (function_) + DispatchToFunction(function_, params_); + } + + private: + Function function_; + Params params_; + + IMPLEMENT_REFCOUNTING(CefRunnableFunction); +}; + +template +inline CefRefPtr NewCefRunnableFunction(Function function) { + return new CefRunnableFunction(function, MakeTuple()); +} + +template +inline CefRefPtr NewCefRunnableFunction(Function function, + const A& a) { + return new CefRunnableFunction >(function, MakeTuple(a)); +} + +template +inline CefRefPtr NewCefRunnableFunction(Function function, + const A& a, const B& b) { + return new CefRunnableFunction >(function, + MakeTuple(a, b)); +} + +template +inline CefRefPtr NewCefRunnableFunction(Function function, + const A& a, const B& b, + const C& c) { + return new CefRunnableFunction >(function, + MakeTuple(a, b, + c)); +} + +template +inline CefRefPtr NewCefRunnableFunction(Function function, + const A& a, const B& b, + const C& c, const D& d) { + return new CefRunnableFunction >(function, + MakeTuple(a, b, + c, + d)); +} + +template +inline CefRefPtr NewCefRunnableFunction(Function function, + const A& a, const B& b, + const C& c, const D& d, + const E& e) { + return new CefRunnableFunction >(function, + MakeTuple(a, b, c, d, e)); +} + +template +inline CefRefPtr NewCefRunnableFunction(Function function, + const A& a, const B& b, + const C& c, const D& d, + const E& e, const F& f) { + return new CefRunnableFunction >(function, + MakeTuple(a, b, c, d, e, f)); +} + +template +inline CefRefPtr NewCefRunnableFunction(Function function, + const A& a, const B& b, + const C& c, const D& d, + const E& e, const F& f, + const G& g) { + return new CefRunnableFunction >( + function, MakeTuple(a, b, c, d, e, f, g)); +} + +template +inline CefRefPtr NewCefRunnableFunction(Function function, + const A& a, const B& b, + const C& c, const D& d, + const E& e, const F& f, + const G& g, const H& h) { + return new CefRunnableFunction >( + function, MakeTuple(a, b, c, d, e, f, g, h)); +} + +#endif // CEF_INCLUDE_CEF_RUNNABLE_H_ diff --git a/dependencies64/cef/include/cef_sandbox_win.h b/dependencies64/cef/include/cef_sandbox_win.h new file mode 100644 index 000000000..9b6c48b09 --- /dev/null +++ b/dependencies64/cef/include/cef_sandbox_win.h @@ -0,0 +1,92 @@ +// Copyright (c) 2013 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#ifndef CEF_INCLUDE_CEF_SANDBOX_WIN_H_ +#define CEF_INCLUDE_CEF_SANDBOX_WIN_H_ +#pragma once + +#include "include/cef_base.h" + +#if defined(OS_WIN) + +#ifdef __cplusplus +extern "C" { +#endif + +// The sandbox is used to restrict sub-processes (renderer, plugin, GPU, etc) +// from directly accessing system resources. This helps to protect the user +// from untrusted and potentially malicious Web content. +// See http://www.chromium.org/developers/design-documents/sandbox for +// complete details. +// +// To enable the sandbox on Windows the following requirements must be met: +// 1. Use the same executable for the browser process and all sub-processes. +// 2. Link the executable with the cef_sandbox static library. +// 3. Call the cef_sandbox_info_create() function from within the executable +// (not from a separate DLL) and pass the resulting pointer into both the +// CefExecutProcess() and CefInitialize() functions via the +// |windows_sandbox_info| parameter. + +/// +// Create the sandbox information object for this process. It is safe to create +// multiple of this object and to destroy the object immediately after passing +// into the CefExecutProcess() and/or CefInitialize() functions. +/// +void* cef_sandbox_info_create(); + +/// +// Destroy the specified sandbox information object. +/// +void cef_sandbox_info_destroy(void* sandbox_info); + +#ifdef __cplusplus +} + +/// +// Manages the life span of a sandbox information object. +/// +class CefScopedSandboxInfo { + public: + CefScopedSandboxInfo() { + sandbox_info_ = cef_sandbox_info_create(); + } + ~CefScopedSandboxInfo() { + cef_sandbox_info_destroy(sandbox_info_); + } + + void* sandbox_info() const { return sandbox_info_; } + + private: + void* sandbox_info_; +}; +#endif // __cplusplus + +#endif // defined(OS_WIN) + +#endif // CEF_INCLUDE_CEF_SANDBOX_WIN_H_ diff --git a/dependencies64/cef/include/cef_scheme.h b/dependencies64/cef/include/cef_scheme.h new file mode 100644 index 000000000..a966a9a79 --- /dev/null +++ b/dependencies64/cef/include/cef_scheme.h @@ -0,0 +1,164 @@ +// Copyright (c) 2012 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// The contents of this file must follow a specific format in order to +// support the CEF translator tool. See the translator.README.txt file in the +// tools directory for more information. +// + +#ifndef CEF_INCLUDE_CEF_SCHEME_H_ +#define CEF_INCLUDE_CEF_SCHEME_H_ +#pragma once + +#include "include/cef_base.h" +#include "include/cef_browser.h" +#include "include/cef_frame.h" +#include "include/cef_request.h" +#include "include/cef_response.h" +#include "include/cef_resource_handler.h" + +class CefSchemeHandlerFactory; + + +/// +// Register a scheme handler factory with the global request context. An empty +// |domain_name| value for a standard scheme will cause the factory to match all +// domain names. The |domain_name| value will be ignored for non-standard +// schemes. If |scheme_name| is a built-in scheme and no handler is returned by +// |factory| then the built-in scheme handler factory will be called. If +// |scheme_name| is a custom scheme then you must also implement the +// CefApp::OnRegisterCustomSchemes() method in all processes. This function may +// be called multiple times to change or remove the factory that matches the +// specified |scheme_name| and optional |domain_name|. Returns false if an error +// occurs. This function may be called on any thread in the browser process. +// Using this function is equivalent to calling +// CefRequestContext::GetGlobalContext()->RegisterSchemeHandlerFactory(). +/// +/*--cef(optional_param=domain_name,optional_param=factory)--*/ +bool CefRegisterSchemeHandlerFactory( + const CefString& scheme_name, + const CefString& domain_name, + CefRefPtr factory); + +/// +// Clear all scheme handler factories registered with the global request +// context. Returns false on error. This function may be called on any thread in +// the browser process. Using this function is equivalent to calling +// CefRequestContext::GetGlobalContext()->ClearSchemeHandlerFactories(). +/// +/*--cef()--*/ +bool CefClearSchemeHandlerFactories(); + + +/// +// Class that manages custom scheme registrations. +/// +/*--cef(source=library)--*/ +class CefSchemeRegistrar : public virtual CefBase { + public: + /// + // Register a custom scheme. This method should not be called for the built-in + // HTTP, HTTPS, FILE, FTP, ABOUT and DATA schemes. + // + // If |is_standard| is true the scheme will be treated as a standard scheme. + // Standard schemes are subject to URL canonicalization and parsing rules as + // defined in the Common Internet Scheme Syntax RFC 1738 Section 3.1 available + // at http://www.ietf.org/rfc/rfc1738.txt + // + // In particular, the syntax for standard scheme URLs must be of the form: + //
+  //  [scheme]://[username]:[password]@[host]:[port]/[url-path]
+  // 
+ // Standard scheme URLs must have a host component that is a fully qualified + // domain name as defined in Section 3.5 of RFC 1034 [13] and Section 2.1 of + // RFC 1123. These URLs will be canonicalized to "scheme://host/path" in the + // simplest case and "scheme://username:password@host:port/path" in the most + // explicit case. For example, "scheme:host/path" and "scheme:///host/path" + // will both be canonicalized to "scheme://host/path". The origin of a + // standard scheme URL is the combination of scheme, host and port (i.e., + // "scheme://host:port" in the most explicit case). + // + // For non-standard scheme URLs only the "scheme:" component is parsed and + // canonicalized. The remainder of the URL will be passed to the handler + // as-is. For example, "scheme:///some%20text" will remain the same. + // Non-standard scheme URLs cannot be used as a target for form submission. + // + // If |is_local| is true the scheme will be treated as local (i.e., with the + // same security rules as those applied to "file" URLs). Normal pages cannot + // link to or access local URLs. Also, by default, local URLs can only perform + // XMLHttpRequest calls to the same URL (origin + path) that originated the + // request. To allow XMLHttpRequest calls from a local URL to other URLs with + // the same origin set the CefSettings.file_access_from_file_urls_allowed + // value to true. To allow XMLHttpRequest calls from a local URL to all + // origins set the CefSettings.universal_access_from_file_urls_allowed value + // to true. + // + // If |is_display_isolated| is true the scheme will be treated as display- + // isolated. This means that pages cannot display these URLs unless they are + // from the same scheme. For example, pages in another origin cannot create + // iframes or hyperlinks to URLs with this scheme. + // + // This function may be called on any thread. It should only be called once + // per unique |scheme_name| value. If |scheme_name| is already registered or + // if an error occurs this method will return false. + /// + /*--cef()--*/ + virtual bool AddCustomScheme(const CefString& scheme_name, + bool is_standard, + bool is_local, + bool is_display_isolated) =0; +}; + + +/// +// Class that creates CefResourceHandler instances for handling scheme requests. +// The methods of this class will always be called on the IO thread. +/// +/*--cef(source=client)--*/ +class CefSchemeHandlerFactory : public virtual CefBase { + public: + /// + // Return a new resource handler instance to handle the request or an empty + // reference to allow default handling of the request. |browser| and |frame| + // will be the browser window and frame respectively that originated the + // request or NULL if the request did not originate from a browser window + // (for example, if the request came from CefURLRequest). The |request| object + // passed to this method will not contain cookie data. + /// + /*--cef(optional_param=browser,optional_param=frame)--*/ + virtual CefRefPtr Create( + CefRefPtr browser, + CefRefPtr frame, + const CefString& scheme_name, + CefRefPtr request) =0; +}; + +#endif // CEF_INCLUDE_CEF_SCHEME_H_ diff --git a/dependencies64/cef/include/cef_ssl_info.h b/dependencies64/cef/include/cef_ssl_info.h new file mode 100644 index 000000000..213e1ee08 --- /dev/null +++ b/dependencies64/cef/include/cef_ssl_info.h @@ -0,0 +1,162 @@ +// Copyright (c) 2015 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// The contents of this file must follow a specific format in order to +// support the CEF translator tool. See the translator.README.txt file in the +// tools directory for more information. +// + +#ifndef CEF_INCLUDE_CEF_SSL_INFO_H_ +#define CEF_INCLUDE_CEF_SSL_INFO_H_ +#pragma once + +#include + +#include "include/cef_base.h" +#include "include/cef_values.h" + +/// +// Class representing the issuer or subject field of an X.509 certificate. +/// +/*--cef(source=library)--*/ +class CefSSLCertPrincipal : public virtual CefBase { + public: + /// + // Returns a name that can be used to represent the issuer. It tries in this + // order: CN, O and OU and returns the first non-empty one found. + /// + /*--cef()--*/ + virtual CefString GetDisplayName() =0; + + /// + // Returns the common name. + /// + /*--cef()--*/ + virtual CefString GetCommonName() =0; + + /// + // Returns the locality name. + /// + /*--cef()--*/ + virtual CefString GetLocalityName() =0; + + /// + // Returns the state or province name. + /// + /*--cef()--*/ + virtual CefString GetStateOrProvinceName() =0; + + /// + // Returns the country name. + /// + /*--cef()--*/ + virtual CefString GetCountryName() =0; + + /// + // Retrieve the list of street addresses. + /// + /*--cef()--*/ + virtual void GetStreetAddresses(std::vector& addresses) =0; + + /// + // Retrieve the list of organization names. + /// + /*--cef()--*/ + virtual void GetOrganizationNames(std::vector& names) =0; + + /// + // Retrieve the list of organization unit names. + /// + /*--cef()--*/ + virtual void GetOrganizationUnitNames(std::vector& names) =0; + + /// + // Retrieve the list of domain components. + /// + /*--cef()--*/ + virtual void GetDomainComponents(std::vector& components) =0; +}; + +/// +// Class representing SSL information. +/// +/*--cef(source=library)--*/ +class CefSSLInfo : public virtual CefBase { + public: + /// + // Returns the subject of the X.509 certificate. For HTTPS server + // certificates this represents the web server. The common name of the + // subject should match the host name of the web server. + /// + /*--cef()--*/ + virtual CefRefPtr GetSubject() =0; + + /// + // Returns the issuer of the X.509 certificate. + /// + /*--cef()--*/ + virtual CefRefPtr GetIssuer() =0; + + /// + // Returns the DER encoded serial number for the X.509 certificate. The value + // possibly includes a leading 00 byte. + /// + /*--cef()--*/ + virtual CefRefPtr GetSerialNumber() =0; + + /// + // Returns the date before which the X.509 certificate is invalid. + // CefTime.GetTimeT() will return 0 if no date was specified. + /// + /*--cef()--*/ + virtual CefTime GetValidStart() =0; + + /// + // Returns the date after which the X.509 certificate is invalid. + // CefTime.GetTimeT() will return 0 if no date was specified. + /// + /*--cef()--*/ + virtual CefTime GetValidExpiry() =0; + + /// + // Returns the DER encoded data for the X.509 certificate. + /// + /*--cef()--*/ + virtual CefRefPtr GetDEREncoded() =0; + + /// + // Returns the PEM encoded data for the X.509 certificate. + /// + /*--cef()--*/ + virtual CefRefPtr GetPEMEncoded() =0; +}; + +#endif // CEF_INCLUDE_CEF_SSL_INFO_H_ diff --git a/dependencies64/cef/include/cef_stream.h b/dependencies64/cef/include/cef_stream.h new file mode 100644 index 000000000..3d0633c25 --- /dev/null +++ b/dependencies64/cef/include/cef_stream.h @@ -0,0 +1,242 @@ +// Copyright (c) 2012 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// The contents of this file must follow a specific format in order to +// support the CEF translator tool. See the translator.README.txt file in the +// tools directory for more information. +// + +#ifndef CEF_INCLUDE_CEF_STREAM_H_ +#define CEF_INCLUDE_CEF_STREAM_H_ + +#include "include/cef_base.h" + +/// +// Interface the client can implement to provide a custom stream reader. The +// methods of this class may be called on any thread. +/// +/*--cef(source=client)--*/ +class CefReadHandler : public virtual CefBase { + public: + /// + // Read raw binary data. + /// + /*--cef()--*/ + virtual size_t Read(void* ptr, size_t size, size_t n) =0; + + /// + // Seek to the specified offset position. |whence| may be any one of + // SEEK_CUR, SEEK_END or SEEK_SET. Return zero on success and non-zero on + // failure. + /// + /*--cef()--*/ + virtual int Seek(int64 offset, int whence) =0; + + /// + // Return the current offset position. + /// + /*--cef()--*/ + virtual int64 Tell() =0; + + /// + // Return non-zero if at end of file. + /// + /*--cef()--*/ + virtual int Eof() =0; + + /// + // Return true if this handler performs work like accessing the file system + // which may block. Used as a hint for determining the thread to access the + // handler from. + /// + /*--cef()--*/ + virtual bool MayBlock() =0; +}; + + +/// +// Class used to read data from a stream. The methods of this class may be +// called on any thread. +/// +/*--cef(source=library)--*/ +class CefStreamReader : public virtual CefBase { + public: + /// + // Create a new CefStreamReader object from a file. + /// + /*--cef()--*/ + static CefRefPtr CreateForFile(const CefString& fileName); + /// + // Create a new CefStreamReader object from data. + /// + /*--cef()--*/ + static CefRefPtr CreateForData(void* data, size_t size); + /// + // Create a new CefStreamReader object from a custom handler. + /// + /*--cef()--*/ + static CefRefPtr CreateForHandler( + CefRefPtr handler); + + /// + // Read raw binary data. + /// + /*--cef()--*/ + virtual size_t Read(void* ptr, size_t size, size_t n) =0; + + /// + // Seek to the specified offset position. |whence| may be any one of + // SEEK_CUR, SEEK_END or SEEK_SET. Returns zero on success and non-zero on + // failure. + /// + /*--cef()--*/ + virtual int Seek(int64 offset, int whence) =0; + + /// + // Return the current offset position. + /// + /*--cef()--*/ + virtual int64 Tell() =0; + + /// + // Return non-zero if at end of file. + /// + /*--cef()--*/ + virtual int Eof() =0; + + /// + // Returns true if this reader performs work like accessing the file system + // which may block. Used as a hint for determining the thread to access the + // reader from. + /// + /*--cef()--*/ + virtual bool MayBlock() =0; +}; + + +/// +// Interface the client can implement to provide a custom stream writer. The +// methods of this class may be called on any thread. +/// +/*--cef(source=client)--*/ +class CefWriteHandler : public virtual CefBase { + public: + /// + // Write raw binary data. + /// + /*--cef()--*/ + virtual size_t Write(const void* ptr, size_t size, size_t n) =0; + + /// + // Seek to the specified offset position. |whence| may be any one of + // SEEK_CUR, SEEK_END or SEEK_SET. Return zero on success and non-zero on + // failure. + /// + /*--cef()--*/ + virtual int Seek(int64 offset, int whence) =0; + + /// + // Return the current offset position. + /// + /*--cef()--*/ + virtual int64 Tell() =0; + + /// + // Flush the stream. + /// + /*--cef()--*/ + virtual int Flush() =0; + + /// + // Return true if this handler performs work like accessing the file system + // which may block. Used as a hint for determining the thread to access the + // handler from. + /// + /*--cef()--*/ + virtual bool MayBlock() =0; +}; + + +/// +// Class used to write data to a stream. The methods of this class may be called +// on any thread. +/// +/*--cef(source=library)--*/ +class CefStreamWriter : public virtual CefBase { + public: + /// + // Create a new CefStreamWriter object for a file. + /// + /*--cef()--*/ + static CefRefPtr CreateForFile(const CefString& fileName); + /// + // Create a new CefStreamWriter object for a custom handler. + /// + /*--cef()--*/ + static CefRefPtr CreateForHandler( + CefRefPtr handler); + + /// + // Write raw binary data. + /// + /*--cef()--*/ + virtual size_t Write(const void* ptr, size_t size, size_t n) =0; + + /// + // Seek to the specified offset position. |whence| may be any one of + // SEEK_CUR, SEEK_END or SEEK_SET. Returns zero on success and non-zero on + // failure. + /// + /*--cef()--*/ + virtual int Seek(int64 offset, int whence) =0; + + /// + // Return the current offset position. + /// + /*--cef()--*/ + virtual int64 Tell() =0; + + /// + // Flush the stream. + /// + /*--cef()--*/ + virtual int Flush() =0; + + /// + // Returns true if this writer performs work like accessing the file system + // which may block. Used as a hint for determining the thread to access the + // writer from. + /// + /*--cef()--*/ + virtual bool MayBlock() =0; +}; + +#endif // CEF_INCLUDE_CEF_STREAM_H_ diff --git a/dependencies64/cef/include/cef_string_visitor.h b/dependencies64/cef/include/cef_string_visitor.h new file mode 100644 index 000000000..549371473 --- /dev/null +++ b/dependencies64/cef/include/cef_string_visitor.h @@ -0,0 +1,55 @@ +// Copyright (c) 2012 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// The contents of this file must follow a specific format in order to +// support the CEF translator tool. See the translator.README.txt file in the +// tools directory for more information. +// + +#ifndef CEF_INCLUDE_CEF_STRING_VISITOR_H_ +#define CEF_INCLUDE_CEF_STRING_VISITOR_H_ + +#include "include/cef_base.h" + +/// +// Implement this interface to receive string values asynchronously. +/// +/*--cef(source=client)--*/ +class CefStringVisitor : public virtual CefBase { + public: + /// + // Method that will be executed. + /// + /*--cef(optional_param=string)--*/ + virtual void Visit(const CefString& string) =0; +}; + +#endif // CEF_INCLUDE_CEF_STRING_VISITOR_H_ diff --git a/dependencies64/cef/include/cef_task.h b/dependencies64/cef/include/cef_task.h new file mode 100644 index 000000000..0ecaa7526 --- /dev/null +++ b/dependencies64/cef/include/cef_task.h @@ -0,0 +1,148 @@ +// Copyright (c) 2013 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// The contents of this file must follow a specific format in order to +// support the CEF translator tool. See the translator.README.txt file in the +// tools directory for more information. +// + +#ifndef CEF_INCLUDE_CEF_TASK_H_ +#define CEF_INCLUDE_CEF_TASK_H_ + +#include "include/cef_base.h" + +typedef cef_thread_id_t CefThreadId; + +/// +// Implement this interface for asynchronous task execution. If the task is +// posted successfully and if the associated message loop is still running then +// the Execute() method will be called on the target thread. If the task fails +// to post then the task object may be destroyed on the source thread instead of +// the target thread. For this reason be cautious when performing work in the +// task object destructor. +/// +/*--cef(source=client)--*/ +class CefTask : public virtual CefBase { + public: + /// + // Method that will be executed on the target thread. + /// + /*--cef()--*/ + virtual void Execute() =0; +}; + +/// +// Class that asynchronously executes tasks on the associated thread. It is safe +// to call the methods of this class on any thread. +// +// CEF maintains multiple internal threads that are used for handling different +// types of tasks in different processes. The cef_thread_id_t definitions in +// cef_types.h list the common CEF threads. Task runners are also available for +// other CEF threads as appropriate (for example, V8 WebWorker threads). +/// +/*--cef(source=library)--*/ +class CefTaskRunner : public virtual CefBase { + public: + /// + // Returns the task runner for the current thread. Only CEF threads will have + // task runners. An empty reference will be returned if this method is called + // on an invalid thread. + /// + /*--cef()--*/ + static CefRefPtr GetForCurrentThread(); + + /// + // Returns the task runner for the specified CEF thread. + /// + /*--cef()--*/ + static CefRefPtr GetForThread(CefThreadId threadId); + + /// + // Returns true if this object is pointing to the same task runner as |that| + // object. + /// + /*--cef()--*/ + virtual bool IsSame(CefRefPtr that) =0; + + /// + // Returns true if this task runner belongs to the current thread. + /// + /*--cef()--*/ + virtual bool BelongsToCurrentThread() =0; + + /// + // Returns true if this task runner is for the specified CEF thread. + /// + /*--cef()--*/ + virtual bool BelongsToThread(CefThreadId threadId) =0; + + /// + // Post a task for execution on the thread associated with this task runner. + // Execution will occur asynchronously. + /// + /*--cef()--*/ + virtual bool PostTask(CefRefPtr task) =0; + + /// + // Post a task for delayed execution on the thread associated with this task + // runner. Execution will occur asynchronously. Delayed tasks are not + // supported on V8 WebWorker threads and will be executed without the + // specified delay. + /// + /*--cef()--*/ + virtual bool PostDelayedTask(CefRefPtr task, int64 delay_ms) =0; +}; + + +/// +// Returns true if called on the specified thread. Equivalent to using +// CefTaskRunner::GetForThread(threadId)->BelongsToCurrentThread(). +/// +/*--cef()--*/ +bool CefCurrentlyOn(CefThreadId threadId); + +/// +// Post a task for execution on the specified thread. Equivalent to +// using CefTaskRunner::GetForThread(threadId)->PostTask(task). +/// +/*--cef()--*/ +bool CefPostTask(CefThreadId threadId, CefRefPtr task); + +/// +// Post a task for delayed execution on the specified thread. Equivalent to +// using CefTaskRunner::GetForThread(threadId)->PostDelayedTask(task, delay_ms). +/// +/*--cef()--*/ +bool CefPostDelayedTask(CefThreadId threadId, CefRefPtr task, + int64 delay_ms); + + +#endif // CEF_INCLUDE_CEF_TASK_H_ diff --git a/dependencies64/cef/include/cef_trace.h b/dependencies64/cef/include/cef_trace.h new file mode 100644 index 000000000..5b977c6e5 --- /dev/null +++ b/dependencies64/cef/include/cef_trace.h @@ -0,0 +1,111 @@ +// Copyright (c) 2012 Marshall A. Greenblatt. Portons copyright (c) 2012 +// Google Inc. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// The contents of this file must follow a specific format in order to +// support the CEF translator tool. See the translator.README.txt file in the +// tools directory for more information. +// + +// See cef_trace_event.h for trace macros and additonal documentation. + +#ifndef CEF_INCLUDE_CEF_TRACE_H_ +#define CEF_INCLUDE_CEF_TRACE_H_ +#pragma once + +#include "include/cef_base.h" +#include "include/cef_callback.h" + +/// +// Implement this interface to receive notification when tracing has completed. +// The methods of this class will be called on the browser process UI thread. +/// +/*--cef(source=client)--*/ +class CefEndTracingCallback : public virtual CefBase { + public: + /// + // Called after all processes have sent their trace data. |tracing_file| is + // the path at which tracing data was written. The client is responsible for + // deleting |tracing_file|. + /// + /*--cef()--*/ + virtual void OnEndTracingComplete(const CefString& tracing_file) =0; +}; + + +/// +// Start tracing events on all processes. Tracing is initialized asynchronously +// and |callback| will be executed on the UI thread after initialization is +// complete. +// +// If CefBeginTracing was called previously, or if a CefEndTracingAsync call is +// pending, CefBeginTracing will fail and return false. +// +// |categories| is a comma-delimited list of category wildcards. A category can +// have an optional '-' prefix to make it an excluded category. Having both +// included and excluded categories in the same list is not supported. +// +// Example: "test_MyTest*" +// Example: "test_MyTest*,test_OtherStuff" +// Example: "-excluded_category1,-excluded_category2" +// +// This function must be called on the browser process UI thread. +/// +/*--cef(optional_param=categories,optional_param=callback)--*/ +bool CefBeginTracing(const CefString& categories, + CefRefPtr callback); + +/// +// Stop tracing events on all processes. +// +// This function will fail and return false if a previous call to +// CefEndTracingAsync is already pending or if CefBeginTracing was not called. +// +// |tracing_file| is the path at which tracing data will be written and +// |callback| is the callback that will be executed once all processes have +// sent their trace data. If |tracing_file| is empty a new temporary file path +// will be used. If |callback| is empty no trace data will be written. +// +// This function must be called on the browser process UI thread. +/// +/*--cef(optional_param=tracing_file,optional_param=callback)--*/ +bool CefEndTracing(const CefString& tracing_file, + CefRefPtr callback); + +/// +// Returns the current system trace time or, if none is defined, the current +// high-res time. Can be used by clients to synchronize with the time +// information in trace events. +/// +/*--cef()--*/ +int64 CefNowFromSystemTraceTime(); + +#endif // CEF_INCLUDE_CEF_TRACE_H_ diff --git a/dependencies64/cef/include/cef_urlrequest.h b/dependencies64/cef/include/cef_urlrequest.h new file mode 100644 index 000000000..5b58b6349 --- /dev/null +++ b/dependencies64/cef/include/cef_urlrequest.h @@ -0,0 +1,188 @@ +// Copyright (c) 2012 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// The contents of this file must follow a specific format in order to +// support the CEF translator tool. See the translator.README.txt file in the +// tools directory for more information. +// + +#ifndef CEF_INCLUDE_CEF_URLREQUEST_H_ +#define CEF_INCLUDE_CEF_URLREQUEST_H_ +#pragma once + +#include "include/cef_auth_callback.h" +#include "include/cef_base.h" +#include "include/cef_request.h" +#include "include/cef_request_context.h" +#include "include/cef_response.h" + +class CefURLRequestClient; + +/// +// Class used to make a URL request. URL requests are not associated with a +// browser instance so no CefClient callbacks will be executed. URL requests +// can be created on any valid CEF thread in either the browser or render +// process. Once created the methods of the URL request object must be accessed +// on the same thread that created it. +/// +/*--cef(source=library)--*/ +class CefURLRequest : public virtual CefBase { + public: + typedef cef_urlrequest_status_t Status; + typedef cef_errorcode_t ErrorCode; + + /// + // Create a new URL request. Only GET, POST, HEAD, DELETE and PUT request + // methods are supported. Multiple post data elements are not supported and + // elements of type PDE_TYPE_FILE are only supported for requests originating + // from the browser process. Requests originating from the render process will + // receive the same handling as requests originating from Web content -- if + // the response contains Content-Disposition or Mime-Type header values that + // would not normally be rendered then the response may receive special + // handling inside the browser (for example, via the file download code path + // instead of the URL request code path). The |request| object will be marked + // as read-only after calling this method. In the browser process if + // |request_context| is empty the global request context will be used. In the + // render process |request_context| must be empty and the context associated + // with the current renderer process' browser will be used. + /// + /*--cef(optional_param=request_context)--*/ + static CefRefPtr Create( + CefRefPtr request, + CefRefPtr client, + CefRefPtr request_context); + + /// + // Returns the request object used to create this URL request. The returned + // object is read-only and should not be modified. + /// + /*--cef()--*/ + virtual CefRefPtr GetRequest() =0; + + /// + // Returns the client. + /// + /*--cef()--*/ + virtual CefRefPtr GetClient() =0; + + /// + // Returns the request status. + /// + /*--cef(default_retval=UR_UNKNOWN)--*/ + virtual Status GetRequestStatus() =0; + + /// + // Returns the request error if status is UR_CANCELED or UR_FAILED, or 0 + // otherwise. + /// + /*--cef(default_retval=ERR_NONE)--*/ + virtual ErrorCode GetRequestError() =0; + + /// + // Returns the response, or NULL if no response information is available. + // Response information will only be available after the upload has completed. + // The returned object is read-only and should not be modified. + /// + /*--cef()--*/ + virtual CefRefPtr GetResponse() =0; + + /// + // Cancel the request. + /// + /*--cef()--*/ + virtual void Cancel() =0; +}; + +/// +// Interface that should be implemented by the CefURLRequest client. The +// methods of this class will be called on the same thread that created the +// request unless otherwise documented. +/// +/*--cef(source=client)--*/ +class CefURLRequestClient : public virtual CefBase { + public: + /// + // Notifies the client that the request has completed. Use the + // CefURLRequest::GetRequestStatus method to determine if the request was + // successful or not. + /// + /*--cef()--*/ + virtual void OnRequestComplete(CefRefPtr request) =0; + + /// + // Notifies the client of upload progress. |current| denotes the number of + // bytes sent so far and |total| is the total size of uploading data (or -1 if + // chunked upload is enabled). This method will only be called if the + // UR_FLAG_REPORT_UPLOAD_PROGRESS flag is set on the request. + /// + /*--cef()--*/ + virtual void OnUploadProgress(CefRefPtr request, + int64 current, + int64 total) =0; + + /// + // Notifies the client of download progress. |current| denotes the number of + // bytes received up to the call and |total| is the expected total size of the + // response (or -1 if not determined). + /// + /*--cef()--*/ + virtual void OnDownloadProgress(CefRefPtr request, + int64 current, + int64 total) =0; + + /// + // Called when some part of the response is read. |data| contains the current + // bytes received since the last call. This method will not be called if the + // UR_FLAG_NO_DOWNLOAD_DATA flag is set on the request. + /// + /*--cef()--*/ + virtual void OnDownloadData(CefRefPtr request, + const void* data, + size_t data_length) =0; + + /// + // Called on the IO thread when the browser needs credentials from the user. + // |isProxy| indicates whether the host is a proxy server. |host| contains the + // hostname and |port| contains the port number. Return true to continue the + // request and call CefAuthCallback::Continue() when the authentication + // information is available. Return false to cancel the request. This method + // will only be called for requests initiated from the browser process. + /// + /*--cef(optional_param=realm)--*/ + virtual bool GetAuthCredentials(bool isProxy, + const CefString& host, + int port, + const CefString& realm, + const CefString& scheme, + CefRefPtr callback) =0; +}; + +#endif // CEF_INCLUDE_CEF_URLREQUEST_H_ diff --git a/dependencies64/cef/include/cef_v8.h b/dependencies64/cef/include/cef_v8.h new file mode 100644 index 000000000..070d4391d --- /dev/null +++ b/dependencies64/cef/include/cef_v8.h @@ -0,0 +1,879 @@ +// Copyright (c) 2013 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// The contents of this file must follow a specific format in order to +// support the CEF translator tool. See the translator.README.txt file in the +// tools directory for more information. +// + + +#ifndef CEF_INCLUDE_CEF_V8_H_ +#define CEF_INCLUDE_CEF_V8_H_ +#pragma once + +#include "include/cef_base.h" +#include "include/cef_browser.h" +#include "include/cef_frame.h" +#include "include/cef_task.h" +#include + +class CefV8Exception; +class CefV8Handler; +class CefV8StackFrame; +class CefV8Value; + + +/// +// Register a new V8 extension with the specified JavaScript extension code and +// handler. Functions implemented by the handler are prototyped using the +// keyword 'native'. The calling of a native function is restricted to the scope +// in which the prototype of the native function is defined. This function may +// only be called on the render process main thread. +// +// Example JavaScript extension code: +//
+//   // create the 'example' global object if it doesn't already exist.
+//   if (!example)
+//     example = {};
+//   // create the 'example.test' global object if it doesn't already exist.
+//   if (!example.test)
+//     example.test = {};
+//   (function() {
+//     // Define the function 'example.test.myfunction'.
+//     example.test.myfunction = function() {
+//       // Call CefV8Handler::Execute() with the function name 'MyFunction'
+//       // and no arguments.
+//       native function MyFunction();
+//       return MyFunction();
+//     };
+//     // Define the getter function for parameter 'example.test.myparam'.
+//     example.test.__defineGetter__('myparam', function() {
+//       // Call CefV8Handler::Execute() with the function name 'GetMyParam'
+//       // and no arguments.
+//       native function GetMyParam();
+//       return GetMyParam();
+//     });
+//     // Define the setter function for parameter 'example.test.myparam'.
+//     example.test.__defineSetter__('myparam', function(b) {
+//       // Call CefV8Handler::Execute() with the function name 'SetMyParam'
+//       // and a single argument.
+//       native function SetMyParam();
+//       if(b) SetMyParam(b);
+//     });
+//
+//     // Extension definitions can also contain normal JavaScript variables
+//     // and functions.
+//     var myint = 0;
+//     example.test.increment = function() {
+//       myint += 1;
+//       return myint;
+//     };
+//   })();
+// 
+// Example usage in the page: +//
+//   // Call the function.
+//   example.test.myfunction();
+//   // Set the parameter.
+//   example.test.myparam = value;
+//   // Get the parameter.
+//   value = example.test.myparam;
+//   // Call another function.
+//   example.test.increment();
+// 
+/// +/*--cef(optional_param=handler)--*/ +bool CefRegisterExtension(const CefString& extension_name, + const CefString& javascript_code, + CefRefPtr handler); + + +/// +// Class representing a V8 context handle. V8 handles can only be accessed from +// the thread on which they are created. Valid threads for creating a V8 handle +// include the render process main thread (TID_RENDERER) and WebWorker threads. +// A task runner for posting tasks on the associated thread can be retrieved via +// the CefV8Context::GetTaskRunner() method. +/// +/*--cef(source=library)--*/ +class CefV8Context : public virtual CefBase { + public: + /// + // Returns the current (top) context object in the V8 context stack. + /// + /*--cef()--*/ + static CefRefPtr GetCurrentContext(); + + /// + // Returns the entered (bottom) context object in the V8 context stack. + /// + /*--cef()--*/ + static CefRefPtr GetEnteredContext(); + + /// + // Returns true if V8 is currently inside a context. + /// + /*--cef()--*/ + static bool InContext(); + + /// + // Returns the task runner associated with this context. V8 handles can only + // be accessed from the thread on which they are created. This method can be + // called on any render process thread. + /// + /*--cef()--*/ + virtual CefRefPtr GetTaskRunner() =0; + + /// + // Returns true if the underlying handle is valid and it can be accessed on + // the current thread. Do not call any other methods if this method returns + // false. + /// + /*--cef()--*/ + virtual bool IsValid() =0; + + /// + // Returns the browser for this context. This method will return an empty + // reference for WebWorker contexts. + /// + /*--cef()--*/ + virtual CefRefPtr GetBrowser() =0; + + /// + // Returns the frame for this context. This method will return an empty + // reference for WebWorker contexts. + /// + /*--cef()--*/ + virtual CefRefPtr GetFrame() =0; + + /// + // Returns the global object for this context. The context must be entered + // before calling this method. + /// + /*--cef()--*/ + virtual CefRefPtr GetGlobal() =0; + + /// + // Enter this context. A context must be explicitly entered before creating a + // V8 Object, Array, Function or Date asynchronously. Exit() must be called + // the same number of times as Enter() before releasing this context. V8 + // objects belong to the context in which they are created. Returns true if + // the scope was entered successfully. + /// + /*--cef()--*/ + virtual bool Enter() =0; + + /// + // Exit this context. Call this method only after calling Enter(). Returns + // true if the scope was exited successfully. + /// + /*--cef()--*/ + virtual bool Exit() =0; + + /// + // Returns true if this object is pointing to the same handle as |that| + // object. + /// + /*--cef()--*/ + virtual bool IsSame(CefRefPtr that) =0; + + /// + // Evaluates the specified JavaScript code using this context's global object. + // On success |retval| will be set to the return value, if any, and the + // function will return true. On failure |exception| will be set to the + // exception, if any, and the function will return false. + /// + /*--cef()--*/ + virtual bool Eval(const CefString& code, + CefRefPtr& retval, + CefRefPtr& exception) =0; +}; + + +typedef std::vector > CefV8ValueList; + +/// +// Interface that should be implemented to handle V8 function calls. The methods +// of this class will be called on the thread associated with the V8 function. +/// +/*--cef(source=client)--*/ +class CefV8Handler : public virtual CefBase { + public: + /// + // Handle execution of the function identified by |name|. |object| is the + // receiver ('this' object) of the function. |arguments| is the list of + // arguments passed to the function. If execution succeeds set |retval| to the + // function return value. If execution fails set |exception| to the exception + // that will be thrown. Return true if execution was handled. + /// + /*--cef()--*/ + virtual bool Execute(const CefString& name, + CefRefPtr object, + const CefV8ValueList& arguments, + CefRefPtr& retval, + CefString& exception) =0; +}; + +/// +// Interface that should be implemented to handle V8 accessor calls. Accessor +// identifiers are registered by calling CefV8Value::SetValue(). The methods +// of this class will be called on the thread associated with the V8 accessor. +/// +/*--cef(source=client)--*/ +class CefV8Accessor : public virtual CefBase { + public: + /// + // Handle retrieval the accessor value identified by |name|. |object| is the + // receiver ('this' object) of the accessor. If retrieval succeeds set + // |retval| to the return value. If retrieval fails set |exception| to the + // exception that will be thrown. Return true if accessor retrieval was + // handled. + /// + /*--cef()--*/ + virtual bool Get(const CefString& name, + const CefRefPtr object, + CefRefPtr& retval, + CefString& exception) =0; + + /// + // Handle assignment of the accessor value identified by |name|. |object| is + // the receiver ('this' object) of the accessor. |value| is the new value + // being assigned to the accessor. If assignment fails set |exception| to the + // exception that will be thrown. Return true if accessor assignment was + // handled. + /// + /*--cef()--*/ + virtual bool Set(const CefString& name, + const CefRefPtr object, + const CefRefPtr value, + CefString& exception) =0; +}; + +/// +// Class representing a V8 exception. The methods of this class may be called on +// any render process thread. +/// +/*--cef(source=library)--*/ +class CefV8Exception : public virtual CefBase { + public: + /// + // Returns the exception message. + /// + /*--cef()--*/ + virtual CefString GetMessage() =0; + + /// + // Returns the line of source code that the exception occurred within. + /// + /*--cef()--*/ + virtual CefString GetSourceLine() =0; + + /// + // Returns the resource name for the script from where the function causing + // the error originates. + /// + /*--cef()--*/ + virtual CefString GetScriptResourceName() =0; + + /// + // Returns the 1-based number of the line where the error occurred or 0 if the + // line number is unknown. + /// + /*--cef()--*/ + virtual int GetLineNumber() =0; + + /// + // Returns the index within the script of the first character where the error + // occurred. + /// + /*--cef()--*/ + virtual int GetStartPosition() =0; + + /// + // Returns the index within the script of the last character where the error + // occurred. + /// + /*--cef()--*/ + virtual int GetEndPosition() =0; + + /// + // Returns the index within the line of the first character where the error + // occurred. + /// + /*--cef()--*/ + virtual int GetStartColumn() =0; + + /// + // Returns the index within the line of the last character where the error + // occurred. + /// + /*--cef()--*/ + virtual int GetEndColumn() =0; +}; + +/// +// Class representing a V8 value handle. V8 handles can only be accessed from +// the thread on which they are created. Valid threads for creating a V8 handle +// include the render process main thread (TID_RENDERER) and WebWorker threads. +// A task runner for posting tasks on the associated thread can be retrieved via +// the CefV8Context::GetTaskRunner() method. +/// +/*--cef(source=library)--*/ +class CefV8Value : public virtual CefBase { + public: + typedef cef_v8_accesscontrol_t AccessControl; + typedef cef_v8_propertyattribute_t PropertyAttribute; + + /// + // Create a new CefV8Value object of type undefined. + /// + /*--cef()--*/ + static CefRefPtr CreateUndefined(); + + /// + // Create a new CefV8Value object of type null. + /// + /*--cef()--*/ + static CefRefPtr CreateNull(); + + /// + // Create a new CefV8Value object of type bool. + /// + /*--cef()--*/ + static CefRefPtr CreateBool(bool value); + + /// + // Create a new CefV8Value object of type int. + /// + /*--cef()--*/ + static CefRefPtr CreateInt(int32 value); + + /// + // Create a new CefV8Value object of type unsigned int. + /// + /*--cef()--*/ + static CefRefPtr CreateUInt(uint32 value); + + /// + // Create a new CefV8Value object of type double. + /// + /*--cef()--*/ + static CefRefPtr CreateDouble(double value); + + /// + // Create a new CefV8Value object of type Date. This method should only be + // called from within the scope of a CefRenderProcessHandler, CefV8Handler or + // CefV8Accessor callback, or in combination with calling Enter() and Exit() + // on a stored CefV8Context reference. + /// + /*--cef()--*/ + static CefRefPtr CreateDate(const CefTime& date); + + /// + // Create a new CefV8Value object of type string. + /// + /*--cef(optional_param=value)--*/ + static CefRefPtr CreateString(const CefString& value); + + /// + // Create a new CefV8Value object of type object with optional accessor. This + // method should only be called from within the scope of a + // CefRenderProcessHandler, CefV8Handler or CefV8Accessor callback, or in + // combination with calling Enter() and Exit() on a stored CefV8Context + // reference. + /// + /*--cef(optional_param=accessor)--*/ + static CefRefPtr CreateObject(CefRefPtr accessor); + + /// + // Create a new CefV8Value object of type array with the specified |length|. + // If |length| is negative the returned array will have length 0. This method + // should only be called from within the scope of a CefRenderProcessHandler, + // CefV8Handler or CefV8Accessor callback, or in combination with calling + // Enter() and Exit() on a stored CefV8Context reference. + /// + /*--cef()--*/ + static CefRefPtr CreateArray(int length); + + /// + // Create a new CefV8Value object of type function. This method should only be + // called from within the scope of a CefRenderProcessHandler, CefV8Handler or + // CefV8Accessor callback, or in combination with calling Enter() and Exit() + // on a stored CefV8Context reference. + /// + /*--cef()--*/ + static CefRefPtr CreateFunction(const CefString& name, + CefRefPtr handler); + + /// + // Returns true if the underlying handle is valid and it can be accessed on + // the current thread. Do not call any other methods if this method returns + // false. + /// + /*--cef()--*/ + virtual bool IsValid() =0; + + /// + // True if the value type is undefined. + /// + /*--cef()--*/ + virtual bool IsUndefined() =0; + + /// + // True if the value type is null. + /// + /*--cef()--*/ + virtual bool IsNull() =0; + + /// + // True if the value type is bool. + /// + /*--cef()--*/ + virtual bool IsBool() =0; + + /// + // True if the value type is int. + /// + /*--cef()--*/ + virtual bool IsInt() =0; + + /// + // True if the value type is unsigned int. + /// + /*--cef()--*/ + virtual bool IsUInt() =0; + + /// + // True if the value type is double. + /// + /*--cef()--*/ + virtual bool IsDouble() =0; + + /// + // True if the value type is Date. + /// + /*--cef()--*/ + virtual bool IsDate() =0; + + /// + // True if the value type is string. + /// + /*--cef()--*/ + virtual bool IsString() =0; + + /// + // True if the value type is object. + /// + /*--cef()--*/ + virtual bool IsObject() =0; + + /// + // True if the value type is array. + /// + /*--cef()--*/ + virtual bool IsArray() =0; + + /// + // True if the value type is function. + /// + /*--cef()--*/ + virtual bool IsFunction() =0; + + /// + // Returns true if this object is pointing to the same handle as |that| + // object. + /// + /*--cef()--*/ + virtual bool IsSame(CefRefPtr that) =0; + + /// + // Return a bool value. The underlying data will be converted to if + // necessary. + /// + /*--cef()--*/ + virtual bool GetBoolValue() =0; + + /// + // Return an int value. The underlying data will be converted to if + // necessary. + /// + /*--cef()--*/ + virtual int32 GetIntValue() =0; + + /// + // Return an unisgned int value. The underlying data will be converted to if + // necessary. + /// + /*--cef()--*/ + virtual uint32 GetUIntValue() =0; + + /// + // Return a double value. The underlying data will be converted to if + // necessary. + /// + /*--cef()--*/ + virtual double GetDoubleValue() =0; + + /// + // Return a Date value. The underlying data will be converted to if + // necessary. + /// + /*--cef()--*/ + virtual CefTime GetDateValue() =0; + + /// + // Return a string value. The underlying data will be converted to if + // necessary. + /// + /*--cef()--*/ + virtual CefString GetStringValue() =0; + + + // OBJECT METHODS - These methods are only available on objects. Arrays and + // functions are also objects. String- and integer-based keys can be used + // interchangably with the framework converting between them as necessary. + + /// + // Returns true if this is a user created object. + /// + /*--cef()--*/ + virtual bool IsUserCreated() =0; + + /// + // Returns true if the last method call resulted in an exception. This + // attribute exists only in the scope of the current CEF value object. + /// + /*--cef()--*/ + virtual bool HasException() =0; + + /// + // Returns the exception resulting from the last method call. This attribute + // exists only in the scope of the current CEF value object. + /// + /*--cef()--*/ + virtual CefRefPtr GetException() =0; + + /// + // Clears the last exception and returns true on success. + /// + /*--cef()--*/ + virtual bool ClearException() =0; + + /// + // Returns true if this object will re-throw future exceptions. This attribute + // exists only in the scope of the current CEF value object. + /// + /*--cef()--*/ + virtual bool WillRethrowExceptions() =0; + + /// + // Set whether this object will re-throw future exceptions. By default + // exceptions are not re-thrown. If a exception is re-thrown the current + // context should not be accessed again until after the exception has been + // caught and not re-thrown. Returns true on success. This attribute exists + // only in the scope of the current CEF value object. + /// + /*--cef()--*/ + virtual bool SetRethrowExceptions(bool rethrow) =0; + + /// + // Returns true if the object has a value with the specified identifier. + /// + /*--cef(capi_name=has_value_bykey,optional_param=key)--*/ + virtual bool HasValue(const CefString& key) =0; + + /// + // Returns true if the object has a value with the specified identifier. + /// + /*--cef(capi_name=has_value_byindex,index_param=index)--*/ + virtual bool HasValue(int index) =0; + + /// + // Deletes the value with the specified identifier and returns true on + // success. Returns false if this method is called incorrectly or an exception + // is thrown. For read-only and don't-delete values this method will return + // true even though deletion failed. + /// + /*--cef(capi_name=delete_value_bykey,optional_param=key)--*/ + virtual bool DeleteValue(const CefString& key) =0; + + /// + // Deletes the value with the specified identifier and returns true on + // success. Returns false if this method is called incorrectly, deletion fails + // or an exception is thrown. For read-only and don't-delete values this + // method will return true even though deletion failed. + /// + /*--cef(capi_name=delete_value_byindex,index_param=index)--*/ + virtual bool DeleteValue(int index) =0; + + /// + // Returns the value with the specified identifier on success. Returns NULL + // if this method is called incorrectly or an exception is thrown. + /// + /*--cef(capi_name=get_value_bykey,optional_param=key)--*/ + virtual CefRefPtr GetValue(const CefString& key) =0; + + /// + // Returns the value with the specified identifier on success. Returns NULL + // if this method is called incorrectly or an exception is thrown. + /// + /*--cef(capi_name=get_value_byindex,index_param=index)--*/ + virtual CefRefPtr GetValue(int index) =0; + + /// + // Associates a value with the specified identifier and returns true on + // success. Returns false if this method is called incorrectly or an exception + // is thrown. For read-only values this method will return true even though + // assignment failed. + /// + /*--cef(capi_name=set_value_bykey,optional_param=key)--*/ + virtual bool SetValue(const CefString& key, CefRefPtr value, + PropertyAttribute attribute) =0; + + /// + // Associates a value with the specified identifier and returns true on + // success. Returns false if this method is called incorrectly or an exception + // is thrown. For read-only values this method will return true even though + // assignment failed. + /// + /*--cef(capi_name=set_value_byindex,index_param=index)--*/ + virtual bool SetValue(int index, CefRefPtr value) =0; + + /// + // Registers an identifier and returns true on success. Access to the + // identifier will be forwarded to the CefV8Accessor instance passed to + // CefV8Value::CreateObject(). Returns false if this method is called + // incorrectly or an exception is thrown. For read-only values this method + // will return true even though assignment failed. + /// + /*--cef(capi_name=set_value_byaccessor,optional_param=key)--*/ + virtual bool SetValue(const CefString& key, AccessControl settings, + PropertyAttribute attribute) =0; + + /// + // Read the keys for the object's values into the specified vector. Integer- + // based keys will also be returned as strings. + /// + /*--cef()--*/ + virtual bool GetKeys(std::vector& keys) =0; + + /// + // Sets the user data for this object and returns true on success. Returns + // false if this method is called incorrectly. This method can only be called + // on user created objects. + /// + /*--cef(optional_param=user_data)--*/ + virtual bool SetUserData(CefRefPtr user_data) =0; + + /// + // Returns the user data, if any, assigned to this object. + /// + /*--cef()--*/ + virtual CefRefPtr GetUserData() =0; + + /// + // Returns the amount of externally allocated memory registered for the + // object. + /// + /*--cef()--*/ + virtual int GetExternallyAllocatedMemory() =0; + + /// + // Adjusts the amount of registered external memory for the object. Used to + // give V8 an indication of the amount of externally allocated memory that is + // kept alive by JavaScript objects. V8 uses this information to decide when + // to perform global garbage collection. Each CefV8Value tracks the amount of + // external memory associated with it and automatically decreases the global + // total by the appropriate amount on its destruction. |change_in_bytes| + // specifies the number of bytes to adjust by. This method returns the number + // of bytes associated with the object after the adjustment. This method can + // only be called on user created objects. + /// + /*--cef()--*/ + virtual int AdjustExternallyAllocatedMemory(int change_in_bytes) =0; + + + // ARRAY METHODS - These methods are only available on arrays. + + /// + // Returns the number of elements in the array. + /// + /*--cef()--*/ + virtual int GetArrayLength() =0; + + + // FUNCTION METHODS - These methods are only available on functions. + + /// + // Returns the function name. + /// + /*--cef()--*/ + virtual CefString GetFunctionName() =0; + + /// + // Returns the function handler or NULL if not a CEF-created function. + /// + /*--cef()--*/ + virtual CefRefPtr GetFunctionHandler() =0; + + /// + // Execute the function using the current V8 context. This method should only + // be called from within the scope of a CefV8Handler or CefV8Accessor + // callback, or in combination with calling Enter() and Exit() on a stored + // CefV8Context reference. |object| is the receiver ('this' object) of the + // function. If |object| is empty the current context's global object will be + // used. |arguments| is the list of arguments that will be passed to the + // function. Returns the function return value on success. Returns NULL if + // this method is called incorrectly or an exception is thrown. + /// + /*--cef(optional_param=object)--*/ + virtual CefRefPtr ExecuteFunction( + CefRefPtr object, + const CefV8ValueList& arguments) =0; + + /// + // Execute the function using the specified V8 context. |object| is the + // receiver ('this' object) of the function. If |object| is empty the + // specified context's global object will be used. |arguments| is the list of + // arguments that will be passed to the function. Returns the function return + // value on success. Returns NULL if this method is called incorrectly or an + // exception is thrown. + /// + /*--cef(optional_param=object)--*/ + virtual CefRefPtr ExecuteFunctionWithContext( + CefRefPtr context, + CefRefPtr object, + const CefV8ValueList& arguments) =0; +}; + +/// +// Class representing a V8 stack trace handle. V8 handles can only be accessed +// from the thread on which they are created. Valid threads for creating a V8 +// handle include the render process main thread (TID_RENDERER) and WebWorker +// threads. A task runner for posting tasks on the associated thread can be +// retrieved via the CefV8Context::GetTaskRunner() method. +/// +/*--cef(source=library)--*/ +class CefV8StackTrace : public virtual CefBase { + public: + /// + // Returns the stack trace for the currently active context. |frame_limit| is + // the maximum number of frames that will be captured. + /// + /*--cef()--*/ + static CefRefPtr GetCurrent(int frame_limit); + + /// + // Returns true if the underlying handle is valid and it can be accessed on + // the current thread. Do not call any other methods if this method returns + // false. + /// + /*--cef()--*/ + virtual bool IsValid() =0; + + /// + // Returns the number of stack frames. + /// + /*--cef()--*/ + virtual int GetFrameCount() =0; + + /// + // Returns the stack frame at the specified 0-based index. + /// + /*--cef()--*/ + virtual CefRefPtr GetFrame(int index) =0; +}; + +/// +// Class representing a V8 stack frame handle. V8 handles can only be accessed +// from the thread on which they are created. Valid threads for creating a V8 +// handle include the render process main thread (TID_RENDERER) and WebWorker +// threads. A task runner for posting tasks on the associated thread can be +// retrieved via the CefV8Context::GetTaskRunner() method. +/// +/*--cef(source=library)--*/ +class CefV8StackFrame : public virtual CefBase { + public: + /// + // Returns true if the underlying handle is valid and it can be accessed on + // the current thread. Do not call any other methods if this method returns + // false. + /// + /*--cef()--*/ + virtual bool IsValid() =0; + + /// + // Returns the name of the resource script that contains the function. + /// + /*--cef()--*/ + virtual CefString GetScriptName() =0; + + /// + // Returns the name of the resource script that contains the function or the + // sourceURL value if the script name is undefined and its source ends with + // a "//@ sourceURL=..." string. + /// + /*--cef()--*/ + virtual CefString GetScriptNameOrSourceURL() =0; + + /// + // Returns the name of the function. + /// + /*--cef()--*/ + virtual CefString GetFunctionName() =0; + + /// + // Returns the 1-based line number for the function call or 0 if unknown. + /// + /*--cef()--*/ + virtual int GetLineNumber() =0; + + /// + // Returns the 1-based column offset on the line for the function call or 0 if + // unknown. + /// + /*--cef()--*/ + virtual int GetColumn() =0; + + /// + // Returns true if the function was compiled using eval(). + /// + /*--cef()--*/ + virtual bool IsEval() =0; + + /// + // Returns true if the function was called as a constructor via "new". + /// + /*--cef()--*/ + virtual bool IsConstructor() =0; +}; + +#endif // CEF_INCLUDE_CEF_V8_H_ diff --git a/dependencies64/cef/include/cef_values.h b/dependencies64/cef/include/cef_values.h new file mode 100644 index 000000000..6ab6adffc --- /dev/null +++ b/dependencies64/cef/include/cef_values.h @@ -0,0 +1,752 @@ +// Copyright (c) 2012 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// The contents of this file must follow a specific format in order to +// support the CEF translator tool. See the translator.README.txt file in the +// tools directory for more information. +// + +#ifndef CEF_INCLUDE_CEF_VALUES_H_ +#define CEF_INCLUDE_CEF_VALUES_H_ +#pragma once + +#include +#include "include/cef_base.h" + +class CefBinaryValue; +class CefDictionaryValue; +class CefListValue; + +typedef cef_value_type_t CefValueType; + +/// +// Class that wraps other data value types. Complex types (binary, dictionary +// and list) will be referenced but not owned by this object. Can be used on any +// process and thread. +/// +/*--cef(source=library)--*/ +class CefValue : public virtual CefBase { + public: + /// + // Creates a new object. + /// + /*--cef()--*/ + static CefRefPtr Create(); + + /// + // Returns true if the underlying data is valid. This will always be true for + // simple types. For complex types (binary, dictionary and list) the + // underlying data may become invalid if owned by another object (e.g. list or + // dictionary) and that other object is then modified or destroyed. This value + // object can be re-used by calling Set*() even if the underlying data is + // invalid. + /// + /*--cef()--*/ + virtual bool IsValid() =0; + + /// + // Returns true if the underlying data is owned by another object. + /// + /*--cef()--*/ + virtual bool IsOwned() =0; + + /// + // Returns true if the underlying data is read-only. Some APIs may expose + // read-only objects. + /// + /*--cef()--*/ + virtual bool IsReadOnly() =0; + + /// + // Returns true if this object and |that| object have the same underlying + // data. If true modifications to this object will also affect |that| object + // and vice-versa. + /// + /*--cef()--*/ + virtual bool IsSame(CefRefPtr that) =0; + + /// + // Returns true if this object and |that| object have an equivalent underlying + // value but are not necessarily the same object. + /// + /*--cef()--*/ + virtual bool IsEqual(CefRefPtr that) =0; + + /// + // Returns a copy of this object. The underlying data will also be copied. + /// + /*--cef()--*/ + virtual CefRefPtr Copy() =0; + + /// + // Returns the underlying value type. + /// + /*--cef(default_retval=VTYPE_INVALID)--*/ + virtual CefValueType GetType() =0; + + /// + // Returns the underlying value as type bool. + /// + /*--cef()--*/ + virtual bool GetBool() =0; + + /// + // Returns the underlying value as type int. + /// + /*--cef()--*/ + virtual int GetInt() =0; + + /// + // Returns the underlying value as type double. + /// + /*--cef()--*/ + virtual double GetDouble() =0; + + /// + // Returns the underlying value as type string. + /// + /*--cef()--*/ + virtual CefString GetString() =0; + + /// + // Returns the underlying value as type binary. The returned reference may + // become invalid if the value is owned by another object or if ownership is + // transferred to another object in the future. To maintain a reference to + // the value after assigning ownership to a dictionary or list pass this + // object to the SetValue() method instead of passing the returned reference + // to SetBinary(). + /// + /*--cef()--*/ + virtual CefRefPtr GetBinary() =0; + + /// + // Returns the underlying value as type dictionary. The returned reference may + // become invalid if the value is owned by another object or if ownership is + // transferred to another object in the future. To maintain a reference to + // the value after assigning ownership to a dictionary or list pass this + // object to the SetValue() method instead of passing the returned reference + // to SetDictionary(). + /// + /*--cef()--*/ + virtual CefRefPtr GetDictionary() =0; + + /// + // Returns the underlying value as type list. The returned reference may + // become invalid if the value is owned by another object or if ownership is + // transferred to another object in the future. To maintain a reference to + // the value after assigning ownership to a dictionary or list pass this + // object to the SetValue() method instead of passing the returned reference + // to SetList(). + /// + /*--cef()--*/ + virtual CefRefPtr GetList() =0; + + /// + // Sets the underlying value as type null. Returns true if the value was set + // successfully. + /// + /*--cef()--*/ + virtual bool SetNull() =0; + + /// + // Sets the underlying value as type bool. Returns true if the value was set + // successfully. + /// + /*--cef()--*/ + virtual bool SetBool(bool value) =0; + + /// + // Sets the underlying value as type int. Returns true if the value was set + // successfully. + /// + /*--cef()--*/ + virtual bool SetInt(int value) =0; + + /// + // Sets the underlying value as type double. Returns true if the value was set + // successfully. + /// + /*--cef()--*/ + virtual bool SetDouble(double value) =0; + + /// + // Sets the underlying value as type string. Returns true if the value was set + // successfully. + /// + /*--cef(optional_param=value)--*/ + virtual bool SetString(const CefString& value) =0; + + /// + // Sets the underlying value as type binary. Returns true if the value was set + // successfully. This object keeps a reference to |value| and ownership of the + // underlying data remains unchanged. + /// + /*--cef()--*/ + virtual bool SetBinary(CefRefPtr value) =0; + + /// + // Sets the underlying value as type dict. Returns true if the value was set + // successfully. This object keeps a reference to |value| and ownership of the + // underlying data remains unchanged. + /// + /*--cef()--*/ + virtual bool SetDictionary(CefRefPtr value) =0; + + /// + // Sets the underlying value as type list. Returns true if the value was set + // successfully. This object keeps a reference to |value| and ownership of the + // underlying data remains unchanged. + /// + /*--cef()--*/ + virtual bool SetList(CefRefPtr value) =0; +}; + + +/// +// Class representing a binary value. Can be used on any process and thread. +/// +/*--cef(source=library)--*/ +class CefBinaryValue : public virtual CefBase { + public: + /// + // Creates a new object that is not owned by any other object. The specified + // |data| will be copied. + /// + /*--cef()--*/ + static CefRefPtr Create(const void* data, + size_t data_size); + + /// + // Returns true if this object is valid. This object may become invalid if + // the underlying data is owned by another object (e.g. list or dictionary) + // and that other object is then modified or destroyed. Do not call any other + // methods if this method returns false. + /// + /*--cef()--*/ + virtual bool IsValid() =0; + + /// + // Returns true if this object is currently owned by another object. + /// + /*--cef()--*/ + virtual bool IsOwned() =0; + + /// + // Returns true if this object and |that| object have the same underlying + // data. + /// + /*--cef()--*/ + virtual bool IsSame(CefRefPtr that) =0; + + /// + // Returns true if this object and |that| object have an equivalent underlying + // value but are not necessarily the same object. + /// + /*--cef()--*/ + virtual bool IsEqual(CefRefPtr that) =0; + + /// + // Returns a copy of this object. The data in this object will also be copied. + /// + /*--cef()--*/ + virtual CefRefPtr Copy() =0; + + /// + // Returns the data size. + /// + /*--cef()--*/ + virtual size_t GetSize() =0; + + /// + // Read up to |buffer_size| number of bytes into |buffer|. Reading begins at + // the specified byte |data_offset|. Returns the number of bytes read. + /// + /*--cef()--*/ + virtual size_t GetData(void* buffer, + size_t buffer_size, + size_t data_offset) =0; +}; + + +/// +// Class representing a dictionary value. Can be used on any process and thread. +/// +/*--cef(source=library)--*/ +class CefDictionaryValue : public virtual CefBase { + public: + typedef std::vector KeyList; + + /// + // Creates a new object that is not owned by any other object. + /// + /*--cef()--*/ + static CefRefPtr Create(); + + /// + // Returns true if this object is valid. This object may become invalid if + // the underlying data is owned by another object (e.g. list or dictionary) + // and that other object is then modified or destroyed. Do not call any other + // methods if this method returns false. + /// + /*--cef()--*/ + virtual bool IsValid() =0; + + /// + // Returns true if this object is currently owned by another object. + /// + /*--cef()--*/ + virtual bool IsOwned() =0; + + /// + // Returns true if the values of this object are read-only. Some APIs may + // expose read-only objects. + /// + /*--cef()--*/ + virtual bool IsReadOnly() =0; + + /// + // Returns true if this object and |that| object have the same underlying + // data. If true modifications to this object will also affect |that| object + // and vice-versa. + /// + /*--cef()--*/ + virtual bool IsSame(CefRefPtr that) =0; + + /// + // Returns true if this object and |that| object have an equivalent underlying + // value but are not necessarily the same object. + /// + /*--cef()--*/ + virtual bool IsEqual(CefRefPtr that) =0; + + /// + // Returns a writable copy of this object. If |exclude_empty_children| is true + // any empty dictionaries or lists will be excluded from the copy. + /// + /*--cef()--*/ + virtual CefRefPtr Copy(bool exclude_empty_children) =0; + + /// + // Returns the number of values. + /// + /*--cef()--*/ + virtual size_t GetSize() =0; + + /// + // Removes all values. Returns true on success. + /// + /*--cef()--*/ + virtual bool Clear() =0; + + /// + // Returns true if the current dictionary has a value for the given key. + /// + /*--cef()--*/ + virtual bool HasKey(const CefString& key) =0; + + /// + // Reads all keys for this dictionary into the specified vector. + /// + /*--cef()--*/ + virtual bool GetKeys(KeyList& keys) =0; + + /// + // Removes the value at the specified key. Returns true is the value was + // removed successfully. + /// + /*--cef()--*/ + virtual bool Remove(const CefString& key) =0; + + /// + // Returns the value type for the specified key. + /// + /*--cef(default_retval=VTYPE_INVALID)--*/ + virtual CefValueType GetType(const CefString& key) =0; + + /// + // Returns the value at the specified key. For simple types the returned + // value will copy existing data and modifications to the value will not + // modify this object. For complex types (binary, dictionary and list) the + // returned value will reference existing data and modifications to the value + // will modify this object. + /// + /*--cef()--*/ + virtual CefRefPtr GetValue(const CefString& key) =0; + + /// + // Returns the value at the specified key as type bool. + /// + /*--cef()--*/ + virtual bool GetBool(const CefString& key) =0; + + /// + // Returns the value at the specified key as type int. + /// + /*--cef()--*/ + virtual int GetInt(const CefString& key) =0; + + /// + // Returns the value at the specified key as type double. + /// + /*--cef()--*/ + virtual double GetDouble(const CefString& key) =0; + + /// + // Returns the value at the specified key as type string. + /// + /*--cef()--*/ + virtual CefString GetString(const CefString& key) =0; + + /// + // Returns the value at the specified key as type binary. The returned + // value will reference existing data. + /// + /*--cef()--*/ + virtual CefRefPtr GetBinary(const CefString& key) =0; + + /// + // Returns the value at the specified key as type dictionary. The returned + // value will reference existing data and modifications to the value will + // modify this object. + /// + /*--cef()--*/ + virtual CefRefPtr GetDictionary(const CefString& key) =0; + + /// + // Returns the value at the specified key as type list. The returned value + // will reference existing data and modifications to the value will modify + // this object. + /// + /*--cef()--*/ + virtual CefRefPtr GetList(const CefString& key) =0; + + /// + // Sets the value at the specified key. Returns true if the value was set + // successfully. If |value| represents simple data then the underlying data + // will be copied and modifications to |value| will not modify this object. If + // |value| represents complex data (binary, dictionary or list) then the + // underlying data will be referenced and modifications to |value| will modify + // this object. + /// + /*--cef()--*/ + virtual bool SetValue(const CefString& key, CefRefPtr value) =0; + + /// + // Sets the value at the specified key as type null. Returns true if the + // value was set successfully. + /// + /*--cef()--*/ + virtual bool SetNull(const CefString& key) =0; + + /// + // Sets the value at the specified key as type bool. Returns true if the + // value was set successfully. + /// + /*--cef()--*/ + virtual bool SetBool(const CefString& key, bool value) =0; + + /// + // Sets the value at the specified key as type int. Returns true if the + // value was set successfully. + /// + /*--cef()--*/ + virtual bool SetInt(const CefString& key, int value) =0; + + /// + // Sets the value at the specified key as type double. Returns true if the + // value was set successfully. + /// + /*--cef()--*/ + virtual bool SetDouble(const CefString& key, double value) =0; + + /// + // Sets the value at the specified key as type string. Returns true if the + // value was set successfully. + /// + /*--cef(optional_param=value)--*/ + virtual bool SetString(const CefString& key, const CefString& value) =0; + + /// + // Sets the value at the specified key as type binary. Returns true if the + // value was set successfully. If |value| is currently owned by another object + // then the value will be copied and the |value| reference will not change. + // Otherwise, ownership will be transferred to this object and the |value| + // reference will be invalidated. + /// + /*--cef()--*/ + virtual bool SetBinary(const CefString& key, + CefRefPtr value) =0; + + /// + // Sets the value at the specified key as type dict. Returns true if the + // value was set successfully. If |value| is currently owned by another object + // then the value will be copied and the |value| reference will not change. + // Otherwise, ownership will be transferred to this object and the |value| + // reference will be invalidated. + /// + /*--cef()--*/ + virtual bool SetDictionary(const CefString& key, + CefRefPtr value) =0; + + /// + // Sets the value at the specified key as type list. Returns true if the + // value was set successfully. If |value| is currently owned by another object + // then the value will be copied and the |value| reference will not change. + // Otherwise, ownership will be transferred to this object and the |value| + // reference will be invalidated. + /// + /*--cef()--*/ + virtual bool SetList(const CefString& key, + CefRefPtr value) =0; +}; + + +/// +// Class representing a list value. Can be used on any process and thread. +/// +/*--cef(source=library)--*/ +class CefListValue : public virtual CefBase { + public: + /// + // Creates a new object that is not owned by any other object. + /// + /*--cef()--*/ + static CefRefPtr Create(); + + /// + // Returns true if this object is valid. This object may become invalid if + // the underlying data is owned by another object (e.g. list or dictionary) + // and that other object is then modified or destroyed. Do not call any other + // methods if this method returns false. + /// + /*--cef()--*/ + virtual bool IsValid() =0; + + /// + // Returns true if this object is currently owned by another object. + /// + /*--cef()--*/ + virtual bool IsOwned() =0; + + /// + // Returns true if the values of this object are read-only. Some APIs may + // expose read-only objects. + /// + /*--cef()--*/ + virtual bool IsReadOnly() =0; + + /// + // Returns true if this object and |that| object have the same underlying + // data. If true modifications to this object will also affect |that| object + // and vice-versa. + /// + /*--cef()--*/ + virtual bool IsSame(CefRefPtr that) =0; + + /// + // Returns true if this object and |that| object have an equivalent underlying + // value but are not necessarily the same object. + /// + /*--cef()--*/ + virtual bool IsEqual(CefRefPtr that) =0; + + /// + // Returns a writable copy of this object. + /// + /*--cef()--*/ + virtual CefRefPtr Copy() =0; + + /// + // Sets the number of values. If the number of values is expanded all + // new value slots will default to type null. Returns true on success. + /// + /*--cef()--*/ + virtual bool SetSize(size_t size) =0; + + /// + // Returns the number of values. + /// + /*--cef()--*/ + virtual size_t GetSize() =0; + + /// + // Removes all values. Returns true on success. + /// + /*--cef()--*/ + virtual bool Clear() =0; + + /// + // Removes the value at the specified index. + /// + /*--cef(index_param=index)--*/ + virtual bool Remove(int index) =0; + + /// + // Returns the value type at the specified index. + /// + /*--cef(default_retval=VTYPE_INVALID,index_param=index)--*/ + virtual CefValueType GetType(int index) =0; + + /// + // Returns the value at the specified index. For simple types the returned + // value will copy existing data and modifications to the value will not + // modify this object. For complex types (binary, dictionary and list) the + // returned value will reference existing data and modifications to the value + // will modify this object. + /// + /*--cef(index_param=index)--*/ + virtual CefRefPtr GetValue(int index) =0; + + /// + // Returns the value at the specified index as type bool. + /// + /*--cef(index_param=index)--*/ + virtual bool GetBool(int index) =0; + + /// + // Returns the value at the specified index as type int. + /// + /*--cef(index_param=index)--*/ + virtual int GetInt(int index) =0; + + /// + // Returns the value at the specified index as type double. + /// + /*--cef(index_param=index)--*/ + virtual double GetDouble(int index) =0; + + /// + // Returns the value at the specified index as type string. + /// + /*--cef(index_param=index)--*/ + virtual CefString GetString(int index) =0; + + /// + // Returns the value at the specified index as type binary. The returned + // value will reference existing data. + /// + /*--cef(index_param=index)--*/ + virtual CefRefPtr GetBinary(int index) =0; + + /// + // Returns the value at the specified index as type dictionary. The returned + // value will reference existing data and modifications to the value will + // modify this object. + /// + /*--cef(index_param=index)--*/ + virtual CefRefPtr GetDictionary(int index) =0; + + /// + // Returns the value at the specified index as type list. The returned + // value will reference existing data and modifications to the value will + // modify this object. + /// + /*--cef(index_param=index)--*/ + virtual CefRefPtr GetList(int index) =0; + + /// + // Sets the value at the specified index. Returns true if the value was set + // successfully. If |value| represents simple data then the underlying data + // will be copied and modifications to |value| will not modify this object. If + // |value| represents complex data (binary, dictionary or list) then the + // underlying data will be referenced and modifications to |value| will modify + // this object. + /// + /*--cef(index_param=index)--*/ + virtual bool SetValue(int index, CefRefPtr value) =0; + + /// + // Sets the value at the specified index as type null. Returns true if the + // value was set successfully. + /// + /*--cef(index_param=index)--*/ + virtual bool SetNull(int index) =0; + + /// + // Sets the value at the specified index as type bool. Returns true if the + // value was set successfully. + /// + /*--cef(index_param=index)--*/ + virtual bool SetBool(int index, bool value) =0; + + /// + // Sets the value at the specified index as type int. Returns true if the + // value was set successfully. + /// + /*--cef(index_param=index)--*/ + virtual bool SetInt(int index, int value) =0; + + /// + // Sets the value at the specified index as type double. Returns true if the + // value was set successfully. + /// + /*--cef(index_param=index)--*/ + virtual bool SetDouble(int index, double value) =0; + + /// + // Sets the value at the specified index as type string. Returns true if the + // value was set successfully. + /// + /*--cef(optional_param=value,index_param=index)--*/ + virtual bool SetString(int index, const CefString& value) =0; + + /// + // Sets the value at the specified index as type binary. Returns true if the + // value was set successfully. If |value| is currently owned by another object + // then the value will be copied and the |value| reference will not change. + // Otherwise, ownership will be transferred to this object and the |value| + // reference will be invalidated. + /// + /*--cef(index_param=index)--*/ + virtual bool SetBinary(int index, CefRefPtr value) =0; + + /// + // Sets the value at the specified index as type dict. Returns true if the + // value was set successfully. If |value| is currently owned by another object + // then the value will be copied and the |value| reference will not change. + // Otherwise, ownership will be transferred to this object and the |value| + // reference will be invalidated. + /// + /*--cef(index_param=index)--*/ + virtual bool SetDictionary(int index, CefRefPtr value) =0; + + /// + // Sets the value at the specified index as type list. Returns true if the + // value was set successfully. If |value| is currently owned by another object + // then the value will be copied and the |value| reference will not change. + // Otherwise, ownership will be transferred to this object and the |value| + // reference will be invalidated. + /// + /*--cef(index_param=index)--*/ + virtual bool SetList(int index, CefRefPtr value) =0; +}; + +#endif // CEF_INCLUDE_CEF_VALUES_H_ diff --git a/dependencies64/cef/include/cef_version.h b/dependencies64/cef/include/cef_version.h new file mode 100644 index 000000000..319ce2156 --- /dev/null +++ b/dependencies64/cef/include/cef_version.h @@ -0,0 +1,102 @@ +// Copyright (c) 2015 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// This file is generated by the make_version_header.py tool. +// + +#ifndef CEF_INCLUDE_CEF_VERSION_H_ +#define CEF_INCLUDE_CEF_VERSION_H_ + +#define CEF_VERSION "3.2378.1268.g4715a16" +#define CEF_VERSION_MAJOR 3 +#define CEF_COMMIT_NUMBER 1268 +#define CEF_COMMIT_HASH "4715a1644e292e191d3840b59a74f821be91daec" +#define COPYRIGHT_YEAR 2015 + +#define CHROME_VERSION_MAJOR 44 +#define CHROME_VERSION_MINOR 0 +#define CHROME_VERSION_BUILD 2378 +#define CHROME_VERSION_PATCH 0 + +#define DO_MAKE_STRING(p) #p +#define MAKE_STRING(p) DO_MAKE_STRING(p) + +#ifndef APSTUDIO_HIDDEN_SYMBOLS + +#include "include/internal/cef_export.h" + +#ifdef __cplusplus +extern "C" { +#endif + +// The API hash is created by analyzing CEF header files for C API type +// definitions. The hash value will change when header files are modified +// in a way that may cause binary incompatibility with other builds. The +// universal hash value will change if any platform is affected whereas the +// platform hash values will change only if that particular platform is +// affected. +#define CEF_API_HASH_UNIVERSAL "2b3193123e3383250ab2063849efe7db537bd4c1" +#if defined(OS_WIN) +#define CEF_API_HASH_PLATFORM "27c1156f5f9b4d4271ec2e146a1e10fb47a01712" +#elif defined(OS_MACOSX) +#define CEF_API_HASH_PLATFORM "f6e8bce3f2a055cb80402692d500986607463e32" +#elif defined(OS_LINUX) +#define CEF_API_HASH_PLATFORM "e50a8044ea7deea0578a41f602f412826eb0ea0a" +#endif + +// Returns CEF version information for the libcef library. The |entry| +// parameter describes which version component will be returned: +// 0 - CEF_VERSION_MAJOR +// 1 - CEF_COMMIT_NUMBER +// 2 - CHROME_VERSION_MAJOR +// 3 - CHROME_VERSION_MINOR +// 4 - CHROME_VERSION_BUILD +// 5 - CHROME_VERSION_PATCH +/// +CEF_EXPORT int cef_version_info(int entry); + +/// +// Returns CEF API hashes for the libcef library. The returned string is owned +// by the library and should not be freed. The |entry| parameter describes which +// hash value will be returned: +// 0 - CEF_API_HASH_PLATFORM +// 1 - CEF_API_HASH_UNIVERSAL +// 2 - CEF_COMMIT_HASH +/// +CEF_EXPORT const char* cef_api_hash(int entry); + +#ifdef __cplusplus +} +#endif + +#endif // APSTUDIO_HIDDEN_SYMBOLS + +#endif // CEF_INCLUDE_CEF_VERSION_H_ diff --git a/dependencies64/cef/include/cef_web_plugin.h b/dependencies64/cef/include/cef_web_plugin.h new file mode 100644 index 000000000..0ff2b8ea1 --- /dev/null +++ b/dependencies64/cef/include/cef_web_plugin.h @@ -0,0 +1,178 @@ +// Copyright (c) 2012 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// The contents of this file must follow a specific format in order to +// support the CEF translator tool. See the translator.README.txt file in the +// tools directory for more information. +// + +#ifndef CEF_INCLUDE_CEF_WEB_PLUGIN_H_ +#define CEF_INCLUDE_CEF_WEB_PLUGIN_H_ + +#include "include/cef_base.h" +#include "include/cef_browser.h" + +/// +// Information about a specific web plugin. +/// +/*--cef(source=library)--*/ +class CefWebPluginInfo : public virtual CefBase { + public: + /// + // Returns the plugin name (i.e. Flash). + /// + /*--cef()--*/ + virtual CefString GetName() =0; + + /// + // Returns the plugin file path (DLL/bundle/library). + /// + /*--cef()--*/ + virtual CefString GetPath() =0; + + /// + // Returns the version of the plugin (may be OS-specific). + /// + /*--cef()--*/ + virtual CefString GetVersion() =0; + + /// + // Returns a description of the plugin from the version information. + /// + /*--cef()--*/ + virtual CefString GetDescription() =0; +}; + +/// +// Interface to implement for visiting web plugin information. The methods of +// this class will be called on the browser process UI thread. +/// +/*--cef(source=client)--*/ +class CefWebPluginInfoVisitor : public virtual CefBase { + public: + /// + // Method that will be called once for each plugin. |count| is the 0-based + // index for the current plugin. |total| is the total number of plugins. + // Return false to stop visiting plugins. This method may never be called if + // no plugins are found. + /// + /*--cef()--*/ + virtual bool Visit(CefRefPtr info, int count, int total) =0; +}; + +/// +// Visit web plugin information. Can be called on any thread in the browser +// process. +/// +/*--cef()--*/ +void CefVisitWebPluginInfo(CefRefPtr visitor); + +/// +// Cause the plugin list to refresh the next time it is accessed regardless +// of whether it has already been loaded. Can be called on any thread in the +// browser process. +/// +/*--cef()--*/ +void CefRefreshWebPlugins(); + +/// +// Add a plugin path (directory + file). This change may not take affect until +// after CefRefreshWebPlugins() is called. Can be called on any thread in the +// browser process. +/// +/*--cef()--*/ +void CefAddWebPluginPath(const CefString& path); + +/// +// Add a plugin directory. This change may not take affect until after +// CefRefreshWebPlugins() is called. Can be called on any thread in the browser +// process. +/// +/*--cef()--*/ +void CefAddWebPluginDirectory(const CefString& dir); + +/// +// Remove a plugin path (directory + file). This change may not take affect +// until after CefRefreshWebPlugins() is called. Can be called on any thread in +// the browser process. +/// +/*--cef()--*/ +void CefRemoveWebPluginPath(const CefString& path); + +/// +// Unregister an internal plugin. This may be undone the next time +// CefRefreshWebPlugins() is called. Can be called on any thread in the browser +// process. +/// +/*--cef()--*/ +void CefUnregisterInternalWebPlugin(const CefString& path); + +/// +// Force a plugin to shutdown. Can be called on any thread in the browser +// process but will be executed on the IO thread. +/// +/*--cef()--*/ +void CefForceWebPluginShutdown(const CefString& path); + +/// +// Register a plugin crash. Can be called on any thread in the browser process +// but will be executed on the IO thread. +/// +/*--cef()--*/ +void CefRegisterWebPluginCrash(const CefString& path); + +/// +// Interface to implement for receiving unstable plugin information. The methods +// of this class will be called on the browser process IO thread. +/// +/*--cef(source=client)--*/ +class CefWebPluginUnstableCallback : public virtual CefBase { + public: + /// + // Method that will be called for the requested plugin. |unstable| will be + // true if the plugin has reached the crash count threshold of 3 times in 120 + // seconds. + /// + /*--cef()--*/ + virtual void IsUnstable(const CefString& path, + bool unstable) =0; +}; + +/// +// Query if a plugin is unstable. Can be called on any thread in the browser +// process. +/// +/*--cef()--*/ +void CefIsWebPluginUnstable(const CefString& path, + CefRefPtr callback); + + +#endif // CEF_INCLUDE_CEF_WEB_PLUGIN_H_ diff --git a/dependencies64/cef/include/cef_xml_reader.h b/dependencies64/cef/include/cef_xml_reader.h new file mode 100644 index 000000000..86be8bac7 --- /dev/null +++ b/dependencies64/cef/include/cef_xml_reader.h @@ -0,0 +1,268 @@ +// Copyright (c) 2012 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// The contents of this file must follow a specific format in order to +// support the CEF translator tool. See the translator.README.txt file in the +// tools directory for more information. +// + +#ifndef CEF_INCLUDE_CEF_XML_READER_H_ +#define CEF_INCLUDE_CEF_XML_READER_H_ +#pragma once + +#include "include/cef_base.h" +#include "include/cef_stream.h" + +/// +// Class that supports the reading of XML data via the libxml streaming API. +// The methods of this class should only be called on the thread that creates +// the object. +/// +/*--cef(source=library)--*/ +class CefXmlReader : public virtual CefBase { + public: + typedef cef_xml_encoding_type_t EncodingType; + typedef cef_xml_node_type_t NodeType; + + /// + // Create a new CefXmlReader object. The returned object's methods can only + // be called from the thread that created the object. + /// + /*--cef()--*/ + static CefRefPtr Create(CefRefPtr stream, + EncodingType encodingType, + const CefString& URI); + + /// + // Moves the cursor to the next node in the document. This method must be + // called at least once to set the current cursor position. Returns true if + // the cursor position was set successfully. + /// + /*--cef()--*/ + virtual bool MoveToNextNode() =0; + + /// + // Close the document. This should be called directly to ensure that cleanup + // occurs on the correct thread. + /// + /*--cef()--*/ + virtual bool Close() =0; + + /// + // Returns true if an error has been reported by the XML parser. + /// + /*--cef()--*/ + virtual bool HasError() =0; + + /// + // Returns the error string. + /// + /*--cef()--*/ + virtual CefString GetError() =0; + + + // The below methods retrieve data for the node at the current cursor + // position. + + /// + // Returns the node type. + /// + /*--cef(default_retval=XML_NODE_UNSUPPORTED)--*/ + virtual NodeType GetType() =0; + + /// + // Returns the node depth. Depth starts at 0 for the root node. + /// + /*--cef()--*/ + virtual int GetDepth() =0; + + /// + // Returns the local name. See + // http://www.w3.org/TR/REC-xml-names/#NT-LocalPart for additional details. + /// + /*--cef()--*/ + virtual CefString GetLocalName() =0; + + /// + // Returns the namespace prefix. See http://www.w3.org/TR/REC-xml-names/ for + // additional details. + /// + /*--cef()--*/ + virtual CefString GetPrefix() =0; + + /// + // Returns the qualified name, equal to (Prefix:)LocalName. See + // http://www.w3.org/TR/REC-xml-names/#ns-qualnames for additional details. + /// + /*--cef()--*/ + virtual CefString GetQualifiedName() =0; + + /// + // Returns the URI defining the namespace associated with the node. See + // http://www.w3.org/TR/REC-xml-names/ for additional details. + /// + /*--cef()--*/ + virtual CefString GetNamespaceURI() =0; + + /// + // Returns the base URI of the node. See http://www.w3.org/TR/xmlbase/ for + // additional details. + /// + /*--cef()--*/ + virtual CefString GetBaseURI() =0; + + /// + // Returns the xml:lang scope within which the node resides. See + // http://www.w3.org/TR/REC-xml/#sec-lang-tag for additional details. + /// + /*--cef()--*/ + virtual CefString GetXmlLang() =0; + + /// + // Returns true if the node represents an empty element. is considered + // empty but is not. + /// + /*--cef()--*/ + virtual bool IsEmptyElement() =0; + + /// + // Returns true if the node has a text value. + /// + /*--cef()--*/ + virtual bool HasValue() =0; + + /// + // Returns the text value. + /// + /*--cef()--*/ + virtual CefString GetValue() =0; + + /// + // Returns true if the node has attributes. + /// + /*--cef()--*/ + virtual bool HasAttributes() =0; + + /// + // Returns the number of attributes. + /// + /*--cef()--*/ + virtual size_t GetAttributeCount() =0; + + /// + // Returns the value of the attribute at the specified 0-based index. + /// + /*--cef(capi_name=get_attribute_byindex,index_param=index)--*/ + virtual CefString GetAttribute(int index) =0; + + /// + // Returns the value of the attribute with the specified qualified name. + /// + /*--cef(capi_name=get_attribute_byqname)--*/ + virtual CefString GetAttribute(const CefString& qualifiedName) =0; + + /// + // Returns the value of the attribute with the specified local name and + // namespace URI. + /// + /*--cef(capi_name=get_attribute_bylname)--*/ + virtual CefString GetAttribute(const CefString& localName, + const CefString& namespaceURI) =0; + + /// + // Returns an XML representation of the current node's children. + /// + /*--cef()--*/ + virtual CefString GetInnerXml() =0; + + /// + // Returns an XML representation of the current node including its children. + /// + /*--cef()--*/ + virtual CefString GetOuterXml() =0; + + /// + // Returns the line number for the current node. + /// + /*--cef()--*/ + virtual int GetLineNumber() =0; + + + // Attribute nodes are not traversed by default. The below methods can be + // used to move the cursor to an attribute node. MoveToCarryingElement() can + // be called afterwards to return the cursor to the carrying element. The + // depth of an attribute node will be 1 + the depth of the carrying element. + + /// + // Moves the cursor to the attribute at the specified 0-based index. Returns + // true if the cursor position was set successfully. + /// + /*--cef(capi_name=move_to_attribute_byindex,index_param=index)--*/ + virtual bool MoveToAttribute(int index) =0; + + /// + // Moves the cursor to the attribute with the specified qualified name. + // Returns true if the cursor position was set successfully. + /// + /*--cef(capi_name=move_to_attribute_byqname)--*/ + virtual bool MoveToAttribute(const CefString& qualifiedName) =0; + + /// + // Moves the cursor to the attribute with the specified local name and + // namespace URI. Returns true if the cursor position was set successfully. + /// + /*--cef(capi_name=move_to_attribute_bylname)--*/ + virtual bool MoveToAttribute(const CefString& localName, + const CefString& namespaceURI) =0; + + /// + // Moves the cursor to the first attribute in the current element. Returns + // true if the cursor position was set successfully. + /// + /*--cef()--*/ + virtual bool MoveToFirstAttribute() =0; + + /// + // Moves the cursor to the next attribute in the current element. Returns + // true if the cursor position was set successfully. + /// + /*--cef()--*/ + virtual bool MoveToNextAttribute() =0; + + /// + // Moves the cursor back to the carrying element. Returns true if the cursor + // position was set successfully. + /// + /*--cef()--*/ + virtual bool MoveToCarryingElement() =0; +}; + +#endif // CEF_INCLUDE_CEF_XML_READER_H_ diff --git a/dependencies64/cef/include/cef_zip_reader.h b/dependencies64/cef/include/cef_zip_reader.h new file mode 100644 index 000000000..1fe02b916 --- /dev/null +++ b/dependencies64/cef/include/cef_zip_reader.h @@ -0,0 +1,141 @@ +// Copyright (c) 2012 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// The contents of this file must follow a specific format in order to +// support the CEF translator tool. See the translator.README.txt file in the +// tools directory for more information. +// + +#ifndef CEF_INCLUDE_CEF_ZIP_READER_H_ +#define CEF_INCLUDE_CEF_ZIP_READER_H_ + +#include "include/cef_base.h" +#include "include/cef_stream.h" + +/// +// Class that supports the reading of zip archives via the zlib unzip API. +// The methods of this class should only be called on the thread that creates +// the object. +/// +/*--cef(source=library)--*/ +class CefZipReader : public virtual CefBase { + public: + /// + // Create a new CefZipReader object. The returned object's methods can only + // be called from the thread that created the object. + /// + /*--cef()--*/ + static CefRefPtr Create(CefRefPtr stream); + + /// + // Moves the cursor to the first file in the archive. Returns true if the + // cursor position was set successfully. + /// + /*--cef()--*/ + virtual bool MoveToFirstFile() =0; + + /// + // Moves the cursor to the next file in the archive. Returns true if the + // cursor position was set successfully. + /// + /*--cef()--*/ + virtual bool MoveToNextFile() =0; + + /// + // Moves the cursor to the specified file in the archive. If |caseSensitive| + // is true then the search will be case sensitive. Returns true if the cursor + // position was set successfully. + /// + /*--cef()--*/ + virtual bool MoveToFile(const CefString& fileName, bool caseSensitive) =0; + + /// + // Closes the archive. This should be called directly to ensure that cleanup + // occurs on the correct thread. + /// + /*--cef()--*/ + virtual bool Close() =0; + + + // The below methods act on the file at the current cursor position. + + /// + // Returns the name of the file. + /// + /*--cef()--*/ + virtual CefString GetFileName() =0; + + /// + // Returns the uncompressed size of the file. + /// + /*--cef()--*/ + virtual int64 GetFileSize() =0; + + /// + // Returns the last modified timestamp for the file. + /// + /*--cef()--*/ + virtual time_t GetFileLastModified() =0; + + /// + // Opens the file for reading of uncompressed data. A read password may + // optionally be specified. + /// + /*--cef(optional_param=password)--*/ + virtual bool OpenFile(const CefString& password) =0; + + /// + // Closes the file. + /// + /*--cef()--*/ + virtual bool CloseFile() =0; + + /// + // Read uncompressed file contents into the specified buffer. Returns < 0 if + // an error occurred, 0 if at the end of file, or the number of bytes read. + /// + /*--cef()--*/ + virtual int ReadFile(void* buffer, size_t bufferSize) =0; + + /// + // Returns the current offset in the uncompressed file contents. + /// + /*--cef()--*/ + virtual int64 Tell() =0; + + /// + // Returns true if at end of the file contents. + /// + /*--cef()--*/ + virtual bool Eof() =0; +}; + +#endif // CEF_INCLUDE_CEF_ZIP_READER_H_ diff --git a/dependencies64/cef/include/internal/cef_export.h b/dependencies64/cef/include/internal/cef_export.h new file mode 100644 index 000000000..2813253b6 --- /dev/null +++ b/dependencies64/cef/include/internal/cef_export.h @@ -0,0 +1,55 @@ +// Copyright (c) 2009 The Chromium Embedded Framework Authors. All rights +// reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#ifndef CEF_INCLUDE_INTERNAL_CEF_EXPORT_H_ +#define CEF_INCLUDE_INTERNAL_CEF_EXPORT_H_ +#pragma once + +#include "include/base/cef_build.h" + +#if defined(COMPILER_MSVC) + +#ifdef BUILDING_CEF_SHARED +#define CEF_EXPORT __declspec(dllexport) +#elif USING_CEF_SHARED +#define CEF_EXPORT __declspec(dllimport) +#else +#define CEF_EXPORT +#endif +#define CEF_CALLBACK __stdcall + +#elif defined(COMPILER_GCC) + +#define CEF_EXPORT __attribute__ ((visibility("default"))) +#define CEF_CALLBACK + +#endif // COMPILER_GCC + +#endif // CEF_INCLUDE_INTERNAL_CEF_EXPORT_H_ diff --git a/dependencies64/cef/include/internal/cef_logging_internal.h b/dependencies64/cef/include/internal/cef_logging_internal.h new file mode 100644 index 000000000..c376d0526 --- /dev/null +++ b/dependencies64/cef/include/internal/cef_logging_internal.h @@ -0,0 +1,66 @@ +// Copyright (c) 2014 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#ifndef CEF_INCLUDE_INTERNAL_CEF_LOGGING_INTERNAL_H_ +#define CEF_INCLUDE_INTERNAL_CEF_LOGGING_INTERNAL_H_ +#pragma once + +#include "include/internal/cef_export.h" + +#ifdef __cplusplus +extern "C" { +#endif + +// See include/base/cef_logging.h for macros and intended usage. + +/// +// Gets the current log level. +/// +CEF_EXPORT int cef_get_min_log_level(); + +/// +// Gets the current vlog level for the given file (usually taken from +// __FILE__). Note that |N| is the size *with* the null terminator. +/// +CEF_EXPORT int cef_get_vlog_level(const char* file_start, size_t N); + +/// +// Add a log message. See the LogSeverity defines for supported |severity| +// values. +/// +CEF_EXPORT void cef_log(const char* file, + int line, + int severity, + const char* message); + +#ifdef __cplusplus +} +#endif // __cplusplus + +#endif // CEF_INCLUDE_INTERNAL_CEF_LOGGING_INTERNAL_H_ diff --git a/dependencies64/cef/include/internal/cef_ptr.h b/dependencies64/cef/include/internal/cef_ptr.h new file mode 100644 index 000000000..e38543911 --- /dev/null +++ b/dependencies64/cef/include/internal/cef_ptr.h @@ -0,0 +1,161 @@ +// Copyright (c) 2014 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +#ifndef CEF_INCLUDE_INTERNAL_CEF_PTR_H_ +#define CEF_INCLUDE_INTERNAL_CEF_PTR_H_ +#pragma once + +#include "include/base/cef_ref_counted.h" + +/// +// Smart pointer implementation that is an alias of scoped_refptr from +// include/base/cef_ref_counted.h. +//

+// A smart pointer class for reference counted objects. Use this class instead +// of calling AddRef and Release manually on a reference counted object to +// avoid common memory leaks caused by forgetting to Release an object +// reference. Sample usage: +//

+//   class MyFoo : public CefBase {
+//    ...
+//   };
+//
+//   void some_function() {
+//     // The MyFoo object that |foo| represents starts with a single
+//     // reference.
+//     CefRefPtr<MyFoo> foo = new MyFoo();
+//     foo->Method(param);
+//     // |foo| is released when this function returns
+//   }
+//
+//   void some_other_function() {
+//     CefRefPtr<MyFoo> foo = new MyFoo();
+//     ...
+//     foo = NULL;  // explicitly releases |foo|
+//     ...
+//     if (foo)
+//       foo->Method(param);
+//   }
+// 
+// The above examples show how CefRefPtr<T> acts like a pointer to T. +// Given two CefRefPtr<T> classes, it is also possible to exchange +// references between the two objects, like so: +//
+//   {
+//     CefRefPtr<MyFoo> a = new MyFoo();
+//     CefRefPtr<MyFoo> b;
+//
+//     b.swap(a);
+//     // now, |b| references the MyFoo object, and |a| references NULL.
+//   }
+// 
+// To make both |a| and |b| in the above example reference the same MyFoo +// object, simply use the assignment operator: +//
+//   {
+//     CefRefPtr<MyFoo> a = new MyFoo();
+//     CefRefPtr<MyFoo> b;
+//
+//     b = a;
+//     // now, |a| and |b| each own a reference to the same MyFoo object.
+//     // the reference count of the underlying MyFoo object will be 2.
+//   }
+// 
+// Reference counted objects can also be passed as function parameters and +// used as function return values: +//
+//   void some_func_with_param(CefRefPtr<MyFoo> param) {
+//     // A reference is added to the MyFoo object that |param| represents
+//     // during the scope of some_func_with_param() and released when
+//     // some_func_with_param() goes out of scope.
+//   }
+//
+//   CefRefPtr<MyFoo> some_func_with_retval() {
+//     // The MyFoo object that |foox| represents starts with a single
+//     // reference.
+//     CefRefPtr<MyFoo> foox = new MyFoo();
+//
+//     // Creating the return value adds an additional reference.
+//     return foox;
+//
+//     // When some_func_with_retval() goes out of scope the original |foox|
+//     // reference is released.
+//   }
+//
+//   void and_another_function() {
+//     CefRefPtr<MyFoo> foo = new MyFoo();
+//
+//     // pass |foo| as a parameter.
+//     some_function(foo);
+//
+//     CefRefPtr<MyFoo> foo2 = some_func_with_retval();
+//     // Now, since we kept a reference to the some_func_with_retval() return
+//     // value, |foo2| is the only class pointing to the MyFoo object created
+//     in some_func_with_retval(), and it has a reference count of 1.
+//
+//     some_func_with_retval();
+//     // Now, since we didn't keep a reference to the some_func_with_retval()
+//     // return value, the MyFoo object created in some_func_with_retval()
+//     // will automatically be released.
+//   }
+// 
+// And in standard containers: +//
+//   {
+//      // Create a vector that holds MyFoo objects.
+//      std::vector<CefRefPtr<MyFoo> > MyFooVec;
+//
+//     // The MyFoo object that |foo| represents starts with a single
+//     // reference.
+//     CefRefPtr<MyFoo> foo = new MyFoo();
+//
+//     // When the MyFoo object is added to |MyFooVec| the reference count
+//     // is increased to 2.
+//     MyFooVec.push_back(foo);
+//   }
+// 
+//

+/// +template +class CefRefPtr : public scoped_refptr { + public: + typedef scoped_refptr parent; + + CefRefPtr() : parent() {} + + CefRefPtr(T* p) : parent(p) {} + + CefRefPtr(const scoped_refptr& r) : parent(r) {} + + template + CefRefPtr(const scoped_refptr& r) : parent(r) {} +}; + +#endif // CEF_INCLUDE_INTERNAL_CEF_PTR_H_ diff --git a/dependencies64/cef/include/internal/cef_string.h b/dependencies64/cef/include/internal/cef_string.h new file mode 100644 index 000000000..a7876fe56 --- /dev/null +++ b/dependencies64/cef/include/internal/cef_string.h @@ -0,0 +1,113 @@ +// Copyright (c) 2010 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#ifndef CEF_INCLUDE_INTERNAL_CEF_STRING_H_ +#define CEF_INCLUDE_INTERNAL_CEF_STRING_H_ +#pragma once + +// The CEF interface is built with one string type as the default. Comment out +// all but one of the CEF_STRING_TYPE_* defines below to specify the default. +// If you change the default you MUST recompile all of CEF. + +// Build with the UTF8 string type as default. +// #define CEF_STRING_TYPE_UTF8 1 + +// Build with the UTF16 string type as default. +#define CEF_STRING_TYPE_UTF16 1 + +// Build with the wide string type as default. +// #define CEF_STRING_TYPE_WIDE 1 + + +#include "include/internal/cef_string_types.h" + +#ifdef __cplusplus +#include "include/internal/cef_string_wrappers.h" +#if defined(CEF_STRING_TYPE_UTF16) +typedef CefStringUTF16 CefString; +#elif defined(CEF_STRING_TYPE_UTF8) +typedef CefStringUTF8 CefString; +#elif defined(CEF_STRING_TYPE_WIDE) +typedef CefStringWide CefString; +#endif +#endif // __cplusplus + +#if defined(CEF_STRING_TYPE_UTF8) +typedef char cef_char_t; +typedef cef_string_utf8_t cef_string_t; +typedef cef_string_userfree_utf8_t cef_string_userfree_t; +#define cef_string_set cef_string_utf8_set +#define cef_string_copy cef_string_utf8_copy +#define cef_string_clear cef_string_utf8_clear +#define cef_string_userfree_alloc cef_string_userfree_utf8_alloc +#define cef_string_userfree_free cef_string_userfree_utf8_free +#define cef_string_from_ascii cef_string_utf8_copy +#define cef_string_to_utf8 cef_string_utf8_copy +#define cef_string_from_utf8 cef_string_utf8_copy +#define cef_string_to_utf16 cef_string_utf8_to_utf16 +#define cef_string_from_utf16 cef_string_utf16_to_utf8 +#define cef_string_to_wide cef_string_utf8_to_wide +#define cef_string_from_wide cef_string_wide_to_utf8 +#elif defined(CEF_STRING_TYPE_UTF16) +typedef char16 cef_char_t; +typedef cef_string_userfree_utf16_t cef_string_userfree_t; +typedef cef_string_utf16_t cef_string_t; +#define cef_string_set cef_string_utf16_set +#define cef_string_copy cef_string_utf16_copy +#define cef_string_clear cef_string_utf16_clear +#define cef_string_userfree_alloc cef_string_userfree_utf16_alloc +#define cef_string_userfree_free cef_string_userfree_utf16_free +#define cef_string_from_ascii cef_string_ascii_to_utf16 +#define cef_string_to_utf8 cef_string_utf16_to_utf8 +#define cef_string_from_utf8 cef_string_utf8_to_utf16 +#define cef_string_to_utf16 cef_string_utf16_copy +#define cef_string_from_utf16 cef_string_utf16_copy +#define cef_string_to_wide cef_string_utf16_to_wide +#define cef_string_from_wide cef_string_wide_to_utf16 +#elif defined(CEF_STRING_TYPE_WIDE) +typedef wchar_t cef_char_t; +typedef cef_string_wide_t cef_string_t; +typedef cef_string_userfree_wide_t cef_string_userfree_t; +#define cef_string_set cef_string_wide_set +#define cef_string_copy cef_string_wide_copy +#define cef_string_clear cef_string_wide_clear +#define cef_string_userfree_alloc cef_string_userfree_wide_alloc +#define cef_string_userfree_free cef_string_userfree_wide_free +#define cef_string_from_ascii cef_string_ascii_to_wide +#define cef_string_to_utf8 cef_string_wide_to_utf8 +#define cef_string_from_utf8 cef_string_utf8_to_wide +#define cef_string_to_utf16 cef_string_wide_to_utf16 +#define cef_string_from_utf16 cef_string_utf16_to_wide +#define cef_string_to_wide cef_string_wide_copy +#define cef_string_from_wide cef_string_wide_copy +#else +#error Please choose a string type. +#endif + +#endif // CEF_INCLUDE_INTERNAL_CEF_STRING_H_ diff --git a/dependencies64/cef/include/internal/cef_string_list.h b/dependencies64/cef/include/internal/cef_string_list.h new file mode 100644 index 000000000..52a0abf2f --- /dev/null +++ b/dependencies64/cef/include/internal/cef_string_list.h @@ -0,0 +1,88 @@ +// Copyright (c) 2009 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#ifndef CEF_INCLUDE_INTERNAL_CEF_STRING_LIST_H_ +#define CEF_INCLUDE_INTERNAL_CEF_STRING_LIST_H_ +#pragma once + +#include "include/internal/cef_export.h" +#include "include/internal/cef_string.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/// +// CEF string maps are a set of key/value string pairs. +/// +typedef void* cef_string_list_t; + +/// +// Allocate a new string map. +/// +CEF_EXPORT cef_string_list_t cef_string_list_alloc(); + +/// +// Return the number of elements in the string list. +/// +CEF_EXPORT int cef_string_list_size(cef_string_list_t list); + +/// +// Retrieve the value at the specified zero-based string list index. Returns +// true (1) if the value was successfully retrieved. +/// +CEF_EXPORT int cef_string_list_value(cef_string_list_t list, + int index, cef_string_t* value); + +/// +// Append a new value at the end of the string list. +/// +CEF_EXPORT void cef_string_list_append(cef_string_list_t list, + const cef_string_t* value); + +/// +// Clear the string list. +/// +CEF_EXPORT void cef_string_list_clear(cef_string_list_t list); + +/// +// Free the string list. +/// +CEF_EXPORT void cef_string_list_free(cef_string_list_t list); + +/// +// Creates a copy of an existing string list. +/// +CEF_EXPORT cef_string_list_t cef_string_list_copy(cef_string_list_t list); + +#ifdef __cplusplus +} +#endif + +#endif // CEF_INCLUDE_INTERNAL_CEF_STRING_LIST_H_ diff --git a/dependencies64/cef/include/internal/cef_string_map.h b/dependencies64/cef/include/internal/cef_string_map.h new file mode 100644 index 000000000..93eea2a55 --- /dev/null +++ b/dependencies64/cef/include/internal/cef_string_map.h @@ -0,0 +1,97 @@ +// Copyright (c) 2009 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#ifndef CEF_INCLUDE_INTERNAL_CEF_STRING_MAP_H_ +#define CEF_INCLUDE_INTERNAL_CEF_STRING_MAP_H_ +#pragma once + +#include "include/internal/cef_export.h" +#include "include/internal/cef_string.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/// +// CEF string maps are a set of key/value string pairs. +/// +typedef void* cef_string_map_t; + +/// +// Allocate a new string map. +/// +CEF_EXPORT cef_string_map_t cef_string_map_alloc(); + +/// +// Return the number of elements in the string map. +/// +CEF_EXPORT int cef_string_map_size(cef_string_map_t map); + +/// +// Return the value assigned to the specified key. +/// +CEF_EXPORT int cef_string_map_find(cef_string_map_t map, + const cef_string_t* key, + cef_string_t* value); + +/// +// Return the key at the specified zero-based string map index. +/// +CEF_EXPORT int cef_string_map_key(cef_string_map_t map, int index, + cef_string_t* key); + +/// +// Return the value at the specified zero-based string map index. +/// +CEF_EXPORT int cef_string_map_value(cef_string_map_t map, int index, + cef_string_t* value); + +/// +// Append a new key/value pair at the end of the string map. +/// +CEF_EXPORT int cef_string_map_append(cef_string_map_t map, + const cef_string_t* key, + const cef_string_t* value); + +/// +// Clear the string map. +/// +CEF_EXPORT void cef_string_map_clear(cef_string_map_t map); + +/// +// Free the string map. +/// +CEF_EXPORT void cef_string_map_free(cef_string_map_t map); + + +#ifdef __cplusplus +} +#endif + +#endif // CEF_INCLUDE_INTERNAL_CEF_STRING_MAP_H_ diff --git a/dependencies64/cef/include/internal/cef_string_multimap.h b/dependencies64/cef/include/internal/cef_string_multimap.h new file mode 100644 index 000000000..cd3904244 --- /dev/null +++ b/dependencies64/cef/include/internal/cef_string_multimap.h @@ -0,0 +1,105 @@ +// Copyright (c) 2011 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#ifndef CEF_INCLUDE_INTERNAL_CEF_STRING_MULTIMAP_H_ +#define CEF_INCLUDE_INTERNAL_CEF_STRING_MULTIMAP_H_ +#pragma once + +#include "include/internal/cef_export.h" +#include "include/internal/cef_string.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/// +// CEF string multimaps are a set of key/value string pairs. +// More than one value can be assigned to a single key. +/// +typedef void* cef_string_multimap_t; + +/// +// Allocate a new string multimap. +/// +CEF_EXPORT cef_string_multimap_t cef_string_multimap_alloc(); + +/// +// Return the number of elements in the string multimap. +/// +CEF_EXPORT int cef_string_multimap_size(cef_string_multimap_t map); + +/// +// Return the number of values with the specified key. +/// +CEF_EXPORT int cef_string_multimap_find_count(cef_string_multimap_t map, + const cef_string_t* key); + +/// +// Return the value_index-th value with the specified key. +/// +CEF_EXPORT int cef_string_multimap_enumerate(cef_string_multimap_t map, + const cef_string_t* key, + int value_index, + cef_string_t* value); + +/// +// Return the key at the specified zero-based string multimap index. +/// +CEF_EXPORT int cef_string_multimap_key(cef_string_multimap_t map, int index, + cef_string_t* key); + +/// +// Return the value at the specified zero-based string multimap index. +/// +CEF_EXPORT int cef_string_multimap_value(cef_string_multimap_t map, int index, + cef_string_t* value); + +/// +// Append a new key/value pair at the end of the string multimap. +/// +CEF_EXPORT int cef_string_multimap_append(cef_string_multimap_t map, + const cef_string_t* key, + const cef_string_t* value); + +/// +// Clear the string multimap. +/// +CEF_EXPORT void cef_string_multimap_clear(cef_string_multimap_t map); + +/// +// Free the string multimap. +/// +CEF_EXPORT void cef_string_multimap_free(cef_string_multimap_t map); + + +#ifdef __cplusplus +} +#endif + +#endif // CEF_INCLUDE_INTERNAL_CEF_STRING_MULTIMAP_H_ diff --git a/dependencies64/cef/include/internal/cef_string_types.h b/dependencies64/cef/include/internal/cef_string_types.h new file mode 100644 index 000000000..493dc7e65 --- /dev/null +++ b/dependencies64/cef/include/internal/cef_string_types.h @@ -0,0 +1,205 @@ +// Copyright (c) 2010 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#ifndef CEF_INCLUDE_INTERNAL_CEF_STRING_TYPES_H_ +#define CEF_INCLUDE_INTERNAL_CEF_STRING_TYPES_H_ +#pragma once + +// CEF provides functions for converting between UTF-8, -16 and -32 strings. +// CEF string types are safe for reading from multiple threads but not for +// modification. It is the user's responsibility to provide synchronization if +// modifying CEF strings from multiple threads. + +#include + +#include "include/base/cef_build.h" +#include "include/internal/cef_export.h" + +#ifdef __cplusplus +extern "C" { +#endif + +// CEF character type definitions. wchar_t is 2 bytes on Windows and 4 bytes on +// most other platforms. + +#if defined(OS_WIN) +typedef wchar_t char16; +#else // !OS_WIN +typedef unsigned short char16; // NOLINT (runtime/int) +#ifndef WCHAR_T_IS_UTF32 +#define WCHAR_T_IS_UTF32 +#endif // WCHAR_T_IS_UTF32 +#endif // !OS_WIN + + +// CEF string type definitions. Whomever allocates |str| is responsible for +// providing an appropriate |dtor| implementation that will free the string in +// the same memory space. When reusing an existing string structure make sure +// to call |dtor| for the old value before assigning new |str| and |dtor| +// values. Static strings will have a NULL |dtor| value. Using the below +// functions if you want this managed for you. + +typedef struct _cef_string_wide_t { + wchar_t* str; + size_t length; + void (*dtor)(wchar_t* str); +} cef_string_wide_t; + +typedef struct _cef_string_utf8_t { + char* str; + size_t length; + void (*dtor)(char* str); +} cef_string_utf8_t; + +typedef struct _cef_string_utf16_t { + char16* str; + size_t length; + void (*dtor)(char16* str); +} cef_string_utf16_t; + + +/// +// These functions set string values. If |copy| is true (1) the value will be +// copied instead of referenced. It is up to the user to properly manage +// the lifespan of references. +/// + +CEF_EXPORT int cef_string_wide_set(const wchar_t* src, size_t src_len, + cef_string_wide_t* output, int copy); +CEF_EXPORT int cef_string_utf8_set(const char* src, size_t src_len, + cef_string_utf8_t* output, int copy); +CEF_EXPORT int cef_string_utf16_set(const char16* src, size_t src_len, + cef_string_utf16_t* output, int copy); + + +/// +// Convenience macros for copying values. +/// + +#define cef_string_wide_copy(src, src_len, output) \ + cef_string_wide_set(src, src_len, output, true) +#define cef_string_utf8_copy(src, src_len, output) \ + cef_string_utf8_set(src, src_len, output, true) +#define cef_string_utf16_copy(src, src_len, output) \ + cef_string_utf16_set(src, src_len, output, true) + + +/// +// These functions clear string values. The structure itself is not freed. +/// + +CEF_EXPORT void cef_string_wide_clear(cef_string_wide_t* str); +CEF_EXPORT void cef_string_utf8_clear(cef_string_utf8_t* str); +CEF_EXPORT void cef_string_utf16_clear(cef_string_utf16_t* str); + + +/// +// These functions compare two string values with the same results as strcmp(). +/// + +CEF_EXPORT int cef_string_wide_cmp(const cef_string_wide_t* str1, + const cef_string_wide_t* str2); +CEF_EXPORT int cef_string_utf8_cmp(const cef_string_utf8_t* str1, + const cef_string_utf8_t* str2); +CEF_EXPORT int cef_string_utf16_cmp(const cef_string_utf16_t* str1, + const cef_string_utf16_t* str2); + + +/// +// These functions convert between UTF-8, -16, and -32 strings. They are +// potentially slow so unnecessary conversions should be avoided. The best +// possible result will always be written to |output| with the boolean return +// value indicating whether the conversion is 100% valid. +/// + +CEF_EXPORT int cef_string_wide_to_utf8(const wchar_t* src, size_t src_len, + cef_string_utf8_t* output); +CEF_EXPORT int cef_string_utf8_to_wide(const char* src, size_t src_len, + cef_string_wide_t* output); + +CEF_EXPORT int cef_string_wide_to_utf16(const wchar_t* src, size_t src_len, + cef_string_utf16_t* output); +CEF_EXPORT int cef_string_utf16_to_wide(const char16* src, size_t src_len, + cef_string_wide_t* output); + +CEF_EXPORT int cef_string_utf8_to_utf16(const char* src, size_t src_len, + cef_string_utf16_t* output); +CEF_EXPORT int cef_string_utf16_to_utf8(const char16* src, size_t src_len, + cef_string_utf8_t* output); + + +/// +// These functions convert an ASCII string, typically a hardcoded constant, to a +// Wide/UTF16 string. Use instead of the UTF8 conversion routines if you know +// the string is ASCII. +/// + +CEF_EXPORT int cef_string_ascii_to_wide(const char* src, size_t src_len, + cef_string_wide_t* output); +CEF_EXPORT int cef_string_ascii_to_utf16(const char* src, size_t src_len, + cef_string_utf16_t* output); + + + +/// +// It is sometimes necessary for the system to allocate string structures with +// the expectation that the user will free them. The userfree types act as a +// hint that the user is responsible for freeing the structure. +/// + +typedef cef_string_wide_t* cef_string_userfree_wide_t; +typedef cef_string_utf8_t* cef_string_userfree_utf8_t; +typedef cef_string_utf16_t* cef_string_userfree_utf16_t; + + +/// +// These functions allocate a new string structure. They must be freed by +// calling the associated free function. +/// + +CEF_EXPORT cef_string_userfree_wide_t cef_string_userfree_wide_alloc(); +CEF_EXPORT cef_string_userfree_utf8_t cef_string_userfree_utf8_alloc(); +CEF_EXPORT cef_string_userfree_utf16_t cef_string_userfree_utf16_alloc(); + + +/// +// These functions free the string structure allocated by the associated +// alloc function. Any string contents will first be cleared. +/// + +CEF_EXPORT void cef_string_userfree_wide_free(cef_string_userfree_wide_t str); +CEF_EXPORT void cef_string_userfree_utf8_free(cef_string_userfree_utf8_t str); +CEF_EXPORT void cef_string_userfree_utf16_free(cef_string_userfree_utf16_t str); + + +#ifdef __cplusplus +} +#endif + +#endif // CEF_INCLUDE_INTERNAL_CEF_STRING_TYPES_H_ diff --git a/dependencies64/cef/include/internal/cef_string_wrappers.h b/dependencies64/cef/include/internal/cef_string_wrappers.h new file mode 100644 index 000000000..060c3c89f --- /dev/null +++ b/dependencies64/cef/include/internal/cef_string_wrappers.h @@ -0,0 +1,715 @@ +// Copyright (c) 2010 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#ifndef CEF_INCLUDE_INTERNAL_CEF_STRING_WRAPPERS_H_ +#define CEF_INCLUDE_INTERNAL_CEF_STRING_WRAPPERS_H_ +#pragma once + +#include +#include + +#include "include/base/cef_string16.h" +#include "include/internal/cef_string_types.h" + +/// +// Traits implementation for wide character strings. +/// +struct CefStringTraitsWide { + typedef wchar_t char_type; + typedef cef_string_wide_t struct_type; + typedef cef_string_userfree_wide_t userfree_struct_type; + + static inline void clear(struct_type *s) { cef_string_wide_clear(s); } + static inline int set(const char_type* src, size_t src_size, + struct_type* output, int copy) { + return cef_string_wide_set(src, src_size, output, copy); + } + static inline int compare(const struct_type* s1, const struct_type* s2) { + return cef_string_wide_cmp(s1, s2); + } + static inline userfree_struct_type userfree_alloc() { + return cef_string_userfree_wide_alloc(); + } + static inline void userfree_free(userfree_struct_type ufs) { + return cef_string_userfree_wide_free(ufs); + } + + // Conversion methods. + static inline bool from_ascii(const char* str, size_t len, struct_type *s) { + return cef_string_ascii_to_wide(str, len, s) ? true : false; + } + static inline std::string to_string(const struct_type *s) { + cef_string_utf8_t cstr; + memset(&cstr, 0, sizeof(cstr)); + cef_string_wide_to_utf8(s->str, s->length, &cstr); + std::string str; + if (cstr.length > 0) + str = std::string(cstr.str, cstr.length); + cef_string_utf8_clear(&cstr); + return str; + } + static inline bool from_string(const std::string& str, struct_type *s) { + return cef_string_utf8_to_wide(str.c_str(), str.length(), s) ? true : false; + } + static inline std::wstring to_wstring(const struct_type *s) { + return std::wstring(s->str, s->length); + } + static inline bool from_wstring(const std::wstring& str, struct_type *s) { + return cef_string_wide_set(str.c_str(), str.length(), s, true) ? + true : false; + } +#if defined(WCHAR_T_IS_UTF32) + static inline base::string16 to_string16(const struct_type *s) { + cef_string_utf16_t cstr; + memset(&cstr, 0, sizeof(cstr)); + cef_string_wide_to_utf16(s->str, s->length, &cstr); + base::string16 str; + if (cstr.length > 0) + str = base::string16(cstr.str, cstr.length); + cef_string_utf16_clear(&cstr); + return str; + } + static inline bool from_string16(const base::string16& str, + struct_type *s) { + return cef_string_utf16_to_wide(str.c_str(), str.length(), s) ? + true : false; + } +#else // WCHAR_T_IS_UTF32 + static inline base::string16 to_string16(const struct_type *s) { + return base::string16(s->str, s->length); + } + static inline bool from_string16(const base::string16& str, struct_type *s) { + return cef_string_wide_set(str.c_str(), str.length(), s, true) ? + true : false; + } +#endif // WCHAR_T_IS_UTF32 +}; + +/// +// Traits implementation for utf8 character strings. +/// +struct CefStringTraitsUTF8 { + typedef char char_type; + typedef cef_string_utf8_t struct_type; + typedef cef_string_userfree_utf8_t userfree_struct_type; + + static inline void clear(struct_type *s) { cef_string_utf8_clear(s); } + static inline int set(const char_type* src, size_t src_size, + struct_type* output, int copy) { + return cef_string_utf8_set(src, src_size, output, copy); + } + static inline int compare(const struct_type* s1, const struct_type* s2) { + return cef_string_utf8_cmp(s1, s2); + } + static inline userfree_struct_type userfree_alloc() { + return cef_string_userfree_utf8_alloc(); + } + static inline void userfree_free(userfree_struct_type ufs) { + return cef_string_userfree_utf8_free(ufs); + } + + // Conversion methods. + static inline bool from_ascii(const char* str, size_t len, struct_type* s) { + return cef_string_utf8_copy(str, len, s) ? true : false; + } + static inline std::string to_string(const struct_type* s) { + return std::string(s->str, s->length); + } + static inline bool from_string(const std::string& str, struct_type* s) { + return cef_string_utf8_copy(str.c_str(), str.length(), s) ? true : false; + } + static inline std::wstring to_wstring(const struct_type* s) { + cef_string_wide_t cstr; + memset(&cstr, 0, sizeof(cstr)); + cef_string_utf8_to_wide(s->str, s->length, &cstr); + std::wstring str; + if (cstr.length > 0) + str = std::wstring(cstr.str, cstr.length); + cef_string_wide_clear(&cstr); + return str; + } + static inline bool from_wstring(const std::wstring& str, struct_type* s) { + return cef_string_wide_to_utf8(str.c_str(), str.length(), s) ? true : false; + } + static inline base::string16 to_string16(const struct_type* s) { + cef_string_utf16_t cstr; + memset(&cstr, 0, sizeof(cstr)); + cef_string_utf8_to_utf16(s->str, s->length, &cstr); + base::string16 str; + if (cstr.length > 0) + str = base::string16(cstr.str, cstr.length); + cef_string_utf16_clear(&cstr); + return str; + } + static inline bool from_string16(const base::string16& str, struct_type* s) { + return cef_string_utf16_to_utf8(str.c_str(), str.length(), s) ? + true : false; + } +}; + +/// +// Traits implementation for utf16 character strings. +/// +struct CefStringTraitsUTF16 { + typedef char16 char_type; + typedef cef_string_utf16_t struct_type; + typedef cef_string_userfree_utf16_t userfree_struct_type; + + static inline void clear(struct_type *s) { cef_string_utf16_clear(s); } + static inline int set(const char_type* src, size_t src_size, + struct_type* output, int copy) { + return cef_string_utf16_set(src, src_size, output, copy); + } + static inline int compare(const struct_type* s1, const struct_type* s2) { + return cef_string_utf16_cmp(s1, s2); + } + static inline userfree_struct_type userfree_alloc() { + return cef_string_userfree_utf16_alloc(); + } + static inline void userfree_free(userfree_struct_type ufs) { + return cef_string_userfree_utf16_free(ufs); + } + + // Conversion methods. + static inline bool from_ascii(const char* str, size_t len, struct_type* s) { + return cef_string_ascii_to_utf16(str, len, s) ? true : false; + } + static inline std::string to_string(const struct_type* s) { + cef_string_utf8_t cstr; + memset(&cstr, 0, sizeof(cstr)); + cef_string_utf16_to_utf8(s->str, s->length, &cstr); + std::string str; + if (cstr.length > 0) + str = std::string(cstr.str, cstr.length); + cef_string_utf8_clear(&cstr); + return str; + } + static inline bool from_string(const std::string& str, struct_type* s) { + return cef_string_utf8_to_utf16(str.c_str(), str.length(), s) ? + true : false; + } +#if defined(WCHAR_T_IS_UTF32) + static inline std::wstring to_wstring(const struct_type* s) { + cef_string_wide_t cstr; + memset(&cstr, 0, sizeof(cstr)); + cef_string_utf16_to_wide(s->str, s->length, &cstr); + std::wstring str; + if (cstr.length > 0) + str = std::wstring(cstr.str, cstr.length); + cef_string_wide_clear(&cstr); + return str; + } + static inline bool from_wstring(const std::wstring& str, struct_type* s) { + return cef_string_wide_to_utf16(str.c_str(), str.length(), s) ? + true : false; + } +#else // WCHAR_T_IS_UTF32 + static inline std::wstring to_wstring(const struct_type* s) { + return std::wstring(s->str, s->length); + } + static inline bool from_wstring(const std::wstring& str, struct_type* s) { + return cef_string_utf16_set(str.c_str(), str.length(), s, true) ? + true : false; + } +#endif // WCHAR_T_IS_UTF32 + static inline base::string16 to_string16(const struct_type* s) { + return base::string16(s->str, s->length); + } + static inline bool from_string16(const base::string16& str, struct_type* s) { + return cef_string_utf16_set(str.c_str(), str.length(), s, true) ? + true : false; + } +}; + +/// +// CEF string classes can convert between all supported string types. For +// example, the CefStringWide class uses wchar_t as the underlying character +// type and provides two approaches for converting data to/from a UTF8 string +// (std::string). +//

+// 1. Implicit conversion using the assignment operator overload. +//

+//   CefStringWide aCefString;
+//   std::string aUTF8String;
+//   aCefString = aUTF8String; // Assign std::string to CefStringWide
+//   aUTF8String = aCefString; // Assign CefStringWide to std::string
+// 
+// 2. Explicit conversion using the FromString/ToString methods. +//
+//   CefStringWide aCefString;
+//   std::string aUTF8String;
+//   aCefString.FromString(aUTF8String); // Assign std::string to CefStringWide
+//   aUTF8String = aCefString.ToString(); // Assign CefStringWide to std::string
+// 
+// Conversion will only occur if the assigned value is a different string type. +// Assigning a std::string to a CefStringUTF8, for example, will copy the data +// without performing a conversion. +//

+// CEF string classes are safe for reading from multiple threads but not for +// modification. It is the user's responsibility to provide synchronization if +// modifying CEF strings from multiple threads. +/// +template +class CefStringBase { + public: + typedef typename traits::char_type char_type; + typedef typename traits::struct_type struct_type; + typedef typename traits::userfree_struct_type userfree_struct_type; + + /// + // Default constructor. + /// + CefStringBase() : string_(NULL), owner_(false) {} + + /// + // Create a new string from an existing string. Data will always be copied. + /// + CefStringBase(const CefStringBase& str) + : string_(NULL), owner_(false) { + FromString(str.c_str(), str.length(), true); + } + + /// + // Create a new string from an existing std::string. Data will be always + // copied. Translation will occur if necessary based on the underlying string + // type. + /// + CefStringBase(const std::string& src) // NOLINT(runtime/explicit) + : string_(NULL), owner_(false) { + FromString(src); + } + CefStringBase(const char* src) // NOLINT(runtime/explicit) + : string_(NULL), owner_(false) { + if (src) + FromString(std::string(src)); + } + + /// + // Create a new string from an existing std::wstring. Data will be always + // copied. Translation will occur if necessary based on the underlying string + // type. + /// + CefStringBase(const std::wstring& src) // NOLINT(runtime/explicit) + : string_(NULL), owner_(false) { + FromWString(src); + } + CefStringBase(const wchar_t* src) // NOLINT(runtime/explicit) + : string_(NULL), owner_(false) { + if (src) + FromWString(std::wstring(src)); + } + +#if defined(WCHAR_T_IS_UTF32) + /// + // Create a new string from an existing string16. Data will be always + // copied. Translation will occur if necessary based on the underlying string + // type. + /// + CefStringBase(const base::string16& src) // NOLINT(runtime/explicit) + : string_(NULL), owner_(false) { + FromString16(src); + } + CefStringBase(const char16* src) // NOLINT(runtime/explicit) + : string_(NULL), owner_(false) { + if (src) + FromString16(base::string16(src)); + } +#endif // WCHAR_T_IS_UTF32 + + /// + // Create a new string from an existing character array. If |copy| is true + // this class will copy the data. Otherwise, this class will reference the + // existing data. Referenced data must exist for the lifetime of this class + // and will not be freed by this class. + /// + CefStringBase(const char_type* src, size_t src_len, bool copy) + : string_(NULL), owner_(false) { + if (src && src_len > 0) + FromString(src, src_len, copy); + } + + /// + // Create a new string referencing an existing string structure without taking + // ownership. Referenced structures must exist for the lifetime of this class + // and will not be freed by this class. + /// + CefStringBase(const struct_type* src) // NOLINT(runtime/explicit) + : string_(NULL), owner_(false) { + if (!src) + return; + // Reference the existing structure without taking ownership. + Attach(const_cast(src), false); + } + + virtual ~CefStringBase() { ClearAndFree(); } + + + // The following methods are named for compatibility with the standard library + // string template types. + + /// + // Return a read-only pointer to the string data. + /// + const char_type* c_str() const { return (string_ ? string_->str : NULL); } + + /// + // Return the length of the string data. + /// + size_t length() const { return (string_ ? string_->length : 0); } + + /// + // Return the length of the string data. + /// + inline size_t size() const { return length(); } + + /// + // Returns true if the string is empty. + /// + bool empty() const { return (string_ == NULL || string_->length == 0); } + + /// + // Compare this string to the specified string. + /// + int compare(const CefStringBase& str) const { + if (empty() && str.empty()) + return 0; + if (empty()) + return -1; + if (str.empty()) + return 1; + return traits::compare(string_, str.GetStruct()); + } + + /// + // Clear the string data. + /// + void clear() { + if (string_) + traits::clear(string_); + } + + /// + // Swap this string's contents with the specified string. + /// + void swap(CefStringBase& str) { + struct_type* tmp_string = string_; + bool tmp_owner = owner_; + string_ = str.string_; + owner_ = str.owner_; + str.string_ = tmp_string; + str.owner_ = tmp_owner; + } + + + // The following methods are unique to CEF string template types. + + /// + // Returns true if this class owns the underlying string structure. + /// + bool IsOwner() const { return owner_; } + + /// + // Returns a read-only pointer to the underlying string structure. May return + // NULL if no structure is currently allocated. + /// + const struct_type* GetStruct() const { return string_; } + + /// + // Returns a writable pointer to the underlying string structure. Will never + // return NULL. + /// + struct_type* GetWritableStruct() { + AllocIfNeeded(); + return string_; + } + + /// + // Clear the state of this class. The underlying string structure and data + // will be freed if this class owns the structure. + /// + void ClearAndFree() { + if (!string_) + return; + if (owner_) { + clear(); + delete string_; + } + string_ = NULL; + owner_ = false; + } + + /// + // Attach to the specified string structure. If |owner| is true this class + // will take ownership of the structure. + /// + void Attach(struct_type* str, bool owner) { + // Free the previous structure and data, if any. + ClearAndFree(); + + string_ = str; + owner_ = owner; + } + + /// + // Take ownership of the specified userfree structure's string data. The + // userfree structure itself will be freed. Only use this method with userfree + // structures. + /// + void AttachToUserFree(userfree_struct_type str) { + // Free the previous structure and data, if any. + ClearAndFree(); + + if (!str) + return; + + AllocIfNeeded(); + owner_ = true; + memcpy(string_, str, sizeof(struct_type)); + + // Free the |str| structure but not the data. + memset(str, 0, sizeof(struct_type)); + traits::userfree_free(str); + } + + /// + // Detach from the underlying string structure. To avoid memory leaks only use + // this method if you already hold a pointer to the underlying string + // structure. + /// + void Detach() { + string_ = NULL; + owner_ = false; + } + + /// + // Create a userfree structure and give it ownership of this class' string + // data. This class will be disassociated from the data. May return NULL if + // this string class currently contains no data. + /// + userfree_struct_type DetachToUserFree() { + if (empty()) + return NULL; + + userfree_struct_type str = traits::userfree_alloc(); + memcpy(str, string_, sizeof(struct_type)); + + // Free this class' structure but not the data. + memset(string_, 0, sizeof(struct_type)); + ClearAndFree(); + + return str; + } + + /// + // Set this string's data to the specified character array. If |copy| is true + // this class will copy the data. Otherwise, this class will reference the + // existing data. Referenced data must exist for the lifetime of this class + // and will not be freed by this class. + /// + bool FromString(const char_type* src, size_t src_len, bool copy) { + if (src == NULL || src_len == 0) { + clear(); + return true; + } + AllocIfNeeded(); + return traits::set(src, src_len, string_, copy) ? true : false; + } + + /// + // Set this string's data from an existing ASCII string. Data will be always + // copied. Translation will occur if necessary based on the underlying string + // type. + /// + bool FromASCII(const char* str) { + size_t len = str ? strlen(str) : 0; + if (len == 0) { + clear(); + return true; + } + AllocIfNeeded(); + return traits::from_ascii(str, len, string_); + } + + /// + // Return this string's data as a std::string. Translation will occur if + // necessary based on the underlying string type. + /// + std::string ToString() const { + if (empty()) + return std::string(); + return traits::to_string(string_); + } + + /// + // Set this string's data from an existing std::string. Data will be always + // copied. Translation will occur if necessary based on the underlying string + // type. + /// + bool FromString(const std::string& str) { + if (str.empty()) { + clear(); + return true; + } + AllocIfNeeded(); + return traits::from_string(str, string_); + } + + /// + // Return this string's data as a std::wstring. Translation will occur if + // necessary based on the underlying string type. + /// + std::wstring ToWString() const { + if (empty()) + return std::wstring(); + return traits::to_wstring(string_); + } + + /// + // Set this string's data from an existing std::wstring. Data will be always + // copied. Translation will occur if necessary based on the underlying string + // type. + /// + bool FromWString(const std::wstring& str) { + if (str.empty()) { + clear(); + return true; + } + AllocIfNeeded(); + return traits::from_wstring(str, string_); + } + + /// + // Return this string's data as a string16. Translation will occur if + // necessary based on the underlying string type. + /// + base::string16 ToString16() const { + if (empty()) + return base::string16(); + return traits::to_string16(string_); + } + + /// + // Set this string's data from an existing string16. Data will be always + // copied. Translation will occur if necessary based on the underlying string + // type. + /// + bool FromString16(const base::string16& str) { + if (str.empty()) { + clear(); + return true; + } + AllocIfNeeded(); + return traits::from_string16(str, string_); + } + + /// + // Comparison operator overloads. + /// + bool operator<(const CefStringBase& str) const { + return (compare(str) < 0); + } + bool operator<=(const CefStringBase& str) const { + return (compare(str) <= 0); + } + bool operator>(const CefStringBase& str) const { + return (compare(str) > 0); + } + bool operator>=(const CefStringBase& str) const { + return (compare(str) >= 0); + } + bool operator==(const CefStringBase& str) const { + return (compare(str) == 0); + } + bool operator!=(const CefStringBase& str) const { + return (compare(str) != 0); + } + + /// + // Assignment operator overloads. + /// + CefStringBase& operator=(const CefStringBase& str) { + FromString(str.c_str(), str.length(), true); + return *this; + } + operator std::string() const { + return ToString(); + } + CefStringBase& operator=(const std::string& str) { + FromString(str); + return *this; + } + CefStringBase& operator=(const char* str) { + FromString(std::string(str)); + return *this; + } + operator std::wstring() const { + return ToWString(); + } + CefStringBase& operator=(const std::wstring& str) { + FromWString(str); + return *this; + } + CefStringBase& operator=(const wchar_t* str) { + FromWString(std::wstring(str)); + return *this; + } +#if defined(WCHAR_T_IS_UTF32) + operator base::string16() const { + return ToString16(); + } + CefStringBase& operator=(const base::string16& str) { + FromString16(str); + return *this; + } + CefStringBase& operator=(const char16* str) { + FromString16(base::string16(str)); + return *this; + } +#endif // WCHAR_T_IS_UTF32 + + private: + // Allocate the string structure if it doesn't already exist. + void AllocIfNeeded() { + if (string_ == NULL) { + string_ = new struct_type; + memset(string_, 0, sizeof(struct_type)); + owner_ = true; + } + } + + struct_type* string_; + bool owner_; +}; + + +typedef CefStringBase CefStringWide; +typedef CefStringBase CefStringUTF8; +typedef CefStringBase CefStringUTF16; + +#endif // CEF_INCLUDE_INTERNAL_CEF_STRING_WRAPPERS_H_ diff --git a/dependencies64/cef/include/internal/cef_thread_internal.h b/dependencies64/cef/include/internal/cef_thread_internal.h new file mode 100644 index 000000000..eee2b2ae4 --- /dev/null +++ b/dependencies64/cef/include/internal/cef_thread_internal.h @@ -0,0 +1,74 @@ +// Copyright (c) 2014 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#ifndef CEF_INCLUDE_INTERNAL_CEF_THREAD_INTERNAL_H_ +#define CEF_INCLUDE_INTERNAL_CEF_THREAD_INTERNAL_H_ +#pragma once + +#if defined(OS_WIN) +#include +#elif defined(OS_POSIX) +#include +#include +#endif + +#include "include/internal/cef_export.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#if defined(OS_WIN) +typedef DWORD cef_platform_thread_id_t; +#elif defined(OS_POSIX) +typedef pid_t cef_platform_thread_id_t; +#endif + +/// +// Returns the current platform thread ID. +/// +CEF_EXPORT cef_platform_thread_id_t cef_get_current_platform_thread_id(); + +#if defined(OS_WIN) +typedef DWORD cef_platform_thread_handle_t; +#elif defined(OS_POSIX) +typedef pthread_t cef_platform_thread_handle_t; +#endif + +/// +// Returns the current platform thread handle. +/// +CEF_EXPORT cef_platform_thread_handle_t + cef_get_current_platform_thread_handle(); + +#ifdef __cplusplus +} +#endif // __cplusplus + +#endif // CEF_INCLUDE_INTERNAL_CEF_THREAD_INTERNAL_H_ diff --git a/dependencies64/cef/include/internal/cef_time.h b/dependencies64/cef/include/internal/cef_time.h new file mode 100644 index 000000000..64e601fe0 --- /dev/null +++ b/dependencies64/cef/include/internal/cef_time.h @@ -0,0 +1,88 @@ +// Copyright (c) 2011 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#ifndef CEF_INCLUDE_INTERNAL_CEF_TIME_H_ +#define CEF_INCLUDE_INTERNAL_CEF_TIME_H_ +#pragma once + +#ifdef __cplusplus +extern "C" { +#endif + +#include "include/internal/cef_export.h" +#include + +/// +// Time information. Values should always be in UTC. +/// +typedef struct _cef_time_t { + int year; // Four digit year "2007" + int month; // 1-based month (values 1 = January, etc.) + int day_of_week; // 0-based day of week (0 = Sunday, etc.) + int day_of_month; // 1-based day of month (1-31) + int hour; // Hour within the current day (0-23) + int minute; // Minute within the current hour (0-59) + int second; // Second within the current minute (0-59 plus leap + // seconds which may take it up to 60). + int millisecond; // Milliseconds within the current second (0-999) +} cef_time_t; + +/// +// Converts cef_time_t to/from time_t. Returns true (1) on success and false (0) +// on failure. +/// +CEF_EXPORT int cef_time_to_timet(const cef_time_t* cef_time, time_t* time); +CEF_EXPORT int cef_time_from_timet(time_t time, cef_time_t* cef_time); + +/// +// Converts cef_time_t to/from a double which is the number of seconds since +// epoch (Jan 1, 1970). Webkit uses this format to represent time. A value of 0 +// means "not initialized". Returns true (1) on success and false (0) on +// failure. +/// +CEF_EXPORT int cef_time_to_doublet(const cef_time_t* cef_time, double* time); +CEF_EXPORT int cef_time_from_doublet(double time, cef_time_t* cef_time); + +/// +// Retrieve the current system time. +// +CEF_EXPORT int cef_time_now(cef_time_t* cef_time); + +/// +// Retrieve the delta in milliseconds between two time values. +// +CEF_EXPORT int cef_time_delta(const cef_time_t* cef_time1, + const cef_time_t* cef_time2, + long long* delta); + +#ifdef __cplusplus +} +#endif + +#endif // CEF_INCLUDE_INTERNAL_CEF_TIME_H_ diff --git a/dependencies64/cef/include/internal/cef_trace_event_internal.h b/dependencies64/cef/include/internal/cef_trace_event_internal.h new file mode 100644 index 000000000..6df870717 --- /dev/null +++ b/dependencies64/cef/include/internal/cef_trace_event_internal.h @@ -0,0 +1,124 @@ +// Copyright (c) 2014 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#ifndef CEF_INCLUDE_INTERNAL_CEF_TRACE_EVENT_INTERNAL_H_ +#define CEF_INCLUDE_INTERNAL_CEF_TRACE_EVENT_INTERNAL_H_ +#pragma once + +#include "include/internal/cef_export.h" +#include "include/internal/cef_types.h" + +#ifdef __cplusplus +extern "C" { +#endif + +// See include/base/cef_trace_event.h for macros and intended usage. + +// Functions for tracing counters and functions; called from macros. +// - |category| string must have application lifetime (static or literal). They +// may not include "(quotes) chars. +// - |argX_name|, |argX_val|, |valueX_name|, |valeX_val| are optional parameters +// and represent pairs of name and values of arguments +// - |copy| is used to avoid memory scoping issues with the |name| and +// |arg_name| parameters by copying them +// - |id| is used to disambiguate counters with the same name, or match async +// trace events + +CEF_EXPORT void cef_trace_event_instant(const char* category, + const char* name, + const char* arg1_name, + uint64 arg1_val, + const char* arg2_name, + uint64 arg2_val, + int copy); +CEF_EXPORT void cef_trace_event_begin(const char* category, + const char* name, + const char* arg1_name, + uint64 arg1_val, + const char* arg2_name, + uint64 arg2_val, + int copy); +CEF_EXPORT void cef_trace_event_end(const char* category, + const char* name, + const char* arg1_name, + uint64 arg1_val, + const char* arg2_name, + uint64 arg2_val, + int copy); +CEF_EXPORT void cef_trace_counter(const char* category, + const char* name, + const char* value1_name, + uint64 value1_val, + const char* value2_name, + uint64 value2_val, + int copy); +CEF_EXPORT void cef_trace_counter_id(const char* category, + const char* name, + uint64 id, + const char* value1_name, + uint64 value1_val, + const char* value2_name, + uint64 value2_val, + int copy); +CEF_EXPORT void cef_trace_event_async_begin(const char* category, + const char* name, + uint64 id, + const char* arg1_name, + uint64 arg1_val, + const char* arg2_name, + uint64 arg2_val, + int copy); +CEF_EXPORT void cef_trace_event_async_step_into(const char* category, + const char* name, + uint64 id, + uint64 step, + const char* arg1_name, + uint64 arg1_val, + int copy); +CEF_EXPORT void cef_trace_event_async_step_past(const char* category, + const char* name, + uint64 id, + uint64 step, + const char* arg1_name, + uint64 arg1_val, + int copy); +CEF_EXPORT void cef_trace_event_async_end(const char* category, + const char* name, + uint64 id, + const char* arg1_name, + uint64 arg1_val, + const char* arg2_name, + uint64 arg2_val, + int copy); + +#ifdef __cplusplus +} +#endif // __cplusplus + +#endif // CEF_INCLUDE_INTERNAL_CEF_TRACE_EVENT_INTERNAL_H_ diff --git a/dependencies64/cef/include/internal/cef_types.h b/dependencies64/cef/include/internal/cef_types.h new file mode 100644 index 000000000..59d2f2353 --- /dev/null +++ b/dependencies64/cef/include/internal/cef_types.h @@ -0,0 +1,2121 @@ +// Copyright (c) 2014 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +#ifndef CEF_INCLUDE_INTERNAL_CEF_TYPES_H_ +#define CEF_INCLUDE_INTERNAL_CEF_TYPES_H_ +#pragma once + +#include "include/base/cef_build.h" +#include "include/internal/cef_string.h" +#include "include/internal/cef_string_list.h" +#include "include/internal/cef_time.h" + +// Bring in platform-specific definitions. +#if defined(OS_WIN) +#include "include/internal/cef_types_win.h" +#elif defined(OS_MACOSX) +#include "include/internal/cef_types_mac.h" +#elif defined(OS_LINUX) +#include "include/internal/cef_types_linux.h" +#endif + +#include // For UINT_MAX +#include // For size_t + +// The NSPR system headers define 64-bit as |long| when possible, except on +// Mac OS X. In order to not have typedef mismatches, we do the same on LP64. +// +// On Mac OS X, |long long| is used for 64-bit types for compatibility with +// format macros even in the LP64 model. +#if defined(__LP64__) && !defined(OS_MACOSX) && !defined(OS_OPENBSD) +typedef long int64; // NOLINT(runtime/int) +typedef unsigned long uint64; // NOLINT(runtime/int) +#else +typedef long long int64; // NOLINT(runtime/int) +typedef unsigned long long uint64; // NOLINT(runtime/int) +#endif + +// TODO: Remove these type guards. These are to avoid conflicts with +// obsolete/protypes.h in the Gecko SDK. +#ifndef _INT32 +#define _INT32 +typedef int int32; +#endif + +// TODO: Remove these type guards. These are to avoid conflicts with +// obsolete/protypes.h in the Gecko SDK. +#ifndef _UINT32 +#define _UINT32 +typedef unsigned int uint32; +#endif + +// UTF-16 character type +#ifndef char16 +#if defined(WIN32) +typedef wchar_t char16; +#else +typedef unsigned short char16; +#endif +#endif + +// 32-bit ARGB color value, not premultiplied. The color components are always +// in a known order. Equivalent to the SkColor type. +typedef uint32 cef_color_t; + +// Return the alpha byte from a cef_color_t value. +#define CefColorGetA(color) (((color) >> 24) & 0xFF) +// Return the red byte from a cef_color_t value. +#define CefColorGetR(color) (((color) >> 16) & 0xFF) +// Return the green byte from a cef_color_t value. +#define CefColorGetG(color) (((color) >> 8) & 0xFF) +// Return the blue byte from a cef_color_t value. +#define CefColorGetB(color) (((color) >> 0) & 0xFF) + +// Return an cef_color_t value with the specified byte component values. +#define CefColorSetARGB(a, r, g, b) \ + static_cast( \ + (static_cast(a) << 24) | \ + (static_cast(r) << 16) | \ + (static_cast(g) << 8) | \ + (static_cast(b) << 0)) + +// Return an int64 value with the specified low and high int32 component values. +#define CefInt64Set(int32_low, int32_high) \ + static_cast((static_cast(int32_low)) | \ + (static_cast(static_cast(int32_high))) << 32) + +// Return the low int32 value from an int64 value. +#define CefInt64GetLow(int64_val) static_cast(int64_val) +// Return the high int32 value from an int64 value. +#define CefInt64GetHigh(int64_val) \ + static_cast((static_cast(int64_val) >> 32) & 0xFFFFFFFFL) + + +#ifdef __cplusplus +extern "C" { +#endif + +/// +// Log severity levels. +/// +typedef enum { + /// + // Default logging (currently INFO logging). + /// + LOGSEVERITY_DEFAULT, + + /// + // Verbose logging. + /// + LOGSEVERITY_VERBOSE, + + /// + // INFO logging. + /// + LOGSEVERITY_INFO, + + /// + // WARNING logging. + /// + LOGSEVERITY_WARNING, + + /// + // ERROR logging. + /// + LOGSEVERITY_ERROR, + + /// + // Completely disable logging. + /// + LOGSEVERITY_DISABLE = 99 +} cef_log_severity_t; + +/// +// Represents the state of a setting. +/// +typedef enum { + /// + // Use the default state for the setting. + /// + STATE_DEFAULT = 0, + + /// + // Enable or allow the setting. + /// + STATE_ENABLED, + + /// + // Disable or disallow the setting. + /// + STATE_DISABLED, +} cef_state_t; + +/// +// Initialization settings. Specify NULL or 0 to get the recommended default +// values. Many of these and other settings can also configured using command- +// line switches. +/// +typedef struct _cef_settings_t { + /// + // Size of this structure. + /// + size_t size; + + /// + // Set to true (1) to use a single process for the browser and renderer. This + // run mode is not officially supported by Chromium and is less stable than + // the multi-process default. Also configurable using the "single-process" + // command-line switch. + /// + int single_process; + + /// + // Set to true (1) to disable the sandbox for sub-processes. See + // cef_sandbox_win.h for requirements to enable the sandbox on Windows. Also + // configurable using the "no-sandbox" command-line switch. + /// + int no_sandbox; + + /// + // The path to a separate executable that will be launched for sub-processes. + // By default the browser process executable is used. See the comments on + // CefExecuteProcess() for details. Also configurable using the + // "browser-subprocess-path" command-line switch. + /// + cef_string_t browser_subprocess_path; + + /// + // Set to true (1) to have the browser process message loop run in a separate + // thread. If false (0) than the CefDoMessageLoopWork() function must be + // called from your application message loop. This option is only supported on + // Windows. + /// + int multi_threaded_message_loop; + + /// + // Set to true (1) to enable windowless (off-screen) rendering support. Do not + // enable this value if the application does not use windowless rendering as + // it may reduce rendering performance on some systems. + /// + int windowless_rendering_enabled; + + /// + // Set to true (1) to disable configuration of browser process features using + // standard CEF and Chromium command-line arguments. Configuration can still + // be specified using CEF data structures or via the + // CefApp::OnBeforeCommandLineProcessing() method. + /// + int command_line_args_disabled; + + /// + // The location where cache data will be stored on disk. If empty then + // browsers will be created in "incognito mode" where in-memory caches are + // used for storage and no data is persisted to disk. HTML5 databases such as + // localStorage will only persist across sessions if a cache path is + // specified. Can be overridden for individual CefRequestContext instances via + // the CefRequestContextSettings.cache_path value. + /// + cef_string_t cache_path; + + /// + // The location where user data such as spell checking dictionary files will + // be stored on disk. If empty then the default platform-specific user data + // directory will be used ("~/.cef_user_data" directory on Linux, + // "~/Library/Application Support/CEF/User Data" directory on Mac OS X, + // "Local Settings\Application Data\CEF\User Data" directory under the user + // profile directory on Windows). + /// + cef_string_t user_data_path; + + /// + // To persist session cookies (cookies without an expiry date or validity + // interval) by default when using the global cookie manager set this value to + // true. Session cookies are generally intended to be transient and most Web + // browsers do not persist them. A |cache_path| value must also be specified + // to enable this feature. Also configurable using the + // "persist-session-cookies" command-line switch. Can be overridden for + // individual CefRequestContext instances via the + // CefRequestContextSettings.persist_session_cookies value. + /// + int persist_session_cookies; + + /// + // Value that will be returned as the User-Agent HTTP header. If empty the + // default User-Agent string will be used. Also configurable using the + // "user-agent" command-line switch. + /// + cef_string_t user_agent; + + /// + // Value that will be inserted as the product portion of the default + // User-Agent string. If empty the Chromium product version will be used. If + // |userAgent| is specified this value will be ignored. Also configurable + // using the "product-version" command-line switch. + /// + cef_string_t product_version; + + /// + // The locale string that will be passed to WebKit. If empty the default + // locale of "en-US" will be used. This value is ignored on Linux where locale + // is determined using environment variable parsing with the precedence order: + // LANGUAGE, LC_ALL, LC_MESSAGES and LANG. Also configurable using the "lang" + // command-line switch. + /// + cef_string_t locale; + + /// + // The directory and file name to use for the debug log. If empty, the + // default name of "debug.log" will be used and the file will be written + // to the application directory. Also configurable using the "log-file" + // command-line switch. + /// + cef_string_t log_file; + + /// + // The log severity. Only messages of this severity level or higher will be + // logged. Also configurable using the "log-severity" command-line switch with + // a value of "verbose", "info", "warning", "error", "error-report" or + // "disable". + /// + cef_log_severity_t log_severity; + + /// + // Custom flags that will be used when initializing the V8 JavaScript engine. + // The consequences of using custom flags may not be well tested. Also + // configurable using the "js-flags" command-line switch. + /// + cef_string_t javascript_flags; + + /// + // The fully qualified path for the resources directory. If this value is + // empty the cef.pak and/or devtools_resources.pak files must be located in + // the module directory on Windows/Linux or the app bundle Resources directory + // on Mac OS X. Also configurable using the "resources-dir-path" command-line + // switch. + /// + cef_string_t resources_dir_path; + + /// + // The fully qualified path for the locales directory. If this value is empty + // the locales directory must be located in the module directory. This value + // is ignored on Mac OS X where pack files are always loaded from the app + // bundle Resources directory. Also configurable using the "locales-dir-path" + // command-line switch. + /// + cef_string_t locales_dir_path; + + /// + // Set to true (1) to disable loading of pack files for resources and locales. + // A resource bundle handler must be provided for the browser and render + // processes via CefApp::GetResourceBundleHandler() if loading of pack files + // is disabled. Also configurable using the "disable-pack-loading" command- + // line switch. + /// + int pack_loading_disabled; + + /// + // Set to a value between 1024 and 65535 to enable remote debugging on the + // specified port. For example, if 8080 is specified the remote debugging URL + // will be http://localhost:8080. CEF can be remotely debugged from any CEF or + // Chrome browser window. Also configurable using the "remote-debugging-port" + // command-line switch. + /// + int remote_debugging_port; + + /// + // The number of stack trace frames to capture for uncaught exceptions. + // Specify a positive value to enable the CefRenderProcessHandler:: + // OnUncaughtException() callback. Specify 0 (default value) and + // OnUncaughtException() will not be called. Also configurable using the + // "uncaught-exception-stack-size" command-line switch. + /// + int uncaught_exception_stack_size; + + /// + // By default CEF V8 references will be invalidated (the IsValid() method will + // return false) after the owning context has been released. This reduces the + // need for external record keeping and avoids crashes due to the use of V8 + // references after the associated context has been released. + // + // CEF currently offers two context safety implementations with different + // performance characteristics. The default implementation (value of 0) uses a + // map of hash values and should provide better performance in situations with + // a small number contexts. The alternate implementation (value of 1) uses a + // hidden value attached to each context and should provide better performance + // in situations with a large number of contexts. + // + // If you need better performance in the creation of V8 references and you + // plan to manually track context lifespan you can disable context safety by + // specifying a value of -1. + // + // Also configurable using the "context-safety-implementation" command-line + // switch. + /// + int context_safety_implementation; + + /// + // Set to true (1) to ignore errors related to invalid SSL certificates. + // Enabling this setting can lead to potential security vulnerabilities like + // "man in the middle" attacks. Applications that load content from the + // internet should not enable this setting. Also configurable using the + // "ignore-certificate-errors" command-line switch. Can be overridden for + // individual CefRequestContext instances via the + // CefRequestContextSettings.ignore_certificate_errors value. + /// + int ignore_certificate_errors; + + /// + // Opaque background color used for accelerated content. By default the + // background color will be white. Only the RGB compontents of the specified + // value will be used. The alpha component must greater than 0 to enable use + // of the background color but will be otherwise ignored. + /// + cef_color_t background_color; + + /// + // Comma delimited ordered list of language codes without any whitespace that + // will be used in the "Accept-Language" HTTP header. May be overridden on a + // per-browser basis using the CefBrowserSettings.accept_language_list value. + // If both values are empty then "en-US,en" will be used. Can be overridden + // for individual CefRequestContext instances via the + // CefRequestContextSettings.accept_language_list value. + /// + cef_string_t accept_language_list; +} cef_settings_t; + +/// +// Request context initialization settings. Specify NULL or 0 to get the +// recommended default values. +/// +typedef struct _cef_request_context_settings_t { + /// + // Size of this structure. + /// + size_t size; + + /// + // The location where cache data will be stored on disk. If empty then + // browsers will be created in "incognito mode" where in-memory caches are + // used for storage and no data is persisted to disk. HTML5 databases such as + // localStorage will only persist across sessions if a cache path is + // specified. To share the global browser cache and related configuration set + // this value to match the CefSettings.cache_path value. + /// + cef_string_t cache_path; + + /// + // To persist session cookies (cookies without an expiry date or validity + // interval) by default when using the global cookie manager set this value to + // true. Session cookies are generally intended to be transient and most Web + // browsers do not persist them. Can be set globally using the + // CefSettings.persist_session_cookies value. This value will be ignored if + // |cache_path| is empty or if it matches the CefSettings.cache_path value. + /// + int persist_session_cookies; + + /// + // Set to true (1) to ignore errors related to invalid SSL certificates. + // Enabling this setting can lead to potential security vulnerabilities like + // "man in the middle" attacks. Applications that load content from the + // internet should not enable this setting. Can be set globally using the + // CefSettings.ignore_certificate_errors value. This value will be ignored if + // |cache_path| matches the CefSettings.cache_path value. + /// + int ignore_certificate_errors; + + /// + // Comma delimited ordered list of language codes without any whitespace that + // will be used in the "Accept-Language" HTTP header. Can be set globally + // using the CefSettings.accept_language_list value or overridden on a per- + // browser basis using the CefBrowserSettings.accept_language_list value. If + // all values are empty then "en-US,en" will be used. This value will be + // ignored if |cache_path| matches the CefSettings.cache_path value. + /// + cef_string_t accept_language_list; +} cef_request_context_settings_t; + +/// +// Browser initialization settings. Specify NULL or 0 to get the recommended +// default values. The consequences of using custom values may not be well +// tested. Many of these and other settings can also configured using command- +// line switches. +/// +typedef struct _cef_browser_settings_t { + /// + // Size of this structure. + /// + size_t size; + + /// + // The maximum rate in frames per second (fps) that CefRenderHandler::OnPaint + // will be called for a windowless browser. The actual fps may be lower if + // the browser cannot generate frames at the requested rate. The minimum + // value is 1 and the maximum value is 60 (default 30). + /// + int windowless_frame_rate; + + // The below values map to WebPreferences settings. + + /// + // Font settings. + /// + cef_string_t standard_font_family; + cef_string_t fixed_font_family; + cef_string_t serif_font_family; + cef_string_t sans_serif_font_family; + cef_string_t cursive_font_family; + cef_string_t fantasy_font_family; + int default_font_size; + int default_fixed_font_size; + int minimum_font_size; + int minimum_logical_font_size; + + /// + // Default encoding for Web content. If empty "ISO-8859-1" will be used. Also + // configurable using the "default-encoding" command-line switch. + /// + cef_string_t default_encoding; + + /// + // Controls the loading of fonts from remote sources. Also configurable using + // the "disable-remote-fonts" command-line switch. + /// + cef_state_t remote_fonts; + + /// + // Controls whether JavaScript can be executed. Also configurable using the + // "disable-javascript" command-line switch. + /// + cef_state_t javascript; + + /// + // Controls whether JavaScript can be used for opening windows. Also + // configurable using the "disable-javascript-open-windows" command-line + // switch. + /// + cef_state_t javascript_open_windows; + + /// + // Controls whether JavaScript can be used to close windows that were not + // opened via JavaScript. JavaScript can still be used to close windows that + // were opened via JavaScript or that have no back/forward history. Also + // configurable using the "disable-javascript-close-windows" command-line + // switch. + /// + cef_state_t javascript_close_windows; + + /// + // Controls whether JavaScript can access the clipboard. Also configurable + // using the "disable-javascript-access-clipboard" command-line switch. + /// + cef_state_t javascript_access_clipboard; + + /// + // Controls whether DOM pasting is supported in the editor via + // execCommand("paste"). The |javascript_access_clipboard| setting must also + // be enabled. Also configurable using the "disable-javascript-dom-paste" + // command-line switch. + /// + cef_state_t javascript_dom_paste; + + /// + // Controls whether the caret position will be drawn. Also configurable using + // the "enable-caret-browsing" command-line switch. + /// + cef_state_t caret_browsing; + + /// + // Controls whether the Java plugin will be loaded. Also configurable using + // the "disable-java" command-line switch. + /// + cef_state_t java; + + /// + // Controls whether any plugins will be loaded. Also configurable using the + // "disable-plugins" command-line switch. + /// + cef_state_t plugins; + + /// + // Controls whether file URLs will have access to all URLs. Also configurable + // using the "allow-universal-access-from-files" command-line switch. + /// + cef_state_t universal_access_from_file_urls; + + /// + // Controls whether file URLs will have access to other file URLs. Also + // configurable using the "allow-access-from-files" command-line switch. + /// + cef_state_t file_access_from_file_urls; + + /// + // Controls whether web security restrictions (same-origin policy) will be + // enforced. Disabling this setting is not recommend as it will allow risky + // security behavior such as cross-site scripting (XSS). Also configurable + // using the "disable-web-security" command-line switch. + /// + cef_state_t web_security; + + /// + // Controls whether image URLs will be loaded from the network. A cached image + // will still be rendered if requested. Also configurable using the + // "disable-image-loading" command-line switch. + /// + cef_state_t image_loading; + + /// + // Controls whether standalone images will be shrunk to fit the page. Also + // configurable using the "image-shrink-standalone-to-fit" command-line + // switch. + /// + cef_state_t image_shrink_standalone_to_fit; + + /// + // Controls whether text areas can be resized. Also configurable using the + // "disable-text-area-resize" command-line switch. + /// + cef_state_t text_area_resize; + + /// + // Controls whether the tab key can advance focus to links. Also configurable + // using the "disable-tab-to-links" command-line switch. + /// + cef_state_t tab_to_links; + + /// + // Controls whether local storage can be used. Also configurable using the + // "disable-local-storage" command-line switch. + /// + cef_state_t local_storage; + + /// + // Controls whether databases can be used. Also configurable using the + // "disable-databases" command-line switch. + /// + cef_state_t databases; + + /// + // Controls whether the application cache can be used. Also configurable using + // the "disable-application-cache" command-line switch. + /// + cef_state_t application_cache; + + /// + // Controls whether WebGL can be used. Note that WebGL requires hardware + // support and may not work on all systems even when enabled. Also + // configurable using the "disable-webgl" command-line switch. + /// + cef_state_t webgl; + + /// + // Opaque background color used for the browser before a document is loaded + // and when no document color is specified. By default the background color + // will be the same as CefSettings.background_color. Only the RGB compontents + // of the specified value will be used. The alpha component must greater than + // 0 to enable use of the background color but will be otherwise ignored. + /// + cef_color_t background_color; + + /// + // Comma delimited ordered list of language codes without any whitespace that + // will be used in the "Accept-Language" HTTP header. May be set globally + // using the CefBrowserSettings.accept_language_list value. If both values are + // empty then "en-US,en" will be used. + /// + cef_string_t accept_language_list; +} cef_browser_settings_t; + +/// +// Return value types. +/// +typedef enum { + /// + // Cancel immediately. + /// + RV_CANCEL = 0, + + /// + // Continue immediately. + /// + RV_CONTINUE, + + /// + // Continue asynchronously (usually via a callback). + /// + RV_CONTINUE_ASYNC, +} cef_return_value_t; + +/// +// URL component parts. +/// +typedef struct _cef_urlparts_t { + /// + // The complete URL specification. + /// + cef_string_t spec; + + /// + // Scheme component not including the colon (e.g., "http"). + /// + cef_string_t scheme; + + /// + // User name component. + /// + cef_string_t username; + + /// + // Password component. + /// + cef_string_t password; + + /// + // Host component. This may be a hostname, an IPv4 address or an IPv6 literal + // surrounded by square brackets (e.g., "[2001:db8::1]"). + /// + cef_string_t host; + + /// + // Port number component. + /// + cef_string_t port; + + /// + // Origin contains just the scheme, host, and port from a URL. Equivalent to + // clearing any username and password, replacing the path with a slash, and + // clearing everything after that. This value will be empty for non-standard + // URLs. + /// + cef_string_t origin; + + /// + // Path component including the first slash following the host. + /// + cef_string_t path; + + /// + // Query string component (i.e., everything following the '?'). + /// + cef_string_t query; +} cef_urlparts_t; + +/// +// Cookie information. +/// +typedef struct _cef_cookie_t { + /// + // The cookie name. + /// + cef_string_t name; + + /// + // The cookie value. + /// + cef_string_t value; + + /// + // If |domain| is empty a host cookie will be created instead of a domain + // cookie. Domain cookies are stored with a leading "." and are visible to + // sub-domains whereas host cookies are not. + /// + cef_string_t domain; + + /// + // If |path| is non-empty only URLs at or below the path will get the cookie + // value. + /// + cef_string_t path; + + /// + // If |secure| is true the cookie will only be sent for HTTPS requests. + /// + int secure; + + /// + // If |httponly| is true the cookie will only be sent for HTTP requests. + /// + int httponly; + + /// + // The cookie creation date. This is automatically populated by the system on + // cookie creation. + /// + cef_time_t creation; + + /// + // The cookie last access date. This is automatically populated by the system + // on access. + /// + cef_time_t last_access; + + /// + // The cookie expiration date is only valid if |has_expires| is true. + /// + int has_expires; + cef_time_t expires; +} cef_cookie_t; + +/// +// Process termination status values. +/// +typedef enum { + /// + // Non-zero exit status. + /// + TS_ABNORMAL_TERMINATION, + + /// + // SIGKILL or task manager kill. + /// + TS_PROCESS_WAS_KILLED, + + /// + // Segmentation fault. + /// + TS_PROCESS_CRASHED, +} cef_termination_status_t; + +/// +// Path key values. +/// +typedef enum { + /// + // Current directory. + /// + PK_DIR_CURRENT, + + /// + // Directory containing PK_FILE_EXE. + /// + PK_DIR_EXE, + + /// + // Directory containing PK_FILE_MODULE. + /// + PK_DIR_MODULE, + + /// + // Temporary directory. + /// + PK_DIR_TEMP, + + /// + // Path and filename of the current executable. + /// + PK_FILE_EXE, + + /// + // Path and filename of the module containing the CEF code (usually the libcef + // module). + /// + PK_FILE_MODULE, + + /// + // "Local Settings\Application Data" directory under the user profile + // directory on Windows. + /// + PK_LOCAL_APP_DATA, + + /// + // "Application Data" directory under the user profile directory on Windows + // and "~/Library/Application Support" directory on Mac OS X. + /// + PK_USER_DATA, +} cef_path_key_t; + +/// +// Storage types. +/// +typedef enum { + ST_LOCALSTORAGE = 0, + ST_SESSIONSTORAGE, +} cef_storage_type_t; + +/// +// Supported error code values. See net\base\net_error_list.h for complete +// descriptions of the error codes. +/// +typedef enum { + ERR_NONE = 0, + ERR_FAILED = -2, + ERR_ABORTED = -3, + ERR_INVALID_ARGUMENT = -4, + ERR_INVALID_HANDLE = -5, + ERR_FILE_NOT_FOUND = -6, + ERR_TIMED_OUT = -7, + ERR_FILE_TOO_BIG = -8, + ERR_UNEXPECTED = -9, + ERR_ACCESS_DENIED = -10, + ERR_NOT_IMPLEMENTED = -11, + ERR_CONNECTION_CLOSED = -100, + ERR_CONNECTION_RESET = -101, + ERR_CONNECTION_REFUSED = -102, + ERR_CONNECTION_ABORTED = -103, + ERR_CONNECTION_FAILED = -104, + ERR_NAME_NOT_RESOLVED = -105, + ERR_INTERNET_DISCONNECTED = -106, + ERR_SSL_PROTOCOL_ERROR = -107, + ERR_ADDRESS_INVALID = -108, + ERR_ADDRESS_UNREACHABLE = -109, + ERR_SSL_CLIENT_AUTH_CERT_NEEDED = -110, + ERR_TUNNEL_CONNECTION_FAILED = -111, + ERR_NO_SSL_VERSIONS_ENABLED = -112, + ERR_SSL_VERSION_OR_CIPHER_MISMATCH = -113, + ERR_SSL_RENEGOTIATION_REQUESTED = -114, + ERR_CERT_COMMON_NAME_INVALID = -200, + ERR_CERT_DATE_INVALID = -201, + ERR_CERT_AUTHORITY_INVALID = -202, + ERR_CERT_CONTAINS_ERRORS = -203, + ERR_CERT_NO_REVOCATION_MECHANISM = -204, + ERR_CERT_UNABLE_TO_CHECK_REVOCATION = -205, + ERR_CERT_REVOKED = -206, + ERR_CERT_INVALID = -207, + ERR_CERT_END = -208, + ERR_INVALID_URL = -300, + ERR_DISALLOWED_URL_SCHEME = -301, + ERR_UNKNOWN_URL_SCHEME = -302, + ERR_TOO_MANY_REDIRECTS = -310, + ERR_UNSAFE_REDIRECT = -311, + ERR_UNSAFE_PORT = -312, + ERR_INVALID_RESPONSE = -320, + ERR_INVALID_CHUNKED_ENCODING = -321, + ERR_METHOD_NOT_SUPPORTED = -322, + ERR_UNEXPECTED_PROXY_AUTH = -323, + ERR_EMPTY_RESPONSE = -324, + ERR_RESPONSE_HEADERS_TOO_BIG = -325, + ERR_CACHE_MISS = -400, + ERR_INSECURE_RESPONSE = -501, +} cef_errorcode_t; + +/// +// The manner in which a link click should be opened. +/// +typedef enum { + WOD_UNKNOWN, + WOD_SUPPRESS_OPEN, + WOD_CURRENT_TAB, + WOD_SINGLETON_TAB, + WOD_NEW_FOREGROUND_TAB, + WOD_NEW_BACKGROUND_TAB, + WOD_NEW_POPUP, + WOD_NEW_WINDOW, + WOD_SAVE_TO_DISK, + WOD_OFF_THE_RECORD, + WOD_IGNORE_ACTION +} cef_window_open_disposition_t; + +/// +// "Verb" of a drag-and-drop operation as negotiated between the source and +// destination. These constants match their equivalents in WebCore's +// DragActions.h and should not be renumbered. +/// +typedef enum { + DRAG_OPERATION_NONE = 0, + DRAG_OPERATION_COPY = 1, + DRAG_OPERATION_LINK = 2, + DRAG_OPERATION_GENERIC = 4, + DRAG_OPERATION_PRIVATE = 8, + DRAG_OPERATION_MOVE = 16, + DRAG_OPERATION_DELETE = 32, + DRAG_OPERATION_EVERY = UINT_MAX +} cef_drag_operations_mask_t; + +/// +// V8 access control values. +/// +typedef enum { + V8_ACCESS_CONTROL_DEFAULT = 0, + V8_ACCESS_CONTROL_ALL_CAN_READ = 1, + V8_ACCESS_CONTROL_ALL_CAN_WRITE = 1 << 1, + V8_ACCESS_CONTROL_PROHIBITS_OVERWRITING = 1 << 2 +} cef_v8_accesscontrol_t; + +/// +// V8 property attribute values. +/// +typedef enum { + V8_PROPERTY_ATTRIBUTE_NONE = 0, // Writeable, Enumerable, + // Configurable + V8_PROPERTY_ATTRIBUTE_READONLY = 1 << 0, // Not writeable + V8_PROPERTY_ATTRIBUTE_DONTENUM = 1 << 1, // Not enumerable + V8_PROPERTY_ATTRIBUTE_DONTDELETE = 1 << 2 // Not configurable +} cef_v8_propertyattribute_t; + +/// +// Post data elements may represent either bytes or files. +/// +typedef enum { + PDE_TYPE_EMPTY = 0, + PDE_TYPE_BYTES, + PDE_TYPE_FILE, +} cef_postdataelement_type_t; + +/// +// Resource type for a request. +/// +typedef enum { + /// + // Top level page. + /// + RT_MAIN_FRAME = 0, + + /// + // Frame or iframe. + /// + RT_SUB_FRAME, + + /// + // CSS stylesheet. + /// + RT_STYLESHEET, + + /// + // External script. + /// + RT_SCRIPT, + + /// + // Image (jpg/gif/png/etc). + /// + RT_IMAGE, + + /// + // Font. + /// + RT_FONT_RESOURCE, + + /// + // Some other subresource. This is the default type if the actual type is + // unknown. + /// + RT_SUB_RESOURCE, + + /// + // Object (or embed) tag for a plugin, or a resource that a plugin requested. + /// + RT_OBJECT, + + /// + // Media resource. + /// + RT_MEDIA, + + /// + // Main resource of a dedicated worker. + /// + RT_WORKER, + + /// + // Main resource of a shared worker. + /// + RT_SHARED_WORKER, + + /// + // Explicitly requested prefetch. + /// + RT_PREFETCH, + + /// + // Favicon. + /// + RT_FAVICON, + + /// + // XMLHttpRequest. + /// + RT_XHR, + + /// + // A request for a + /// + RT_PING, + + /// + // Main resource of a service worker. + /// + RT_SERVICE_WORKER, +} cef_resource_type_t; + +/// +// Transition type for a request. Made up of one source value and 0 or more +// qualifiers. +/// +typedef enum { + /// + // Source is a link click or the JavaScript window.open function. This is + // also the default value for requests like sub-resource loads that are not + // navigations. + /// + TT_LINK = 0, + + /// + // Source is some other "explicit" navigation action such as creating a new + // browser or using the LoadURL function. This is also the default value + // for navigations where the actual type is unknown. + /// + TT_EXPLICIT = 1, + + /// + // Source is a subframe navigation. This is any content that is automatically + // loaded in a non-toplevel frame. For example, if a page consists of several + // frames containing ads, those ad URLs will have this transition type. + // The user may not even realize the content in these pages is a separate + // frame, so may not care about the URL. + /// + TT_AUTO_SUBFRAME = 3, + + /// + // Source is a subframe navigation explicitly requested by the user that will + // generate new navigation entries in the back/forward list. These are + // probably more important than frames that were automatically loaded in + // the background because the user probably cares about the fact that this + // link was loaded. + /// + TT_MANUAL_SUBFRAME = 4, + + /// + // Source is a form submission by the user. NOTE: In some situations + // submitting a form does not result in this transition type. This can happen + // if the form uses a script to submit the contents. + /// + TT_FORM_SUBMIT = 7, + + /// + // Source is a "reload" of the page via the Reload function or by re-visiting + // the same URL. NOTE: This is distinct from the concept of whether a + // particular load uses "reload semantics" (i.e. bypasses cached data). + /// + TT_RELOAD = 8, + + /// + // General mask defining the bits used for the source values. + /// + TT_SOURCE_MASK = 0xFF, + + // Qualifiers. + // Any of the core values above can be augmented by one or more qualifiers. + // These qualifiers further define the transition. + + /// + // Attempted to visit a URL but was blocked. + /// + TT_BLOCKED_FLAG = 0x00800000, + + /// + // Used the Forward or Back function to navigate among browsing history. + /// + TT_FORWARD_BACK_FLAG = 0x01000000, + + /// + // The beginning of a navigation chain. + /// + TT_CHAIN_START_FLAG = 0x10000000, + + /// + // The last transition in a redirect chain. + /// + TT_CHAIN_END_FLAG = 0x20000000, + + /// + // Redirects caused by JavaScript or a meta refresh tag on the page. + /// + TT_CLIENT_REDIRECT_FLAG = 0x40000000, + + /// + // Redirects sent from the server by HTTP headers. + /// + TT_SERVER_REDIRECT_FLAG = 0x80000000, + + /// + // Used to test whether a transition involves a redirect. + /// + TT_IS_REDIRECT_MASK = 0xC0000000, + + /// + // General mask defining the bits used for the qualifiers. + /// + TT_QUALIFIER_MASK = 0xFFFFFF00, +} cef_transition_type_t; + +/// +// Flags used to customize the behavior of CefURLRequest. +/// +typedef enum { + /// + // Default behavior. + /// + UR_FLAG_NONE = 0, + + /// + // If set the cache will be skipped when handling the request. + /// + UR_FLAG_SKIP_CACHE = 1 << 0, + + /// + // If set user name, password, and cookies may be sent with the request, and + // cookies may be saved from the response. + /// + UR_FLAG_ALLOW_CACHED_CREDENTIALS = 1 << 1, + + /// + // If set upload progress events will be generated when a request has a body. + /// + UR_FLAG_REPORT_UPLOAD_PROGRESS = 1 << 3, + + /// + // If set the headers sent and received for the request will be recorded. + /// + UR_FLAG_REPORT_RAW_HEADERS = 1 << 5, + + /// + // If set the CefURLRequestClient::OnDownloadData method will not be called. + /// + UR_FLAG_NO_DOWNLOAD_DATA = 1 << 6, + + /// + // If set 5XX redirect errors will be propagated to the observer instead of + // automatically re-tried. This currently only applies for requests + // originated in the browser process. + /// + UR_FLAG_NO_RETRY_ON_5XX = 1 << 7, +} cef_urlrequest_flags_t; + +/// +// Flags that represent CefURLRequest status. +/// +typedef enum { + /// + // Unknown status. + /// + UR_UNKNOWN = 0, + + /// + // Request succeeded. + /// + UR_SUCCESS, + + /// + // An IO request is pending, and the caller will be informed when it is + // completed. + /// + UR_IO_PENDING, + + /// + // Request was canceled programatically. + /// + UR_CANCELED, + + /// + // Request failed for some reason. + /// + UR_FAILED, +} cef_urlrequest_status_t; + +/// +// Structure representing a point. +/// +typedef struct _cef_point_t { + int x; + int y; +} cef_point_t; + +/// +// Structure representing a rectangle. +/// +typedef struct _cef_rect_t { + int x; + int y; + int width; + int height; +} cef_rect_t; + +/// +// Structure representing a size. +/// +typedef struct _cef_size_t { + int width; + int height; +} cef_size_t; + +/// +// Existing process IDs. +/// +typedef enum { + /// + // Browser process. + /// + PID_BROWSER, + /// + // Renderer process. + /// + PID_RENDERER, +} cef_process_id_t; + +/// +// Existing thread IDs. +/// +typedef enum { +// BROWSER PROCESS THREADS -- Only available in the browser process. + + /// + // The main thread in the browser. This will be the same as the main + // application thread if CefInitialize() is called with a + // CefSettings.multi_threaded_message_loop value of false. + /// + TID_UI, + + /// + // Used to interact with the database. + /// + TID_DB, + + /// + // Used to interact with the file system. + /// + TID_FILE, + + /// + // Used for file system operations that block user interactions. + // Responsiveness of this thread affects users. + /// + TID_FILE_USER_BLOCKING, + + /// + // Used to launch and terminate browser processes. + /// + TID_PROCESS_LAUNCHER, + + /// + // Used to handle slow HTTP cache operations. + /// + TID_CACHE, + + /// + // Used to process IPC and network messages. + /// + TID_IO, + +// RENDER PROCESS THREADS -- Only available in the render process. + + /// + // The main thread in the renderer. Used for all WebKit and V8 interaction. + /// + TID_RENDERER, +} cef_thread_id_t; + +/// +// Supported value types. +/// +typedef enum { + VTYPE_INVALID = 0, + VTYPE_NULL, + VTYPE_BOOL, + VTYPE_INT, + VTYPE_DOUBLE, + VTYPE_STRING, + VTYPE_BINARY, + VTYPE_DICTIONARY, + VTYPE_LIST, +} cef_value_type_t; + +/// +// Supported JavaScript dialog types. +/// +typedef enum { + JSDIALOGTYPE_ALERT = 0, + JSDIALOGTYPE_CONFIRM, + JSDIALOGTYPE_PROMPT, +} cef_jsdialog_type_t; + +/// +// Screen information used when window rendering is disabled. This structure is +// passed as a parameter to CefRenderHandler::GetScreenInfo and should be filled +// in by the client. +/// +typedef struct _cef_screen_info_t { + /// + // Device scale factor. Specifies the ratio between physical and logical + // pixels. + /// + float device_scale_factor; + + /// + // The screen depth in bits per pixel. + /// + int depth; + + /// + // The bits per color component. This assumes that the colors are balanced + // equally. + /// + int depth_per_component; + + /// + // This can be true for black and white printers. + /// + int is_monochrome; + + /// + // This is set from the rcMonitor member of MONITORINFOEX, to whit: + // "A RECT structure that specifies the display monitor rectangle, + // expressed in virtual-screen coordinates. Note that if the monitor + // is not the primary display monitor, some of the rectangle's + // coordinates may be negative values." + // + // The |rect| and |available_rect| properties are used to determine the + // available surface for rendering popup views. + /// + cef_rect_t rect; + + /// + // This is set from the rcWork member of MONITORINFOEX, to whit: + // "A RECT structure that specifies the work area rectangle of the + // display monitor that can be used by applications, expressed in + // virtual-screen coordinates. Windows uses this rectangle to + // maximize an application on the monitor. The rest of the area in + // rcMonitor contains system windows such as the task bar and side + // bars. Note that if the monitor is not the primary display monitor, + // some of the rectangle's coordinates may be negative values". + // + // The |rect| and |available_rect| properties are used to determine the + // available surface for rendering popup views. + /// + cef_rect_t available_rect; +} cef_screen_info_t; + +/// +// Supported menu IDs. Non-English translations can be provided for the +// IDS_MENU_* strings in CefResourceBundleHandler::GetLocalizedString(). +/// +typedef enum { + // Navigation. + MENU_ID_BACK = 100, + MENU_ID_FORWARD = 101, + MENU_ID_RELOAD = 102, + MENU_ID_RELOAD_NOCACHE = 103, + MENU_ID_STOPLOAD = 104, + + // Editing. + MENU_ID_UNDO = 110, + MENU_ID_REDO = 111, + MENU_ID_CUT = 112, + MENU_ID_COPY = 113, + MENU_ID_PASTE = 114, + MENU_ID_DELETE = 115, + MENU_ID_SELECT_ALL = 116, + + // Miscellaneous. + MENU_ID_FIND = 130, + MENU_ID_PRINT = 131, + MENU_ID_VIEW_SOURCE = 132, + + // Spell checking word correction suggestions. + MENU_ID_SPELLCHECK_SUGGESTION_0 = 200, + MENU_ID_SPELLCHECK_SUGGESTION_1 = 201, + MENU_ID_SPELLCHECK_SUGGESTION_2 = 202, + MENU_ID_SPELLCHECK_SUGGESTION_3 = 203, + MENU_ID_SPELLCHECK_SUGGESTION_4 = 204, + MENU_ID_SPELLCHECK_SUGGESTION_LAST = 204, + MENU_ID_NO_SPELLING_SUGGESTIONS = 205, + MENU_ID_ADD_TO_DICTIONARY = 206, + + // All user-defined menu IDs should come between MENU_ID_USER_FIRST and + // MENU_ID_USER_LAST to avoid overlapping the Chromium and CEF ID ranges + // defined in the tools/gritsettings/resource_ids file. + MENU_ID_USER_FIRST = 26500, + MENU_ID_USER_LAST = 28500, +} cef_menu_id_t; + +/// +// Mouse button types. +/// +typedef enum { + MBT_LEFT = 0, + MBT_MIDDLE, + MBT_RIGHT, +} cef_mouse_button_type_t; + +/// +// Structure representing mouse event information. +/// +typedef struct _cef_mouse_event_t { + /// + // X coordinate relative to the left side of the view. + /// + int x; + + /// + // Y coordinate relative to the top side of the view. + /// + int y; + + /// + // Bit flags describing any pressed modifier keys. See + // cef_event_flags_t for values. + /// + uint32 modifiers; +} cef_mouse_event_t; + +/// +// Paint element types. +/// +typedef enum { + PET_VIEW = 0, + PET_POPUP, +} cef_paint_element_type_t; + +/// +// Supported event bit flags. +/// +typedef enum { + EVENTFLAG_NONE = 0, + EVENTFLAG_CAPS_LOCK_ON = 1 << 0, + EVENTFLAG_SHIFT_DOWN = 1 << 1, + EVENTFLAG_CONTROL_DOWN = 1 << 2, + EVENTFLAG_ALT_DOWN = 1 << 3, + EVENTFLAG_LEFT_MOUSE_BUTTON = 1 << 4, + EVENTFLAG_MIDDLE_MOUSE_BUTTON = 1 << 5, + EVENTFLAG_RIGHT_MOUSE_BUTTON = 1 << 6, + // Mac OS-X command key. + EVENTFLAG_COMMAND_DOWN = 1 << 7, + EVENTFLAG_NUM_LOCK_ON = 1 << 8, + EVENTFLAG_IS_KEY_PAD = 1 << 9, + EVENTFLAG_IS_LEFT = 1 << 10, + EVENTFLAG_IS_RIGHT = 1 << 11, +} cef_event_flags_t; + +/// +// Supported menu item types. +/// +typedef enum { + MENUITEMTYPE_NONE, + MENUITEMTYPE_COMMAND, + MENUITEMTYPE_CHECK, + MENUITEMTYPE_RADIO, + MENUITEMTYPE_SEPARATOR, + MENUITEMTYPE_SUBMENU, +} cef_menu_item_type_t; + +/// +// Supported context menu type flags. +/// +typedef enum { + /// + // No node is selected. + /// + CM_TYPEFLAG_NONE = 0, + /// + // The top page is selected. + /// + CM_TYPEFLAG_PAGE = 1 << 0, + /// + // A subframe page is selected. + /// + CM_TYPEFLAG_FRAME = 1 << 1, + /// + // A link is selected. + /// + CM_TYPEFLAG_LINK = 1 << 2, + /// + // A media node is selected. + /// + CM_TYPEFLAG_MEDIA = 1 << 3, + /// + // There is a textual or mixed selection that is selected. + /// + CM_TYPEFLAG_SELECTION = 1 << 4, + /// + // An editable element is selected. + /// + CM_TYPEFLAG_EDITABLE = 1 << 5, +} cef_context_menu_type_flags_t; + +/// +// Supported context menu media types. +/// +typedef enum { + /// + // No special node is in context. + /// + CM_MEDIATYPE_NONE, + /// + // An image node is selected. + /// + CM_MEDIATYPE_IMAGE, + /// + // A video node is selected. + /// + CM_MEDIATYPE_VIDEO, + /// + // An audio node is selected. + /// + CM_MEDIATYPE_AUDIO, + /// + // A file node is selected. + /// + CM_MEDIATYPE_FILE, + /// + // A plugin node is selected. + /// + CM_MEDIATYPE_PLUGIN, +} cef_context_menu_media_type_t; + +/// +// Supported context menu media state bit flags. +/// +typedef enum { + CM_MEDIAFLAG_NONE = 0, + CM_MEDIAFLAG_ERROR = 1 << 0, + CM_MEDIAFLAG_PAUSED = 1 << 1, + CM_MEDIAFLAG_MUTED = 1 << 2, + CM_MEDIAFLAG_LOOP = 1 << 3, + CM_MEDIAFLAG_CAN_SAVE = 1 << 4, + CM_MEDIAFLAG_HAS_AUDIO = 1 << 5, + CM_MEDIAFLAG_HAS_VIDEO = 1 << 6, + CM_MEDIAFLAG_CONTROL_ROOT_ELEMENT = 1 << 7, + CM_MEDIAFLAG_CAN_PRINT = 1 << 8, + CM_MEDIAFLAG_CAN_ROTATE = 1 << 9, +} cef_context_menu_media_state_flags_t; + +/// +// Supported context menu edit state bit flags. +/// +typedef enum { + CM_EDITFLAG_NONE = 0, + CM_EDITFLAG_CAN_UNDO = 1 << 0, + CM_EDITFLAG_CAN_REDO = 1 << 1, + CM_EDITFLAG_CAN_CUT = 1 << 2, + CM_EDITFLAG_CAN_COPY = 1 << 3, + CM_EDITFLAG_CAN_PASTE = 1 << 4, + CM_EDITFLAG_CAN_DELETE = 1 << 5, + CM_EDITFLAG_CAN_SELECT_ALL = 1 << 6, + CM_EDITFLAG_CAN_TRANSLATE = 1 << 7, +} cef_context_menu_edit_state_flags_t; + +/// +// Key event types. +/// +typedef enum { + /// + // Notification that a key transitioned from "up" to "down". + /// + KEYEVENT_RAWKEYDOWN = 0, + + /// + // Notification that a key was pressed. This does not necessarily correspond + // to a character depending on the key and language. Use KEYEVENT_CHAR for + // character input. + /// + KEYEVENT_KEYDOWN, + + /// + // Notification that a key was released. + /// + KEYEVENT_KEYUP, + + /// + // Notification that a character was typed. Use this for text input. Key + // down events may generate 0, 1, or more than one character event depending + // on the key, locale, and operating system. + /// + KEYEVENT_CHAR +} cef_key_event_type_t; + +/// +// Structure representing keyboard event information. +/// +typedef struct _cef_key_event_t { + /// + // The type of keyboard event. + /// + cef_key_event_type_t type; + + /// + // Bit flags describing any pressed modifier keys. See + // cef_event_flags_t for values. + /// + uint32 modifiers; + + /// + // The Windows key code for the key event. This value is used by the DOM + // specification. Sometimes it comes directly from the event (i.e. on + // Windows) and sometimes it's determined using a mapping function. See + // WebCore/platform/chromium/KeyboardCodes.h for the list of values. + /// + int windows_key_code; + + /// + // The actual key code genenerated by the platform. + /// + int native_key_code; + + /// + // Indicates whether the event is considered a "system key" event (see + // http://msdn.microsoft.com/en-us/library/ms646286(VS.85).aspx for details). + // This value will always be false on non-Windows platforms. + /// + int is_system_key; + + /// + // The character generated by the keystroke. + /// + char16 character; + + /// + // Same as |character| but unmodified by any concurrently-held modifiers + // (except shift). This is useful for working out shortcut keys. + /// + char16 unmodified_character; + + /// + // True if the focus is currently on an editable field on the page. This is + // useful for determining if standard key events should be intercepted. + /// + int focus_on_editable_field; +} cef_key_event_t; + +/// +// Focus sources. +/// +typedef enum { + /// + // The source is explicit navigation via the API (LoadURL(), etc). + /// + FOCUS_SOURCE_NAVIGATION = 0, + /// + // The source is a system-generated focus event. + /// + FOCUS_SOURCE_SYSTEM, +} cef_focus_source_t; + +/// +// Navigation types. +/// +typedef enum { + NAVIGATION_LINK_CLICKED = 0, + NAVIGATION_FORM_SUBMITTED, + NAVIGATION_BACK_FORWARD, + NAVIGATION_RELOAD, + NAVIGATION_FORM_RESUBMITTED, + NAVIGATION_OTHER, +} cef_navigation_type_t; + +/// +// Supported XML encoding types. The parser supports ASCII, ISO-8859-1, and +// UTF16 (LE and BE) by default. All other types must be translated to UTF8 +// before being passed to the parser. If a BOM is detected and the correct +// decoder is available then that decoder will be used automatically. +/// +typedef enum { + XML_ENCODING_NONE = 0, + XML_ENCODING_UTF8, + XML_ENCODING_UTF16LE, + XML_ENCODING_UTF16BE, + XML_ENCODING_ASCII, +} cef_xml_encoding_type_t; + +/// +// XML node types. +/// +typedef enum { + XML_NODE_UNSUPPORTED = 0, + XML_NODE_PROCESSING_INSTRUCTION, + XML_NODE_DOCUMENT_TYPE, + XML_NODE_ELEMENT_START, + XML_NODE_ELEMENT_END, + XML_NODE_ATTRIBUTE, + XML_NODE_TEXT, + XML_NODE_CDATA, + XML_NODE_ENTITY_REFERENCE, + XML_NODE_WHITESPACE, + XML_NODE_COMMENT, +} cef_xml_node_type_t; + +/// +// Popup window features. +/// +typedef struct _cef_popup_features_t { + int x; + int xSet; + int y; + int ySet; + int width; + int widthSet; + int height; + int heightSet; + + int menuBarVisible; + int statusBarVisible; + int toolBarVisible; + int locationBarVisible; + int scrollbarsVisible; + int resizable; + + int fullscreen; + int dialog; + cef_string_list_t additionalFeatures; +} cef_popup_features_t; + +/// +// DOM document types. +/// +typedef enum { + DOM_DOCUMENT_TYPE_UNKNOWN = 0, + DOM_DOCUMENT_TYPE_HTML, + DOM_DOCUMENT_TYPE_XHTML, + DOM_DOCUMENT_TYPE_PLUGIN, +} cef_dom_document_type_t; + +/// +// DOM event category flags. +/// +typedef enum { + DOM_EVENT_CATEGORY_UNKNOWN = 0x0, + DOM_EVENT_CATEGORY_UI = 0x1, + DOM_EVENT_CATEGORY_MOUSE = 0x2, + DOM_EVENT_CATEGORY_MUTATION = 0x4, + DOM_EVENT_CATEGORY_KEYBOARD = 0x8, + DOM_EVENT_CATEGORY_TEXT = 0x10, + DOM_EVENT_CATEGORY_COMPOSITION = 0x20, + DOM_EVENT_CATEGORY_DRAG = 0x40, + DOM_EVENT_CATEGORY_CLIPBOARD = 0x80, + DOM_EVENT_CATEGORY_MESSAGE = 0x100, + DOM_EVENT_CATEGORY_WHEEL = 0x200, + DOM_EVENT_CATEGORY_BEFORE_TEXT_INSERTED = 0x400, + DOM_EVENT_CATEGORY_OVERFLOW = 0x800, + DOM_EVENT_CATEGORY_PAGE_TRANSITION = 0x1000, + DOM_EVENT_CATEGORY_POPSTATE = 0x2000, + DOM_EVENT_CATEGORY_PROGRESS = 0x4000, + DOM_EVENT_CATEGORY_XMLHTTPREQUEST_PROGRESS = 0x8000, +} cef_dom_event_category_t; + +/// +// DOM event processing phases. +/// +typedef enum { + DOM_EVENT_PHASE_UNKNOWN = 0, + DOM_EVENT_PHASE_CAPTURING, + DOM_EVENT_PHASE_AT_TARGET, + DOM_EVENT_PHASE_BUBBLING, +} cef_dom_event_phase_t; + +/// +// DOM node types. +/// +typedef enum { + DOM_NODE_TYPE_UNSUPPORTED = 0, + DOM_NODE_TYPE_ELEMENT, + DOM_NODE_TYPE_ATTRIBUTE, + DOM_NODE_TYPE_TEXT, + DOM_NODE_TYPE_CDATA_SECTION, + DOM_NODE_TYPE_PROCESSING_INSTRUCTIONS, + DOM_NODE_TYPE_COMMENT, + DOM_NODE_TYPE_DOCUMENT, + DOM_NODE_TYPE_DOCUMENT_TYPE, + DOM_NODE_TYPE_DOCUMENT_FRAGMENT, +} cef_dom_node_type_t; + +/// +// Supported file dialog modes. +/// +typedef enum { + /// + // Requires that the file exists before allowing the user to pick it. + /// + FILE_DIALOG_OPEN = 0, + + /// + // Like Open, but allows picking multiple files to open. + /// + FILE_DIALOG_OPEN_MULTIPLE, + + /// + // Like Open, but selects a folder to open. + /// + FILE_DIALOG_OPEN_FOLDER, + + /// + // Allows picking a nonexistent file, and prompts to overwrite if the file + // already exists. + /// + FILE_DIALOG_SAVE, + + /// + // General mask defining the bits used for the type values. + /// + FILE_DIALOG_TYPE_MASK = 0xFF, + + // Qualifiers. + // Any of the type values above can be augmented by one or more qualifiers. + // These qualifiers further define the dialog behavior. + + /// + // Prompt to overwrite if the user selects an existing file with the Save + // dialog. + /// + FILE_DIALOG_OVERWRITEPROMPT_FLAG = 0x01000000, + + /// + // Do not display read-only files. + /// + FILE_DIALOG_HIDEREADONLY_FLAG = 0x02000000, +} cef_file_dialog_mode_t; + +/// +// Geoposition error codes. +/// +typedef enum { + GEOPOSITON_ERROR_NONE = 0, + GEOPOSITON_ERROR_PERMISSION_DENIED, + GEOPOSITON_ERROR_POSITION_UNAVAILABLE, + GEOPOSITON_ERROR_TIMEOUT, +} cef_geoposition_error_code_t; + +/// +// Structure representing geoposition information. The properties of this +// structure correspond to those of the JavaScript Position object although +// their types may differ. +/// +typedef struct _cef_geoposition_t { + /// + // Latitude in decimal degrees north (WGS84 coordinate frame). + /// + double latitude; + + /// + // Longitude in decimal degrees west (WGS84 coordinate frame). + /// + double longitude; + + /// + // Altitude in meters (above WGS84 datum). + /// + double altitude; + + /// + // Accuracy of horizontal position in meters. + /// + double accuracy; + + /// + // Accuracy of altitude in meters. + /// + double altitude_accuracy; + + /// + // Heading in decimal degrees clockwise from true north. + /// + double heading; + + /// + // Horizontal component of device velocity in meters per second. + /// + double speed; + + /// + // Time of position measurement in milliseconds since Epoch in UTC time. This + // is taken from the host computer's system clock. + /// + cef_time_t timestamp; + + /// + // Error code, see enum above. + /// + cef_geoposition_error_code_t error_code; + + /// + // Human-readable error message. + /// + cef_string_t error_message; +} cef_geoposition_t; + +/// +// Print job color mode values. +/// +typedef enum { + COLOR_MODEL_UNKNOWN, + COLOR_MODEL_GRAY, + COLOR_MODEL_COLOR, + COLOR_MODEL_CMYK, + COLOR_MODEL_CMY, + COLOR_MODEL_KCMY, + COLOR_MODEL_CMY_K, // CMY_K represents CMY+K. + COLOR_MODEL_BLACK, + COLOR_MODEL_GRAYSCALE, + COLOR_MODEL_RGB, + COLOR_MODEL_RGB16, + COLOR_MODEL_RGBA, + COLOR_MODEL_COLORMODE_COLOR, // Used in samsung printer ppds. + COLOR_MODEL_COLORMODE_MONOCHROME, // Used in samsung printer ppds. + COLOR_MODEL_HP_COLOR_COLOR, // Used in HP color printer ppds. + COLOR_MODEL_HP_COLOR_BLACK, // Used in HP color printer ppds. + COLOR_MODEL_PRINTOUTMODE_NORMAL, // Used in foomatic ppds. + COLOR_MODEL_PRINTOUTMODE_NORMAL_GRAY, // Used in foomatic ppds. + COLOR_MODEL_PROCESSCOLORMODEL_CMYK, // Used in canon printer ppds. + COLOR_MODEL_PROCESSCOLORMODEL_GREYSCALE, // Used in canon printer ppds. + COLOR_MODEL_PROCESSCOLORMODEL_RGB, // Used in canon printer ppds +} cef_color_model_t; + +/// +// Print job duplex mode values. +/// +typedef enum { + DUPLEX_MODE_UNKNOWN = -1, + DUPLEX_MODE_SIMPLEX, + DUPLEX_MODE_LONG_EDGE, + DUPLEX_MODE_SHORT_EDGE, +} cef_duplex_mode_t; + +/// +// Structure representing a print job page range. +/// +typedef struct _cef_page_range_t { + int from; + int to; +} cef_page_range_t; + +/// +// Cursor type values. +/// +typedef enum { + CT_POINTER = 0, + CT_CROSS, + CT_HAND, + CT_IBEAM, + CT_WAIT, + CT_HELP, + CT_EASTRESIZE, + CT_NORTHRESIZE, + CT_NORTHEASTRESIZE, + CT_NORTHWESTRESIZE, + CT_SOUTHRESIZE, + CT_SOUTHEASTRESIZE, + CT_SOUTHWESTRESIZE, + CT_WESTRESIZE, + CT_NORTHSOUTHRESIZE, + CT_EASTWESTRESIZE, + CT_NORTHEASTSOUTHWESTRESIZE, + CT_NORTHWESTSOUTHEASTRESIZE, + CT_COLUMNRESIZE, + CT_ROWRESIZE, + CT_MIDDLEPANNING, + CT_EASTPANNING, + CT_NORTHPANNING, + CT_NORTHEASTPANNING, + CT_NORTHWESTPANNING, + CT_SOUTHPANNING, + CT_SOUTHEASTPANNING, + CT_SOUTHWESTPANNING, + CT_WESTPANNING, + CT_MOVE, + CT_VERTICALTEXT, + CT_CELL, + CT_CONTEXTMENU, + CT_ALIAS, + CT_PROGRESS, + CT_NODROP, + CT_COPY, + CT_NONE, + CT_NOTALLOWED, + CT_ZOOMIN, + CT_ZOOMOUT, + CT_GRAB, + CT_GRABBING, + CT_CUSTOM, +} cef_cursor_type_t; + +/// +// Structure representing cursor information. |buffer| will be +// |size.width|*|size.height|*4 bytes in size and represents a BGRA image with +// an upper-left origin. +/// +typedef struct _cef_cursor_info_t { + cef_point_t hotspot; + float image_scale_factor; + void* buffer; + cef_size_t size; +} cef_cursor_info_t; + +/// +// URI unescape rules passed to CefURIDecode(). +/// +typedef enum { + /// + // Don't unescape anything at all. + /// + UU_NONE = 0, + + /// + // Don't unescape anything special, but all normal unescaping will happen. + // This is a placeholder and can't be combined with other flags (since it's + // just the absence of them). All other unescape rules imply "normal" in + // addition to their special meaning. Things like escaped letters, digits, + // and most symbols will get unescaped with this mode. + /// + UU_NORMAL = 1, + + /// + // Convert %20 to spaces. In some places where we're showing URLs, we may + // want this. In places where the URL may be copied and pasted out, then + // you wouldn't want this since it might not be interpreted in one piece + // by other applications. + /// + UU_SPACES = 2, + + /// + // Unescapes various characters that will change the meaning of URLs, + // including '%', '+', '&', '/', '#'. If we unescaped these characters, the + // resulting URL won't be the same as the source one. This flag is used when + // generating final output like filenames for URLs where we won't be + // interpreting as a URL and want to do as much unescaping as possible. + /// + UU_URL_SPECIAL_CHARS = 4, + + /// + // Unescapes control characters such as %01. This INCLUDES NULLs. This is + // used for rare cases such as data: URL decoding where the result is binary + // data. This flag also unescapes BiDi control characters. + // + // DO NOT use CONTROL_CHARS if the URL is going to be displayed in the UI + // for security reasons. + /// + UU_CONTROL_CHARS = 8, + + /// + // URL queries use "+" for space. This flag controls that replacement. + /// + UU_REPLACE_PLUS_WITH_SPACE = 16, +} cef_uri_unescape_rule_t; + +#ifdef __cplusplus +} +#endif + +#endif // CEF_INCLUDE_INTERNAL_CEF_TYPES_H_ diff --git a/dependencies64/cef/include/internal/cef_types_win.h b/dependencies64/cef/include/internal/cef_types_win.h new file mode 100644 index 000000000..27bf6053b --- /dev/null +++ b/dependencies64/cef/include/internal/cef_types_win.h @@ -0,0 +1,109 @@ +// Copyright (c) 2009 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +#ifndef CEF_INCLUDE_INTERNAL_CEF_TYPES_WIN_H_ +#define CEF_INCLUDE_INTERNAL_CEF_TYPES_WIN_H_ +#pragma once + +#include "include/base/cef_build.h" + +#if defined(OS_WIN) +#include +#include "include/internal/cef_string.h" + +// Handle types. +#define cef_cursor_handle_t HCURSOR +#define cef_event_handle_t MSG* +#define cef_window_handle_t HWND +#define cef_text_input_context_t void* + +#define kNullCursorHandle NULL +#define kNullEventHandle NULL +#define kNullWindowHandle NULL + +#ifdef __cplusplus +extern "C" { +#endif + +/// +// Structure representing CefExecuteProcess arguments. +/// +typedef struct _cef_main_args_t { + HINSTANCE instance; +} cef_main_args_t; + +/// +// Structure representing window information. +/// +typedef struct _cef_window_info_t { + // Standard parameters required by CreateWindowEx() + DWORD ex_style; + cef_string_t window_name; + DWORD style; + int x; + int y; + int width; + int height; + cef_window_handle_t parent_window; + HMENU menu; + + /// + // Set to true (1) to create the browser using windowless (off-screen) + // rendering. No window will be created for the browser and all rendering will + // occur via the CefRenderHandler interface. The |parent_window| value will be + // used to identify monitor info and to act as the parent window for dialogs, + // context menus, etc. If |parent_window| is not provided then the main screen + // monitor will be used and some functionality that requires a parent window + // may not function correctly. In order to create windowless browsers the + // CefSettings.windowless_rendering_enabled value must be set to true. + /// + int windowless_rendering_enabled; + + /// + // Set to true (1) to enable transparent painting in combination with + // windowless rendering. When this value is true a transparent background + // color will be used (RGBA=0x00000000). When this value is false the + // background will be white and opaque. + /// + int transparent_painting_enabled; + + /// + // Handle for the new browser window. Only used with windowed rendering. + /// + cef_window_handle_t window; +} cef_window_info_t; + +#ifdef __cplusplus +} +#endif + +#endif // OS_WIN + +#endif // CEF_INCLUDE_INTERNAL_CEF_TYPES_WIN_H_ diff --git a/dependencies64/cef/include/internal/cef_types_wrappers.h b/dependencies64/cef/include/internal/cef_types_wrappers.h new file mode 100644 index 000000000..d120463fa --- /dev/null +++ b/dependencies64/cef/include/internal/cef_types_wrappers.h @@ -0,0 +1,821 @@ +// Copyright (c) 2013 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#ifndef CEF_INCLUDE_INTERNAL_CEF_TYPES_WRAPPERS_H_ +#define CEF_INCLUDE_INTERNAL_CEF_TYPES_WRAPPERS_H_ +#pragma once + +#include "include/internal/cef_string.h" +#include "include/internal/cef_string_list.h" +#include "include/internal/cef_types.h" + +/// +// Template class that provides common functionality for CEF structure wrapping. +/// +template +class CefStructBase : public traits::struct_type { + public: + typedef typename traits::struct_type struct_type; + + CefStructBase() : attached_to_(NULL) { + Init(); + } + virtual ~CefStructBase() { + // Only clear this object's data if it isn't currently attached to a + // structure. + if (!attached_to_) + Clear(this); + } + + CefStructBase(const CefStructBase& r) { + Init(); + *this = r; + } + CefStructBase(const struct_type& r) { // NOLINT(runtime/explicit) + Init(); + *this = r; + } + + /// + // Clear this object's values. + /// + void Reset() { + Clear(this); + Init(); + } + + /// + // Attach to the source structure's existing values. DetachTo() can be called + // to insert the values back into the existing structure. + /// + void AttachTo(struct_type& source) { + // Only clear this object's data if it isn't currently attached to a + // structure. + if (!attached_to_) + Clear(this); + + // This object is now attached to the new structure. + attached_to_ = &source; + + // Transfer ownership of the values from the source structure. + memcpy(static_cast(this), &source, sizeof(struct_type)); + } + + /// + // Relinquish ownership of values to the target structure. + /// + void DetachTo(struct_type& target) { + if (attached_to_ != &target) { + // Clear the target structure's values only if we are not currently + // attached to that structure. + Clear(&target); + } + + // Transfer ownership of the values to the target structure. + memcpy(&target, static_cast(this), sizeof(struct_type)); + + // Remove the references from this object. + Init(); + } + + /// + // Set this object's values. If |copy| is true the source structure's values + // will be copied instead of referenced. + /// + void Set(const struct_type& source, bool copy) { + traits::set(&source, this, copy); + } + + CefStructBase& operator=(const CefStructBase& s) { + return operator=(static_cast(s)); + } + + CefStructBase& operator=(const struct_type& s) { + Set(s, true); + return *this; + } + + protected: + void Init() { + memset(static_cast(this), 0, sizeof(struct_type)); + attached_to_ = NULL; + traits::init(this); + } + + static void Clear(struct_type* s) { traits::clear(s); } + + struct_type* attached_to_; +}; + + +struct CefPointTraits { + typedef cef_point_t struct_type; + + static inline void init(struct_type* s) {} + static inline void clear(struct_type* s) {} + + static inline void set(const struct_type* src, struct_type* target, + bool copy) { + *target = *src; + } +}; + +/// +// Class representing a point. +/// +class CefPoint : public CefStructBase { + public: + typedef CefStructBase parent; + + CefPoint() : parent() {} + CefPoint(const cef_point_t& r) : parent(r) {} // NOLINT(runtime/explicit) + CefPoint(const CefPoint& r) : parent(r) {} // NOLINT(runtime/explicit) + CefPoint(int x, int y) : parent() { + Set(x, y); + } + + bool IsEmpty() const { return x <= 0 && y <= 0; } + void Set(int x, int y) { + this->x = x, this->y = y; + } +}; + +inline bool operator==(const CefPoint& a, const CefPoint& b) { + return a.x == b.x && a.y == b.y; +} + +inline bool operator!=(const CefPoint& a, const CefPoint& b) { + return !(a == b); +} + + +struct CefRectTraits { + typedef cef_rect_t struct_type; + + static inline void init(struct_type* s) {} + static inline void clear(struct_type* s) {} + + static inline void set(const struct_type* src, struct_type* target, + bool copy) { + *target = *src; + } +}; + +/// +// Class representing a rectangle. +/// +class CefRect : public CefStructBase { + public: + typedef CefStructBase parent; + + CefRect() : parent() {} + CefRect(const cef_rect_t& r) : parent(r) {} // NOLINT(runtime/explicit) + CefRect(const CefRect& r) : parent(r) {} // NOLINT(runtime/explicit) + CefRect(int x, int y, int width, int height) : parent() { + Set(x, y, width, height); + } + + bool IsEmpty() const { return width <= 0 || height <= 0; } + void Set(int x, int y, int width, int height) { + this->x = x, this->y = y, this->width = width, this->height = height; + } +}; + +inline bool operator==(const CefRect& a, const CefRect& b) { + return a.x == b.x && a.y == b.y && a.width == b.width && a.height == b.height; +} + +inline bool operator!=(const CefRect& a, const CefRect& b) { + return !(a == b); +} + + +struct CefSizeTraits { + typedef cef_size_t struct_type; + + static inline void init(struct_type* s) {} + static inline void clear(struct_type* s) {} + + static inline void set(const struct_type* src, struct_type* target, + bool copy) { + *target = *src; + } +}; + +/// +// Class representing a size. +/// +class CefSize : public CefStructBase { + public: + typedef CefStructBase parent; + + CefSize() : parent() {} + CefSize(const cef_size_t& r) : parent(r) {} // NOLINT(runtime/explicit) + CefSize(const CefSize& r) : parent(r) {} // NOLINT(runtime/explicit) + CefSize(int width, int height) : parent() { + Set(width, height); + } + + bool IsEmpty() const { return width <= 0 || height <= 0; } + void Set(int width, int height) { + this->width = width, this->height = height; + } +}; + +inline bool operator==(const CefSize& a, const CefSize& b) { + return a.width == b.width && a.height == b.height; +} + +inline bool operator!=(const CefSize& a, const CefSize& b) { + return !(a == b); +} + + +struct CefScreenInfoTraits { + typedef cef_screen_info_t struct_type; + + static inline void init(struct_type* s) {} + + static inline void clear(struct_type* s) {} + + static inline void set(const struct_type* src, struct_type* target, + bool copy) { + target->device_scale_factor = src->device_scale_factor; + target->depth = src->depth; + target->depth_per_component = src->depth_per_component; + target->is_monochrome = src->is_monochrome; + target->rect = src->rect; + target->available_rect = src->available_rect; + } +}; + +/// +// Class representing the virtual screen information for use when window +// rendering is disabled. +/// +class CefScreenInfo : public CefStructBase { + public: + typedef CefStructBase parent; + + CefScreenInfo() : parent() {} + CefScreenInfo(const cef_screen_info_t& r) : parent(r) {} // NOLINT(runtime/explicit) + CefScreenInfo(const CefScreenInfo& r) : parent(r) {} // NOLINT(runtime/explicit) + CefScreenInfo(float device_scale_factor, + int depth, + int depth_per_component, + bool is_monochrome, + const CefRect& rect, + const CefRect& available_rect) : parent() { + Set(device_scale_factor, depth, depth_per_component, + is_monochrome, rect, available_rect); + } + + void Set(float device_scale_factor, + int depth, + int depth_per_component, + bool is_monochrome, + const CefRect& rect, + const CefRect& available_rect) { + this->device_scale_factor = device_scale_factor; + this->depth = depth; + this->depth_per_component = depth_per_component; + this->is_monochrome = is_monochrome; + this->rect = rect; + this->available_rect = available_rect; + } +}; + + +struct CefKeyEventTraits { + typedef cef_key_event_t struct_type; + + static inline void init(struct_type* s) {} + + static inline void clear(struct_type* s) {} + + static inline void set(const struct_type* src, struct_type* target, + bool copy) { + target->type = src->type; + target->modifiers = src->modifiers; + target->windows_key_code = src->windows_key_code; + target->native_key_code = src->native_key_code; + target->is_system_key = src->is_system_key; + target->character = src->character; + target->unmodified_character = src->unmodified_character; + target->focus_on_editable_field = src->focus_on_editable_field; + } +}; + +/// +// Class representing a a keyboard event. +/// +typedef CefStructBase CefKeyEvent; + + +struct CefMouseEventTraits { + typedef cef_mouse_event_t struct_type; + + static inline void init(struct_type* s) {} + + static inline void clear(struct_type* s) {} + + static inline void set(const struct_type* src, struct_type* target, + bool copy) { + target->x = src->x; + target->y = src->y; + target->modifiers = src->modifiers; + } +}; + +/// +// Class representing a mouse event. +/// +typedef CefStructBase CefMouseEvent; + + +struct CefPopupFeaturesTraits { + typedef cef_popup_features_t struct_type; + + static inline void init(struct_type* s) { + s->menuBarVisible = true; + s->statusBarVisible = true; + s->toolBarVisible = true; + s->locationBarVisible = true; + s->scrollbarsVisible = true; + s->resizable = true; + } + + static inline void clear(struct_type* s) { + if (s->additionalFeatures) + cef_string_list_free(s->additionalFeatures); + } + + static inline void set(const struct_type* src, struct_type* target, + bool copy) { + if (target->additionalFeatures) + cef_string_list_free(target->additionalFeatures); + target->additionalFeatures = src->additionalFeatures ? + cef_string_list_copy(src->additionalFeatures) : NULL; + + target->x = src->x; + target->xSet = src->xSet; + target->y = src->y; + target->ySet = src->ySet; + target->width = src->width; + target->widthSet = src->widthSet; + target->height = src->height; + target->heightSet = src->heightSet; + target->menuBarVisible = src->menuBarVisible; + target->statusBarVisible = src->statusBarVisible; + target->toolBarVisible = src->toolBarVisible; + target->locationBarVisible = src->locationBarVisible; + target->scrollbarsVisible = src->scrollbarsVisible; + target->resizable = src->resizable; + target->fullscreen = src->fullscreen; + target->dialog = src->dialog; + } +}; + +/// +// Class representing popup window features. +/// +typedef CefStructBase CefPopupFeatures; + + +struct CefSettingsTraits { + typedef cef_settings_t struct_type; + + static inline void init(struct_type* s) { + s->size = sizeof(struct_type); + } + + static inline void clear(struct_type* s) { + cef_string_clear(&s->browser_subprocess_path); + cef_string_clear(&s->cache_path); + cef_string_clear(&s->user_data_path); + cef_string_clear(&s->user_agent); + cef_string_clear(&s->product_version); + cef_string_clear(&s->locale); + cef_string_clear(&s->log_file); + cef_string_clear(&s->javascript_flags); + cef_string_clear(&s->resources_dir_path); + cef_string_clear(&s->locales_dir_path); + cef_string_clear(&s->accept_language_list); + } + + static inline void set(const struct_type* src, struct_type* target, + bool copy) { + target->single_process = src->single_process; + target->no_sandbox = src->no_sandbox; + cef_string_set(src->browser_subprocess_path.str, + src->browser_subprocess_path.length, + &target->browser_subprocess_path, copy); + target->multi_threaded_message_loop = src->multi_threaded_message_loop; + target->windowless_rendering_enabled = src->windowless_rendering_enabled; + target->command_line_args_disabled = src->command_line_args_disabled; + + cef_string_set(src->cache_path.str, src->cache_path.length, + &target->cache_path, copy); + cef_string_set(src->user_data_path.str, src->user_data_path.length, + &target->user_data_path, copy); + target->persist_session_cookies = src->persist_session_cookies; + + cef_string_set(src->user_agent.str, src->user_agent.length, + &target->user_agent, copy); + cef_string_set(src->product_version.str, src->product_version.length, + &target->product_version, copy); + cef_string_set(src->locale.str, src->locale.length, &target->locale, copy); + + cef_string_set(src->log_file.str, src->log_file.length, &target->log_file, + copy); + target->log_severity = src->log_severity; + cef_string_set(src->javascript_flags.str, src->javascript_flags.length, + &target->javascript_flags, copy); + + cef_string_set(src->resources_dir_path.str, src->resources_dir_path.length, + &target->resources_dir_path, copy); + cef_string_set(src->locales_dir_path.str, src->locales_dir_path.length, + &target->locales_dir_path, copy); + target->pack_loading_disabled = src->pack_loading_disabled; + target->remote_debugging_port = src->remote_debugging_port; + target->uncaught_exception_stack_size = src->uncaught_exception_stack_size; + target->context_safety_implementation = src->context_safety_implementation; + target->ignore_certificate_errors = src->ignore_certificate_errors; + target->background_color = src->background_color; + + cef_string_set(src->accept_language_list.str, + src->accept_language_list.length, &target->accept_language_list, copy); + } +}; + +/// +// Class representing initialization settings. +/// +typedef CefStructBase CefSettings; + + +struct CefRequestContextSettingsTraits { + typedef cef_request_context_settings_t struct_type; + + static inline void init(struct_type* s) { + s->size = sizeof(struct_type); + } + + static inline void clear(struct_type* s) { + cef_string_clear(&s->cache_path); + cef_string_clear(&s->accept_language_list); + } + + static inline void set(const struct_type* src, struct_type* target, + bool copy) { + cef_string_set(src->cache_path.str, src->cache_path.length, + &target->cache_path, copy); + target->persist_session_cookies = src->persist_session_cookies; + target->ignore_certificate_errors = src->ignore_certificate_errors; + cef_string_set(src->accept_language_list.str, + src->accept_language_list.length, &target->accept_language_list, copy); + } +}; + +/// +// Class representing request context initialization settings. +/// +typedef CefStructBase + CefRequestContextSettings; + + +struct CefBrowserSettingsTraits { + typedef cef_browser_settings_t struct_type; + + static inline void init(struct_type* s) { + s->size = sizeof(struct_type); + } + + static inline void clear(struct_type* s) { + cef_string_clear(&s->standard_font_family); + cef_string_clear(&s->fixed_font_family); + cef_string_clear(&s->serif_font_family); + cef_string_clear(&s->sans_serif_font_family); + cef_string_clear(&s->cursive_font_family); + cef_string_clear(&s->fantasy_font_family); + cef_string_clear(&s->default_encoding); + cef_string_clear(&s->accept_language_list); + } + + static inline void set(const struct_type* src, struct_type* target, + bool copy) { + target->windowless_frame_rate = src->windowless_frame_rate; + + cef_string_set(src->standard_font_family.str, + src->standard_font_family.length, &target->standard_font_family, copy); + cef_string_set(src->fixed_font_family.str, src->fixed_font_family.length, + &target->fixed_font_family, copy); + cef_string_set(src->serif_font_family.str, src->serif_font_family.length, + &target->serif_font_family, copy); + cef_string_set(src->sans_serif_font_family.str, + src->sans_serif_font_family.length, &target->sans_serif_font_family, + copy); + cef_string_set(src->cursive_font_family.str, + src->cursive_font_family.length, &target->cursive_font_family, copy); + cef_string_set(src->fantasy_font_family.str, + src->fantasy_font_family.length, &target->fantasy_font_family, copy); + + target->default_font_size = src->default_font_size; + target->default_fixed_font_size = src->default_fixed_font_size; + target->minimum_font_size = src->minimum_font_size; + target->minimum_logical_font_size = src->minimum_logical_font_size; + + cef_string_set(src->default_encoding.str, src->default_encoding.length, + &target->default_encoding, copy); + + target->remote_fonts = src->remote_fonts; + target->javascript = src->javascript; + target->javascript_open_windows = src->javascript_open_windows; + target->javascript_close_windows = src->javascript_close_windows; + target->javascript_access_clipboard = src->javascript_access_clipboard; + target->javascript_dom_paste = src->javascript_dom_paste; + target->caret_browsing = src->caret_browsing; + target->java = src->java; + target->plugins = src->plugins; + target->universal_access_from_file_urls = + src->universal_access_from_file_urls; + target->file_access_from_file_urls = src->file_access_from_file_urls; + target->web_security = src->web_security; + target->image_loading = src->image_loading; + target->image_shrink_standalone_to_fit = + src->image_shrink_standalone_to_fit; + target->text_area_resize = src->text_area_resize; + target->tab_to_links = src->tab_to_links; + target->local_storage = src->local_storage; + target->databases= src->databases; + target->application_cache = src->application_cache; + target->webgl = src->webgl; + + target->background_color = src->background_color; + + cef_string_set(src->accept_language_list.str, + src->accept_language_list.length, &target->accept_language_list, copy); + } +}; + +/// +// Class representing browser initialization settings. +/// +typedef CefStructBase CefBrowserSettings; + + +struct CefURLPartsTraits { + typedef cef_urlparts_t struct_type; + + static inline void init(struct_type* s) {} + + static inline void clear(struct_type* s) { + cef_string_clear(&s->spec); + cef_string_clear(&s->scheme); + cef_string_clear(&s->username); + cef_string_clear(&s->password); + cef_string_clear(&s->host); + cef_string_clear(&s->port); + cef_string_clear(&s->origin); + cef_string_clear(&s->path); + cef_string_clear(&s->query); + } + + static inline void set(const struct_type* src, struct_type* target, + bool copy) { + cef_string_set(src->spec.str, src->spec.length, &target->spec, copy); + cef_string_set(src->scheme.str, src->scheme.length, &target->scheme, copy); + cef_string_set(src->username.str, src->username.length, &target->username, + copy); + cef_string_set(src->password.str, src->password.length, &target->password, + copy); + cef_string_set(src->host.str, src->host.length, &target->host, copy); + cef_string_set(src->port.str, src->port.length, &target->port, copy); + cef_string_set(src->origin.str, src->origin.length, &target->origin, copy); + cef_string_set(src->path.str, src->path.length, &target->path, copy); + cef_string_set(src->query.str, src->query.length, &target->query, copy); + } +}; + +/// +// Class representing a URL's component parts. +/// +typedef CefStructBase CefURLParts; + + +struct CefTimeTraits { + typedef cef_time_t struct_type; + + static inline void init(struct_type* s) {} + + static inline void clear(struct_type* s) {} + + static inline void set(const struct_type* src, struct_type* target, + bool copy) { + *target = *src; + } +}; + +/// +// Class representing a time. +/// +class CefTime : public CefStructBase { + public: + typedef CefStructBase parent; + + CefTime() : parent() {} + CefTime(const cef_time_t& r) : parent(r) {} // NOLINT(runtime/explicit) + CefTime(const CefTime& r) : parent(r) {} // NOLINT(runtime/explicit) + explicit CefTime(time_t r) : parent() { SetTimeT(r); } + explicit CefTime(double r) : parent() { SetDoubleT(r); } + + // Converts to/from time_t. + void SetTimeT(time_t r) { + cef_time_from_timet(r, this); + } + time_t GetTimeT() const { + time_t time = 0; + cef_time_to_timet(this, &time); + return time; + } + + // Converts to/from a double which is the number of seconds since epoch + // (Jan 1, 1970). Webkit uses this format to represent time. A value of 0 + // means "not initialized". + void SetDoubleT(double r) { + cef_time_from_doublet(r, this); + } + double GetDoubleT() const { + double time = 0; + cef_time_to_doublet(this, &time); + return time; + } + + // Set this object to now. + void Now() { + cef_time_now(this); + } + + // Return the delta between this object and |other| in milliseconds. + long long Delta(const CefTime& other) { + long long delta = 0; + cef_time_delta(this, &other, &delta); + return delta; + } +}; + + +struct CefCookieTraits { + typedef cef_cookie_t struct_type; + + static inline void init(struct_type* s) {} + + static inline void clear(struct_type* s) { + cef_string_clear(&s->name); + cef_string_clear(&s->value); + cef_string_clear(&s->domain); + cef_string_clear(&s->path); + } + + static inline void set(const struct_type* src, struct_type* target, + bool copy) { + cef_string_set(src->name.str, src->name.length, &target->name, copy); + cef_string_set(src->value.str, src->value.length, &target->value, copy); + cef_string_set(src->domain.str, src->domain.length, &target->domain, copy); + cef_string_set(src->path.str, src->path.length, &target->path, copy); + target->secure = src->secure; + target->httponly = src->httponly; + target->creation = src->creation; + target->last_access = src->last_access; + target->has_expires = src->has_expires; + target->expires = src->expires; + } +}; + +/// +// Class representing a cookie. +/// +typedef CefStructBase CefCookie; + + +struct CefGeopositionTraits { + typedef cef_geoposition_t struct_type; + + static inline void init(struct_type* s) {} + + static inline void clear(struct_type* s) { + cef_string_clear(&s->error_message); + } + + static inline void set(const struct_type* src, struct_type* target, + bool copy) { + target->latitude = src->latitude; + target->longitude = src->longitude; + target->altitude = src->altitude; + target->accuracy = src->accuracy; + target->altitude_accuracy = src->altitude_accuracy; + target->heading = src->heading; + target->speed = src->speed; + target->timestamp = src->timestamp; + target->error_code = src->error_code; + cef_string_set(src->error_message.str, src->error_message.length, + &target->error_message, copy); + } +}; + +/// +// Class representing a geoposition. +/// +typedef CefStructBase CefGeoposition; + + +struct CefPageRangeTraits { + typedef cef_page_range_t struct_type; + + static inline void init(struct_type* s) {} + static inline void clear(struct_type* s) {} + + static inline void set(const struct_type* src, struct_type* target, + bool copy) { + *target = *src; + } +}; + +/// +// Class representing a print job page range. +/// +class CefPageRange : public CefStructBase { + public: + typedef CefStructBase parent; + + CefPageRange() : parent() {} + CefPageRange(const cef_page_range_t& r) // NOLINT(runtime/explicit) + : parent(r) {} + CefPageRange(const CefPageRange& r) // NOLINT(runtime/explicit) + : parent(r) {} + CefPageRange(int from, int to) : parent() { + Set(from, to); + } + + void Set(int from, int to) { + this->from = from, this->to = to; + } +}; + +inline bool operator==(const CefPageRange& a, const CefPageRange& b) { + return a.from == b.from && a.to == b.to; +} + +inline bool operator!=(const CefPageRange& a, const CefPageRange& b) { + return !(a == b); +} + + +struct CefCursorInfoTraits { + typedef cef_cursor_info_t struct_type; + + static inline void init(struct_type* s) {} + + static inline void clear(struct_type* s) {} + + static inline void set(const struct_type* src, struct_type* target, + bool copy) { + target->hotspot = src->hotspot; + target->image_scale_factor = src->image_scale_factor; + target->buffer = src->buffer; + target->size = src->size; + } +}; + +/// +// Class representing cursor information. +/// +typedef CefStructBase CefCursorInfo; + +#endif // CEF_INCLUDE_INTERNAL_CEF_TYPES_WRAPPERS_H_ diff --git a/dependencies64/cef/include/internal/cef_win.h b/dependencies64/cef/include/internal/cef_win.h new file mode 100644 index 000000000..7361a3ce4 --- /dev/null +++ b/dependencies64/cef/include/internal/cef_win.h @@ -0,0 +1,156 @@ +// Copyright (c) 2008 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +#ifndef CEF_INCLUDE_INTERNAL_CEF_WIN_H_ +#define CEF_INCLUDE_INTERNAL_CEF_WIN_H_ +#pragma once + +#include "include/internal/cef_types_win.h" +#include "include/internal/cef_types_wrappers.h" + +/// +// Handle types. +/// +#define CefCursorHandle cef_cursor_handle_t +#define CefEventHandle cef_event_handle_t +#define CefWindowHandle cef_window_handle_t +#define CefTextInputContext cef_text_input_context_t + +struct CefMainArgsTraits { + typedef cef_main_args_t struct_type; + + static inline void init(struct_type* s) {} + static inline void clear(struct_type* s) {} + + static inline void set(const struct_type* src, struct_type* target, + bool copy) { + target->instance = src->instance; + } +}; + +// Class representing CefExecuteProcess arguments. +class CefMainArgs : public CefStructBase { + public: + typedef CefStructBase parent; + + CefMainArgs() : parent() {} + explicit CefMainArgs(const cef_main_args_t& r) : parent(r) {} + explicit CefMainArgs(const CefMainArgs& r) : parent(r) {} + explicit CefMainArgs(HINSTANCE hInstance) : parent() { + instance = hInstance; + } +}; + +struct CefWindowInfoTraits { + typedef cef_window_info_t struct_type; + + static inline void init(struct_type* s) {} + + static inline void clear(struct_type* s) { + cef_string_clear(&s->window_name); + } + + static inline void set(const struct_type* src, struct_type* target, + bool copy) { + target->ex_style = src->ex_style; + cef_string_set(src->window_name.str, src->window_name.length, + &target->window_name, copy); + target->style = src->style; + target->x = src->x; + target->y = src->y; + target->width = src->width; + target->height = src->height; + target->parent_window = src->parent_window; + target->menu = src->menu; + target->transparent_painting_enabled = src->transparent_painting_enabled; + target->windowless_rendering_enabled = src->windowless_rendering_enabled; + target->window = src->window; + } +}; + +/// +// Class representing window information. +/// +class CefWindowInfo : public CefStructBase { + public: + typedef CefStructBase parent; + + CefWindowInfo() : parent() {} + explicit CefWindowInfo(const cef_window_info_t& r) : parent(r) {} + explicit CefWindowInfo(const CefWindowInfo& r) : parent(r) {} + + /// + // Create the browser as a child window. + /// + void SetAsChild(CefWindowHandle parent, RECT windowRect) { + style = WS_CHILD | WS_CLIPCHILDREN | WS_CLIPSIBLINGS | WS_TABSTOP | + WS_VISIBLE; + parent_window = parent; + x = windowRect.left; + y = windowRect.top; + width = windowRect.right - windowRect.left; + height = windowRect.bottom - windowRect.top; + } + + /// + // Create the browser as a popup window. + /// + void SetAsPopup(CefWindowHandle parent, const CefString& windowName) { + style = WS_OVERLAPPEDWINDOW | WS_CLIPCHILDREN | WS_CLIPSIBLINGS | + WS_VISIBLE; + parent_window = parent; + x = CW_USEDEFAULT; + y = CW_USEDEFAULT; + width = CW_USEDEFAULT; + height = CW_USEDEFAULT; + + cef_string_copy(windowName.c_str(), windowName.length(), &window_name); + } + + /// + // Create the browser using windowless (off-screen) rendering. No window + // will be created for the browser and all rendering will occur via the + // CefRenderHandler interface. The |parent| value will be used to identify + // monitor info and to act as the parent window for dialogs, context menus, + // etc. If |parent| is not provided then the main screen monitor will be used + // and some functionality that requires a parent window may not function + // correctly. If |transparent| is true a transparent background color will be + // used (RGBA=0x00000000). If |transparent| is false the background will be + // white and opaque. In order to create windowless browsers the + // CefSettings.windowless_rendering_enabled value must be set to true. + /// + void SetAsWindowless(CefWindowHandle parent, bool transparent) { + windowless_rendering_enabled = TRUE; + parent_window = parent; + transparent_painting_enabled = transparent; + } +}; + +#endif // CEF_INCLUDE_INTERNAL_CEF_WIN_H_ diff --git a/dependencies64/cef/include/wrapper/cef_byte_read_handler.h b/dependencies64/cef/include/wrapper/cef_byte_read_handler.h new file mode 100644 index 000000000..559cdd818 --- /dev/null +++ b/dependencies64/cef/include/wrapper/cef_byte_read_handler.h @@ -0,0 +1,79 @@ +// Copyright (c) 2012 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// The contents of this file are only available to applications that link +// against the libcef_dll_wrapper target. +// + +#ifndef CEF_INCLUDE_WRAPPER_CEF_BYTE_READ_HANDLER_H_ +#define CEF_INCLUDE_WRAPPER_CEF_BYTE_READ_HANDLER_H_ +#pragma once + +#include "include/base/cef_lock.h" +#include "include/base/cef_macros.h" +#include "include/cef_base.h" +#include "include/cef_stream.h" + +/// +// Thread safe implementation of the CefReadHandler class for reading an +// in-memory array of bytes. +/// +class CefByteReadHandler : public CefReadHandler { + public: + /// + // Create a new object for reading an array of bytes. An optional |source| + // reference can be kept to keep the underlying data source from being + // released while the reader exists. + /// + CefByteReadHandler(const unsigned char* bytes, + size_t size, + CefRefPtr source); + + // CefReadHandler methods. + virtual size_t Read(void* ptr, size_t size, size_t n) OVERRIDE; + virtual int Seek(int64 offset, int whence) OVERRIDE; + virtual int64 Tell() OVERRIDE; + virtual int Eof() OVERRIDE; + virtual bool MayBlock() OVERRIDE { return false; } + + private: + const unsigned char* bytes_; + int64 size_; + int64 offset_; + CefRefPtr source_; + + base::Lock lock_; + + IMPLEMENT_REFCOUNTING(CefByteReadHandler); + DISALLOW_COPY_AND_ASSIGN(CefByteReadHandler); +}; + +#endif // CEF_INCLUDE_WRAPPER_CEF_BYTE_READ_HANDLER_H_ diff --git a/dependencies64/cef/include/wrapper/cef_closure_task.h b/dependencies64/cef/include/wrapper/cef_closure_task.h new file mode 100644 index 000000000..8828c6566 --- /dev/null +++ b/dependencies64/cef/include/wrapper/cef_closure_task.h @@ -0,0 +1,101 @@ +// Copyright (c) 2014 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// The contents of this file are only available to applications that link +// against the libcef_dll_wrapper target. +// + +#ifndef CEF_INCLUDE_WRAPPER_CEF_CLOSURE_TASK_H_ +#define CEF_INCLUDE_WRAPPER_CEF_CLOSURE_TASK_H_ +#pragma once + +#include "include/base/cef_callback_forward.h" +#include "include/base/cef_macros.h" +#include "include/cef_task.h" + +/// +// Helpers for asynchronously executing a base::Closure (bound function or +// method) on a CEF thread. Creation of base::Closures can be facilitated using +// base::Bind. See include/base/cef_callback.h for complete usage instructions. +// +// TO use these helpers you should include this header and the header that +// defines base::Bind. +// +// #include "include/base/cef_bind.h" +// #include "include/wrapper/cef_closure_task.h" +// +// Example of executing a bound function: +// +// // Define a function. +// void MyFunc(int arg) { /* do something with |arg| on the UI thread */ } +// +// // Post a task that will execute MyFunc on the UI thread and pass an |arg| +// // value of 5. +// CefPostTask(TID_UI, base::Bind(&MyFunc, 5)); +// +// Example of executing a bound method: +// +// // Define a class. +// class MyClass : public CefBase { +// public: +// MyClass() {} +// void MyMethod(int arg) { /* do something with |arg| on the UI thread */ } +// private: +// IMPLEMENT_REFCOUNTING(MyClass); +// }; +// +// // Create an instance of MyClass. +// CefRefPtr instance = new MyClass(); +// +// // Post a task that will execute MyClass::MyMethod on the UI thread and pass +// // an |arg| value of 5. |instance| will be kept alive until after the task +// // completes. +// CefPostTask(TID_UI, base::Bind(&MyClass::MyMethod, instance, 5)); +/// + +/// +// Create a CefTask that wraps a base::Closure. Can be used in combination with +// CefTaskRunner. +/// +CefRefPtr CefCreateClosureTask(const base::Closure& closure); + +/// +// Post a Closure for execution on the specified thread. +/// +bool CefPostTask(CefThreadId threadId, const base::Closure& closure); + +/// +// Post a Closure for delayed execution on the specified thread. +/// +bool CefPostDelayedTask(CefThreadId threadId, const base::Closure& closure, + int64 delay_ms); + +#endif // CEF_INCLUDE_WRAPPER_CEF_CLOSURE_TASK_H_ diff --git a/dependencies64/cef/include/wrapper/cef_helpers.h b/dependencies64/cef/include/wrapper/cef_helpers.h new file mode 100644 index 000000000..639cde8cb --- /dev/null +++ b/dependencies64/cef/include/wrapper/cef_helpers.h @@ -0,0 +1,124 @@ +// Copyright (c) 2014 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// The contents of this file are only available to applications that link +// against the libcef_dll_wrapper target. +// + +#ifndef CEF_INCLUDE_WRAPPER_CEF_HELPERS_H_ +#define CEF_INCLUDE_WRAPPER_CEF_HELPERS_H_ +#pragma once + +#include +#include +#include + +#include "include/base/cef_bind.h" +#include "include/base/cef_logging.h" +#include "include/base/cef_macros.h" +#include "include/cef_task.h" + +#define CEF_REQUIRE_UI_THREAD() DCHECK(CefCurrentlyOn(TID_UI)); +#define CEF_REQUIRE_IO_THREAD() DCHECK(CefCurrentlyOn(TID_IO)); +#define CEF_REQUIRE_FILE_THREAD() DCHECK(CefCurrentlyOn(TID_FILE)); +#define CEF_REQUIRE_RENDERER_THREAD() DCHECK(CefCurrentlyOn(TID_RENDERER)); + + +// Use this struct in conjuction with refcounted types to ensure that an +// object is deleted on the specified thread. For example: +// +// class Foo : public base::RefCountedThreadSafe { +// public: +// Foo(); +// void DoSomething(); +// +// private: +// // Allow deletion via scoped_refptr only. +// friend struct CefDeleteOnThread; +// friend class base::RefCountedThreadSafe; +// +// virtual ~Foo() {} +// }; +// +// base::scoped_refptr foo = new Foo(); +// foo->DoSomething(); +// foo = NULL; // Deletion of |foo| will occur on the UI thread. +// +template +struct CefDeleteOnThread { + template + static void Destruct(const T* x) { + if (CefCurrentlyOn(thread)) { + delete x; + } else { + CefPostTask(thread, + base::Bind(&CefDeleteOnThread::Destruct, x)); + } + } +}; + +struct CefDeleteOnUIThread : public CefDeleteOnThread { }; +struct CefDeleteOnIOThread : public CefDeleteOnThread { }; +struct CefDeleteOnFileThread : public CefDeleteOnThread { }; +struct CefDeleteOnRendererThread : public CefDeleteOnThread { }; + + +/// +// Helper class to manage a scoped copy of |argv|. +/// +class CefScopedArgArray { + public: + CefScopedArgArray(int argc, char* argv[]) { + // argv should have (argc + 1) elements, the last one always being NULL. + array_ = new char*[argc + 1]; + for (int i = 0; i < argc; ++i) { + values_.push_back(argv[i]); + array_[i] = const_cast(values_[i].c_str()); + } + array_[argc] = NULL; + } + ~CefScopedArgArray() { + delete [] array_; + } + + char** array() const { return array_; } + + private: + char** array_; + + // Keep values in a vector separate from |array_| because various users may + // modify |array_| and we still want to clean up memory properly. + std::vector values_; + + DISALLOW_COPY_AND_ASSIGN(CefScopedArgArray); +}; + +#endif // CEF_INCLUDE_WRAPPER_CEF_HELPERS_H_ diff --git a/dependencies64/cef/include/wrapper/cef_message_router.h b/dependencies64/cef/include/wrapper/cef_message_router.h new file mode 100644 index 000000000..2a6fcfe6f --- /dev/null +++ b/dependencies64/cef/include/wrapper/cef_message_router.h @@ -0,0 +1,428 @@ +// Copyright (c) 2014 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// The contents of this file are only available to applications that link +// against the libcef_dll_wrapper target. +// + +#ifndef CEF_INCLUDE_WRAPPER_CEF_MESSAGE_ROUTER_H_ +#define CEF_INCLUDE_WRAPPER_CEF_MESSAGE_ROUTER_H_ +#pragma once + +#include "include/base/cef_ref_counted.h" +#include "include/cef_base.h" +#include "include/cef_browser.h" +#include "include/cef_process_message.h" +#include "include/cef_v8.h" + +// The below classes implement support for routing aynchronous messages between +// JavaScript running in the renderer process and C++ running in the browser +// process. An application interacts with the router by passing it data from +// standard CEF C++ callbacks (OnBeforeBrowse, OnProcessMessageRecieved, +// OnContextCreated, etc). The renderer-side router supports generic JavaScript +// callback registration and execution while the browser-side router supports +// application-specific logic via one or more application-provided Handler +// instances. +// +// The renderer-side router implementation exposes a query function and a cancel +// function via the JavaScript 'window' object: +// +// // Create and send a new query. +// var request_id = window.cefQuery({ +// request: 'my_request', +// persistent: false, +// onSuccess: function(response) {}, +// onFailure: function(error_code, error_message) {} +// }); +// +// // Optionally cancel the query. +// window.cefQueryCancel(request_id); +// +// When |window.cefQuery| is executed the request is sent asynchronously to one +// or more C++ Handler objects registered in the browser process. Each C++ +// Handler can choose to either handle or ignore the query in the +// Handler::OnQuery callback. If a Handler chooses to handle the query then it +// should execute Callback::Success when a response is available or +// Callback::Failure if an error occurs. This will result in asynchronous +// execution of the associated JavaScript callback in the renderer process. Any +// queries unhandled by C++ code in the browser process will be automatically +// canceled and the associated JavaScript onFailure callback will be executed +// with an error code of -1. +// +// Queries can be either persistent or non-persistent. If the query is +// persistent than the callbacks will remain registered until one of the +// following conditions are met: +// +// A. The query is canceled in JavaScript using the |window.cefQueryCancel| +// function. +// B. The query is canceled in C++ code using the Callback::Failure function. +// C. The context associated with the query is released due to browser +// destruction, navigation or renderer process termination. +// +// If the query is non-persistent then the registration will be removed after +// the JavaScript callback is executed a single time. If a query is canceled for +// a reason other than Callback::Failure being executed then the associated +// Handler's OnQueryCanceled method will be called. +// +// Some possible usage patterns include: +// +// One-time Request. Use a non-persistent query to send a JavaScript request. +// The Handler evaluates the request and returns the response. The query is +// then discarded. +// +// Broadcast. Use a persistent query to register as a JavaScript broadcast +// receiver. The Handler keeps track of all registered Callbacks and executes +// them sequentially to deliver the broadcast message. +// +// Subscription. Use a persistent query to register as a JavaScript subscription +// receiver. The Handler initiates the subscription feed on the first request +// and delivers responses to all registered subscribers as they become +// available. The Handler cancels the subscription feed when there are no +// longer any registered JavaScript receivers. +// +// Message routing occurs on a per-browser and per-context basis. Consequently, +// additional application logic can be applied by restricting which browser or +// context instances are passed into the router. If you choose to use this +// approach do so cautiously. In order for the router to function correctly any +// browser or context instance passed into a single router callback must then +// be passed into all router callbacks. +// +// There is generally no need to have multiple renderer-side routers unless you +// wish to have multiple bindings with different JavaScript function names. It +// can be useful to have multiple browser-side routers with different client- +// provided Handler instances when implementing different behaviors on a per- +// browser basis. +// +// This implementation places no formatting restrictions on payload content. +// An application may choose to exchange anything from simple formatted +// strings to serialized XML or JSON data. +// +// +// EXAMPLE USAGE +// +// 1. Define the router configuration. You can optionally specify settings +// like the JavaScript function names. The configuration must be the same in +// both the browser and renderer processes. If using multiple routers in the +// same application make sure to specify unique function names for each +// router configuration. +// +// // Example config object showing the default values. +// CefMessageRouterConfig config; +// config.js_query_function = "cefQuery"; +// config.js_cancel_function = "cefQueryCancel"; +// +// 2. Create an instance of CefMessageRouterBrowserSide in the browser process. +// You might choose to make it a member of your CefClient implementation, +// for example. +// +// browser_side_router_ = CefMessageRouterBrowserSide::Create(config); +// +// 3. Register one or more Handlers. The Handler instances must either outlive +// the router or be removed from the router before they're deleted. +// +// browser_side_router_->AddHandler(my_handler); +// +// 4. Call all required CefMessageRouterBrowserSide methods from other callbacks +// in your CefClient implementation (OnBeforeClose, etc). See the +// CefMessageRouterBrowserSide class documentation for the complete list of +// methods. +// +// 5. Create an instance of CefMessageRouterRendererSide in the renderer process. +// You might choose to make it a member of your CefApp implementation, for +// example. +// +// renderer_side_router_ = CefMessageRouterRendererSide::Create(config); +// +// 6. Call all required CefMessageRouterRendererSide methods from other +// callbacks in your CefRenderProcessHandler implementation +// (OnContextCreated, etc). See the CefMessageRouterRendererSide class +// documentation for the complete list of methods. +// +// 7. Execute the query function from JavaScript code. +// +// window.cefQuery({request: 'my_request', +// persistent: false, +// onSuccess: function(response) { print(response); }, +// onFailure: function(error_code, error_message) {} }); +// +// 8. Handle the query in your Handler::OnQuery implementation and execute the +// appropriate callback either immediately or asynchronously. +// +// void MyHandler::OnQuery(int64 query_id, +// CefRefPtr browser, +// CefRefPtr frame, +// const CefString& request, +// bool persistent, +// CefRefPtr callback) { +// if (request == "my_request") { +// callback->Continue("my_response"); +// return true; +// } +// return false; // Not handled. +// } +// +// 9. Notice that the onSuccess callback is executed in JavaScript. + +/// +// Used to configure the query router. The same values must be passed to both +// CefMessageRouterBrowserSide and CefMessageRouterRendererSide. If using multiple +// router pairs make sure to choose values that do not conflict. +/// +struct CefMessageRouterConfig { + CefMessageRouterConfig(); + + // Name of the JavaScript function that will be added to the 'window' object + // for sending a query. The default value is "cefQuery". + CefString js_query_function; + + // Name of the JavaScript function that will be added to the 'window' object + // for canceling a pending query. The default value is "cefQueryCancel". + CefString js_cancel_function; +}; + +/// +// Implements the browser side of query routing. The methods of this class may +// be called on any browser process thread unless otherwise indicated. +/// +class CefMessageRouterBrowserSide : + public base::RefCountedThreadSafe { + public: + /// + // Callback associated with a single pending asynchronous query. Execute the + // Success or Failure method to send an asynchronous response to the + // associated JavaScript handler. It is a runtime error to destroy a Callback + // object associated with an uncanceled query without first executing one of + // the callback methods. The methods of this class may be called on any + // browser process thread. + /// + class Callback : public CefBase { + public: + /// + // Notify the associated JavaScript onSuccess callback that the query has + // completed successfully with the specified |response|. + /// + virtual void Success(const CefString& response) =0; + + /// + // Notify the associated JavaScript onFailure callback that the query has + // failed with the specified |error_code| and |error_message|. + /// + virtual void Failure(int error_code, const CefString& error_message) =0; + }; + + /// + // Implement this interface to handle queries. All methods will be executed on + // the browser process UI thread. + /// + class Handler { + public: + typedef CefMessageRouterBrowserSide::Callback Callback; + + /// + // Executed when a new query is received. |query_id| uniquely identifies the + // query for the life span of the router. Return true to handle the query + // or false to propagate the query to other registered handlers, if any. If + // no handlers return true from this method then the query will be + // automatically canceled with an error code of -1 delivered to the + // JavaScript onFailure callback. If this method returns true then a + // Callback method must be executed either in this method or asynchronously + // to complete the query. + /// + virtual bool OnQuery(CefRefPtr browser, + CefRefPtr frame, + int64 query_id, + const CefString& request, + bool persistent, + CefRefPtr callback) { + return false; + } + + /// + // Executed when a query has been canceled either explicitly using the + // JavaScript cancel function or implicitly due to browser destruction, + // navigation or renderer process termination. It will only be called for + // the single handler that returned true from OnQuery for the same + // |query_id|. No references to the associated Callback object should be + // kept after this method is called, nor should any Callback methods be + // executed. + /// + virtual void OnQueryCanceled(CefRefPtr browser, + CefRefPtr frame, + int64 query_id) {} + + virtual ~Handler() {} + }; + + /// + // Create a new router with the specified configuration. + /// + static CefRefPtr Create( + const CefMessageRouterConfig& config); + + /// + // Add a new query handler. If |first| is true it will be added as the first + // handler, otherwise it will be added as the last handler. Returns true if + // the handler is added successfully or false if the handler has already been + // added. Must be called on the browser process UI thread. The Handler object + // must either outlive the router or be removed before deletion. + /// + virtual bool AddHandler(Handler* handler, bool first) =0; + + /// + // Remove an existing query handler. Any pending queries associated with the + // handler will be canceled. Handler::OnQueryCanceled will be called and the + // associated JavaScript onFailure callback will be executed with an error + // code of -1. Returns true if the handler is removed successfully or false + // if the handler is not found. Must be called on the browser process UI + // thread. + /// + virtual bool RemoveHandler(Handler* handler) =0; + + /// + // Cancel all pending queries associated with either |browser| or |handler|. + // If both |browser| and |handler| are NULL all pending queries will be + // canceled. Handler::OnQueryCanceled will be called and the associated + // JavaScript onFailure callback will be executed in all cases with an error + // code of -1. + /// + virtual void CancelPending(CefRefPtr browser, + Handler* handler) =0; + + /// + // Returns the number of queries currently pending for the specified |browser| + // and/or |handler|. Either or both values may be empty. Must be called on the + // browser process UI thread. + /// + virtual int GetPendingCount(CefRefPtr browser, + Handler* handler) =0; + + + // The below methods should be called from other CEF handlers. They must be + // called exactly as documented for the router to function correctly. + + /// + // Call from CefLifeSpanHandler::OnBeforeClose. Any pending queries associated + // with |browser| will be canceled and Handler::OnQueryCanceled will be called. + // No JavaScript callbacks will be executed since this indicates destruction + // of the browser. + /// + virtual void OnBeforeClose(CefRefPtr browser) =0; + + /// + // Call from CefRequestHandler::OnRenderProcessTerminated. Any pending queries + // associated with |browser| will be canceled and Handler::OnQueryCanceled + // will be called. No JavaScript callbacks will be executed since this + // indicates destruction of the context. + /// + virtual void OnRenderProcessTerminated(CefRefPtr browser) =0; + + /// + // Call from CefRequestHandler::OnBeforeBrowse only if the navigation is + // allowed to proceed. If |frame| is the main frame then any pending queries + // associated with |browser| will be canceled and Handler::OnQueryCanceled + // will be called. No JavaScript callbacks will be executed since this + // indicates destruction of the context. + /// + virtual void OnBeforeBrowse(CefRefPtr browser, + CefRefPtr frame) =0; + + /// + // Call from CefClient::OnProcessMessageReceived. Returns true if the message + // is handled by this router or false otherwise. + /// + virtual bool OnProcessMessageReceived( + CefRefPtr browser, + CefProcessId source_process, + CefRefPtr message) =0; + + protected: + // Protect against accidental deletion of this object. + friend class base::RefCountedThreadSafe; + virtual ~CefMessageRouterBrowserSide() {} +}; + +/// +// Implements the renderer side of query routing. The methods of this class must +// be called on the render process main thread. +/// +class CefMessageRouterRendererSide : + public base::RefCountedThreadSafe { + public: + /// + // Create a new router with the specified configuration. + /// + static CefRefPtr Create( + const CefMessageRouterConfig& config); + + /// + // Returns the number of queries currently pending for the specified |browser| + // and/or |context|. Either or both values may be empty. + /// + virtual int GetPendingCount(CefRefPtr browser, + CefRefPtr context) =0; + + + // The below methods should be called from other CEF handlers. They must be + // called exactly as documented for the router to function correctly. + + /// + // Call from CefRenderProcessHandler::OnContextCreated. Registers the + // JavaScripts functions with the new context. + /// + virtual void OnContextCreated(CefRefPtr browser, + CefRefPtr frame, + CefRefPtr context) =0; + + /// + // Call from CefRenderProcessHandler::OnContextReleased. Any pending queries + // associated with the released context will be canceled and + // Handler::OnQueryCanceled will be called in the browser process. + /// + virtual void OnContextReleased(CefRefPtr browser, + CefRefPtr frame, + CefRefPtr context) =0; + + /// + // Call from CefRenderProcessHandler::OnProcessMessageReceived. Returns true + // if the message is handled by this router or false otherwise. + /// + virtual bool OnProcessMessageReceived( + CefRefPtr browser, + CefProcessId source_process, + CefRefPtr message) =0; + + protected: + // Protect against accidental deletion of this object. + friend class base::RefCountedThreadSafe; + virtual ~CefMessageRouterRendererSide() {} +}; + +#endif // CEF_INCLUDE_WRAPPER_CEF_MESSAGE_ROUTER_H_ diff --git a/dependencies64/cef/include/wrapper/cef_stream_resource_handler.h b/dependencies64/cef/include/wrapper/cef_stream_resource_handler.h new file mode 100644 index 000000000..6a9a69814 --- /dev/null +++ b/dependencies64/cef/include/wrapper/cef_stream_resource_handler.h @@ -0,0 +1,104 @@ +// Copyright (c) 2012 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// The contents of this file are only available to applications that link +// against the libcef_dll_wrapper target. +// + +#ifndef CEF_INCLUDE_WRAPPER_CEF_STREAM_RESOURCE_HANDLER_H_ +#define CEF_INCLUDE_WRAPPER_CEF_STREAM_RESOURCE_HANDLER_H_ +#pragma once + +#include "include/base/cef_macros.h" +#include "include/base/cef_scoped_ptr.h" +#include "include/cef_base.h" +#include "include/cef_resource_handler.h" +#include "include/cef_response.h" + +class CefStreamReader; + +/// +// Implementation of the CefResourceHandler class for reading from a CefStream. +/// +class CefStreamResourceHandler : public CefResourceHandler { + public: + /// + // Create a new object with default response values. + /// + CefStreamResourceHandler(const CefString& mime_type, + CefRefPtr stream); + /// + // Create a new object with explicit response values. + /// + CefStreamResourceHandler(int status_code, + const CefString& status_text, + const CefString& mime_type, + CefResponse::HeaderMap header_map, + CefRefPtr stream); + + virtual ~CefStreamResourceHandler(); + + // CefResourceHandler methods. + virtual bool ProcessRequest(CefRefPtr request, + CefRefPtr callback) OVERRIDE; + virtual void GetResponseHeaders(CefRefPtr response, + int64& response_length, + CefString& redirectUrl) OVERRIDE; + virtual bool ReadResponse(void* data_out, + int bytes_to_read, + int& bytes_read, + CefRefPtr callback) OVERRIDE; + virtual void Cancel() OVERRIDE; + + private: + void ReadOnFileThread(int bytes_to_read, + CefRefPtr callback); + + const int status_code_; + const CefString status_text_; + const CefString mime_type_; + const CefResponse::HeaderMap header_map_; + const CefRefPtr stream_; + bool read_on_file_thread_; + + class Buffer; + scoped_ptr buffer_; +#ifndef NDEBUG + // Used in debug builds to verify that |buffer_| isn't being accessed on + // multiple threads at the same time. + bool buffer_owned_by_file_thread_; +#endif + + IMPLEMENT_REFCOUNTING(CefStreamResourceHandler); + DISALLOW_COPY_AND_ASSIGN(CefStreamResourceHandler); +}; + +#endif // CEF_INCLUDE_WRAPPER_CEF_STREAM_RESOURCE_HANDLER_H_ diff --git a/dependencies64/cef/include/wrapper/cef_xml_object.h b/dependencies64/cef/include/wrapper/cef_xml_object.h new file mode 100644 index 000000000..bf1755432 --- /dev/null +++ b/dependencies64/cef/include/wrapper/cef_xml_object.h @@ -0,0 +1,196 @@ +// Copyright (c) 2011 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// The contents of this file are only available to applications that link +// against the libcef_dll_wrapper target. +// + +#ifndef CEF_INCLUDE_WRAPPER_CEF_XML_OBJECT_H_ +#define CEF_INCLUDE_WRAPPER_CEF_XML_OBJECT_H_ +#pragma once + +#include +#include + +#include "include/base/cef_lock.h" +#include "include/base/cef_macros.h" +#include "include/base/cef_ref_counted.h" +#include "include/cef_base.h" +#include "include/cef_xml_reader.h" + +class CefStreamReader; + +/// +// Thread safe class for representing XML data as a structured object. This +// class should not be used with large XML documents because all data will be +// resident in memory at the same time. This implementation supports a +// restricted set of XML features: +//
+// (1) Processing instructions, whitespace and comments are ignored.
+// (2) Elements and attributes must always be referenced using the fully
+//     qualified name (ie, namespace:localname).
+// (3) Empty elements () and elements with zero-length values ()
+//     are considered the same.
+// (4) Element nodes are considered part of a value if:
+//     (a) The element node follows a non-element node at the same depth
+//         (see 5), or
+//     (b) The element node does not have a namespace and the parent node does.
+// (5) Mixed node types at the same depth are combined into a single element
+//     value as follows:
+//     (a) All node values are concatenated to form a single string value.
+//     (b) Entity reference nodes are resolved to the corresponding entity
+//         value.
+//     (c) Element nodes are represented by their outer XML string.
+// 
+/// +class CefXmlObject : public base::RefCountedThreadSafe { + public: + typedef std::vector > ObjectVector; + typedef std::map AttributeMap; + + /// + // Create a new object with the specified name. An object name must always be + // at least one character long. + /// + explicit CefXmlObject(const CefString& name); + + /// + // Load the contents of the specified XML stream into this object. The + // existing children and attributes, if any, will first be cleared. + /// + bool Load(CefRefPtr stream, + CefXmlReader::EncodingType encodingType, + const CefString& URI, CefString* loadError); + + /// + // Set the name, children and attributes of this object to a duplicate of the + // specified object's contents. The existing children and attributes, if any, + // will first be cleared. + /// + void Set(CefRefPtr object); + + /// + // Append a duplicate of the children and attributes of the specified object + // to this object. If |overwriteAttributes| is true then any attributes in + // this object that also exist in the specified object will be overwritten + // with the new values. The name of this object is not changed. + /// + void Append(CefRefPtr object, bool overwriteAttributes); + + /// + // Return a new object with the same name, children and attributes as this + // object. The parent of the new object will be NULL. + /// + CefRefPtr Duplicate(); + + /// + // Clears this object's children and attributes. The name and parenting of + // this object are not changed. + /// + void Clear(); + + /// + // Access the object's name. An object name must always be at least one + // character long. + /// + CefString GetName(); + bool SetName(const CefString& name); + + /// + // Access the object's parent. The parent can be NULL if this object has not + // been added as the child on another object. + /// + bool HasParent(); + CefRefPtr GetParent(); + + /// + // Access the object's value. An object cannot have a value if it also has + // children. Attempting to set the value while children exist will fail. + /// + bool HasValue(); + CefString GetValue(); + bool SetValue(const CefString& value); + + /// + // Access the object's attributes. Attributes must have unique names. + /// + bool HasAttributes(); + size_t GetAttributeCount(); + bool HasAttribute(const CefString& name); + CefString GetAttributeValue(const CefString& name); + bool SetAttributeValue(const CefString& name, const CefString& value); + size_t GetAttributes(AttributeMap& attributes); + void ClearAttributes(); + + /// + // Access the object's children. Each object can only have one parent so + // attempting to add an object that already has a parent will fail. Removing a + // child will set the child's parent to NULL. Adding a child will set the + // child's parent to this object. This object's value, if any, will be cleared + // if a child is added. + /// + bool HasChildren(); + size_t GetChildCount(); + bool HasChild(CefRefPtr child); + bool AddChild(CefRefPtr child); + bool RemoveChild(CefRefPtr child); + size_t GetChildren(ObjectVector& children); + void ClearChildren(); + + /// + // Find the first child with the specified name. + /// + CefRefPtr FindChild(const CefString& name); + + /// + // Find all children with the specified name. + /// + size_t FindChildren(const CefString& name, ObjectVector& children); + + private: + // Protect against accidental deletion of this object. + friend class base::RefCountedThreadSafe; + ~CefXmlObject(); + + void SetParent(CefXmlObject* parent); + + CefString name_; + CefXmlObject* parent_; + CefString value_; + AttributeMap attributes_; + ObjectVector children_; + + base::Lock lock_; + + DISALLOW_COPY_AND_ASSIGN(CefXmlObject); +}; + +#endif // CEF_INCLUDE_WRAPPER_CEF_XML_OBJECT_H_ diff --git a/dependencies64/cef/include/wrapper/cef_zip_archive.h b/dependencies64/cef/include/wrapper/cef_zip_archive.h new file mode 100644 index 000000000..7ad10bda8 --- /dev/null +++ b/dependencies64/cef/include/wrapper/cef_zip_archive.h @@ -0,0 +1,143 @@ +// Copyright (c) 2011 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// The contents of this file are only available to applications that link +// against the libcef_dll_wrapper target. +// + +#ifndef CEF_INCLUDE_WRAPPER_CEF_ZIP_ARCHIVE_H_ +#define CEF_INCLUDE_WRAPPER_CEF_ZIP_ARCHIVE_H_ +#pragma once + +#include + +#include "include/base/cef_lock.h" +#include "include/base/cef_macros.h" +#include "include/base/cef_ref_counted.h" +#include "include/cef_base.h" + +class CefStreamReader; + +/// +// Thread-safe class for accessing zip archive file contents. This class should +// not be used with large archive files because all data will be resident in +// memory at the same time. This implementation supports a restricted set of zip +// archive features: +// (1) All file names are stored and compared in lower case. +// (2) File ordering from the original zip archive is not maintained. This +// means that files from the same folder may not be located together in the +// file content map. +/// +class CefZipArchive : public base::RefCountedThreadSafe { + public: + /// + // Class representing a file in the archive. Accessing the file data from + // multiple threads is safe provided a reference to the File object is kept. + /// + class File : public CefBase { + public: + /// + // Returns the read-only data contained in the file. + /// + virtual const unsigned char* GetData() const =0; + + /// + // Returns the size of the data in the file. + /// + virtual size_t GetDataSize() const =0; + + /// + // Returns a CefStreamReader object for streaming the contents of the file. + /// + virtual CefRefPtr GetStreamReader() const =0; + }; + + typedef std::map > FileMap; + + /// + // Create a new object. + /// + CefZipArchive(); + + /// + // Load the contents of the specified zip archive stream into this object. + // If the zip archive requires a password then provide it via |password|. + // If |overwriteExisting| is true then any files in this object that also + // exist in the specified archive will be replaced with the new files. + // Returns the number of files successfully loaded. + /// + size_t Load(CefRefPtr stream, + const CefString& password, + bool overwriteExisting); + + /// + // Clears the contents of this object. + /// + void Clear(); + + /// + // Returns the number of files in the archive. + /// + size_t GetFileCount() const; + + /// + // Returns true if the specified file exists and has contents. + /// + bool HasFile(const CefString& fileName) const; + + /// + // Returns the specified file. + /// + CefRefPtr GetFile(const CefString& fileName) const; + + /// + // Removes the specified file. + /// + bool RemoveFile(const CefString& fileName); + + /// + // Returns the map of all files. + /// + size_t GetFiles(FileMap& map) const; + + private: + // Protect against accidental deletion of this object. + friend class base::RefCountedThreadSafe; + ~CefZipArchive(); + + FileMap contents_; + + mutable base::Lock lock_; + + DISALLOW_COPY_AND_ASSIGN(CefZipArchive); +}; + +#endif // CEF_INCLUDE_WRAPPER_CEF_ZIP_ARCHIVE_H_ diff --git a/dependencies64/cef/lib/win32/libcef.lib b/dependencies64/cef/lib/win32/libcef.lib new file mode 100644 index 000000000..1a775b952 Binary files /dev/null and b/dependencies64/cef/lib/win32/libcef.lib differ diff --git a/dependencies64/cef/lib/win32/libcef_dll_wrapper.lib b/dependencies64/cef/lib/win32/libcef_dll_wrapper.lib new file mode 100644 index 000000000..bd6714663 Binary files /dev/null and b/dependencies64/cef/lib/win32/libcef_dll_wrapper.lib differ diff --git a/modules/CMakeLists.txt b/modules/CMakeLists.txt index af2bde63a..44d478403 100644 --- a/modules/CMakeLists.txt +++ b/modules/CMakeLists.txt @@ -15,6 +15,7 @@ add_subdirectory(image) if (MSVC) add_subdirectory(flash) add_subdirectory(psd) + add_subdirectory(html) endif () add_subdirectory(reroute) diff --git a/modules/html/CMakeLists.txt b/modules/html/CMakeLists.txt new file mode 100644 index 000000000..11ebe3336 --- /dev/null +++ b/modules/html/CMakeLists.txt @@ -0,0 +1,64 @@ +cmake_minimum_required (VERSION 2.6) +project (html) + +set(SOURCES + producer/html_cg_proxy.cpp + producer/html_producer.cpp + + html.cpp +) +set(HEADERS + producer/html_cg_proxy.h + producer/html_producer.h + + html.h +) + +add_library(html ${SOURCES} ${HEADERS}) + +include_directories(..) +include_directories(../..) +include_directories(${BOOST_INCLUDE_PATH}) +include_directories(${RXCPP_INCLUDE_PATH}) +include_directories(${TBB_INCLUDE_PATH}) +include_directories(${CEF_INCLUDE_PATH}) +include_directories(${CEF_PATH}) +include_directories(${ASMLIB_INCLUDE_PATH}) + +set_target_properties(html PROPERTIES FOLDER modules) +source_group(sources\\producer producer/*) +source_group(sources ./*) + +if(MSVC) + target_link_libraries(html + common + core + + libcef.lib + libcef_dll_wrapper.lib + ) +endif() + +casparcg_add_include_statement("modules/html/html.h") +casparcg_add_init_statement("html::init" "html") +casparcg_add_uninit_statement("html::uninit") +casparcg_add_command_line_arg_interceptor("html::intercept_command_line") +casparcg_add_module_project("html") + +casparcg_add_runtime_dependency("${CEF_RESOURCES_PATH}/locales") +casparcg_add_runtime_dependency("${CEF_RESOURCES_PATH}/cef.pak") +casparcg_add_runtime_dependency("${CEF_RESOURCES_PATH}/cef_100_percent.pak") +casparcg_add_runtime_dependency("${CEF_RESOURCES_PATH}/cef_200_percent.pak") +casparcg_add_runtime_dependency("${CEF_RESOURCES_PATH}/devtools_resources.pak") +casparcg_add_runtime_dependency("${CEF_RESOURCES_PATH}/icudtl.dat") + +if(MSVC) + casparcg_add_runtime_dependency("${CEF_BIN_PATH}/libcef.dll") + casparcg_add_runtime_dependency("${CEF_BIN_PATH}/d3dcompiler_43.dll") + casparcg_add_runtime_dependency("${CEF_BIN_PATH}/d3dcompiler_47.dll") + casparcg_add_runtime_dependency("${CEF_BIN_PATH}/ffmpegsumo.dll") + casparcg_add_runtime_dependency("${CEF_BIN_PATH}/libEGL.dll") + casparcg_add_runtime_dependency("${CEF_BIN_PATH}/libGLESv2.dll") + casparcg_add_runtime_dependency("${CEF_BIN_PATH}/natives_blob.bin") + casparcg_add_runtime_dependency("${CEF_BIN_PATH}/snapshot_blob.bin") +endif() diff --git a/modules/html/html.cpp b/modules/html/html.cpp new file mode 100644 index 000000000..1ffd3c3a3 --- /dev/null +++ b/modules/html/html.cpp @@ -0,0 +1,389 @@ +/* +* Copyright 2013 Sveriges Television AB http://casparcg.com/ +* +* This file is part of CasparCG (www.casparcg.com). +* +* CasparCG is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* CasparCG is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with CasparCG. If not, see . +* +* Author: Robert Nagy, ronag89@gmail.com +*/ + +#include "html.h" + +#include "producer/html_producer.h" +#include "producer/html_cg_proxy.h" + +#include +#include + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#pragma comment(lib, "libcef.lib") +#pragma comment(lib, "libcef_dll_wrapper.lib") + +namespace caspar { namespace html { + +std::unique_ptr g_cef_executor; + +void caspar_log( + const CefRefPtr& browser, + boost::log::trivial::severity_level level, + const std::string& message) +{ + if (browser) + { + auto msg = CefProcessMessage::Create(LOG_MESSAGE_NAME); + msg->GetArgumentList()->SetInt(0, level); + msg->GetArgumentList()->SetString(1, message); + browser->SendProcessMessage(PID_BROWSER, msg); + } +} + +class animation_handler : public CefV8Handler +{ +private: + std::vector> callbacks_; + boost::timer since_start_timer_; +public: + CefRefPtr browser; + std::function()> get_context; + + bool Execute( + const CefString& name, + CefRefPtr object, + const CefV8ValueList& arguments, + CefRefPtr& retval, + CefString& exception) override + { + if (!CefCurrentlyOn(TID_RENDERER)) + return false; + + if (arguments.size() < 1 || !arguments.at(0)->IsFunction()) + { + return false; + } + + callbacks_.push_back(arguments.at(0)); + + if (browser) + browser->SendProcessMessage(PID_BROWSER, CefProcessMessage::Create( + ANIMATION_FRAME_REQUESTED_MESSAGE_NAME)); + + return true; + } + + void tick() + { + if (!get_context) + return; + + auto context = get_context(); + + if (!context) + return; + + if (!CefCurrentlyOn(TID_RENDERER)) + return; + + std::vector> callbacks; + callbacks_.swap(callbacks); + + CefV8ValueList callback_args; + CefTime timestamp; + timestamp.Now(); + callback_args.push_back(CefV8Value::CreateDouble( + since_start_timer_.elapsed() * 1000.0)); + + BOOST_FOREACH(auto callback, callbacks) + { + callback->ExecuteFunctionWithContext( + context, callback, callback_args); + } + } + + IMPLEMENT_REFCOUNTING(animation_handler); +}; + +class remove_handler : public CefV8Handler +{ + CefRefPtr browser_; +public: + remove_handler(CefRefPtr browser) + : browser_(browser) + { + } + + bool Execute( + const CefString& name, + CefRefPtr object, + const CefV8ValueList& arguments, + CefRefPtr& retval, + CefString& exception) override + { + if (!CefCurrentlyOn(TID_RENDERER)) + return false; + + browser_->SendProcessMessage( + PID_BROWSER, + CefProcessMessage::Create(REMOVE_MESSAGE_NAME)); + + return true; + } + + IMPLEMENT_REFCOUNTING(remove_handler); +}; + +class renderer_application : public CefApp, CefRenderProcessHandler +{ + std::vector, CefRefPtr>> contexts_per_handlers_; + //std::map, CefRefPtr> contexts_per_handlers_; +public: + CefRefPtr GetRenderProcessHandler() override + { + return this; + } + + CefRefPtr get_context( + const CefRefPtr& handler) + { + BOOST_FOREACH(auto& ctx, contexts_per_handlers_) + { + if (ctx.first == handler) + return ctx.second; + } + + return nullptr; + } + + void OnContextCreated( + CefRefPtr browser, + CefRefPtr frame, + CefRefPtr context) override + { + caspar_log(browser, boost::log::trivial::trace, + "context for frame " + + boost::lexical_cast(frame->GetIdentifier()) + + " created"); + + CefRefPtr handler = new animation_handler; + contexts_per_handlers_.push_back(std::make_pair(handler, context)); + auto handler_ptr = handler.get(); + + handler->browser = browser; + handler->get_context = [this, handler_ptr] + { + return get_context(handler_ptr); + }; + + auto window = context->GetGlobal(); + + auto function = CefV8Value::CreateFunction( + "requestAnimationFrame", + handler.get()); + window->SetValue( + "requestAnimationFrame", + function, + V8_PROPERTY_ATTRIBUTE_NONE); + + function = CefV8Value::CreateFunction( + "remove", + new remove_handler(browser)); + window->SetValue( + "remove", + function, + V8_PROPERTY_ATTRIBUTE_NONE); + } + + void OnContextReleased( + CefRefPtr browser, + CefRefPtr frame, + CefRefPtr context) + { + auto removed = boost::remove_if( + contexts_per_handlers_, [&](const std::pair< + CefRefPtr, + CefRefPtr>& c) + { + return c.second->IsSame(context); + }); + + if (removed != contexts_per_handlers_.end()) + caspar_log(browser, boost::log::trivial::trace, + "context for frame " + + boost::lexical_cast(frame->GetIdentifier()) + + " released"); + else + caspar_log(browser, boost::log::trivial::warning, + "context for frame " + + boost::lexical_cast(frame->GetIdentifier()) + + " released, but not found"); + } + + void OnBrowserDestroyed(CefRefPtr browser) override + { + contexts_per_handlers_.clear(); + } + + bool OnProcessMessageReceived( + CefRefPtr browser, + CefProcessId source_process, + CefRefPtr message) override + { + if (message->GetName().ToString() == TICK_MESSAGE_NAME) + { + BOOST_FOREACH(auto& handler, contexts_per_handlers_) + { + handler.first->tick(); + } + + return true; + } + else + { + return false; + } + } + + IMPLEMENT_REFCOUNTING(renderer_application); +}; + +bool intercept_command_line(int argc, char** argv) +{ + CefMainArgs main_args; + + if (CefExecuteProcess(main_args, CefRefPtr(new renderer_application), nullptr) >= 0) + return true; + + return false; +} + +void init(core::module_dependencies dependencies) +{ + core::register_producer_factory(html::create_producer); + + CefMainArgs main_args; + g_cef_executor.reset(new executor(L"cef")); + g_cef_executor->invoke([&] + { + CefSettings settings; + settings.windowless_rendering_enabled = true; + CefInitialize(main_args, settings, nullptr, nullptr); + }); + g_cef_executor->begin_invoke([&] + { + CefRunMessageLoop(); + }); + dependencies.cg_registry->register_cg_producer( + L"html", + { L".html" }, + [](const std::wstring& filename) + { + return ""; + }, + [](const spl::shared_ptr& producer) + { + return spl::make_shared(producer); + }, + [](const spl::shared_ptr& ff, const core::video_format_desc& f, const std::wstring& filename) + { + return html::create_producer(ff, f, { filename }); + }, + false + ); +} + +void uninit() +{ + invoke([] + { + CefQuitMessageLoop(); + }); + g_cef_executor->begin_invoke([&] + { + CefShutdown(); + }); +} + +class cef_task : public CefTask +{ +private: + std::promise promise_; + std::function function_; +public: + cef_task(const std::function& function) + : function_(function) + { + } + + void Execute() override + { + CASPAR_LOG(trace) << "[cef_task] executing task"; + + try + { + function_(); + promise_.set_value(); + CASPAR_LOG(trace) << "[cef_task] task succeeded"; + } + catch (...) + { + promise_.set_exception(std::current_exception()); + CASPAR_LOG(warning) << "[cef_task] task failed"; + } + } + + std::future future() + { + return promise_.get_future(); + } + + IMPLEMENT_REFCOUNTING(cef_task); +}; + +void invoke(const std::function& func) +{ + begin_invoke(func).get(); +} + +std::future begin_invoke(const std::function& func) +{ + CefRefPtr task = new cef_task(func); + + if (CefCurrentlyOn(TID_UI)) + { + // Avoid deadlock. + task->Execute(); + return task->future(); + } + + if (CefPostTask(TID_UI, task.get())) + return task->future(); + else + BOOST_THROW_EXCEPTION(caspar_exception() + << msg_info("[cef_executor] Could not post task")); +} + +}} diff --git a/modules/html/html.h b/modules/html/html.h new file mode 100644 index 000000000..5a192bc2f --- /dev/null +++ b/modules/html/html.h @@ -0,0 +1,44 @@ +/* +* Copyright 2013 Sveriges Television AB http://casparcg.com/ +* +* This file is part of CasparCG (www.casparcg.com). +* +* CasparCG is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* CasparCG is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with CasparCG. If not, see . +* +* Author: Robert Nagy, ronag89@gmail.com +*/ + +#pragma once + +#include +#include +#include + +#include + +namespace caspar { namespace html { + +const std::string TICK_MESSAGE_NAME = "CasparCGTick"; +const std::string ANIMATION_FRAME_REQUESTED_MESSAGE_NAME = + "CasparCGAnimationFrameRequested"; +const std::string REMOVE_MESSAGE_NAME = "CasparCGRemove"; +const std::string LOG_MESSAGE_NAME = "CasparCGLog"; + +bool intercept_command_line(int argc, char** argv); +void init(core::module_dependencies dependencies); +void uninit(); +void invoke(const std::function& func); +std::future begin_invoke(const std::function& func); + +}} diff --git a/modules/html/producer/html_cg_proxy.cpp b/modules/html/producer/html_cg_proxy.cpp new file mode 100644 index 000000000..702dff0d9 --- /dev/null +++ b/modules/html/producer/html_cg_proxy.cpp @@ -0,0 +1,95 @@ +/* +* Copyright 2013 Sveriges Television AB http://casparcg.com/ +* +* This file is part of CasparCG (www.casparcg.com). +* +* CasparCG is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* CasparCG is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with CasparCG. If not, see . +* +* Author: Helge Norberg, helge.norberg@svt.se +*/ + +#include "html_cg_proxy.h" + +#include + +namespace caspar { namespace html { + +struct html_cg_proxy::impl +{ + spl::shared_ptr producer; +}; + +html_cg_proxy::html_cg_proxy(spl::shared_ptr producer) + : impl_(new impl { producer }) +{ +} + +html_cg_proxy::~html_cg_proxy() +{ +} + +void html_cg_proxy::add( + int layer, + const std::wstring& template_name, + bool play_on_load, + const std::wstring& start_from_label, + const std::wstring& data) +{ + update(layer, data); + + if (play_on_load) + play(layer); +} + +void html_cg_proxy::remove(int layer) +{ + impl_->producer->call({ L"remove()" }); +} + +void html_cg_proxy::play(int layer) +{ + impl_->producer->call({ L"play()" }); +} + +void html_cg_proxy::stop(int layer, unsigned int mix_out_duration) +{ + impl_->producer->call({ L"stop()" }); +} + +void html_cg_proxy::next(int layer) +{ + impl_->producer->call({ L"next()" }); +} + +void html_cg_proxy::update(int layer, const std::wstring& data) +{ + +} + +std::wstring html_cg_proxy::invoke(int layer, const std::wstring& label) +{ + return L""; +} + +std::wstring html_cg_proxy::description(int layer) +{ + return L""; +} + +std::wstring html_cg_proxy::template_host_info() +{ + return L""; +} + +}} diff --git a/modules/html/producer/html_cg_proxy.h b/modules/html/producer/html_cg_proxy.h new file mode 100644 index 000000000..69b97a554 --- /dev/null +++ b/modules/html/producer/html_cg_proxy.h @@ -0,0 +1,55 @@ +/* +* Copyright 2013 Sveriges Television AB http://casparcg.com/ +* +* This file is part of CasparCG (www.casparcg.com). +* +* CasparCG is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* CasparCG is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with CasparCG. If not, see . +* +* Author: Helge Norberg, helge.norberg@svt.se +*/ + +#pragma once + +#include + +#include + +namespace caspar { namespace html { + +class html_cg_proxy : public core::cg_proxy +{ +public: + html_cg_proxy(spl::shared_ptr producer); + ~html_cg_proxy(); + + void add( + int layer, + const std::wstring& template_name, + bool play_on_load, + const std::wstring& start_from_label, + const std::wstring& data) override; + void remove(int layer) override; + void play(int layer) override; + void stop(int layer, unsigned int mix_out_duration) override; + void next(int layer) override; + void update(int layer, const std::wstring& data) override; + std::wstring invoke(int layer, const std::wstring& label) override; + std::wstring description(int layer) override; + std::wstring template_host_info() override; +private: + struct impl; + spl::shared_ptr impl_; +}; + +}} diff --git a/modules/html/producer/html_producer.cpp b/modules/html/producer/html_producer.cpp new file mode 100644 index 000000000..1141554b9 --- /dev/null +++ b/modules/html/producer/html_producer.cpp @@ -0,0 +1,580 @@ +/* +* Copyright 2013 Sveriges Television AB http://casparcg.com/ +* +* This file is part of CasparCG (www.casparcg.com). +* +* CasparCG is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* CasparCG is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with CasparCG. If not, see . +* +* Author: Robert Nagy, ronag89@gmail.com +*/ + +#include "html_producer.h" + +#include + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include +#include + +#include + +#include + +#include "../html.h" + +#pragma comment (lib, "libcef.lib") +#pragma comment (lib, "libcef_dll_wrapper.lib") + +namespace caspar { + namespace html { + + class html_client + : public CefClient + , public CefRenderHandler + , public CefLifeSpanHandler + , public CefLoadHandler + { + std::wstring url_; + spl::shared_ptr graph_; + boost::timer tick_timer_; + boost::timer frame_timer_; + boost::timer paint_timer_; + + spl::shared_ptr frame_factory_; + core::video_format_desc format_desc_; + tbb::concurrent_queue javascript_before_load_; + tbb::atomic loaded_; + tbb::atomic removed_; + tbb::atomic animation_frame_requested_; + std::queue frames_; + mutable boost::mutex frames_mutex_; + + core::draw_frame last_frame_; + core::draw_frame last_progressive_frame_; + mutable boost::mutex last_frame_mutex_; + + CefRefPtr browser_; + + executor executor_; + + public: + + html_client( + spl::shared_ptr frame_factory, + const core::video_format_desc& format_desc, + const std::wstring& url) + : url_(url) + , frame_factory_(std::move(frame_factory)) + , format_desc_(format_desc) + , last_frame_(core::draw_frame::empty()) + , last_progressive_frame_(core::draw_frame::empty()) + , executor_(L"html_producer") + { + graph_->set_color("browser-tick-time", diagnostics::color(0.1f, 1.0f, 0.1f)); + graph_->set_color("tick-time", diagnostics::color(0.0f, 0.6f, 0.9f)); + graph_->set_color("late-frame", diagnostics::color(0.6f, 0.3f, 0.9f)); + graph_->set_text(print()); + diagnostics::register_graph(graph_); + + loaded_ = false; + removed_ = false; + animation_frame_requested_ = false; + executor_.begin_invoke([&]{ update(); }); + } + + core::draw_frame receive() + { + auto frame = last_frame(); + executor_.begin_invoke([&]{ update(); }); + return frame; + } + + core::draw_frame last_frame() const + { + return lock(last_frame_mutex_, [&] + { + return last_frame_; + }); + } + + void execute_javascript(const std::wstring& javascript) + { + if (!loaded_) + { + javascript_before_load_.push(javascript); + } + else + { + execute_queued_javascript(); + do_execute_javascript(javascript); + } + } + + void close() + { + if (!animation_frame_requested_) + CASPAR_LOG(warning) << print() + << " window.requestAnimationFrame() never called. " + << "Animations might have been laggy"; + + html::invoke([=] + { + if (browser_ != nullptr) + { + browser_->GetHost()->CloseBrowser(true); + } + }); + } + + void remove() + { + close(); + removed_ = true; + } + + bool is_removed() const + { + return removed_; + } + + private: + + bool GetViewRect(CefRefPtr browser, CefRect &rect) + { + CASPAR_ASSERT(CefCurrentlyOn(TID_UI)); + + rect = CefRect(0, 0, format_desc_.square_width, format_desc_.square_height); + return true; + } + + void OnPaint( + CefRefPtr browser, + PaintElementType type, + const RectList &dirtyRects, + const void *buffer, + int width, + int height) + { + graph_->set_value("browser-tick-time", paint_timer_.elapsed() + * format_desc_.fps + * format_desc_.field_count + * 0.5); + paint_timer_.restart(); + CASPAR_ASSERT(CefCurrentlyOn(TID_UI)); + + boost::timer copy_timer; + core::pixel_format_desc pixel_desc; + pixel_desc.format = core::pixel_format::bgra; + pixel_desc.planes.push_back( + core::pixel_format_desc::plane(width, height, 4)); + auto frame = frame_factory_->create_frame(this, pixel_desc); + A_memcpy(frame.image_data().begin(), buffer, width * height * 4); + + lock(frames_mutex_, [&] + { + frames_.push(core::draw_frame(std::move(frame))); + + size_t max_in_queue = format_desc_.field_count; + + while (frames_.size() > max_in_queue) + { + frames_.pop(); + graph_->set_tag("dropped-frame"); + } + }); + graph_->set_value("copy-time", copy_timer.elapsed() + * format_desc_.fps + * format_desc_.field_count + * 0.5); + } + + void OnAfterCreated(CefRefPtr browser) override + { + CASPAR_ASSERT(CefCurrentlyOn(TID_UI)); + + browser_ = browser; + } + + void OnBeforeClose(CefRefPtr browser) override + { + CASPAR_ASSERT(CefCurrentlyOn(TID_UI)); + + browser_ = nullptr; + } + + bool DoClose(CefRefPtr browser) override + { + CASPAR_ASSERT(CefCurrentlyOn(TID_UI)); + + return false; + } + + CefRefPtr GetRenderHandler() override + { + return this; + } + + CefRefPtr GetLifeSpanHandler() override + { + return this; + } + + CefRefPtr GetLoadHandler() override { + return this; + } + + void OnLoadEnd( + CefRefPtr browser, + CefRefPtr frame, + int httpStatusCode) override + { + loaded_ = true; + execute_queued_javascript(); + } + + bool OnProcessMessageReceived( + CefRefPtr browser, + CefProcessId source_process, + CefRefPtr message) override + { + auto name = message->GetName().ToString(); + + if (name == ANIMATION_FRAME_REQUESTED_MESSAGE_NAME) + { + CASPAR_LOG(trace) + << print() << L" Requested animation frame"; + animation_frame_requested_ = true; + + return true; + } + else if (name == REMOVE_MESSAGE_NAME) + { + remove(); + + return true; + } + else if (name == LOG_MESSAGE_NAME) + { + auto args = message->GetArgumentList(); + auto severity = + static_cast(args->GetInt(0)); + auto msg = args->GetString(1).ToWString(); + + BOOST_LOG_STREAM_WITH_PARAMS( + log::logger::get(), + (boost::log::keywords::severity = severity)) + << print() << L" [renderer_process] " << msg; + } + + return false; + } + + void invoke_requested_animation_frames() + { + if (browser_) + browser_->SendProcessMessage( + CefProcessId::PID_RENDERER, + CefProcessMessage::Create(TICK_MESSAGE_NAME)); + graph_->set_value("tick-time", tick_timer_.elapsed() + * format_desc_.fps + * format_desc_.field_count + * 0.5); + tick_timer_.restart(); + } + + bool try_pop(core::draw_frame& result) + { + return lock(frames_mutex_, [&]() -> bool + { + if (!frames_.empty()) + { + result = frames_.front(); + frames_.pop(); + + return true; + } + + return false; + }); + } + + core::draw_frame pop() + { + core::draw_frame frame; + + if (!try_pop(frame)) + { + BOOST_THROW_EXCEPTION(caspar_exception() << msg_info(u8(print()) + " No frame in buffer")); + } + + return frame; + } + + void update() + { + invoke_requested_animation_frames(); + + prec_timer timer; + timer.tick(0.0); + + auto num_frames = lock(frames_mutex_, [&] + { + return frames_.size(); + }); + + if (num_frames >= format_desc_.field_count) + { + if (format_desc_.field_mode != core::field_mode::progressive) + { + auto frame1 = pop(); + + executor_.yield(caspar::task_priority::lowest_priority); + timer.tick(1.0 / (format_desc_.fps * format_desc_.field_count)); + invoke_requested_animation_frames(); + + auto frame2 = pop(); + + lock(last_frame_mutex_, [&] + { + last_progressive_frame_ = frame2; + last_frame_ = core::draw_frame::interlace(frame1, frame2, format_desc_.field_mode); + }); + } + else + { + auto frame = pop(); + + lock(last_frame_mutex_, [&] + { + last_frame_ = frame; + }); + } + } + else if (num_frames == 1) // Interlaced but only one frame + { // available. Probably the last frame + // of some animation sequence. + auto frame = pop(); + + lock(last_frame_mutex_, [&] + { + last_progressive_frame_ = frame; + last_frame_ = frame; + }); + + timer.tick(1.0 / (format_desc_.fps * format_desc_.field_count)); + invoke_requested_animation_frames(); + } + else + { + graph_->set_tag("late-frame"); + + if (format_desc_.field_mode != core::field_mode::progressive) + { + lock(last_frame_mutex_, [&] + { + last_frame_ = last_progressive_frame_; + }); + + timer.tick(1.0 / (format_desc_.fps * format_desc_.field_count)); + invoke_requested_animation_frames(); + } + } + } + + void do_execute_javascript(const std::wstring& javascript) + { + html::begin_invoke([=] + { + if (browser_ != nullptr) + browser_->GetMainFrame()->ExecuteJavaScript(u8(javascript).c_str(), browser_->GetMainFrame()->GetURL(), 0); + }); + } + + void execute_queued_javascript() + { + std::wstring javascript; + + while (javascript_before_load_.try_pop(javascript)) + do_execute_javascript(javascript); + } + + std::wstring print() const + { + return L"html[" + url_ + L"]"; + } + + IMPLEMENT_REFCOUNTING(html_client); + }; + + class html_producer + : public core::frame_producer_base + { + core::monitor::subject monitor_subject_; + const std::wstring url_; + core::constraints constraints_; + + CefRefPtr client_; + + public: + html_producer( + const spl::shared_ptr& frame_factory, + const core::video_format_desc& format_desc, + const std::wstring& url) + : url_(url) + { + constraints_.width.set(format_desc.square_width); + constraints_.height.set(format_desc.square_height); + + html::invoke([&] + { + client_ = new html_client(frame_factory, format_desc, url_); + + CefWindowInfo window_info; + + //window_info.SetTransparentPainting(TRUE); + window_info.SetAsWindowless(nullptr, true); + //window_info.SetAsWindowless(nullptr, true); + + CefBrowserSettings browser_settings; + CefBrowserHost::CreateBrowser(window_info, client_.get(), url, browser_settings, nullptr); + }); + } + + ~html_producer() + { + if (client_) + client_->close(); + } + + // frame_producer + + std::wstring name() const override + { + return L"html"; + } + + core::draw_frame receive_impl() override + { + if (client_) + { + if (client_->is_removed()) + { + client_ = nullptr; + return core::draw_frame::empty(); + } + + return client_->receive(); + } + + return core::draw_frame::empty(); + } + + /*core::draw_frame last_frame() override + { + return client_ + ? client_->last_frame() + : core::draw_frame::empty(); + }*/ + + std::future call(const std::vector& params) override + { + if (!client_) + return make_ready_future(std::wstring(L"")); + + auto javascript = params.at(0); + + client_->execute_javascript(javascript); + + return make_ready_future(std::wstring(L"")); + } + + std::wstring print() const override + { + return L"html[" + url_ + L"]"; + } + + boost::property_tree::wptree info() const override + { + boost::property_tree::wptree info; + info.add(L"type", L"html-producer"); + return info; + } + + core::constraints& pixel_constraints() override + { + return constraints_; + } + + core::monitor::subject& monitor_output() + { + return monitor_subject_; + } + }; + + spl::shared_ptr create_producer( + const spl::shared_ptr& frame_factory, + const core::video_format_desc& format_desc, + const std::vector& params) + { + const auto filename = env::template_folder() + L"/" + params.at(0) + L".html"; + const auto found_filename = find_case_insensitive(filename); + + if (!found_filename && !boost::iequals(params.at(0), L"[HTML]")) + return core::frame_producer::empty(); + + const auto url = found_filename + ? *found_filename + : params.at(1); + + if (!boost::algorithm::contains(url, ".") || boost::algorithm::ends_with(url, "_A") || boost::algorithm::ends_with(url, "_ALPHA")) + return core::frame_producer::empty(); + + return core::create_destroy_proxy(spl::make_shared( + frame_factory, + format_desc, + url)); + } + } +} diff --git a/modules/html/producer/html_producer.h b/modules/html/producer/html_producer.h new file mode 100644 index 000000000..484db796e --- /dev/null +++ b/modules/html/producer/html_producer.h @@ -0,0 +1,48 @@ +/* +* Copyright 2013 Sveriges Television AB http://casparcg.com/ +* +* This file is part of CasparCG (www.casparcg.com). +* +* CasparCG is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* CasparCG is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with CasparCG. If not, see . +* +* Author: Robert Nagy, ronag89@gmail.com +*/ + +#pragma once + +#include + +#include +#include + +#include +#include + +namespace caspar { + +namespace core { + +class frame_producer; +class frame_factory; + +} + +namespace html { + +spl::shared_ptr create_producer( + const spl::shared_ptr& frame_factory, + const core::video_format_desc& format_desc, + const std::vector& params); + +}} \ No newline at end of file diff --git a/shell/CMakeLists.txt b/shell/CMakeLists.txt index 68ff4f160..1d7bf6f47 100644 --- a/shell/CMakeLists.txt +++ b/shell/CMakeLists.txt @@ -4,6 +4,7 @@ project (shell) join_list("${CASPARCG_MODULE_INCLUDE_STATEMENTS}" "\n" CASPARCG_MODULE_INCLUDE_STATEMENTS) join_list("${CASPARCG_MODULE_INIT_STATEMENTS}" "\n" CASPARCG_MODULE_INIT_STATEMENTS) join_list("${CASPARCG_MODULE_UNINIT_STATEMENTS}" "\n" CASPARCG_MODULE_UNINIT_STATEMENTS) +join_list("${CASPARCG_MODULE_COMMAND_LINE_ARG_INTERCEPTORS_STATEMENTS}" "\n" CASPARCG_MODULE_COMMAND_LINE_ARG_INTERCEPTORS_STATEMENTS) configure_file("${PROJECT_SOURCE_DIR}/included_modules.tmpl" "${PROJECT_SOURCE_DIR}/included_modules.h") if (MSVC) @@ -65,6 +66,11 @@ casparcg_add_runtime_dependency("${CMAKE_CURRENT_SOURCE_DIR}/casparcg.config") set(OUTPUT_FOLDER "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}") foreach(FILE_TO_COPY ${CASPARCG_RUNTIME_DEPENDENCIES}) - add_custom_command(TARGET casparcg_copy_dependencies POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy \"${FILE_TO_COPY}\" \"${OUTPUT_FOLDER}/\") - add_custom_command(TARGET casparcg_copy_dependencies POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy \"${FILE_TO_COPY}\" \"${CMAKE_CURRENT_BINARY_DIR}/\") + if(IS_DIRECTORY "${FILE_TO_COPY}") + add_custom_command(TARGET casparcg_copy_dependencies POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy_directory \"${FILE_TO_COPY}\" \"${OUTPUT_FOLDER}/\") + add_custom_command(TARGET casparcg_copy_dependencies POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy_directory \"${FILE_TO_COPY}\" \"${CMAKE_CURRENT_BINARY_DIR}/\") + else() + add_custom_command(TARGET casparcg_copy_dependencies POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy \"${FILE_TO_COPY}\" \"${OUTPUT_FOLDER}/\") + add_custom_command(TARGET casparcg_copy_dependencies POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy \"${FILE_TO_COPY}\" \"${CMAKE_CURRENT_BINARY_DIR}/\") + endif() endforeach(FILE_TO_COPY) diff --git a/shell/included_modules.tmpl b/shell/included_modules.tmpl index e7863608d..786d7ac8a 100644 --- a/shell/included_modules.tmpl +++ b/shell/included_modules.tmpl @@ -11,11 +11,16 @@ ${CASPARCG_MODULE_INCLUDE_STATEMENTS} namespace caspar { -void initialize_modules(const core::module_dependencies& dependencies) +static bool intercept_command_line_args(int argc, char** argv) +{${CASPARCG_MODULE_COMMAND_LINE_ARG_INTERCEPTORS_STATEMENTS} + return false; +} + +static void initialize_modules(const core::module_dependencies& dependencies) {${CASPARCG_MODULE_INIT_STATEMENTS}} -void uninitialize_modules() -{${CASPARCG_MODULE_UNINIT_STATEMENTS} -} +static void uninitialize_modules() +{ +${CASPARCG_MODULE_UNINIT_STATEMENTS}} } diff --git a/shell/main.cpp b/shell/main.cpp index 0a16c5179..c393cbc05 100644 --- a/shell/main.cpp +++ b/shell/main.cpp @@ -38,6 +38,7 @@ #include "server.h" #include "platform_specific.h" +#include "included_modules.h" #include #include @@ -260,8 +261,11 @@ void on_abort(int) CASPAR_THROW_EXCEPTION(invalid_operation() << msg_info("abort called")); } -int main(int argc, wchar_t* argv[]) -{ +int main(int argc, char** argv) +{ + if (intercept_command_line_args(argc, argv)) + return 0; + int return_code = 0; setup_prerequisites(); //std::signal(SIGABRT, on_abort);