Browse Source

Working on WebView

Josh Engebretson 10 years ago
parent
commit
6ea80d0bda
100 changed files with 23235 additions and 6 deletions
  1. 7 0
      Build/CMake/Modules/AtomicDesktop.cmake
  2. 40 0
      Build/CMake/Modules/AtomicEditor-HelperInfo.plist.template
  3. 43 0
      Build/CMake/Modules/AtomicEditorInfo.plist.template
  4. 5 4
      Build/CMake/Modules/AtomicMac.cmake
  5. 303 0
      Build/CMake/Modules/AtomicWebView.cmake
  6. 10 0
      Source/AtomicEditor/Application/AEEditorCommon.cpp
  7. 81 2
      Source/AtomicEditor/CMakeLists.txt
  8. 14 0
      Source/AtomicEditor/WebView/WebProcessHelperMac.cpp
  9. 8 0
      Source/AtomicWebView/CMakeLists.txt
  10. 50 0
      Source/AtomicWebView/WebBrowserHost.cpp
  11. 24 0
      Source/AtomicWebView/WebBrowserHost.h
  12. 0 0
      Source/AtomicWebView/WebClient.cpp
  13. 0 0
      Source/AtomicWebView/WebClient.h
  14. 6 0
      Source/CMakeLists.txt
  15. 4 0
      Source/ThirdParty/CEF/CMakeLists.txt
  16. 126 0
      Source/ThirdParty/CEF/include/base/cef_atomic_ref_count.h
  17. 198 0
      Source/ThirdParty/CEF/include/base/cef_atomicops.h
  18. 87 0
      Source/ThirdParty/CEF/include/base/cef_basictypes.h
  19. 548 0
      Source/ThirdParty/CEF/include/base/cef_bind.h
  20. 586 0
      Source/ThirdParty/CEF/include/base/cef_bind_helpers.h
  21. 189 0
      Source/ThirdParty/CEF/include/base/cef_build.h
  22. 807 0
      Source/ThirdParty/CEF/include/base/cef_callback.h
  23. 59 0
      Source/ThirdParty/CEF/include/base/cef_callback_forward.h
  24. 93 0
      Source/ThirdParty/CEF/include/base/cef_callback_helpers.h
  25. 444 0
      Source/ThirdParty/CEF/include/base/cef_callback_list.h
  26. 314 0
      Source/ThirdParty/CEF/include/base/cef_cancelable_callback.h
  27. 167 0
      Source/ThirdParty/CEF/include/base/cef_lock.h
  28. 746 0
      Source/ThirdParty/CEF/include/base/cef_logging.h
  29. 218 0
      Source/ThirdParty/CEF/include/base/cef_macros.h
  30. 259 0
      Source/ThirdParty/CEF/include/base/cef_move.h
  31. 113 0
      Source/ThirdParty/CEF/include/base/cef_platform_thread.h
  32. 386 0
      Source/ThirdParty/CEF/include/base/cef_ref_counted.h
  33. 624 0
      Source/ThirdParty/CEF/include/base/cef_scoped_ptr.h
  34. 227 0
      Source/ThirdParty/CEF/include/base/cef_string16.h
  35. 192 0
      Source/ThirdParty/CEF/include/base/cef_template_util.h
  36. 125 0
      Source/ThirdParty/CEF/include/base/cef_thread_checker.h
  37. 287 0
      Source/ThirdParty/CEF/include/base/cef_thread_collision_warner.h
  38. 427 0
      Source/ThirdParty/CEF/include/base/cef_trace_event.h
  39. 1407 0
      Source/ThirdParty/CEF/include/base/cef_tuple.h
  40. 382 0
      Source/ThirdParty/CEF/include/base/cef_weak_ptr.h
  41. 126 0
      Source/ThirdParty/CEF/include/base/internal/cef_atomicops_atomicword_compat.h
  42. 223 0
      Source/ThirdParty/CEF/include/base/internal/cef_atomicops_mac.h
  43. 2852 0
      Source/ThirdParty/CEF/include/base/internal/cef_bind_internal.h
  44. 223 0
      Source/ThirdParty/CEF/include/base/internal/cef_callback_internal.h
  45. 87 0
      Source/ThirdParty/CEF/include/base/internal/cef_lock_impl.h
  46. 154 0
      Source/ThirdParty/CEF/include/base/internal/cef_raw_scoped_refptr_mismatch_checker.h
  47. 70 0
      Source/ThirdParty/CEF/include/base/internal/cef_thread_checker_impl.h
  48. 189 0
      Source/ThirdParty/CEF/include/capi/cef_app_capi.h
  49. 75 0
      Source/ThirdParty/CEF/include/capi/cef_auth_callback_capi.h
  50. 90 0
      Source/ThirdParty/CEF/include/capi/cef_base_capi.h
  51. 673 0
      Source/ThirdParty/CEF/include/capi/cef_browser_capi.h
  52. 104 0
      Source/ThirdParty/CEF/include/capi/cef_browser_process_handler_capi.h
  53. 89 0
      Source/ThirdParty/CEF/include/capi/cef_callback_capi.h
  54. 176 0
      Source/ThirdParty/CEF/include/capi/cef_client_capi.h
  55. 213 0
      Source/ThirdParty/CEF/include/capi/cef_command_line_capi.h
  56. 242 0
      Source/ThirdParty/CEF/include/capi/cef_context_menu_handler_capi.h
  57. 232 0
      Source/ThirdParty/CEF/include/capi/cef_cookie_capi.h
  58. 112 0
      Source/ThirdParty/CEF/include/capi/cef_dialog_handler_capi.h
  59. 122 0
      Source/ThirdParty/CEF/include/capi/cef_display_handler_capi.h
  60. 341 0
      Source/ThirdParty/CEF/include/capi/cef_dom_capi.h
  61. 137 0
      Source/ThirdParty/CEF/include/capi/cef_download_handler_capi.h
  62. 162 0
      Source/ThirdParty/CEF/include/capi/cef_download_item_capi.h
  63. 211 0
      Source/ThirdParty/CEF/include/capi/cef_drag_data_capi.h
  64. 87 0
      Source/ThirdParty/CEF/include/capi/cef_drag_handler_capi.h
  65. 78 0
      Source/ThirdParty/CEF/include/capi/cef_find_handler_capi.h
  66. 90 0
      Source/ThirdParty/CEF/include/capi/cef_focus_handler_capi.h
  67. 220 0
      Source/ThirdParty/CEF/include/capi/cef_frame_capi.h
  68. 79 0
      Source/ThirdParty/CEF/include/capi/cef_geolocation_capi.h
  69. 106 0
      Source/ThirdParty/CEF/include/capi/cef_geolocation_handler_capi.h
  70. 133 0
      Source/ThirdParty/CEF/include/capi/cef_jsdialog_handler_capi.h
  71. 84 0
      Source/ThirdParty/CEF/include/capi/cef_keyboard_handler_capi.h
  72. 177 0
      Source/ThirdParty/CEF/include/capi/cef_life_span_handler_capi.h
  73. 112 0
      Source/ThirdParty/CEF/include/capi/cef_load_handler_capi.h
  74. 388 0
      Source/ThirdParty/CEF/include/capi/cef_menu_model_capi.h
  75. 126 0
      Source/ThirdParty/CEF/include/capi/cef_navigation_entry_capi.h
  76. 106 0
      Source/ThirdParty/CEF/include/capi/cef_origin_whitelist_capi.h
  77. 149 0
      Source/ThirdParty/CEF/include/capi/cef_parser_capi.h
  78. 58 0
      Source/ThirdParty/CEF/include/capi/cef_path_util_capi.h
  79. 141 0
      Source/ThirdParty/CEF/include/capi/cef_print_handler_capi.h
  80. 207 0
      Source/ThirdParty/CEF/include/capi/cef_print_settings_capi.h
  81. 102 0
      Source/ThirdParty/CEF/include/capi/cef_process_message_capi.h
  82. 64 0
      Source/ThirdParty/CEF/include/capi/cef_process_util_capi.h
  83. 171 0
      Source/ThirdParty/CEF/include/capi/cef_render_handler_capi.h
  84. 177 0
      Source/ThirdParty/CEF/include/capi/cef_render_process_handler_capi.h
  85. 300 0
      Source/ThirdParty/CEF/include/capi/cef_request_capi.h
  86. 172 0
      Source/ThirdParty/CEF/include/capi/cef_request_context_capi.h
  87. 74 0
      Source/ThirdParty/CEF/include/capi/cef_request_context_handler_capi.h
  88. 254 0
      Source/ThirdParty/CEF/include/capi/cef_request_handler_capi.h
  89. 86 0
      Source/ThirdParty/CEF/include/capi/cef_resource_bundle_handler_capi.h
  90. 124 0
      Source/ThirdParty/CEF/include/capi/cef_resource_handler_capi.h
  91. 130 0
      Source/ThirdParty/CEF/include/capi/cef_response_capi.h
  92. 173 0
      Source/ThirdParty/CEF/include/capi/cef_scheme_capi.h
  93. 180 0
      Source/ThirdParty/CEF/include/capi/cef_ssl_info_capi.h
  94. 252 0
      Source/ThirdParty/CEF/include/capi/cef_stream_capi.h
  95. 69 0
      Source/ThirdParty/CEF/include/capi/cef_string_visitor_capi.h
  96. 159 0
      Source/ThirdParty/CEF/include/capi/cef_task_capi.h
  97. 118 0
      Source/ThirdParty/CEF/include/capi/cef_trace_capi.h
  98. 194 0
      Source/ThirdParty/CEF/include/capi/cef_urlrequest_capi.h
  99. 852 0
      Source/ThirdParty/CEF/include/capi/cef_v8_capi.h
  100. 734 0
      Source/ThirdParty/CEF/include/capi/cef_values_capi.h

+ 7 - 0
Build/CMake/Modules/AtomicDesktop.cmake

@@ -7,4 +7,11 @@ add_definitions( -DATOMIC_NAVIGATION -DATOMIC_TBUI -DATOMIC_FILEWATCHER -DPOCO_N
 
 set (ATOMIC_LINK_LIBRARIES ${ATOMIC_LINK_LIBRARIES} LibCpuId SQLite)
 
+# Check whether the CEF submodule is available
+if (EXISTS ${CMAKE_SOURCE_DIR}/Submodules/CEF)
+    set(ATOMIC_WEBVIEW TRUE)
+    add_definitions( -DATOMIC_WEBVIEW )
+    include("AtomicWebView")
+endif()
+
 include(AtomicNET)

+ 40 - 0
Build/CMake/Modules/AtomicEditor-HelperInfo.plist.template

@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+    <key>CFBundleDevelopmentRegion</key>
+    <string>English</string>
+    <key>CFBundleExecutable</key>
+    <string>${MACOSX_BUNDLE_EXECUTABLE_NAME}</string>
+    <key>CFBundleGetInfoString</key>
+    <string>${MACOSX_BUNDLE_INFO_STRING}</string>
+    <key>CFBundleIconFile</key>
+    <string>${MACOSX_BUNDLE_ICON_FILE}</string>
+    <key>CFBundleIdentifier</key>
+    <string>${MACOSX_BUNDLE_GUI_IDENTIFIER}</string>
+    <key>CFBundleInfoDictionaryVersion</key>
+    <string>6.0</string>
+    <key>CFBundleLongVersionString</key>
+    <string>${MACOSX_BUNDLE_LONG_VERSION_STRING}</string>
+    <key>CFBundleName</key>
+    <string>${MACOSX_BUNDLE_BUNDLE_NAME}</string>
+    <key>CFBundlePackageType</key>
+    <string>APPL</string>
+    <key>CFBundleShortVersionString</key>
+    <string>${MACOSX_BUNDLE_SHORT_VERSION_STRING}</string>
+    <key>CFBundleSignature</key>
+    <string>????</string>
+    <key>CFBundleVersion</key>
+    <string>${MACOSX_BUNDLE_BUNDLE_VERSION}</string>
+    <key>CSResourcesFileMapped</key>
+    <true/>
+    <key>LSRequiresCarbon</key>
+    <true/>
+    <key>LSUIElement</key>
+  	<string>1</string>
+  	<key>NSSupportsAutomaticGraphicsSwitching</key>
+  	<true/>
+    <key>NSHumanReadableCopyright</key>
+    <string>${MACOSX_BUNDLE_COPYRIGHT}</string>
+</dict>
+</plist>

+ 43 - 0
Build/CMake/Modules/AtomicEditorInfo.plist.template

@@ -0,0 +1,43 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+    <key>CFBundleDevelopmentRegion</key>
+    <string>English</string>
+    <key>CFBundleExecutable</key>
+    <string>${MACOSX_BUNDLE_EXECUTABLE_NAME}</string>
+    <key>CFBundleGetInfoString</key>
+    <string>${MACOSX_BUNDLE_INFO_STRING}</string>
+    <key>CFBundleIconFile</key>
+    <string>${MACOSX_BUNDLE_ICON_FILE}</string>
+    <key>CFBundleIdentifier</key>
+    <string>${MACOSX_BUNDLE_GUI_IDENTIFIER}</string>
+    <key>CFBundleInfoDictionaryVersion</key>
+    <string>6.0</string>
+    <key>CFBundleLongVersionString</key>
+    <string>${MACOSX_BUNDLE_LONG_VERSION_STRING}</string>
+    <key>CFBundleName</key>
+    <string>${MACOSX_BUNDLE_BUNDLE_NAME}</string>
+    <key>CFBundlePackageType</key>
+    <string>APPL</string>
+    <key>CFBundleShortVersionString</key>
+    <string>${MACOSX_BUNDLE_SHORT_VERSION_STRING}</string>
+    <key>CFBundleSignature</key>
+    <string>????</string>
+    <key>CFBundleVersion</key>
+    <string>${MACOSX_BUNDLE_BUNDLE_VERSION}</string>
+    <key>CSResourcesFileMapped</key>
+    <true/>
+    <key>LSRequiresCarbon</key>
+    <true/>
+    <key>NSSupportsAutomaticGraphicsSwitching</key>
+  	<true/>    
+    <key>NSHumanReadableCopyright</key>
+    <string>${MACOSX_BUNDLE_COPYRIGHT}</string>
+    <key>LSEnvironment</key>
+    <dict>
+        <key>URHO3D_PREFIX_PATH</key>
+        <string>../Resources</string>
+    </dict>
+</dict>
+</plist>

+ 5 - 4
Build/CMake/Modules/AtomicMac.cmake

@@ -8,16 +8,17 @@ include(AtomicDesktop)
 # only have 32 bit mono installed, fix this
 # set (CMAKE_OSX_ARCHITECTURES i386)
 
+set(CMAKE_OSX_ARCHITECTURES "x86_64")
+set(CMAKE_OSX_DEPLOYMENT_TARGET  "10.9")
+
 add_definitions(-DATOMIC_PLATFORM_OSX -DATOMIC_OPENGL -DKNET_UNIX)
 
 if (CMAKE_GENERATOR STREQUAL "Xcode")
-
-add_definitions(-DATOMIC_XCODE)
-
+    add_definitions(-DATOMIC_XCODE)
 endif()
 
 list (APPEND ATOMIC_LINK_LIBRARIES GLEW)
 
-set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-invalid-offsetof -std=gnu++0x")
+set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-invalid-offsetof -std=gnu++11")
 
 set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -framework AudioUnit -framework Carbon -framework Cocoa -framework CoreAudio -framework ForceFeedback -framework IOKit -framework OpenGL -framework CoreServices -framework Security")

+ 303 - 0
Build/CMake/Modules/AtomicWebView.cmake

@@ -0,0 +1,303 @@
+
+# Copyright (c) 2014 The Chromium Embedded Framework Authors. All rights
+# reserved. Use of this source code is governed by a BSD-style license that
+# can be found in the LICENSE file.
+
+# Determine the platform.
+
+if("${CMAKE_SYSTEM_NAME}" STREQUAL "Darwin")
+  set(OS_MACOSX 1)
+  set(OS_POSIX 1)
+elseif("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux")
+  set(OS_LINUX 1)
+  set(OS_POSIX 1)
+elseif("${CMAKE_SYSTEM_NAME}" STREQUAL "Windows")
+  set(OS_WINDOWS 1)
+endif()
+
+if(CMAKE_SIZEOF_VOID_P MATCHES 8)
+  set(PROJECT_ARCH "x86_64")
+else()
+  set(PROJECT_ARCH "x86")
+endif()
+
+if(OS_MACOSX)
+    set(CEF_STANDARD_LIBS "-lpthread" "-framework Cocoa" "-framework AppKit")
+    set(CEF_LIBTYPE SHARED)
+    set(CEF_BINARY_DIR "${CMAKE_SOURCE_DIR}/Submodules/CEF/MacOSX/$<CONFIGURATION>")
+    set(CEF_BINARY_DIR_DEBUG "${CMAKE_SOURCE_DIR}/Submodules/CEF/MacOSX/Debug")
+    set(CEF_BINARY_DIR_RELEASE "${CMAKE_SOURCE_DIR}/Submodules/CEF/MacOSX/Release")
+    set(CEF_LIB_DEBUG "${CEF_BINARY_DIR_DEBUG}/Chromium Embedded Framework.framework/Chromium Embedded Framework")
+    set(CEF_LIB_RELEASE "${CEF_BINARY_DIR_RELEASE}/Chromium Embedded Framework.framework/Chromium Embedded Framework")
+endif()
+
+#
+# Shared macros.
+#
+
+# Append platform specific sources to a list of sources.
+macro(APPEND_PLATFORM_SOURCES name_of_list)
+  if(OS_LINUX AND ${name_of_list}_LINUX)
+    list(APPEND ${name_of_list} ${${name_of_list}_LINUX})
+  endif()
+  if(OS_POSIX AND ${name_of_list}_POSIX)
+    list(APPEND ${name_of_list} ${${name_of_list}_POSIX})
+  endif()
+  if(OS_WINDOWS AND ${name_of_list}_WINDOWS)
+    list(APPEND ${name_of_list} ${${name_of_list}_WINDOWS})
+  endif()
+  if(OS_MACOSX AND ${name_of_list}_MACOSX)
+    list(APPEND ${name_of_list} ${${name_of_list}_MACOSX})
+  endif()
+endmacro()
+
+# Add a logical target that can be used to link the specified libraries into an
+# executable target.
+macro(ADD_LOGICAL_TARGET target debug_lib release_lib)
+  add_library(${target} ${CEF_LIBTYPE} IMPORTED)
+  set_target_properties(${target} PROPERTIES
+    IMPORTED_LOCATION "${release_lib}"
+    IMPORTED_LOCATION_DEBUG "${debug_lib}"
+    IMPORTED_LOCATION_RELEASE "${release_lib}"
+    )
+endmacro()
+
+# Determine the target output directory based on platform and generator.
+macro(SET_CEF_TARGET_OUT_DIR)
+  if(${CMAKE_GENERATOR} STREQUAL "Ninja")
+    # Ninja does not create a subdirectory named after the configuration.
+    set(CEF_TARGET_OUT_DIR "${CMAKE_CURRENT_BINARY_DIR}")
+  elseif(OS_LINUX)
+    set(CEF_TARGET_OUT_DIR "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_BUILD_TYPE}")
+  else()
+    # ATOMIC: Unix Makefiles not creating Debug/Release?
+    set(CEF_TARGET_OUT_DIR "${CMAKE_CURRENT_BINARY_DIR}")
+    #set(CEF_TARGET_OUT_DIR "${CMAKE_CURRENT_BINARY_DIR}/$<CONFIGURATION>")
+  endif()
+endmacro()
+
+# Copy a list of files from one directory to another. Relative files paths are maintained.
+macro(COPY_FILES target file_list source_dir target_dir)
+  foreach(FILENAME ${file_list})
+    set(source_file ${source_dir}/${FILENAME})
+    set(target_file ${target_dir}/${FILENAME})
+    if(IS_DIRECTORY ${source_file})
+      add_custom_command(
+        TARGET ${target}
+        POST_BUILD
+        COMMAND ${CMAKE_COMMAND} -E copy_directory "${source_file}" "${target_file}"
+        VERBATIM
+        )
+    else()
+      add_custom_command(
+        TARGET ${target}
+        POST_BUILD
+        COMMAND ${CMAKE_COMMAND} -E copy_if_different "${source_file}" "${target_file}"
+        VERBATIM
+        )
+    endif()
+  endforeach()
+endmacro()
+
+# Rename a directory replacing the target if it already exists.
+macro(RENAME_DIRECTORY target source_dir target_dir)
+  add_custom_command(
+    TARGET ${target}
+    POST_BUILD
+    # Remove the target directory if it already exists.
+    COMMAND ${CMAKE_COMMAND} -E remove_directory "${target_dir}"
+    # Rename the source directory to target directory.
+    COMMAND ${CMAKE_COMMAND} -E rename "${source_dir}" "${target_dir}"
+    VERBATIM
+    )
+endmacro()
+
+
+#
+# Linux macros.
+#
+
+if(OS_LINUX)
+
+# Use pkg-config to find Linux libraries and update compiler/linker variables.
+macro(FIND_LINUX_LIBRARIES libraries)
+  # Read pkg-config info into variables.
+  execute_process(COMMAND pkg-config --cflags ${libraries} OUTPUT_VARIABLE FLL_CFLAGS)
+  execute_process(COMMAND pkg-config --libs-only-L --libs-only-other ${libraries} OUTPUT_VARIABLE FLL_LDFLAGS)
+  execute_process(COMMAND pkg-config --libs-only-l ${libraries} OUTPUT_VARIABLE FLL_LIBS)
+
+  # Strip leading and trailing whitepspace.
+  STRING(STRIP "${FLL_CFLAGS}"  FLL_CFLAGS)
+  STRING(STRIP "${FLL_LDFLAGS}" FLL_LDFLAGS)
+  STRING(STRIP "${FLL_LIBS}"    FLL_LIBS)
+
+  # Update the variables.
+  set(CMAKE_C_FLAGS             "${CMAKE_C_FLAGS} ${FLL_CFLAGS}")
+  set(CMAKE_CXX_FLAGS           "${CMAKE_CXX_FLAGS} ${FLL_CFLAGS}")
+  set(CMAKE_EXE_LINKER_FLAGS    "${CMAKE_EXE_LINKER_FLAGS} ${FLL_LDFLAGS}")
+  set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${FLL_LDFLAGS}")
+  set(CEF_STANDARD_LIBS         "${CEF_STANDARD_LIBS} ${FLL_LIBS}")
+endmacro()
+
+# Set SUID permissions on the specified executable.
+macro(SET_LINUX_SUID_PERMISSIONS target executable)
+  add_custom_command(
+    TARGET ${target}
+    POST_BUILD
+    COMMAND ${CMAKE_COMMAND} -E echo ""
+    COMMAND ${CMAKE_COMMAND} -E echo "*** Run the following command manually to set SUID permissions ***"
+    COMMAND ${CMAKE_COMMAND} -E echo "EXE=\"${executable}\" && sudo -- chown root:root $EXE && sudo -- chmod 4755 $EXE"
+    COMMAND ${CMAKE_COMMAND} -E echo ""
+    VERBATIM
+    )
+endmacro()
+
+endif(OS_LINUX)
+
+
+#
+# Mac OS X macros.
+#
+
+if(OS_MACOSX)
+
+# Set Xcode target properties.
+function(SET_XCODE_TARGET_PROPERTIES target)
+  set_target_properties(${target} PROPERTIES
+    XCODE_ATTRIBUTE_ALWAYS_SEARCH_USER_PATHS                    NO
+    XCODE_ATTRIBUTE_CLANG_CXX_LANGUAGE_STANDARD                 "gnu++11"   # -std=gnu++11
+    XCODE_ATTRIBUTE_CLANG_LINK_OBJC_RUNTIME                     NO          # -fno-objc-link-runtime
+    XCODE_ATTRIBUTE_CLANG_WARN_OBJC_MISSING_PROPERTY_SYNTHESIS  YES         # -Wobjc-missing-property-synthesis
+    XCODE_ATTRIBUTE_COPY_PHASE_STRIP                            NO
+    XCODE_ATTRIBUTE_DEAD_CODE_STRIPPING[variant=Release]        YES         # -Wl,-dead_strip
+    XCODE_ATTRIBUTE_GCC_C_LANGUAGE_STANDARD                     "c99"       # -std=c99
+    XCODE_ATTRIBUTE_GCC_CW_ASM_SYNTAX                           NO          # No -fasm-blocks
+    XCODE_ATTRIBUTE_GCC_DYNAMIC_NO_PIC                          NO
+    XCODE_ATTRIBUTE_GCC_ENABLE_CPP_EXCEPTIONS                   NO          # -fno-exceptions
+    XCODE_ATTRIBUTE_GCC_ENABLE_CPP_RTTI                         NO          # -fno-rtti
+    XCODE_ATTRIBUTE_GCC_ENABLE_PASCAL_STRINGS                   NO          # No -mpascal-strings
+    XCODE_ATTRIBUTE_GCC_INLINES_ARE_PRIVATE_EXTERN              YES         # -fvisibility-inlines-hidden
+    XCODE_ATTRIBUTE_GCC_OBJC_CALL_CXX_CDTORS                    YES         # -fobjc-call-cxx-cdtors
+    XCODE_ATTRIBUTE_GCC_SYMBOLS_PRIVATE_EXTERN                  YES         # -fvisibility=hidden
+    XCODE_ATTRIBUTE_GCC_THREADSAFE_STATICS                      NO          # -fno-threadsafe-statics
+    XCODE_ATTRIBUTE_GCC_TREAT_WARNINGS_AS_ERRORS                YES         # -Werror
+    XCODE_ATTRIBUTE_GCC_VERSION                                 "com.apple.compilers.llvm.clang.1_0"
+    XCODE_ATTRIBUTE_GCC_WARN_ABOUT_MISSING_NEWLINE              YES         # -Wnewline-eof
+    XCODE_ATTRIBUTE_USE_HEADERMAP                               NO
+    OSX_ARCHITECTURES_DEBUG                                     "${CMAKE_OSX_ARCHITECTURES}"
+    OSX_ARCHITECTURES_RELEASE                                   "${CMAKE_OSX_ARCHITECTURES}"
+    )
+endfunction()
+
+# Override default add_library function.
+function(cef_add_library name)
+  add_library(${name} ${ARGN})
+  SET_XCODE_TARGET_PROPERTIES(${name})
+endfunction()
+
+# Override default add_executable function.
+function(cef_add_executable name)
+  add_executable(${name} ${ARGN})
+  SET_XCODE_TARGET_PROPERTIES(${name})
+endfunction()
+
+# Fix the framework link in the helper executable.
+macro(FIX_MACOSX_HELPER_FRAMEWORK_LINK target app_path)
+  add_custom_command(TARGET ${target}
+    POST_BUILD
+    COMMAND install_name_tool -change "@executable_path/Chromium Embedded Framework"
+            "@executable_path/../../../../Frameworks/Chromium Embedded Framework.framework/Chromium Embedded Framework"
+            "${app_path}/Contents/MacOS/${target}"
+    VERBATIM
+    )
+endmacro()
+
+# Fix the framework link in the main executable.
+macro(FIX_MACOSX_MAIN_FRAMEWORK_LINK target app_path)
+  add_custom_command(TARGET ${target}
+    POST_BUILD
+    COMMAND install_name_tool -change "@executable_path/Chromium Embedded Framework"
+            "@executable_path/../Frameworks/Chromium Embedded Framework.framework/Chromium Embedded Framework"
+            "${app_path}/Contents/MacOS/${target}"
+    VERBATIM
+    )
+endmacro()
+
+# Make the other helper app bundles.
+macro(MAKE_MACOSX_HELPERS target app_path)
+  add_custom_command(TARGET ${target}
+    POST_BUILD
+    # The exported variables need to be set for generators other than Xcode.
+    COMMAND export BUILT_PRODUCTS_DIR=${app_path} &&
+            export CONTENTS_FOLDER_PATH=/Contents &&
+            ${CMAKE_SOURCE_DIR}/Source/ThirdParty/CEF/tools/make_more_helpers.sh "Frameworks" "${target}"
+    WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
+    VERBATIM
+    )
+endmacro()
+
+# Manually process and copy over resource files.
+macro(COPY_MACOSX_RESOURCES resource_list prefix_list target source_dir app_path)
+  foreach(FILENAME ${resource_list})
+    # Remove one or more prefixes from the source paths.
+    set(TARGET_FILENAME "${FILENAME}")
+    foreach(PREFIX ${prefix_list})
+      string(REGEX REPLACE "^.*${PREFIX}" "" TARGET_FILENAME ${TARGET_FILENAME})
+    endforeach()
+
+    # Determine the absolute source and target paths.
+    set(TARGET_PATH "${app_path}/Contents/Resources/${TARGET_FILENAME}")
+    if(IS_ABSOLUTE ${FILENAME})
+      set(SOURCE_PATH ${FILENAME})
+    else()
+      set(SOURCE_PATH "${source_dir}/${FILENAME}")
+    endif()
+
+    if(${FILENAME} MATCHES ".xib$")
+      # Change the target file extension.
+      string(REGEX REPLACE ".xib$" ".nib" TARGET_PATH ${TARGET_PATH})
+
+      get_filename_component(TARGET_DIRECTORY ${TARGET_PATH} PATH)
+      add_custom_command(
+        TARGET ${target}
+        POST_BUILD
+        # Create the target directory.
+        COMMAND ${CMAKE_COMMAND} -E make_directory "${TARGET_DIRECTORY}"
+        # Compile the XIB file to a NIB.
+        COMMAND /usr/bin/ibtool --output-format binary1 --compile "${TARGET_PATH}" "${SOURCE_PATH}"
+        VERBATIM
+        )
+    elseif(NOT ${TARGET_FILENAME} STREQUAL "Info.plist")
+      # Copy the file as-is.
+      add_custom_command(
+        TARGET ${target}
+        POST_BUILD
+        COMMAND ${CMAKE_COMMAND} -E copy "${SOURCE_PATH}" "${TARGET_PATH}"
+        VERBATIM
+        )
+    endif()
+  endforeach()
+endmacro()
+
+endif(OS_MACOSX)
+
+
+#
+# Windows macros.
+#
+
+if(OS_WINDOWS)
+
+# Add custom manifest files to an executable target.
+macro(ADD_WINDOWS_MANIFEST manifest_path target)
+  add_custom_command(
+    TARGET ${target}
+    POST_BUILD
+    COMMAND "mt.exe" -nologo
+            -manifest \"${manifest_path}/${target}.exe.manifest\" \"${manifest_path}/compatibility.manifest\"
+            -outputresource:"${CEF_TARGET_OUT_DIR}/${target}.exe"\;\#1
+    COMMENT "Adding manifest..."
+    )
+endmacro()
+
+endif(OS_WINDOWS)

+ 10 - 0
Source/AtomicEditor/Application/AEEditorCommon.cpp

@@ -28,6 +28,10 @@
 #include <AtomicNET/NETScript/NETScript.h>
 #endif
 
+#ifdef ATOMIC_WEBVIEW
+#include <AtomicWebView/WebBrowserHost.h>
+#endif
+
 #include "../Components/EditorComponents.h"
 
 #include "AEEditorCommon.h"
@@ -111,6 +115,12 @@ void AEEditorCommon::Setup()
 
 #endif
 
+#ifdef ATOMIC_WEBVIEW
+
+    context_->RegisterSubsystem(new WebBrowserHost(context_));
+
+#endif
+
 #ifdef ATOMIC_DOTNET
 
     // Instantiate and register the AtomicNET subsystem

+ 81 - 2
Source/AtomicEditor/CMakeLists.txt

@@ -3,10 +3,14 @@ include_directories ( ${CMAKE_SOURCE_DIR}/Source/ThirdParty
                       ${CMAKE_SOURCE_DIR}/Source/ThirdParty/kNet/include
                       ${CMAKE_SOURCE_DIR}/Source/ThirdParty/FreeType/include
                       ${CMAKE_SOURCE_DIR}/Source/ThirdParty/Box2D
-                      ${CMAKE_SOURCE_DIR}/Source/ThirdParty/nativefiledialog )
+                      ${CMAKE_SOURCE_DIR}/Source/ThirdParty/nativefiledialog
+                      ${CMAKE_SOURCE_DIR}/Source/ThirdParty/CEF )
 
 file (GLOB_RECURSE SOURCE_FILES *.cpp *.h)
 
+# Remove the web helper sources
+list(REMOVE_ITEM SOURCE_FILES ${CMAKE_CURRENT_SOURCE_DIR}/WebView/WebProcessHelperMac.cpp)
+
 file (GLOB JAVASCRIPT_BINDINGS_SOURCE ${CMAKE_SOURCE_DIR}/Artifacts/Build/Source/Generated/${JAVASCRIPT_BINDINGS_PLATFORM}/Javascript/Packages/Editor/*.cpp)
 
 set (SOURCE_FILES ${SOURCE_FILES} ${JAVASCRIPT_BINDINGS_SOURCE})
@@ -42,8 +46,83 @@ add_executable(AtomicEditor ${EXE_TYPE} ${SOURCE_FILES} ${ATOMIC_EDITOR_ICON})
 
 target_link_libraries(AtomicEditor ToolCore AtomicJS AtomicPlayerJS AtomicNETJS ToolCoreJS Poco nativefiledialog ${ATOMIC_LINK_LIBRARIES})
 
+if (ATOMIC_WEBVIEW)
+
+# Target executable names.
+set(CEF_TARGET "AtomicEditor")
+
+if(OS_MACOSX)
+  set(CEF_HELPER_TARGET "AtomicEditor Helper")
+endif()
+
+# Logical target used to link the libcef library.
+ADD_LOGICAL_TARGET("libcef_lib" "${CEF_LIB_DEBUG}" "${CEF_LIB_RELEASE}")
+
+# Determine the target output directory.
+SET_CEF_TARGET_OUT_DIR()
+
+if(OS_MACOSX)
+
+  # Output paths for the app bundles.
+  set(CEF_APP "${CEF_TARGET_OUT_DIR}/${CEF_TARGET}.app")
+  set(CEF_HELPER_APP "${CEF_TARGET_OUT_DIR}/${CEF_HELPER_TARGET}.app")
+
+  # Variable referenced from Info.plist files.
+  set(PRODUCT_NAME "${CEF_TARGET}")
+
+  # Helper executable target.
+  add_executable(${CEF_HELPER_TARGET} MACOSX_BUNDLE "${CMAKE_CURRENT_SOURCE_DIR}/WebView/WebProcessHelperMac.cpp")
+  add_dependencies(${CEF_HELPER_TARGET} libcef_dll_wrapper)
+  target_link_libraries(${CEF_HELPER_TARGET} libcef_lib libcef_dll_wrapper ${CEF_STANDARD_LIBS})
+  set_target_properties(${CEF_HELPER_TARGET} PROPERTIES
+    MACOSX_BUNDLE_INFO_PLIST "${CMAKE_SOURCE_DIR}/Build/CMake/Modules/AtomicEditor-HelperInfo.plist.template"
+    )
+
+  # Fix the framework link in the helper executable.
+  FIX_MACOSX_HELPER_FRAMEWORK_LINK(${CEF_HELPER_TARGET} ${CEF_HELPER_APP})
+
+  # Main executable target.
+  add_dependencies(${CEF_TARGET} libcef_dll_wrapper "${CEF_HELPER_TARGET}")
+  target_link_libraries(${CEF_TARGET} AtomicWebView libcef_lib libcef_dll_wrapper ${CEF_STANDARD_LIBS})
+
+  # Copy files into the main app bundle.
+  add_custom_command(
+    TARGET ${CEF_TARGET}
+    POST_BUILD
+    # Copy the helper app bundle into the Frameworks directory.
+    COMMAND ${CMAKE_COMMAND} -E copy_directory
+            "${CEF_HELPER_APP}"
+            "${CEF_APP}/Contents/Frameworks/${CEF_HELPER_TARGET}.app"
+    # Copy the CEF framework into the Frameworks directory.
+    COMMAND ${CMAKE_COMMAND} -E copy_directory
+            "${CEF_BINARY_DIR}/Chromium Embedded Framework.framework"
+            "${CEF_APP}/Contents/Frameworks/Chromium Embedded Framework.framework"
+    VERBATIM
+    )
+
+  # Fix the framework link in the main executable.
+  FIX_MACOSX_MAIN_FRAMEWORK_LINK(${CEF_TARGET} ${CEF_APP})
+
+  # Make the other helper app bundles.
+  MAKE_MACOSX_HELPERS(${CEF_TARGET} ${CEF_APP})
+
+  if(NOT ${CMAKE_GENERATOR} STREQUAL "Xcode")
+    # Manually process and copy over resource files.
+    # The Xcode generator handles this via the set_target_properties RESOURCE directive.
+    set(PREFIXES "mac/")  # Remove these prefixes from input file paths.
+    COPY_MACOSX_RESOURCES("${CEFSIMPLE_RESOURCES_SRCS}" "${PREFIXES}" "${CEF_TARGET}" "${CMAKE_CURRENT_SOURCE_DIR}" "${CEF_APP}")
+  endif()
+endif()
+
+endif()
+
+
+
 if (APPLE)
-    set (TARGET_PROPERTIES MACOSX_BUNDLE_INFO_PLIST MacOSXBundleInfo.plist.template)
+    set (TARGET_PROPERTIES MACOSX_BUNDLE_INFO_PLIST "${CMAKE_SOURCE_DIR}/Build/CMake/Modules/AtomicEditorInfo.plist.template")
+
+    SET( MACOSX_BUNDLE_GUI_IDENTIFIER "com.thunderbeastgames.atomiceditor")
+    SET( MACOSX_BUNDLE_BUNDLE_NAME "AtomicEditor")
 
     target_link_libraries(AtomicEditor NETCore NETScript libcurl)
 

+ 14 - 0
Source/AtomicEditor/WebView/WebProcessHelperMac.cpp

@@ -0,0 +1,14 @@
+// Copyright (c) 2013 The Chromium Embedded Framework Authors. All rights
+// reserved. Use of this source code is governed by a BSD-style license that can
+// be found in the LICENSE file.
+
+#include "include/cef_app.h"
+
+// Entry point function for sub-processes.
+int main(int argc, char* argv[]) {
+  // Provide CEF with command-line arguments.
+  CefMainArgs main_args(argc, argv);
+
+  // Execute the sub-process.
+  return CefExecuteProcess(main_args, NULL, NULL);
+}

+ 8 - 0
Source/AtomicWebView/CMakeLists.txt

@@ -0,0 +1,8 @@
+include_directories (${CMAKE_SOURCE_DIR}/Source/ThirdParty
+                     ${CMAKE_SOURCE_DIR}/Source/ThirdParty/CEF )
+
+
+file (GLOB SOURCE_FILES *.cpp *.h)
+
+add_library(AtomicWebView ${SOURCE_FILES})
+

+ 50 - 0
Source/AtomicWebView/WebBrowserHost.cpp

@@ -0,0 +1,50 @@
+
+#include <ThirdParty/CEF/include/cef_app.h>
+#include <ThirdParty/CEF/include/cef_client.h>
+#include <ThirdParty/CEF/include/cef_render_handler.h>
+
+#include <Atomic/Core/ProcessUtils.h>
+#include <Atomic/IO/Log.h>
+
+#include "WebBrowserHost.h"
+
+namespace Atomic
+{
+
+WebBrowserHost::WebBrowserHost(Context* context) : Object (context)
+{
+    const Vector<String>& arguments = GetArguments();
+
+    const char** _argv { 0 };
+
+    PODVector<const char*> argv;
+    for (unsigned i = 0; i < arguments.Size(); i++)
+        argv.Push(arguments[i].CString());
+
+    CefMainArgs args(arguments.Size(), arguments.Size() ? (char**) &argv[0] : (char **) _argv);
+
+    // TODO: We're losing the main system menu items on OSX and cmd-q no longer works
+    // when we init CEF
+
+    int result = CefExecuteProcess(args, nullptr, nullptr);
+
+    if (result >= 0)
+    {
+        LOGERROR("CEFExecuteProcess - Error");
+    }
+
+    CefSettings settings;
+
+    if (!CefInitialize(args, settings, nullptr, nullptr))
+    {
+        LOGERROR("CefInitialize - Error");
+    }
+
+}
+
+WebBrowserHost::~WebBrowserHost()
+{
+
+}
+
+}

+ 24 - 0
Source/AtomicWebView/WebBrowserHost.h

@@ -0,0 +1,24 @@
+
+#include <Atomic/Core/Object.h>
+
+#pragma once
+
+namespace Atomic
+{
+
+/// Javascript subsystem.
+class ATOMIC_API WebBrowserHost : public Object
+{
+    OBJECT(WebBrowserHost);
+
+public:
+    /// Construct.
+    WebBrowserHost(Context* context);
+    /// Destruct.
+    ~WebBrowserHost();
+
+private:
+
+};
+
+}

+ 0 - 0
Source/AtomicWebView/WebClient.cpp


+ 0 - 0
Source/AtomicWebView/WebClient.h


+ 6 - 0
Source/CMakeLists.txt

@@ -2,6 +2,12 @@
 add_subdirectory(ThirdParty)
 add_subdirectory(Atomic)
 add_subdirectory(AtomicJS)
+
+
+if (ATOMIC_WEBVIEW)
+    add_subdirectory(AtomicWebView)    
+endif()
+
 add_subdirectory(AtomicPlayer)
 add_subdirectory(AtomicPlayerJS)
 

+ 4 - 0
Source/ThirdParty/CEF/CMakeLists.txt

@@ -0,0 +1,4 @@
+
+include_directories(${CMAKE_CURRENT_SOURCE_DIR})
+
+add_subdirectory(libcef_dll)

+ 126 - 0
Source/ThirdParty/CEF/include/base/cef_atomic_ref_count.h

@@ -0,0 +1,126 @@
+// 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 is a low level implementation of atomic semantics for reference
+// counting.  Please use cef_ref_counted.h directly instead.
+//
+// The Chromium implementation includes annotations to avoid some false
+// positives when using data race detection tools. Annotations are not
+// currently supported by the CEF implementation.
+
+#ifndef CEF_INCLUDE_BASE_CEF_ATOMIC_REF_COUNT_H_
+#define CEF_INCLUDE_BASE_CEF_ATOMIC_REF_COUNT_H_
+#pragma once
+
+#if defined(BASE_ATOMIC_REF_COUNT_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/atomic_ref_count.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_atomicops.h"
+
+// Annotations are not currently supported.
+#define ANNOTATE_HAPPENS_BEFORE(obj) /* empty */
+#define ANNOTATE_HAPPENS_AFTER(obj) /* empty */
+
+namespace base {
+
+typedef subtle::Atomic32 AtomicRefCount;
+
+// Increment a reference count by "increment", which must exceed 0.
+inline void AtomicRefCountIncN(volatile AtomicRefCount *ptr,
+                               AtomicRefCount increment) {
+  subtle::NoBarrier_AtomicIncrement(ptr, increment);
+}
+
+// Decrement a reference count by "decrement", which must exceed 0,
+// and return whether the result is non-zero.
+// Insert barriers to ensure that state written before the reference count
+// became zero will be visible to a thread that has just made the count zero.
+inline bool AtomicRefCountDecN(volatile AtomicRefCount *ptr,
+                               AtomicRefCount decrement) {
+  ANNOTATE_HAPPENS_BEFORE(ptr);
+  bool res = (subtle::Barrier_AtomicIncrement(ptr, -decrement) != 0);
+  if (!res) {
+    ANNOTATE_HAPPENS_AFTER(ptr);
+  }
+  return res;
+}
+
+// Increment a reference count by 1.
+inline void AtomicRefCountInc(volatile AtomicRefCount *ptr) {
+  base::AtomicRefCountIncN(ptr, 1);
+}
+
+// Decrement a reference count by 1 and return whether the result is non-zero.
+// Insert barriers to ensure that state written before the reference count
+// became zero will be visible to a thread that has just made the count zero.
+inline bool AtomicRefCountDec(volatile AtomicRefCount *ptr) {
+  return base::AtomicRefCountDecN(ptr, 1);
+}
+
+// Return whether the reference count is one.  If the reference count is used
+// in the conventional way, a refrerence count of 1 implies that the current
+// thread owns the reference and no other thread shares it.  This call performs
+// the test for a reference count of one, and performs the memory barrier
+// needed for the owning thread to act on the object, knowing that it has
+// exclusive access to the object.
+inline bool AtomicRefCountIsOne(volatile AtomicRefCount *ptr) {
+  bool res = (subtle::Acquire_Load(ptr) == 1);
+  if (res) {
+    ANNOTATE_HAPPENS_AFTER(ptr);
+  }
+  return res;
+}
+
+// Return whether the reference count is zero.  With conventional object
+// referencing counting, the object will be destroyed, so the reference count
+// should never be zero.  Hence this is generally used for a debug check.
+inline bool AtomicRefCountIsZero(volatile AtomicRefCount *ptr) {
+  bool res = (subtle::Acquire_Load(ptr) == 0);
+  if (res) {
+    ANNOTATE_HAPPENS_AFTER(ptr);
+  }
+  return res;
+}
+
+}  // namespace base
+
+#endif  // !BUILDING_CEF_SHARED
+
+#endif  // CEF_INCLUDE_BASE_CEF_ATOMIC_REF_COUNT_H_

+ 198 - 0
Source/ThirdParty/CEF/include/base/cef_atomicops.h

@@ -0,0 +1,198 @@
+// 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.
+
+// For atomic operations on reference counts, see cef_atomic_ref_count.h.
+
+// The routines exported by this module are subtle.  If you use them, even if
+// you get the code right, it will depend on careful reasoning about atomicity
+// and memory ordering; it will be less readable, and harder to maintain.  If
+// you plan to use these routines, you should have a good reason, such as solid
+// evidence that performance would otherwise suffer, or there being no
+// alternative.  You should assume only properties explicitly guaranteed by the
+// specifications in this file.  You are almost certainly _not_ writing code
+// just for the x86; if you assume x86 semantics, x86 hardware bugs and
+// implementations on other archtectures will cause your code to break.  If you
+// do not know what you are doing, avoid these routines, and use a Mutex.
+//
+// It is incorrect to make direct assignments to/from an atomic variable.
+// You should use one of the Load or Store routines.  The NoBarrier
+// versions are provided when no barriers are needed:
+//   NoBarrier_Store()
+//   NoBarrier_Load()
+// Although there are currently no compiler enforcement, you are encouraged
+// to use these.
+//
+
+#ifndef CEF_INCLUDE_BASE_CEF_ATOMICOPS_H_
+#define CEF_INCLUDE_BASE_CEF_ATOMICOPS_H_
+#pragma once
+
+#if defined(BASE_ATOMICOPS_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/atomicops.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 <stdint.h>
+
+#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_

+ 87 - 0
Source/ThirdParty/CEF/include/base/cef_basictypes.h

@@ -0,0 +1,87 @@
+// 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 <limits.h>         // For UINT_MAX
+#include <stddef.h>         // 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
+// <inttypes.h> 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
+
+#endif  // !BUILDING_CEF_SHARED
+
+// UTF-16 character type.
+// This should be kept synchronized with base/strings/string16.h
+#ifndef char16
+#if defined(WCHAR_T_IS_UTF16)
+typedef wchar_t             char16;
+#elif defined(WCHAR_T_IS_UTF32)
+typedef unsigned short      char16;
+#endif
+#endif
+
+#endif  // CEF_INCLUDE_BASE_CEF_BASICTYPES_H_

+ 548 - 0
Source/ThirdParty/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 <typename Functor>
+base::Callback<
+    typename cef_internal::BindState<
+        typename cef_internal::FunctorTraits<Functor>::RunnableType,
+        typename cef_internal::FunctorTraits<Functor>::RunType,
+        void()>
+            ::UnboundRunType>
+Bind(Functor functor) {
+  // Typedefs for how to store and run the functor.
+  typedef typename cef_internal::FunctorTraits<Functor>::RunnableType RunnableType;
+  typedef typename cef_internal::FunctorTraits<Functor>::RunType RunType;
+
+  typedef cef_internal::BindState<RunnableType, RunType, void()> BindState;
+
+
+  return Callback<typename BindState::UnboundRunType>(
+      new BindState(cef_internal::MakeRunnable(functor)));
+}
+
+template <typename Functor, typename P1>
+base::Callback<
+    typename cef_internal::BindState<
+        typename cef_internal::FunctorTraits<Functor>::RunnableType,
+        typename cef_internal::FunctorTraits<Functor>::RunType,
+        void(typename cef_internal::CallbackParamTraits<P1>::StorageType)>
+            ::UnboundRunType>
+Bind(Functor functor, const P1& p1) {
+  // Typedefs for how to store and run the functor.
+  typedef typename cef_internal::FunctorTraits<Functor>::RunnableType RunnableType;
+  typedef typename cef_internal::FunctorTraits<Functor>::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<typename RunnableType::RunType>
+      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<typename BoundFunctorTraits::A1Type>::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<RunnableType>::value ||
+          !cef_internal::NeedsScopedRefptrButGetsRawPtr<P1>::value,
+      p1_is_refcounted_type_and_needs_scoped_refptr);
+  COMPILE_ASSERT(!cef_internal::HasIsMethodTag<RunnableType>::value ||
+                     !is_array<P1>::value,
+                 first_bound_argument_to_method_cannot_be_array);
+  typedef cef_internal::BindState<RunnableType, RunType,
+      void(typename cef_internal::CallbackParamTraits<P1>::StorageType)> BindState;
+
+
+  return Callback<typename BindState::UnboundRunType>(
+      new BindState(cef_internal::MakeRunnable(functor), p1));
+}
+
+template <typename Functor, typename P1, typename P2>
+base::Callback<
+    typename cef_internal::BindState<
+        typename cef_internal::FunctorTraits<Functor>::RunnableType,
+        typename cef_internal::FunctorTraits<Functor>::RunType,
+        void(typename cef_internal::CallbackParamTraits<P1>::StorageType,
+            typename cef_internal::CallbackParamTraits<P2>::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<Functor>::RunnableType RunnableType;
+  typedef typename cef_internal::FunctorTraits<Functor>::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<typename RunnableType::RunType>
+      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<typename BoundFunctorTraits::A1Type>::value ||
+          is_non_const_reference<typename BoundFunctorTraits::A2Type>::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<RunnableType>::value ||
+          !cef_internal::NeedsScopedRefptrButGetsRawPtr<P1>::value,
+      p1_is_refcounted_type_and_needs_scoped_refptr);
+  COMPILE_ASSERT(!cef_internal::HasIsMethodTag<RunnableType>::value ||
+                     !is_array<P1>::value,
+                 first_bound_argument_to_method_cannot_be_array);
+  COMPILE_ASSERT(!cef_internal::NeedsScopedRefptrButGetsRawPtr<P2>::value,
+                 p2_is_refcounted_type_and_needs_scoped_refptr);
+  typedef cef_internal::BindState<RunnableType, RunType,
+      void(typename cef_internal::CallbackParamTraits<P1>::StorageType,
+      typename cef_internal::CallbackParamTraits<P2>::StorageType)> BindState;
+
+
+  return Callback<typename BindState::UnboundRunType>(
+      new BindState(cef_internal::MakeRunnable(functor), p1, p2));
+}
+
+template <typename Functor, typename P1, typename P2, typename P3>
+base::Callback<
+    typename cef_internal::BindState<
+        typename cef_internal::FunctorTraits<Functor>::RunnableType,
+        typename cef_internal::FunctorTraits<Functor>::RunType,
+        void(typename cef_internal::CallbackParamTraits<P1>::StorageType,
+            typename cef_internal::CallbackParamTraits<P2>::StorageType,
+            typename cef_internal::CallbackParamTraits<P3>::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<Functor>::RunnableType RunnableType;
+  typedef typename cef_internal::FunctorTraits<Functor>::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<typename RunnableType::RunType>
+      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<typename BoundFunctorTraits::A1Type>::value ||
+          is_non_const_reference<typename BoundFunctorTraits::A2Type>::value ||
+          is_non_const_reference<typename BoundFunctorTraits::A3Type>::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<RunnableType>::value ||
+          !cef_internal::NeedsScopedRefptrButGetsRawPtr<P1>::value,
+      p1_is_refcounted_type_and_needs_scoped_refptr);
+  COMPILE_ASSERT(!cef_internal::HasIsMethodTag<RunnableType>::value ||
+                     !is_array<P1>::value,
+                 first_bound_argument_to_method_cannot_be_array);
+  COMPILE_ASSERT(!cef_internal::NeedsScopedRefptrButGetsRawPtr<P2>::value,
+                 p2_is_refcounted_type_and_needs_scoped_refptr);
+  COMPILE_ASSERT(!cef_internal::NeedsScopedRefptrButGetsRawPtr<P3>::value,
+                 p3_is_refcounted_type_and_needs_scoped_refptr);
+  typedef cef_internal::BindState<RunnableType, RunType,
+      void(typename cef_internal::CallbackParamTraits<P1>::StorageType,
+      typename cef_internal::CallbackParamTraits<P2>::StorageType,
+      typename cef_internal::CallbackParamTraits<P3>::StorageType)> BindState;
+
+
+  return Callback<typename BindState::UnboundRunType>(
+      new BindState(cef_internal::MakeRunnable(functor), p1, p2, p3));
+}
+
+template <typename Functor, typename P1, typename P2, typename P3, typename P4>
+base::Callback<
+    typename cef_internal::BindState<
+        typename cef_internal::FunctorTraits<Functor>::RunnableType,
+        typename cef_internal::FunctorTraits<Functor>::RunType,
+        void(typename cef_internal::CallbackParamTraits<P1>::StorageType,
+            typename cef_internal::CallbackParamTraits<P2>::StorageType,
+            typename cef_internal::CallbackParamTraits<P3>::StorageType,
+            typename cef_internal::CallbackParamTraits<P4>::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<Functor>::RunnableType RunnableType;
+  typedef typename cef_internal::FunctorTraits<Functor>::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<typename RunnableType::RunType>
+      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<typename BoundFunctorTraits::A1Type>::value ||
+          is_non_const_reference<typename BoundFunctorTraits::A2Type>::value ||
+          is_non_const_reference<typename BoundFunctorTraits::A3Type>::value ||
+          is_non_const_reference<typename BoundFunctorTraits::A4Type>::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<RunnableType>::value ||
+          !cef_internal::NeedsScopedRefptrButGetsRawPtr<P1>::value,
+      p1_is_refcounted_type_and_needs_scoped_refptr);
+  COMPILE_ASSERT(!cef_internal::HasIsMethodTag<RunnableType>::value ||
+                     !is_array<P1>::value,
+                 first_bound_argument_to_method_cannot_be_array);
+  COMPILE_ASSERT(!cef_internal::NeedsScopedRefptrButGetsRawPtr<P2>::value,
+                 p2_is_refcounted_type_and_needs_scoped_refptr);
+  COMPILE_ASSERT(!cef_internal::NeedsScopedRefptrButGetsRawPtr<P3>::value,
+                 p3_is_refcounted_type_and_needs_scoped_refptr);
+  COMPILE_ASSERT(!cef_internal::NeedsScopedRefptrButGetsRawPtr<P4>::value,
+                 p4_is_refcounted_type_and_needs_scoped_refptr);
+  typedef cef_internal::BindState<RunnableType, RunType,
+      void(typename cef_internal::CallbackParamTraits<P1>::StorageType,
+      typename cef_internal::CallbackParamTraits<P2>::StorageType,
+      typename cef_internal::CallbackParamTraits<P3>::StorageType,
+      typename cef_internal::CallbackParamTraits<P4>::StorageType)> BindState;
+
+
+  return Callback<typename BindState::UnboundRunType>(
+      new BindState(cef_internal::MakeRunnable(functor), p1, p2, p3, p4));
+}
+
+template <typename Functor, typename P1, typename P2, typename P3, typename P4,
+    typename P5>
+base::Callback<
+    typename cef_internal::BindState<
+        typename cef_internal::FunctorTraits<Functor>::RunnableType,
+        typename cef_internal::FunctorTraits<Functor>::RunType,
+        void(typename cef_internal::CallbackParamTraits<P1>::StorageType,
+            typename cef_internal::CallbackParamTraits<P2>::StorageType,
+            typename cef_internal::CallbackParamTraits<P3>::StorageType,
+            typename cef_internal::CallbackParamTraits<P4>::StorageType,
+            typename cef_internal::CallbackParamTraits<P5>::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<Functor>::RunnableType RunnableType;
+  typedef typename cef_internal::FunctorTraits<Functor>::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<typename RunnableType::RunType>
+      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<typename BoundFunctorTraits::A1Type>::value ||
+          is_non_const_reference<typename BoundFunctorTraits::A2Type>::value ||
+          is_non_const_reference<typename BoundFunctorTraits::A3Type>::value ||
+          is_non_const_reference<typename BoundFunctorTraits::A4Type>::value ||
+          is_non_const_reference<typename BoundFunctorTraits::A5Type>::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<RunnableType>::value ||
+          !cef_internal::NeedsScopedRefptrButGetsRawPtr<P1>::value,
+      p1_is_refcounted_type_and_needs_scoped_refptr);
+  COMPILE_ASSERT(!cef_internal::HasIsMethodTag<RunnableType>::value ||
+                     !is_array<P1>::value,
+                 first_bound_argument_to_method_cannot_be_array);
+  COMPILE_ASSERT(!cef_internal::NeedsScopedRefptrButGetsRawPtr<P2>::value,
+                 p2_is_refcounted_type_and_needs_scoped_refptr);
+  COMPILE_ASSERT(!cef_internal::NeedsScopedRefptrButGetsRawPtr<P3>::value,
+                 p3_is_refcounted_type_and_needs_scoped_refptr);
+  COMPILE_ASSERT(!cef_internal::NeedsScopedRefptrButGetsRawPtr<P4>::value,
+                 p4_is_refcounted_type_and_needs_scoped_refptr);
+  COMPILE_ASSERT(!cef_internal::NeedsScopedRefptrButGetsRawPtr<P5>::value,
+                 p5_is_refcounted_type_and_needs_scoped_refptr);
+  typedef cef_internal::BindState<RunnableType, RunType,
+      void(typename cef_internal::CallbackParamTraits<P1>::StorageType,
+      typename cef_internal::CallbackParamTraits<P2>::StorageType,
+      typename cef_internal::CallbackParamTraits<P3>::StorageType,
+      typename cef_internal::CallbackParamTraits<P4>::StorageType,
+      typename cef_internal::CallbackParamTraits<P5>::StorageType)> BindState;
+
+
+  return Callback<typename BindState::UnboundRunType>(
+      new BindState(cef_internal::MakeRunnable(functor), p1, p2, p3, p4, p5));
+}
+
+template <typename Functor, typename P1, typename P2, typename P3, typename P4,
+    typename P5, typename P6>
+base::Callback<
+    typename cef_internal::BindState<
+        typename cef_internal::FunctorTraits<Functor>::RunnableType,
+        typename cef_internal::FunctorTraits<Functor>::RunType,
+        void(typename cef_internal::CallbackParamTraits<P1>::StorageType,
+            typename cef_internal::CallbackParamTraits<P2>::StorageType,
+            typename cef_internal::CallbackParamTraits<P3>::StorageType,
+            typename cef_internal::CallbackParamTraits<P4>::StorageType,
+            typename cef_internal::CallbackParamTraits<P5>::StorageType,
+            typename cef_internal::CallbackParamTraits<P6>::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<Functor>::RunnableType RunnableType;
+  typedef typename cef_internal::FunctorTraits<Functor>::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<typename RunnableType::RunType>
+      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<typename BoundFunctorTraits::A1Type>::value ||
+          is_non_const_reference<typename BoundFunctorTraits::A2Type>::value ||
+          is_non_const_reference<typename BoundFunctorTraits::A3Type>::value ||
+          is_non_const_reference<typename BoundFunctorTraits::A4Type>::value ||
+          is_non_const_reference<typename BoundFunctorTraits::A5Type>::value ||
+          is_non_const_reference<typename BoundFunctorTraits::A6Type>::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<RunnableType>::value ||
+          !cef_internal::NeedsScopedRefptrButGetsRawPtr<P1>::value,
+      p1_is_refcounted_type_and_needs_scoped_refptr);
+  COMPILE_ASSERT(!cef_internal::HasIsMethodTag<RunnableType>::value ||
+                     !is_array<P1>::value,
+                 first_bound_argument_to_method_cannot_be_array);
+  COMPILE_ASSERT(!cef_internal::NeedsScopedRefptrButGetsRawPtr<P2>::value,
+                 p2_is_refcounted_type_and_needs_scoped_refptr);
+  COMPILE_ASSERT(!cef_internal::NeedsScopedRefptrButGetsRawPtr<P3>::value,
+                 p3_is_refcounted_type_and_needs_scoped_refptr);
+  COMPILE_ASSERT(!cef_internal::NeedsScopedRefptrButGetsRawPtr<P4>::value,
+                 p4_is_refcounted_type_and_needs_scoped_refptr);
+  COMPILE_ASSERT(!cef_internal::NeedsScopedRefptrButGetsRawPtr<P5>::value,
+                 p5_is_refcounted_type_and_needs_scoped_refptr);
+  COMPILE_ASSERT(!cef_internal::NeedsScopedRefptrButGetsRawPtr<P6>::value,
+                 p6_is_refcounted_type_and_needs_scoped_refptr);
+  typedef cef_internal::BindState<RunnableType, RunType,
+      void(typename cef_internal::CallbackParamTraits<P1>::StorageType,
+      typename cef_internal::CallbackParamTraits<P2>::StorageType,
+      typename cef_internal::CallbackParamTraits<P3>::StorageType,
+      typename cef_internal::CallbackParamTraits<P4>::StorageType,
+      typename cef_internal::CallbackParamTraits<P5>::StorageType,
+      typename cef_internal::CallbackParamTraits<P6>::StorageType)> BindState;
+
+
+  return Callback<typename BindState::UnboundRunType>(
+      new BindState(cef_internal::MakeRunnable(functor), p1, p2, p3, p4, p5, p6));
+}
+
+template <typename Functor, typename P1, typename P2, typename P3, typename P4,
+    typename P5, typename P6, typename P7>
+base::Callback<
+    typename cef_internal::BindState<
+        typename cef_internal::FunctorTraits<Functor>::RunnableType,
+        typename cef_internal::FunctorTraits<Functor>::RunType,
+        void(typename cef_internal::CallbackParamTraits<P1>::StorageType,
+            typename cef_internal::CallbackParamTraits<P2>::StorageType,
+            typename cef_internal::CallbackParamTraits<P3>::StorageType,
+            typename cef_internal::CallbackParamTraits<P4>::StorageType,
+            typename cef_internal::CallbackParamTraits<P5>::StorageType,
+            typename cef_internal::CallbackParamTraits<P6>::StorageType,
+            typename cef_internal::CallbackParamTraits<P7>::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<Functor>::RunnableType RunnableType;
+  typedef typename cef_internal::FunctorTraits<Functor>::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<typename RunnableType::RunType>
+      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<typename BoundFunctorTraits::A1Type>::value ||
+          is_non_const_reference<typename BoundFunctorTraits::A2Type>::value ||
+          is_non_const_reference<typename BoundFunctorTraits::A3Type>::value ||
+          is_non_const_reference<typename BoundFunctorTraits::A4Type>::value ||
+          is_non_const_reference<typename BoundFunctorTraits::A5Type>::value ||
+          is_non_const_reference<typename BoundFunctorTraits::A6Type>::value ||
+          is_non_const_reference<typename BoundFunctorTraits::A7Type>::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<RunnableType>::value ||
+          !cef_internal::NeedsScopedRefptrButGetsRawPtr<P1>::value,
+      p1_is_refcounted_type_and_needs_scoped_refptr);
+  COMPILE_ASSERT(!cef_internal::HasIsMethodTag<RunnableType>::value ||
+                     !is_array<P1>::value,
+                 first_bound_argument_to_method_cannot_be_array);
+  COMPILE_ASSERT(!cef_internal::NeedsScopedRefptrButGetsRawPtr<P2>::value,
+                 p2_is_refcounted_type_and_needs_scoped_refptr);
+  COMPILE_ASSERT(!cef_internal::NeedsScopedRefptrButGetsRawPtr<P3>::value,
+                 p3_is_refcounted_type_and_needs_scoped_refptr);
+  COMPILE_ASSERT(!cef_internal::NeedsScopedRefptrButGetsRawPtr<P4>::value,
+                 p4_is_refcounted_type_and_needs_scoped_refptr);
+  COMPILE_ASSERT(!cef_internal::NeedsScopedRefptrButGetsRawPtr<P5>::value,
+                 p5_is_refcounted_type_and_needs_scoped_refptr);
+  COMPILE_ASSERT(!cef_internal::NeedsScopedRefptrButGetsRawPtr<P6>::value,
+                 p6_is_refcounted_type_and_needs_scoped_refptr);
+  COMPILE_ASSERT(!cef_internal::NeedsScopedRefptrButGetsRawPtr<P7>::value,
+                 p7_is_refcounted_type_and_needs_scoped_refptr);
+  typedef cef_internal::BindState<RunnableType, RunType,
+      void(typename cef_internal::CallbackParamTraits<P1>::StorageType,
+      typename cef_internal::CallbackParamTraits<P2>::StorageType,
+      typename cef_internal::CallbackParamTraits<P3>::StorageType,
+      typename cef_internal::CallbackParamTraits<P4>::StorageType,
+      typename cef_internal::CallbackParamTraits<P5>::StorageType,
+      typename cef_internal::CallbackParamTraits<P6>::StorageType,
+      typename cef_internal::CallbackParamTraits<P7>::StorageType)> BindState;
+
+
+  return Callback<typename BindState::UnboundRunType>(
+      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_

+ 586 - 0
Source/ThirdParty/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<void(int)> 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<Foo> arg) { }
+//   scoped_ptr<Foo> CreateFoo() { return scoped_ptr<Foo>(new Foo()); }
+//
+//   scoped_ptr<Foo> 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<T>() - 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 <typename C>
+//   Yes NotTheCheckWeWant(Helper<&C::TargetFunc>*);
+//
+//   template <typename C>
+//   No NotTheCheckWeWant(...);
+//
+//   static const bool value = sizeof(NotTheCheckWeWant<T>(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 <typename C>
+//   No GoodCheck(Helper<&C::TargetFunc>*);
+//
+//   template <typename C>
+//   Yes GoodCheck(...);
+//
+//   static const bool value = sizeof(GoodCheck<Base>(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<Base>(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 <typename T>
+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 <void(BaseMixin::*)(void)> struct Helper {};
+
+  template <typename C>
+  static No& Check(Helper<&C::AddRef>*);
+
+  template <typename >
+  static Yes& Check(...);
+
+ public:
+  static const bool value = sizeof(Check<Base>(0)) == sizeof(Yes);
+};
+
+// Helpers to assert that arguments of a recounted type are bound with a
+// scoped_refptr.
+template <bool IsClasstype, typename T>
+struct UnsafeBindtoRefCountedArgHelper : false_type {
+};
+
+template <typename T>
+struct UnsafeBindtoRefCountedArgHelper<true, T>
+    : integral_constant<bool, SupportsAddRefAndRelease<T>::value> {
+};
+
+template <typename T>
+struct UnsafeBindtoRefCountedArg : false_type {
+};
+
+template <typename T>
+struct UnsafeBindtoRefCountedArg<T*>
+    : UnsafeBindtoRefCountedArgHelper<is_class<T>::value, T> {
+};
+
+template <typename T>
+class HasIsMethodTag {
+  typedef char Yes[1];
+  typedef char No[2];
+
+  template <typename U>
+  static Yes& Check(typename U::IsMethod*);
+
+  template <typename U>
+  static No& Check(...);
+
+ public:
+  static const bool value = sizeof(Check<T>(0)) == sizeof(Yes);
+};
+
+template <typename T>
+class UnretainedWrapper {
+ public:
+  explicit UnretainedWrapper(T* o) : ptr_(o) {}
+  T* get() const { return ptr_; }
+ private:
+  T* ptr_;
+};
+
+template <typename T>
+class ConstRefWrapper {
+ public:
+  explicit ConstRefWrapper(const T& o) : ptr_(&o) {}
+  const T& get() const { return *ptr_; }
+ private:
+  const T* ptr_;
+};
+
+template <typename T>
+struct IgnoreResultHelper {
+  explicit IgnoreResultHelper(T functor) : functor_(functor) {}
+
+  T functor_;
+};
+
+template <typename T>
+struct IgnoreResultHelper<Callback<T> > {
+  explicit IgnoreResultHelper(const Callback<T>& functor) : functor_(functor) {}
+
+  const Callback<T>& 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 <typename T>
+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 <typename T>
+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 <typename T>
+struct UnwrapTraits {
+  typedef const T& ForwardType;
+  static ForwardType Unwrap(const T& o) { return o; }
+};
+
+template <typename T>
+struct UnwrapTraits<UnretainedWrapper<T> > {
+  typedef T* ForwardType;
+  static ForwardType Unwrap(UnretainedWrapper<T> unretained) {
+    return unretained.get();
+  }
+};
+
+template <typename T>
+struct UnwrapTraits<ConstRefWrapper<T> > {
+  typedef const T& ForwardType;
+  static ForwardType Unwrap(ConstRefWrapper<T> const_ref) {
+    return const_ref.get();
+  }
+};
+
+template <typename T>
+struct UnwrapTraits<scoped_refptr<T> > {
+  typedef T* ForwardType;
+  static ForwardType Unwrap(const scoped_refptr<T>& o) { return o.get(); }
+};
+
+template <typename T>
+struct UnwrapTraits<WeakPtr<T> > {
+  typedef const WeakPtr<T>& ForwardType;
+  static ForwardType Unwrap(const WeakPtr<T>& o) { return o; }
+};
+
+template <typename T>
+struct UnwrapTraits<OwnedWrapper<T> > {
+  typedef T* ForwardType;
+  static ForwardType Unwrap(const OwnedWrapper<T>& o) {
+    return o.get();
+  }
+};
+
+template <typename T>
+struct UnwrapTraits<PassedWrapper<T> > {
+  typedef T ForwardType;
+  static T Unwrap(PassedWrapper<T>& o) {
+    return o.Pass();
+  }
+};
+
+// Utility for handling different refcounting semantics in the Bind()
+// function.
+template <bool is_method, typename T>
+struct MaybeRefcount;
+
+template <typename T>
+struct MaybeRefcount<false, T> {
+  static void AddRef(const T&) {}
+  static void Release(const T&) {}
+};
+
+template <typename T, size_t n>
+struct MaybeRefcount<false, T[n]> {
+  static void AddRef(const T*) {}
+  static void Release(const T*) {}
+};
+
+template <typename T>
+struct MaybeRefcount<true, T> {
+  static void AddRef(const T&) {}
+  static void Release(const T&) {}
+};
+
+template <typename T>
+struct MaybeRefcount<true, T*> {
+  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 <typename T>
+struct MaybeRefcount<true, scoped_refptr<T> > {
+  static void AddRef(const scoped_refptr<T>& o) {}
+  static void Release(const scoped_refptr<T>& o) {}
+};
+
+template <typename T>
+struct MaybeRefcount<true, const T*> {
+  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 <bool IsMethod, typename P1>
+struct IsWeakMethod : public false_type {};
+
+template <typename T>
+struct IsWeakMethod<true, WeakPtr<T> > : public true_type {};
+
+template <typename T>
+struct IsWeakMethod<true, ConstRefWrapper<WeakPtr<T> > > : public true_type {};
+
+}  // namespace cef_internal
+
+template <typename T>
+static inline cef_internal::UnretainedWrapper<T> Unretained(T* o) {
+  return cef_internal::UnretainedWrapper<T>(o);
+}
+
+template <typename T>
+static inline cef_internal::ConstRefWrapper<T> ConstRef(const T& o) {
+  return cef_internal::ConstRefWrapper<T>(o);
+}
+
+template <typename T>
+static inline cef_internal::OwnedWrapper<T> Owned(T* o) {
+  return cef_internal::OwnedWrapper<T>(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 <typename T>
+static inline cef_internal::PassedWrapper<T> Passed(T scoper) {
+  return cef_internal::PassedWrapper<T>(scoper.Pass());
+}
+template <typename T>
+static inline cef_internal::PassedWrapper<T> Passed(T* scoper) {
+  return cef_internal::PassedWrapper<T>(scoper->Pass());
+}
+
+template <typename T>
+static inline cef_internal::IgnoreResultHelper<T> IgnoreResult(T data) {
+  return cef_internal::IgnoreResultHelper<T>(data);
+}
+
+template <typename T>
+static inline cef_internal::IgnoreResultHelper<Callback<T> >
+IgnoreResult(const Callback<T>& data) {
+  return cef_internal::IgnoreResultHelper<Callback<T> >(data);
+}
+
+void DoNothing();
+
+template<typename T>
+void DeletePointer(T* obj) {
+  delete obj;
+}
+
+}  // namespace base
+
+#endif  // !BUILDING_CEF_SHARED
+
+#endif  // CEF_INCLUDE_BASE_CEF_BIND_HELPERS_H_

+ 189 - 0
Source/ThirdParty/CEF/include/base/cef_build.h

@@ -0,0 +1,189 @@
+// 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 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 <base/basictypes.h>.
+#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
+
+// Annotate a virtual method indicating it must be overriding a virtual method
+// in the parent class.
+// Use like:
+//   void foo() OVERRIDE;
+// NOTE: This define should only be used in classes exposed to the client since
+// C++11 support may not be enabled in client applications. CEF internal classes
+// should use the `override` keyword directly.
+#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
+
+#endif  // CEF_INCLUDE_BASE_CEF_BUILD_H_

+ 807 - 0
Source/ThirdParty/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<void(void)>)
+// 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<int(void)> 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<Ref> {
+//    public:
+//     int Foo() { return 3; }
+//     void PrintBye() { LOG(INFO) << "bye."; }
+//   };
+//   scoped_refptr<Ref> ref = new Ref();
+//   base::Callback<void(void)> 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<void(int, std::string)>& 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<double(double)>& 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<void(int, const std::string&)> 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<void(void)> cb = base::Bind(&MyFunc, 23, "hello world");
+//   cb.Run();
+//
+//   A callback with no unbound input parameters (base::Callback<void(void)>)
+//   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<void(const std::string&)> 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<void<int>) 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<void(void)> 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<Foo> arg) {}
+//   scoped_ptr<Foo> 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<Foo> arg) {}
+//   scoped_refptr<Foo> 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<int(int)> is convertible to tr1::function<void(int)>).
+//
+// 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 <typename Sig>
+class Callback;
+
+namespace cef_internal {
+template <typename Runnable, typename RunType, typename BoundArgsType>
+struct BindState;
+}  // namespace cef_internal
+
+template <typename R>
+class Callback<R(void)> : 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 <typename Runnable, typename BindRunType, typename BoundArgsType>
+  Callback(cef_internal::BindState<Runnable, BindRunType,
+           BoundArgsType>* 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<Runnable, BindRunType, BoundArgsType>
+            ::InvokerType::Run;
+    polymorphic_invoke_ = reinterpret_cast<InvokeFuncStorage>(invoke_func);
+  }
+
+  bool Equals(const Callback& other) const {
+    return CallbackBase::Equals(other);
+  }
+
+  R Run() const {
+    PolymorphicInvoke f =
+        reinterpret_cast<PolymorphicInvoke>(polymorphic_invoke_);
+
+    return f(bind_state_.get());
+  }
+
+ private:
+  typedef R(*PolymorphicInvoke)(
+      cef_internal::BindStateBase*);
+
+};
+
+template <typename R, typename A1>
+class Callback<R(A1)> : 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 <typename Runnable, typename BindRunType, typename BoundArgsType>
+  Callback(cef_internal::BindState<Runnable, BindRunType,
+           BoundArgsType>* 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<Runnable, BindRunType, BoundArgsType>
+            ::InvokerType::Run;
+    polymorphic_invoke_ = reinterpret_cast<InvokeFuncStorage>(invoke_func);
+  }
+
+  bool Equals(const Callback& other) const {
+    return CallbackBase::Equals(other);
+  }
+
+  R Run(typename cef_internal::CallbackParamTraits<A1>::ForwardType a1) const {
+    PolymorphicInvoke f =
+        reinterpret_cast<PolymorphicInvoke>(polymorphic_invoke_);
+
+    return f(bind_state_.get(), cef_internal::CallbackForward(a1));
+  }
+
+ private:
+  typedef R(*PolymorphicInvoke)(
+      cef_internal::BindStateBase*,
+          typename cef_internal::CallbackParamTraits<A1>::ForwardType);
+
+};
+
+template <typename R, typename A1, typename A2>
+class Callback<R(A1, A2)> : 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 <typename Runnable, typename BindRunType, typename BoundArgsType>
+  Callback(cef_internal::BindState<Runnable, BindRunType,
+           BoundArgsType>* 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<Runnable, BindRunType, BoundArgsType>
+            ::InvokerType::Run;
+    polymorphic_invoke_ = reinterpret_cast<InvokeFuncStorage>(invoke_func);
+  }
+
+  bool Equals(const Callback& other) const {
+    return CallbackBase::Equals(other);
+  }
+
+  R Run(typename cef_internal::CallbackParamTraits<A1>::ForwardType a1,
+        typename cef_internal::CallbackParamTraits<A2>::ForwardType a2) const {
+    PolymorphicInvoke f =
+        reinterpret_cast<PolymorphicInvoke>(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<A1>::ForwardType,
+          typename cef_internal::CallbackParamTraits<A2>::ForwardType);
+
+};
+
+template <typename R, typename A1, typename A2, typename A3>
+class Callback<R(A1, A2, A3)> : 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 <typename Runnable, typename BindRunType, typename BoundArgsType>
+  Callback(cef_internal::BindState<Runnable, BindRunType,
+           BoundArgsType>* 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<Runnable, BindRunType, BoundArgsType>
+            ::InvokerType::Run;
+    polymorphic_invoke_ = reinterpret_cast<InvokeFuncStorage>(invoke_func);
+  }
+
+  bool Equals(const Callback& other) const {
+    return CallbackBase::Equals(other);
+  }
+
+  R Run(typename cef_internal::CallbackParamTraits<A1>::ForwardType a1,
+        typename cef_internal::CallbackParamTraits<A2>::ForwardType a2,
+        typename cef_internal::CallbackParamTraits<A3>::ForwardType a3) const {
+    PolymorphicInvoke f =
+        reinterpret_cast<PolymorphicInvoke>(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<A1>::ForwardType,
+          typename cef_internal::CallbackParamTraits<A2>::ForwardType,
+          typename cef_internal::CallbackParamTraits<A3>::ForwardType);
+
+};
+
+template <typename R, typename A1, typename A2, typename A3, typename A4>
+class Callback<R(A1, A2, A3, A4)> : 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 <typename Runnable, typename BindRunType, typename BoundArgsType>
+  Callback(cef_internal::BindState<Runnable, BindRunType,
+           BoundArgsType>* 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<Runnable, BindRunType, BoundArgsType>
+            ::InvokerType::Run;
+    polymorphic_invoke_ = reinterpret_cast<InvokeFuncStorage>(invoke_func);
+  }
+
+  bool Equals(const Callback& other) const {
+    return CallbackBase::Equals(other);
+  }
+
+  R Run(typename cef_internal::CallbackParamTraits<A1>::ForwardType a1,
+        typename cef_internal::CallbackParamTraits<A2>::ForwardType a2,
+        typename cef_internal::CallbackParamTraits<A3>::ForwardType a3,
+        typename cef_internal::CallbackParamTraits<A4>::ForwardType a4) const {
+    PolymorphicInvoke f =
+        reinterpret_cast<PolymorphicInvoke>(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<A1>::ForwardType,
+          typename cef_internal::CallbackParamTraits<A2>::ForwardType,
+          typename cef_internal::CallbackParamTraits<A3>::ForwardType,
+          typename cef_internal::CallbackParamTraits<A4>::ForwardType);
+
+};
+
+template <typename R, typename A1, typename A2, typename A3, typename A4,
+    typename A5>
+class Callback<R(A1, A2, A3, A4, A5)> : 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 <typename Runnable, typename BindRunType, typename BoundArgsType>
+  Callback(cef_internal::BindState<Runnable, BindRunType,
+           BoundArgsType>* 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<Runnable, BindRunType, BoundArgsType>
+            ::InvokerType::Run;
+    polymorphic_invoke_ = reinterpret_cast<InvokeFuncStorage>(invoke_func);
+  }
+
+  bool Equals(const Callback& other) const {
+    return CallbackBase::Equals(other);
+  }
+
+  R Run(typename cef_internal::CallbackParamTraits<A1>::ForwardType a1,
+        typename cef_internal::CallbackParamTraits<A2>::ForwardType a2,
+        typename cef_internal::CallbackParamTraits<A3>::ForwardType a3,
+        typename cef_internal::CallbackParamTraits<A4>::ForwardType a4,
+        typename cef_internal::CallbackParamTraits<A5>::ForwardType a5) const {
+    PolymorphicInvoke f =
+        reinterpret_cast<PolymorphicInvoke>(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<A1>::ForwardType,
+          typename cef_internal::CallbackParamTraits<A2>::ForwardType,
+          typename cef_internal::CallbackParamTraits<A3>::ForwardType,
+          typename cef_internal::CallbackParamTraits<A4>::ForwardType,
+          typename cef_internal::CallbackParamTraits<A5>::ForwardType);
+
+};
+
+template <typename R, typename A1, typename A2, typename A3, typename A4,
+    typename A5, typename A6>
+class Callback<R(A1, A2, A3, A4, A5, A6)> : 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 <typename Runnable, typename BindRunType, typename BoundArgsType>
+  Callback(cef_internal::BindState<Runnable, BindRunType,
+           BoundArgsType>* 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<Runnable, BindRunType, BoundArgsType>
+            ::InvokerType::Run;
+    polymorphic_invoke_ = reinterpret_cast<InvokeFuncStorage>(invoke_func);
+  }
+
+  bool Equals(const Callback& other) const {
+    return CallbackBase::Equals(other);
+  }
+
+  R Run(typename cef_internal::CallbackParamTraits<A1>::ForwardType a1,
+        typename cef_internal::CallbackParamTraits<A2>::ForwardType a2,
+        typename cef_internal::CallbackParamTraits<A3>::ForwardType a3,
+        typename cef_internal::CallbackParamTraits<A4>::ForwardType a4,
+        typename cef_internal::CallbackParamTraits<A5>::ForwardType a5,
+        typename cef_internal::CallbackParamTraits<A6>::ForwardType a6) const {
+    PolymorphicInvoke f =
+        reinterpret_cast<PolymorphicInvoke>(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<A1>::ForwardType,
+          typename cef_internal::CallbackParamTraits<A2>::ForwardType,
+          typename cef_internal::CallbackParamTraits<A3>::ForwardType,
+          typename cef_internal::CallbackParamTraits<A4>::ForwardType,
+          typename cef_internal::CallbackParamTraits<A5>::ForwardType,
+          typename cef_internal::CallbackParamTraits<A6>::ForwardType);
+
+};
+
+template <typename R, typename A1, typename A2, typename A3, typename A4,
+    typename A5, typename A6, typename A7>
+class Callback<R(A1, A2, A3, A4, A5, A6, A7)> : 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 <typename Runnable, typename BindRunType, typename BoundArgsType>
+  Callback(cef_internal::BindState<Runnable, BindRunType,
+           BoundArgsType>* 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<Runnable, BindRunType, BoundArgsType>
+            ::InvokerType::Run;
+    polymorphic_invoke_ = reinterpret_cast<InvokeFuncStorage>(invoke_func);
+  }
+
+  bool Equals(const Callback& other) const {
+    return CallbackBase::Equals(other);
+  }
+
+  R Run(typename cef_internal::CallbackParamTraits<A1>::ForwardType a1,
+        typename cef_internal::CallbackParamTraits<A2>::ForwardType a2,
+        typename cef_internal::CallbackParamTraits<A3>::ForwardType a3,
+        typename cef_internal::CallbackParamTraits<A4>::ForwardType a4,
+        typename cef_internal::CallbackParamTraits<A5>::ForwardType a5,
+        typename cef_internal::CallbackParamTraits<A6>::ForwardType a6,
+        typename cef_internal::CallbackParamTraits<A7>::ForwardType a7) const {
+    PolymorphicInvoke f =
+        reinterpret_cast<PolymorphicInvoke>(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<A1>::ForwardType,
+          typename cef_internal::CallbackParamTraits<A2>::ForwardType,
+          typename cef_internal::CallbackParamTraits<A3>::ForwardType,
+          typename cef_internal::CallbackParamTraits<A4>::ForwardType,
+          typename cef_internal::CallbackParamTraits<A5>::ForwardType,
+          typename cef_internal::CallbackParamTraits<A6>::ForwardType,
+          typename cef_internal::CallbackParamTraits<A7>::ForwardType);
+
+};
+
+
+// Syntactic sugar to make Callbacks<void(void)> easier to declare since it
+// will be used in a lot of APIs with delayed execution.
+typedef Callback<void(void)> Closure;
+
+}  // namespace base
+
+#endif  // !BUILDING_CEF_SHARED
+
+#endif  // CEF_INCLUDE_BASE_CEF_CALLBACK_H_

+ 59 - 0
Source/ThirdParty/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 <typename Sig>
+class Callback;
+
+typedef Callback<void(void)> Closure;
+
+}  // namespace base
+
+#endif  // !!BUILDING_CEF_SHARED
+
+#endif  // INCLUDE_BASE_CEF_CALLBACK_FORWARD_H_

+ 93 - 0
Source/ThirdParty/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 <typename Sig>
+base::Callback<Sig> ResetAndReturn(base::Callback<Sig>* cb) {
+  base::Callback<Sig> 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_

+ 444 - 0
Source/ThirdParty/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 <list>
+
+#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<void(const Foo&)> OnFooCallback;
+//
+//   scoped_ptr<base::CallbackList<void(const Foo&)>::Subscription>
+//   RegisterCallback(const OnFooCallback& cb) {
+//     return callback_list_.Add(cb);
+//   }
+//
+//  private:
+//   void NotifyFoo(const Foo& foo) {
+//      callback_list_.Notify(foo);
+//   }
+//
+//   base::CallbackList<void(const Foo&)> 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<base::CallbackList<void(const Foo&)>::Subscription>
+//       foo_subscription_;
+//
+//   DISALLOW_COPY_AND_ASSIGN(MyWidgetListener);
+// };
+
+namespace base {
+
+namespace cef_internal {
+
+template <typename CallbackType>
+class CallbackListBase {
+ public:
+  class Subscription {
+   public:
+    Subscription(CallbackListBase<CallbackType>* list,
+                 typename std::list<CallbackType>::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<CallbackType>* list_;
+    typename std::list<CallbackType>::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<Subscription> Add(const CallbackType& cb) WARN_UNUSED_RESULT {
+    DCHECK(!cb.is_null());
+    return scoped_ptr<Subscription>(
+        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<CallbackType>* 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<CallbackType>* list_;
+    typename std::list<CallbackType>::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<CallbackType>::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<CallbackType> callbacks_;
+  int active_iterator_count_;
+  Closure removal_callback_;
+
+  DISALLOW_COPY_AND_ASSIGN(CallbackListBase);
+};
+
+}  // namespace cef_internal
+
+template <typename Sig> class CallbackList;
+
+template <>
+class CallbackList<void(void)>
+    : public cef_internal::CallbackListBase<Callback<void(void)> > {
+ public:
+  typedef Callback<void(void)> CallbackType;
+
+  CallbackList() {}
+
+  void Notify() {
+    cef_internal::CallbackListBase<CallbackType>::Iterator it =
+        this->GetIterator();
+    CallbackType* cb;
+    while ((cb = it.GetNext()) != NULL) {
+      cb->Run();
+    }
+  }
+
+ private:
+  DISALLOW_COPY_AND_ASSIGN(CallbackList);
+};
+
+template <typename A1>
+class CallbackList<void(A1)>
+    : public cef_internal::CallbackListBase<Callback<void(A1)> > {
+ public:
+  typedef Callback<void(A1)> CallbackType;
+
+  CallbackList() {}
+
+  void Notify(typename cef_internal::CallbackParamTraits<A1>::ForwardType a1) {
+    typename cef_internal::CallbackListBase<CallbackType>::Iterator it =
+        this->GetIterator();
+    CallbackType* cb;
+    while ((cb = it.GetNext()) != NULL) {
+      cb->Run(a1);
+    }
+  }
+
+ private:
+  DISALLOW_COPY_AND_ASSIGN(CallbackList);
+};
+
+template <typename A1, typename A2>
+class CallbackList<void(A1, A2)>
+    : public cef_internal::CallbackListBase<Callback<void(A1, A2)> > {
+ public:
+  typedef Callback<void(A1, A2)> CallbackType;
+
+  CallbackList() {}
+
+  void Notify(typename cef_internal::CallbackParamTraits<A1>::ForwardType a1,
+              typename cef_internal::CallbackParamTraits<A2>::ForwardType a2) {
+    typename cef_internal::CallbackListBase<CallbackType>::Iterator it =
+        this->GetIterator();
+    CallbackType* cb;
+    while ((cb = it.GetNext()) != NULL) {
+      cb->Run(a1, a2);
+    }
+  }
+
+ private:
+  DISALLOW_COPY_AND_ASSIGN(CallbackList);
+};
+
+template <typename A1, typename A2, typename A3>
+class CallbackList<void(A1, A2, A3)>
+    : public cef_internal::CallbackListBase<Callback<void(A1, A2, A3)> > {
+ public:
+  typedef Callback<void(A1, A2, A3)> CallbackType;
+
+  CallbackList() {}
+
+  void Notify(typename cef_internal::CallbackParamTraits<A1>::ForwardType a1,
+              typename cef_internal::CallbackParamTraits<A2>::ForwardType a2,
+              typename cef_internal::CallbackParamTraits<A3>::ForwardType a3) {
+    typename cef_internal::CallbackListBase<CallbackType>::Iterator it =
+        this->GetIterator();
+    CallbackType* cb;
+    while ((cb = it.GetNext()) != NULL) {
+      cb->Run(a1, a2, a3);
+    }
+  }
+
+ private:
+  DISALLOW_COPY_AND_ASSIGN(CallbackList);
+};
+
+template <typename A1, typename A2, typename A3, typename A4>
+class CallbackList<void(A1, A2, A3, A4)>
+    : public cef_internal::CallbackListBase<Callback<void(A1, A2, A3, A4)> > {
+ public:
+  typedef Callback<void(A1, A2, A3, A4)> CallbackType;
+
+  CallbackList() {}
+
+  void Notify(typename cef_internal::CallbackParamTraits<A1>::ForwardType a1,
+              typename cef_internal::CallbackParamTraits<A2>::ForwardType a2,
+              typename cef_internal::CallbackParamTraits<A3>::ForwardType a3,
+              typename cef_internal::CallbackParamTraits<A4>::ForwardType a4) {
+    typename cef_internal::CallbackListBase<CallbackType>::Iterator it =
+        this->GetIterator();
+    CallbackType* cb;
+    while ((cb = it.GetNext()) != NULL) {
+      cb->Run(a1, a2, a3, a4);
+    }
+  }
+
+ private:
+  DISALLOW_COPY_AND_ASSIGN(CallbackList);
+};
+
+template <typename A1, typename A2, typename A3, typename A4, typename A5>
+class CallbackList<void(A1, A2, A3, A4, A5)>
+    : public cef_internal::CallbackListBase<Callback<void(A1, A2, A3, A4, A5)> > {
+ public:
+  typedef Callback<void(A1, A2, A3, A4, A5)> CallbackType;
+
+  CallbackList() {}
+
+  void Notify(typename cef_internal::CallbackParamTraits<A1>::ForwardType a1,
+              typename cef_internal::CallbackParamTraits<A2>::ForwardType a2,
+              typename cef_internal::CallbackParamTraits<A3>::ForwardType a3,
+              typename cef_internal::CallbackParamTraits<A4>::ForwardType a4,
+              typename cef_internal::CallbackParamTraits<A5>::ForwardType a5) {
+    typename cef_internal::CallbackListBase<CallbackType>::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 <typename A1, typename A2, typename A3, typename A4, typename A5,
+    typename A6>
+class CallbackList<void(A1, A2, A3, A4, A5, A6)>
+    : public cef_internal::CallbackListBase<Callback<void(A1, A2, A3, A4, A5,
+        A6)> > {
+ public:
+  typedef Callback<void(A1, A2, A3, A4, A5, A6)> CallbackType;
+
+  CallbackList() {}
+
+  void Notify(typename cef_internal::CallbackParamTraits<A1>::ForwardType a1,
+              typename cef_internal::CallbackParamTraits<A2>::ForwardType a2,
+              typename cef_internal::CallbackParamTraits<A3>::ForwardType a3,
+              typename cef_internal::CallbackParamTraits<A4>::ForwardType a4,
+              typename cef_internal::CallbackParamTraits<A5>::ForwardType a5,
+              typename cef_internal::CallbackParamTraits<A6>::ForwardType a6) {
+    typename cef_internal::CallbackListBase<CallbackType>::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 <typename A1, typename A2, typename A3, typename A4, typename A5,
+    typename A6, typename A7>
+class CallbackList<void(A1, A2, A3, A4, A5, A6, A7)>
+    : public cef_internal::CallbackListBase<Callback<void(A1, A2, A3, A4, A5, A6,
+        A7)> > {
+ public:
+  typedef Callback<void(A1, A2, A3, A4, A5, A6, A7)> CallbackType;
+
+  CallbackList() {}
+
+  void Notify(typename cef_internal::CallbackParamTraits<A1>::ForwardType a1,
+              typename cef_internal::CallbackParamTraits<A2>::ForwardType a2,
+              typename cef_internal::CallbackParamTraits<A3>::ForwardType a3,
+              typename cef_internal::CallbackParamTraits<A4>::ForwardType a4,
+              typename cef_internal::CallbackParamTraits<A5>::ForwardType a5,
+              typename cef_internal::CallbackParamTraits<A6>::ForwardType a6,
+              typename cef_internal::CallbackParamTraits<A7>::ForwardType a7) {
+    typename cef_internal::CallbackListBase<CallbackType>::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_

+ 314 - 0
Source/ThirdParty/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 <typename Sig>
+class CancelableCallback;
+
+template <>
+class CancelableCallback<void(void)> {
+ public:
+  CancelableCallback() : weak_factory_(this) {}
+
+  // |callback| must not be null.
+  explicit CancelableCallback(const base::Callback<void(void)>& 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<void(void)>& 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<void(void)>& 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<void(void)>::Forward,
+                            weak_factory_.GetWeakPtr());
+  }
+
+  // Used to ensure Forward() is not run when this object is destroyed.
+  base::WeakPtrFactory<CancelableCallback<void(void)> > weak_factory_;
+
+  // The wrapper closure.
+  base::Callback<void(void)> forwarder_;
+
+  // The stored closure that may be cancelled.
+  base::Callback<void(void)> callback_;
+
+  DISALLOW_COPY_AND_ASSIGN(CancelableCallback);
+};
+
+template <typename A1>
+class CancelableCallback<void(A1)> {
+ public:
+  CancelableCallback() : weak_factory_(this) {}
+
+  // |callback| must not be null.
+  explicit CancelableCallback(const base::Callback<void(A1)>& 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<void(A1)>& 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<void(A1)>& 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<void(A1)>::Forward,
+                            weak_factory_.GetWeakPtr());
+  }
+
+  // Used to ensure Forward() is not run when this object is destroyed.
+  base::WeakPtrFactory<CancelableCallback<void(A1)> > weak_factory_;
+
+  // The wrapper closure.
+  base::Callback<void(A1)> forwarder_;
+
+  // The stored closure that may be cancelled.
+  base::Callback<void(A1)> callback_;
+
+  DISALLOW_COPY_AND_ASSIGN(CancelableCallback);
+};
+
+template <typename A1, typename A2>
+class CancelableCallback<void(A1, A2)> {
+ public:
+  CancelableCallback() : weak_factory_(this) {}
+
+  // |callback| must not be null.
+  explicit CancelableCallback(const base::Callback<void(A1, A2)>& 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<void(A1, A2)>& 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<void(A1, A2)>& 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<void(A1, A2)>::Forward,
+                            weak_factory_.GetWeakPtr());
+  }
+
+  // Used to ensure Forward() is not run when this object is destroyed.
+  base::WeakPtrFactory<CancelableCallback<void(A1, A2)> > weak_factory_;
+
+  // The wrapper closure.
+  base::Callback<void(A1, A2)> forwarder_;
+
+  // The stored closure that may be cancelled.
+  base::Callback<void(A1, A2)> callback_;
+
+  DISALLOW_COPY_AND_ASSIGN(CancelableCallback);
+};
+
+typedef CancelableCallback<void(void)> CancelableClosure;
+
+}  // namespace base
+
+#endif  // !BUILDING_CEF_SHARED
+
+#endif  // CEF_INCLUDE_BASE_CEF_CANCELABLE_CALLBACK_H_

+ 167 - 0
Source/ThirdParty/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_

+ 746 - 0
Source/ThirdParty/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(<a particular severity level>).  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 <cassert>
+#include <string>
+#include <cstring>
+#include <sstream>
+
+#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 <size_t N>
+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<class t1, class t2>
+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<int, int>(
+    const int&, const int&, const char* names);
+extern template
+std::string* MakeCheckOpString<unsigned long, unsigned long>(
+    const unsigned long&, const unsigned long&, const char* names);
+extern template
+std::string* MakeCheckOpString<unsigned long, unsigned int>(
+    const unsigned long&, const unsigned int&, const char* names);
+extern template
+std::string* MakeCheckOpString<unsigned int, unsigned long>(
+    const unsigned int&, const unsigned long&, const char* names);
+extern template
+std::string* MakeCheckOpString<std::string, std::string>(
+    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 <class t1, class t2> \
+  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_

+ 218 - 0
Source/ThirdParty/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 <stddef.h>  // 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 <typename T, size_t N>
+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 <typename T, size_t N>
+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 <bool>
+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<bool(expr)>
+//
+//   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_

+ 259 - 0
Source/ThirdParty/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 <typename T>
+//  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<RValue*>(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<Parent> p)" accept a
+// value of type scoped_ptr<Child> 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<Foo>& 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_

+ 113 - 0
Source/ThirdParty/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_

+ 386 - 0
Source/ThirdParty/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 <cassert>
+
+#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 cef_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 cef_subtle
+
+//
+// A base class for reference counted classes.  Otherwise, known as a cheap
+// knock-off of WebKit's RefCounted<T> class.  To use this guy just extend your
+// class from it like so:
+//
+//   class MyFoo : public base::RefCounted<MyFoo> {
+//    ...
+//    private:
+//     friend class base::RefCounted<MyFoo>;
+//     ~MyFoo();
+//   };
+//
+// You should always make your destructor private, to avoid any code deleting
+// the object accidently while there are references to it.
+template <class T>
+class RefCounted : public cef_subtle::RefCountedBase {
+ public:
+  RefCounted() {}
+
+  void AddRef() const {
+    cef_subtle::RefCountedBase::AddRef();
+  }
+
+  void Release() const {
+    if (cef_subtle::RefCountedBase::Release()) {
+      delete static_cast<const T*>(this);
+    }
+  }
+
+ protected:
+  ~RefCounted() {}
+
+ private:
+  DISALLOW_COPY_AND_ASSIGN(RefCounted<T>);
+};
+
+// Forward declaration.
+template <class T, typename Traits> class RefCountedThreadSafe;
+
+// Default traits for RefCountedThreadSafe<T>.  Deletes the object when its ref
+// count reaches 0.  Overload to delete it on a different thread etc.
+template<typename T>
+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<T,
+                         DefaultRefCountedThreadSafeTraits>::DeleteInternal(x);
+  }
+};
+
+//
+// A thread-safe variant of RefCounted<T>
+//
+//   class MyFoo : public base::RefCountedThreadSafe<MyFoo> {
+//    ...
+//   };
+//
+// 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>;
+//     ~MyFoo();
+template <class T, typename Traits = DefaultRefCountedThreadSafeTraits<T> >
+class RefCountedThreadSafe : public cef_subtle::RefCountedThreadSafeBase {
+ public:
+  RefCountedThreadSafe() {}
+
+  void AddRef() const {
+    cef_subtle::RefCountedThreadSafeBase::AddRef();
+  }
+
+  void Release() const {
+    if (cef_subtle::RefCountedThreadSafeBase::Release()) {
+      Traits::Destruct(static_cast<const T*>(this));
+    }
+  }
+
+ protected:
+  ~RefCountedThreadSafe() {}
+
+ private:
+  friend struct DefaultRefCountedThreadSafeTraits<T>;
+  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<typename T>
+class RefCountedData
+    : public base::RefCountedThreadSafe< base::RefCountedData<T> > {
+ public:
+  RefCountedData() : data() {}
+  RefCountedData(const T& in_value) : data(in_value) {}
+
+  T data;
+
+ private:
+  friend class base::RefCountedThreadSafe<base::RefCountedData<T> >;
+  ~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<MyFoo> {
+//    ...
+//   };
+//
+//   void some_function() {
+//     scoped_refptr<MyFoo> foo = new MyFoo();
+//     foo->Method(param);
+//     // |foo| is released when this function returns
+//   }
+//
+//   void some_other_function() {
+//     scoped_refptr<MyFoo> foo = new MyFoo();
+//     ...
+//     foo = NULL;  // explicitly releases |foo|
+//     ...
+//     if (foo)
+//       foo->Method(param);
+//   }
+//
+// The above examples show how scoped_refptr<T> acts like a pointer to T.
+// Given two scoped_refptr<T> classes, it is also possible to exchange
+// references between the two objects, like so:
+//
+//   {
+//     scoped_refptr<MyFoo> a = new MyFoo();
+//     scoped_refptr<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:
+//
+//   {
+//     scoped_refptr<MyFoo> a = new MyFoo();
+//     scoped_refptr<MyFoo> b;
+//
+//     b = a;
+//     // now, |a| and |b| each own a reference to the same MyFoo object.
+//   }
+//
+template <class T>
+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<T>& r) : ptr_(r.ptr_) {
+    if (ptr_)
+      ptr_->AddRef();
+  }
+
+  template <typename U>
+  scoped_refptr(const scoped_refptr<U>& r) : ptr_(r.get()) {
+    if (ptr_)
+      ptr_->AddRef();
+  }
+
+  ~scoped_refptr() {
+    if (ptr_)
+      ptr_->Release();
+  }
+
+  T* get() const { return ptr_; }
+
+  // Allow scoped_refptr<C> to be used in boolean expression
+  // and comparison operations.
+  operator T*() const { return ptr_; }
+
+  T* operator->() const {
+    assert(ptr_ != NULL);
+    return ptr_;
+  }
+
+  scoped_refptr<T>& 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<T>& operator=(const scoped_refptr<T>& r) {
+    return *this = r.ptr_;
+  }
+
+  template <typename U>
+  scoped_refptr<T>& operator=(const scoped_refptr<U>& r) {
+    return *this = r.get();
+  }
+
+  void swap(T** pp) {
+    T* p = ptr_;
+    ptr_ = *pp;
+    *pp = p;
+  }
+
+  void swap(scoped_refptr<T>& r) {
+    swap(&r.ptr_);
+  }
+
+ protected:
+  T* ptr_;
+};
+
+// Handy utility for creating a scoped_refptr<T> out of a T* explicitly without
+// having to retype all the template arguments
+template <typename T>
+scoped_refptr<T> make_scoped_refptr(T* t) {
+  return scoped_refptr<T>(t);
+}
+
+#endif  // !BUILDING_CEF_SHARED
+
+#endif  // CEF_INCLUDE_BASE_CEF_REF_COUNTED_H_

+ 624 - 0
Source/ThirdParty/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<T>):
+//   {
+//     scoped_ptr<Foo> foo(new Foo("wee"));
+//   }  // foo goes out of scope, releasing the pointer with it.
+//
+//   {
+//     scoped_ptr<Foo> 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<T[]>):
+//   {
+//     scoped_ptr<Foo[]> 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<Foo> arg) {
+//     // Do something with arg
+//   }
+//   scoped_ptr<Foo> CreateFoo() {
+//     // No need for calling Pass() because we are constructing a temporary
+//     // for the return value.
+//     return scoped_ptr<Foo>(new Foo("new"));
+//   }
+//   scoped_ptr<Foo> PassThru(scoped_ptr<Foo> arg) {
+//     return arg.Pass();
+//   }
+//
+//   {
+//     scoped_ptr<Foo> ptr(new Foo("yay"));  // ptr manages Foo("yay").
+//     TakesOwnership(ptr.Pass());           // ptr no longer owns Foo("yay").
+//     scoped_ptr<Foo> ptr2 = CreateFoo();   // ptr2 owns the return Foo.
+//     scoped_ptr<Foo> 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<Child> to initialize a scoped_ptr<Parent>:
+//
+//   scoped_ptr<Foo> foo(new Foo());
+//   scoped_ptr<FooParent> parent(foo.Pass());
+//
+// PassAs<>() should be used to upcast return value in return statement:
+//
+//   scoped_ptr<Foo> CreateFoo() {
+//     scoped_ptr<FooChild> result(new FooChild());
+//     return result.PassAs<Foo>();
+//   }
+//
+// Note that PassAs<>() is implemented only for scoped_ptr<T>, but not for
+// scoped_ptr<T[]>. 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 <assert.h>
+#include <stddef.h>
+#include <stdlib.h>
+
+#include <algorithm>  // 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<T>.
+template <class T>
+struct DefaultDeleter {
+  DefaultDeleter() {}
+  template <typename U> DefaultDeleter(const DefaultDeleter<U>& 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<U*, T*> 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<U*, T*>::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 <class T>
+struct DefaultDeleter<T[]> {
+  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 <typename U> void operator()(U* array) const;
+};
+
+template <class T, int n>
+struct DefaultDeleter<T[n]> {
+  // Never allow someone to declare something like scoped_ptr<int[10]>.
+  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<int, base::FreeDeleter> foo_ptr(
+//     static_cast<int*>(malloc(sizeof(int))));
+struct FreeDeleter {
+  inline void operator()(void* ptr) const {
+    free(ptr);
+  }
+};
+
+namespace cef_internal {
+
+template <typename T> struct IsNotRefCounted {
+  enum {
+    value = !base::is_convertible<T*, base::subtle::RefCountedBase*>::value &&
+        !base::is_convertible<T*, base::subtle::RefCountedThreadSafeBase*>::
+            value
+  };
+};
+
+// Minimal implementation of the core logic of scoped_ptr, suitable for
+// reuse in both scoped_ptr and its specializations.
+template <class T, class D>
+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 <typename U, typename V>
+  scoped_ptr_impl(scoped_ptr_impl<U, V>* 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 <typename U, typename V>
+  void TakeState(scoped_ptr_impl<U, V>* 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<D&>(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<D&>(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<D&>(data_), static_cast<D&>(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 <typename U, typename V> 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<T> is like a T*, except that the destructor of scoped_ptr<T>
+// automatically deletes the pointer it holds (if any).
+// That is, scoped_ptr<T> owns the T object that it points to.
+// Like a T*, a scoped_ptr<T> may hold either NULL or a pointer to a T object.
+// Also like T*, scoped_ptr<T> 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<T>) == 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 T, class D = base::DefaultDeleter<T> >
+class scoped_ptr {
+  MOVE_ONLY_TYPE_FOR_CPP_03(scoped_ptr, RValue)
+
+  COMPILE_ASSERT(base::cef_internal::IsNotRefCounted<T>::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 <typename U, typename V>
+  scoped_ptr(scoped_ptr<U, V> other) : impl_(&other.impl_) {
+    COMPILE_ASSERT(!base::is_array<U>::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 <typename U, typename V>
+  scoped_ptr& operator=(scoped_ptr<U, V> rhs) {
+    COMPILE_ASSERT(!base::is_array<U>::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<element_type> 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<element_type, deleter_type>
+      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 <typename PassAsType>
+  scoped_ptr<PassAsType> PassAs() {
+    return scoped_ptr<PassAsType>(Pass());
+  }
+
+ private:
+  // Needed to reach into |impl_| in the constructor.
+  template <typename U, typename V> friend class scoped_ptr;
+  base::cef_internal::scoped_ptr_impl<element_type, deleter_type> 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 <class U> bool operator==(scoped_ptr<U> const& p2) const;
+  template <class U> bool operator!=(scoped_ptr<U> const& p2) const;
+};
+
+template <class T, class D>
+class scoped_ptr<T[], D> {
+  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<const T*>().
+  //   However, because of the first bullet in this comment, users MUST
+  //   NOT use implicit_cast<Base*>() 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<element_type> 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<element_type, deleter_type>
+      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<element_type, deleter_type> 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 <typename U> 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 <typename U> 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 <class U> bool operator==(scoped_ptr<U> const& p2) const;
+  template <class U> bool operator!=(scoped_ptr<U> const& p2) const;
+};
+
+// Free functions
+template <class T, class D>
+void swap(scoped_ptr<T, D>& p1, scoped_ptr<T, D>& p2) {
+  p1.swap(p2);
+}
+
+template <class T, class D>
+bool operator==(T* p1, const scoped_ptr<T, D>& p2) {
+  return p1 == p2.get();
+}
+
+template <class T, class D>
+bool operator!=(T* p1, const scoped_ptr<T, D>& p2) {
+  return p1 != p2.get();
+}
+
+// A function to convert T* into scoped_ptr<T>
+// Doing e.g. make_scoped_ptr(new FooBarBaz<type>(arg)) is a shorter notation
+// for scoped_ptr<FooBarBaz<type> >(new FooBarBaz<type>(arg))
+template <typename T>
+scoped_ptr<T> make_scoped_ptr(T* ptr) {
+  return scoped_ptr<T>(ptr);
+}
+
+#endif  // !BUILDING_CEF_SHARED
+
+#endif  // CEF_INCLUDE_BASE_CEF_MEMORY_SCOPED_PTR_H_

+ 227 - 0
Source/ThirdParty/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 <stdio.h>
+#include <string>
+
+#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<wchar_t> string16_char_traits;
+
+}  // namespace base
+
+#elif defined(WCHAR_T_IS_UTF32)
+
+#include <stdint.h>  // 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<state_type> 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<int_type>(EOF);
+  }
+};
+
+typedef std::basic_string<char16, base::string16_char_traits> 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<char> (string) and std::basic_string<wchar_t> (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<base::char16, base::string16_char_traits>;
+
+#endif  // WCHAR_T_IS_UTF32
+
+#endif  // !BUILDING_CEF_SHARED
+
+#endif  // CEF_INCLUDE_BASE_CEF_STRING16_H_

+ 192 - 0
Source/ThirdParty/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 <cstddef>  // For size_t.
+
+#include "include/base/cef_build.h"
+
+namespace base {
+
+// template definitions from tr1
+
+template<class T, T v>
+struct integral_constant {
+  static const T value = v;
+  typedef T value_type;
+  typedef integral_constant<T, v> type;
+};
+
+template <class T, T v> const T integral_constant<T, v>::value;
+
+typedef integral_constant<bool, true> true_type;
+typedef integral_constant<bool, false> false_type;
+
+template <class T> struct is_pointer : false_type {};
+template <class T> struct is_pointer<T*> : 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<typename T>
+struct is_member_function_pointer : false_type {};
+
+template <typename R, typename Z>
+struct is_member_function_pointer<R(Z::*)()> : true_type {};
+template <typename R, typename Z>
+struct is_member_function_pointer<R(Z::*)() const> : true_type {};
+
+template <typename R, typename Z, typename A>
+struct is_member_function_pointer<R(Z::*)(A)> : true_type {};
+template <typename R, typename Z, typename A>
+struct is_member_function_pointer<R(Z::*)(A) const> : true_type {};
+
+template <typename R, typename Z, typename A, typename B>
+struct is_member_function_pointer<R(Z::*)(A, B)> : true_type {};
+template <typename R, typename Z, typename A, typename B>
+struct is_member_function_pointer<R(Z::*)(A, B) const> : true_type {};
+
+template <typename R, typename Z, typename A, typename B, typename C>
+struct is_member_function_pointer<R(Z::*)(A, B, C)> : true_type {};
+template <typename R, typename Z, typename A, typename B, typename C>
+struct is_member_function_pointer<R(Z::*)(A, B, C) const> : true_type {};
+
+template <typename R, typename Z, typename A, typename B, typename C,
+          typename D>
+struct is_member_function_pointer<R(Z::*)(A, B, C, D)> : true_type {};
+template <typename R, typename Z, typename A, typename B, typename C,
+          typename D>
+struct is_member_function_pointer<R(Z::*)(A, B, C, D) const> : true_type {};
+
+
+template <class T, class U> struct is_same : public false_type {};
+template <class T> struct is_same<T,T> : true_type {};
+
+template<class> struct is_array : public false_type {};
+template<class T, size_t n> struct is_array<T[n]> : public true_type {};
+template<class T> struct is_array<T[]> : public true_type {};
+
+template <class T> struct is_non_const_reference : false_type {};
+template <class T> struct is_non_const_reference<T&> : true_type {};
+template <class T> struct is_non_const_reference<const T&> : false_type {};
+
+template <class T> struct is_const : false_type {};
+template <class T> struct is_const<const T> : true_type {};
+
+template <class T> struct is_void : false_type {};
+template <> struct is_void<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 <typename To>
+  static YesType Test(To);
+
+  template <typename To>
+  static NoType Test(...);
+
+  template <typename From>
+  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 <typename C>
+  static YesType Test(void(C::*)(void));
+
+  template <typename C>
+  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 <typename From, typename To>
+struct is_convertible
+    : integral_constant<bool,
+                        sizeof(cef_internal::ConvertHelper::Test<To>(
+                                   cef_internal::ConvertHelper::Create<From>())) ==
+                        sizeof(cef_internal::YesType)> {
+};
+
+template <typename T>
+struct is_class
+    : integral_constant<bool,
+                        sizeof(cef_internal::IsClassHelper::Test<T>(0)) ==
+                            sizeof(cef_internal::YesType)> {
+};
+
+template<bool B, class T = void>
+struct enable_if {};
+
+template<class T>
+struct enable_if<true, T> { typedef T type; };
+
+}  // namespace base
+
+#endif  // !BUILDING_CEF_SHARED
+
+#endif  // CEF_INCLUDE_BASE_CEF_TEMPLATE_UTIL_H_

+ 125 - 0
Source/ThirdParty/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_

+ 287 - 0
Source/ThirdParty/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 <memory>
+
+#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_

+ 427 - 0
Source/ThirdParty/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_

+ 1407 - 0
Source/ThirdParty/CEF/include/base/cef_tuple.h

@@ -0,0 +1,1407 @@
+// 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<int, const char*> tuple_a(1, "wee");
+//   Tuple2<int, const char*> 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.
+
+namespace base {
+
+#define DEFINE_TUPLE_LEAF(N, x)                                        \
+  template <typename T>                                                \
+  struct TupleLeaf<N, T> {                                             \
+    TupleLeaf() {}                                                     \
+    explicit TupleLeaf(typename TupleTraits<T>::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 <typename A>
+using Tuple1 = Tuple<A>;
+template <typename A, typename B>
+using Tuple2 = Tuple<A, B>;
+template <typename A, typename B, typename C>
+using Tuple3 = Tuple<A, B, C>;
+template <typename A, typename B, typename C, typename D>
+using Tuple4 = Tuple<A, B, C, D>;
+template <typename A, typename B, typename C, typename D, typename E>
+using Tuple5 = Tuple<A, B, C, D, E>;
+template <typename A,
+          typename B,
+          typename C,
+          typename D,
+          typename E,
+          typename F>
+using Tuple6 = Tuple<A, B, C, D, E, F>;
+template <typename A,
+          typename B,
+          typename C,
+          typename D,
+          typename E,
+          typename F,
+          typename G>
+using Tuple7 = Tuple<A, B, C, D, E, F, G>;
+template <typename A,
+          typename B,
+          typename C,
+          typename D,
+          typename E,
+          typename F,
+          typename G,
+          typename H>
+using Tuple8 = Tuple<A, B, C, D, E, F, G, H>;
+
+}  // namespace base
+
+#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"
+
+namespace base {
+
+// 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 <class P>
+struct TupleTraits {
+  typedef P ValueType;
+  typedef P& RefType;
+  typedef const P& ParamType;
+};
+
+template <class P>
+struct TupleTraits<P&> {
+  typedef P ValueType;
+  typedef P& RefType;
+  typedef P& ParamType;
+};
+
+template <class P>
+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<A> 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 <class A>
+struct Tuple1 {
+ public:
+  typedef A TypeA;
+
+  Tuple1() {}
+  explicit Tuple1(typename TupleTraits<A>::ParamType a) : a(a) {}
+
+  A a;
+};
+
+template <class A, class B>
+struct Tuple2 {
+ public:
+  typedef A TypeA;
+  typedef B TypeB;
+
+  Tuple2() {}
+  Tuple2(typename TupleTraits<A>::ParamType a,
+         typename TupleTraits<B>::ParamType b)
+      : a(a), b(b) {
+  }
+
+  A a;
+  B b;
+};
+
+template <class A, class B, class C>
+struct Tuple3 {
+ public:
+  typedef A TypeA;
+  typedef B TypeB;
+  typedef C TypeC;
+
+  Tuple3() {}
+  Tuple3(typename TupleTraits<A>::ParamType a,
+         typename TupleTraits<B>::ParamType b,
+         typename TupleTraits<C>::ParamType c)
+      : a(a), b(b), c(c){
+  }
+
+  A a;
+  B b;
+  C c;
+};
+
+template <class A, class B, class C, class D>
+struct Tuple4 {
+ public:
+  typedef A TypeA;
+  typedef B TypeB;
+  typedef C TypeC;
+  typedef D TypeD;
+
+  Tuple4() {}
+  Tuple4(typename TupleTraits<A>::ParamType a,
+         typename TupleTraits<B>::ParamType b,
+         typename TupleTraits<C>::ParamType c,
+         typename TupleTraits<D>::ParamType d)
+      : a(a), b(b), c(c), d(d) {
+  }
+
+  A a;
+  B b;
+  C c;
+  D d;
+};
+
+template <class A, class B, class C, class D, class E>
+struct Tuple5 {
+ public:
+  typedef A TypeA;
+  typedef B TypeB;
+  typedef C TypeC;
+  typedef D TypeD;
+  typedef E TypeE;
+
+  Tuple5() {}
+  Tuple5(typename TupleTraits<A>::ParamType a,
+    typename TupleTraits<B>::ParamType b,
+    typename TupleTraits<C>::ParamType c,
+    typename TupleTraits<D>::ParamType d,
+    typename TupleTraits<E>::ParamType e)
+    : a(a), b(b), c(c), d(d), e(e) {
+  }
+
+  A a;
+  B b;
+  C c;
+  D d;
+  E e;
+};
+
+template <class A, class B, class C, class D, class E, class F>
+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<A>::ParamType a,
+    typename TupleTraits<B>::ParamType b,
+    typename TupleTraits<C>::ParamType c,
+    typename TupleTraits<D>::ParamType d,
+    typename TupleTraits<E>::ParamType e,
+    typename TupleTraits<F>::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 <class A, class B, class C, class D, class E, class F, class G>
+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<A>::ParamType a,
+    typename TupleTraits<B>::ParamType b,
+    typename TupleTraits<C>::ParamType c,
+    typename TupleTraits<D>::ParamType d,
+    typename TupleTraits<E>::ParamType e,
+    typename TupleTraits<F>::ParamType f,
+    typename TupleTraits<G>::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 <class A, class B, class C, class D, class E, class F, class G,
+          class H>
+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<A>::ParamType a,
+    typename TupleTraits<B>::ParamType b,
+    typename TupleTraits<C>::ParamType c,
+    typename TupleTraits<D>::ParamType d,
+    typename TupleTraits<E>::ParamType e,
+    typename TupleTraits<F>::ParamType f,
+    typename TupleTraits<G>::ParamType g,
+    typename TupleTraits<H>::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 <class A>
+struct TupleTypes< Tuple1<A> > {
+  typedef Tuple1<typename TupleTraits<A>::ValueType> ValueTuple;
+  typedef Tuple1<typename TupleTraits<A>::RefType> RefTuple;
+  typedef Tuple1<typename TupleTraits<A>::ParamType> ParamTuple;
+};
+
+template <class A, class B>
+struct TupleTypes< Tuple2<A, B> > {
+  typedef Tuple2<typename TupleTraits<A>::ValueType,
+                 typename TupleTraits<B>::ValueType> ValueTuple;
+typedef Tuple2<typename TupleTraits<A>::RefType,
+               typename TupleTraits<B>::RefType> RefTuple;
+  typedef Tuple2<typename TupleTraits<A>::ParamType,
+                 typename TupleTraits<B>::ParamType> ParamTuple;
+};
+
+template <class A, class B, class C>
+struct TupleTypes< Tuple3<A, B, C> > {
+  typedef Tuple3<typename TupleTraits<A>::ValueType,
+                 typename TupleTraits<B>::ValueType,
+                 typename TupleTraits<C>::ValueType> ValueTuple;
+typedef Tuple3<typename TupleTraits<A>::RefType,
+               typename TupleTraits<B>::RefType,
+               typename TupleTraits<C>::RefType> RefTuple;
+  typedef Tuple3<typename TupleTraits<A>::ParamType,
+                 typename TupleTraits<B>::ParamType,
+                 typename TupleTraits<C>::ParamType> ParamTuple;
+};
+
+template <class A, class B, class C, class D>
+struct TupleTypes< Tuple4<A, B, C, D> > {
+  typedef Tuple4<typename TupleTraits<A>::ValueType,
+                 typename TupleTraits<B>::ValueType,
+                 typename TupleTraits<C>::ValueType,
+                 typename TupleTraits<D>::ValueType> ValueTuple;
+typedef Tuple4<typename TupleTraits<A>::RefType,
+               typename TupleTraits<B>::RefType,
+               typename TupleTraits<C>::RefType,
+               typename TupleTraits<D>::RefType> RefTuple;
+  typedef Tuple4<typename TupleTraits<A>::ParamType,
+                 typename TupleTraits<B>::ParamType,
+                 typename TupleTraits<C>::ParamType,
+                 typename TupleTraits<D>::ParamType> ParamTuple;
+};
+
+template <class A, class B, class C, class D, class E>
+struct TupleTypes< Tuple5<A, B, C, D, E> > {
+  typedef Tuple5<typename TupleTraits<A>::ValueType,
+                 typename TupleTraits<B>::ValueType,
+                 typename TupleTraits<C>::ValueType,
+                 typename TupleTraits<D>::ValueType,
+                 typename TupleTraits<E>::ValueType> ValueTuple;
+typedef Tuple5<typename TupleTraits<A>::RefType,
+               typename TupleTraits<B>::RefType,
+               typename TupleTraits<C>::RefType,
+               typename TupleTraits<D>::RefType,
+               typename TupleTraits<E>::RefType> RefTuple;
+  typedef Tuple5<typename TupleTraits<A>::ParamType,
+                 typename TupleTraits<B>::ParamType,
+                 typename TupleTraits<C>::ParamType,
+                 typename TupleTraits<D>::ParamType,
+                 typename TupleTraits<E>::ParamType> ParamTuple;
+};
+
+template <class A, class B, class C, class D, class E, class F>
+struct TupleTypes< Tuple6<A, B, C, D, E, F> > {
+  typedef Tuple6<typename TupleTraits<A>::ValueType,
+                 typename TupleTraits<B>::ValueType,
+                 typename TupleTraits<C>::ValueType,
+                 typename TupleTraits<D>::ValueType,
+                 typename TupleTraits<E>::ValueType,
+                 typename TupleTraits<F>::ValueType> ValueTuple;
+typedef Tuple6<typename TupleTraits<A>::RefType,
+               typename TupleTraits<B>::RefType,
+               typename TupleTraits<C>::RefType,
+               typename TupleTraits<D>::RefType,
+               typename TupleTraits<E>::RefType,
+               typename TupleTraits<F>::RefType> RefTuple;
+  typedef Tuple6<typename TupleTraits<A>::ParamType,
+                 typename TupleTraits<B>::ParamType,
+                 typename TupleTraits<C>::ParamType,
+                 typename TupleTraits<D>::ParamType,
+                 typename TupleTraits<E>::ParamType,
+                 typename TupleTraits<F>::ParamType> ParamTuple;
+};
+
+template <class A, class B, class C, class D, class E, class F, class G>
+struct TupleTypes< Tuple7<A, B, C, D, E, F, G> > {
+  typedef Tuple7<typename TupleTraits<A>::ValueType,
+                 typename TupleTraits<B>::ValueType,
+                 typename TupleTraits<C>::ValueType,
+                 typename TupleTraits<D>::ValueType,
+                 typename TupleTraits<E>::ValueType,
+                 typename TupleTraits<F>::ValueType,
+                 typename TupleTraits<G>::ValueType> ValueTuple;
+typedef Tuple7<typename TupleTraits<A>::RefType,
+               typename TupleTraits<B>::RefType,
+               typename TupleTraits<C>::RefType,
+               typename TupleTraits<D>::RefType,
+               typename TupleTraits<E>::RefType,
+               typename TupleTraits<F>::RefType,
+               typename TupleTraits<G>::RefType> RefTuple;
+  typedef Tuple7<typename TupleTraits<A>::ParamType,
+                 typename TupleTraits<B>::ParamType,
+                 typename TupleTraits<C>::ParamType,
+                 typename TupleTraits<D>::ParamType,
+                 typename TupleTraits<E>::ParamType,
+                 typename TupleTraits<F>::ParamType,
+                 typename TupleTraits<G>::ParamType> ParamTuple;
+};
+
+template <class A, class B, class C, class D, class E, class F, class G,
+          class H>
+struct TupleTypes< Tuple8<A, B, C, D, E, F, G, H> > {
+  typedef Tuple8<typename TupleTraits<A>::ValueType,
+                 typename TupleTraits<B>::ValueType,
+                 typename TupleTraits<C>::ValueType,
+                 typename TupleTraits<D>::ValueType,
+                 typename TupleTraits<E>::ValueType,
+                 typename TupleTraits<F>::ValueType,
+                 typename TupleTraits<G>::ValueType,
+                 typename TupleTraits<H>::ValueType> ValueTuple;
+typedef Tuple8<typename TupleTraits<A>::RefType,
+               typename TupleTraits<B>::RefType,
+               typename TupleTraits<C>::RefType,
+               typename TupleTraits<D>::RefType,
+               typename TupleTraits<E>::RefType,
+               typename TupleTraits<F>::RefType,
+               typename TupleTraits<G>::RefType,
+               typename TupleTraits<H>::RefType> RefTuple;
+  typedef Tuple8<typename TupleTraits<A>::ParamType,
+                 typename TupleTraits<B>::ParamType,
+                 typename TupleTraits<C>::ParamType,
+                 typename TupleTraits<D>::ParamType,
+                 typename TupleTraits<E>::ParamType,
+                 typename TupleTraits<F>::ParamType,
+                 typename TupleTraits<G>::ParamType,
+                 typename TupleTraits<H>::ParamType> ParamTuple;
+};
+
+// Tuple creators -------------------------------------------------------------
+//
+// Helper functions for constructing tuples while inferring the template
+// argument types.
+
+inline Tuple0 MakeTuple() {
+  return Tuple0();
+}
+
+template <class A>
+inline Tuple1<A> MakeTuple(const A& a) {
+  return Tuple1<A>(a);
+}
+
+template <class A, class B>
+inline Tuple2<A, B> MakeTuple(const A& a, const B& b) {
+  return Tuple2<A, B>(a, b);
+}
+
+template <class A, class B, class C>
+inline Tuple3<A, B, C> MakeTuple(const A& a, const B& b, const C& c) {
+  return Tuple3<A, B, C>(a, b, c);
+}
+
+template <class A, class B, class C, class D>
+inline Tuple4<A, B, C, D> MakeTuple(const A& a, const B& b, const C& c,
+                                    const D& d) {
+  return Tuple4<A, B, C, D>(a, b, c, d);
+}
+
+template <class A, class B, class C, class D, class E>
+inline Tuple5<A, B, C, D, E> MakeTuple(const A& a, const B& b, const C& c,
+                                       const D& d, const E& e) {
+  return Tuple5<A, B, C, D, E>(a, b, c, d, e);
+}
+
+template <class A, class B, class C, class D, class E, class F>
+inline Tuple6<A, B, C, D, E, F> 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>(a, b, c, d, e, f);
+}
+
+template <class A, class B, class C, class D, class E, class F, class G>
+inline Tuple7<A, B, C, D, E, F, G> 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>(a, b, c, d, e, f, g);
+}
+
+template <class A, class B, class C, class D, class E, class F, class G,
+          class H>
+inline Tuple8<A, B, C, D, E, F, G, H> 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>(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 <class A>
+inline Tuple1<A&> MakeRefTuple(A& a) {
+  return Tuple1<A&>(a);
+}
+
+template <class A, class B>
+inline Tuple2<A&, B&> MakeRefTuple(A& a, B& b) {
+  return Tuple2<A&, B&>(a, b);
+}
+
+template <class A, class B, class C>
+inline Tuple3<A&, B&, C&> MakeRefTuple(A& a, B& b, C& c) {
+  return Tuple3<A&, B&, C&>(a, b, c);
+}
+
+template <class A, class B, class C, class D>
+inline Tuple4<A&, B&, C&, D&> MakeRefTuple(A& a, B& b, C& c, D& d) {
+  return Tuple4<A&, B&, C&, D&>(a, b, c, d);
+}
+
+template <class A, class B, class C, class D, class E>
+inline Tuple5<A&, B&, C&, D&, E&> MakeRefTuple(A& a, B& b, C& c, D& d, E& e) {
+  return Tuple5<A&, B&, C&, D&, E&>(a, b, c, d, e);
+}
+
+template <class A, class B, class C, class D, class E, class F>
+inline Tuple6<A&, B&, C&, D&, E&, F&> MakeRefTuple(A& a, B& b, C& c, D& d, E& e,
+                                                   F& f) {
+  return Tuple6<A&, B&, C&, D&, E&, F&>(a, b, c, d, e, f);
+}
+
+template <class A, class B, class C, class D, class E, class F, class G>
+inline Tuple7<A&, B&, C&, D&, E&, F&, G&> MakeRefTuple(A& a, B& b, C& c, D& d,
+                                                       E& e, F& f, G& g) {
+  return Tuple7<A&, B&, C&, D&, E&, F&, G&>(a, b, c, d, e, f, g);
+}
+
+template <class A, class B, class C, class D, class E, class F, class G,
+          class H>
+inline Tuple8<A&, B&, C&, D&, E&, F&, G&, H&> 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&>(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 <class ObjT, class Method>
+inline void DispatchToMethod(ObjT* obj, Method method, const Tuple0& arg) {
+  (obj->*method)();
+}
+
+template <class ObjT, class Method, class A>
+inline void DispatchToMethod(ObjT* obj, Method method, const A& arg) {
+  (obj->*method)(base::cef_internal::UnwrapTraits<A>::Unwrap(arg));
+}
+
+template <class ObjT, class Method, class A>
+inline void DispatchToMethod(ObjT* obj, Method method, const Tuple1<A>& arg) {
+  (obj->*method)(base::cef_internal::UnwrapTraits<A>::Unwrap(arg.a));
+}
+
+template<class ObjT, class Method, class A, class B>
+inline void DispatchToMethod(ObjT* obj,
+                             Method method,
+                             const Tuple2<A, B>& arg) {
+  (obj->*method)(base::cef_internal::UnwrapTraits<A>::Unwrap(arg.a),
+                 base::cef_internal::UnwrapTraits<B>::Unwrap(arg.b));
+}
+
+template<class ObjT, class Method, class A, class B, class C>
+inline void DispatchToMethod(ObjT* obj, Method method,
+                             const Tuple3<A, B, C>& arg) {
+  (obj->*method)(base::cef_internal::UnwrapTraits<A>::Unwrap(arg.a),
+                 base::cef_internal::UnwrapTraits<B>::Unwrap(arg.b),
+                 base::cef_internal::UnwrapTraits<C>::Unwrap(arg.c));
+}
+
+template<class ObjT, class Method, class A, class B, class C, class D>
+inline void DispatchToMethod(ObjT* obj, Method method,
+                             const Tuple4<A, B, C, D>& arg) {
+  (obj->*method)(base::cef_internal::UnwrapTraits<A>::Unwrap(arg.a),
+                 base::cef_internal::UnwrapTraits<B>::Unwrap(arg.b),
+                 base::cef_internal::UnwrapTraits<C>::Unwrap(arg.c),
+                 base::cef_internal::UnwrapTraits<D>::Unwrap(arg.d));
+}
+
+template<class ObjT, class Method, class A, class B, class C, class D, class E>
+inline void DispatchToMethod(ObjT* obj, Method method,
+                             const Tuple5<A, B, C, D, E>& arg) {
+  (obj->*method)(base::cef_internal::UnwrapTraits<A>::Unwrap(arg.a),
+                 base::cef_internal::UnwrapTraits<B>::Unwrap(arg.b),
+                 base::cef_internal::UnwrapTraits<C>::Unwrap(arg.c),
+                 base::cef_internal::UnwrapTraits<D>::Unwrap(arg.d),
+                 base::cef_internal::UnwrapTraits<E>::Unwrap(arg.e));
+}
+
+template<class ObjT, class Method, class A, class B, class C, class D, class E,
+         class F>
+inline void DispatchToMethod(ObjT* obj, Method method,
+                             const Tuple6<A, B, C, D, E, F>& arg) {
+  (obj->*method)(base::cef_internal::UnwrapTraits<A>::Unwrap(arg.a),
+                 base::cef_internal::UnwrapTraits<B>::Unwrap(arg.b),
+                 base::cef_internal::UnwrapTraits<C>::Unwrap(arg.c),
+                 base::cef_internal::UnwrapTraits<D>::Unwrap(arg.d),
+                 base::cef_internal::UnwrapTraits<E>::Unwrap(arg.e),
+                 base::cef_internal::UnwrapTraits<F>::Unwrap(arg.f));
+}
+
+template<class ObjT, class Method, class A, class B, class C, class D, class E,
+         class F, class G>
+inline void DispatchToMethod(ObjT* obj, Method method,
+                             const Tuple7<A, B, C, D, E, F, G>& arg) {
+  (obj->*method)(base::cef_internal::UnwrapTraits<A>::Unwrap(arg.a),
+                 base::cef_internal::UnwrapTraits<B>::Unwrap(arg.b),
+                 base::cef_internal::UnwrapTraits<C>::Unwrap(arg.c),
+                 base::cef_internal::UnwrapTraits<D>::Unwrap(arg.d),
+                 base::cef_internal::UnwrapTraits<E>::Unwrap(arg.e),
+                 base::cef_internal::UnwrapTraits<F>::Unwrap(arg.f),
+                 base::cef_internal::UnwrapTraits<G>::Unwrap(arg.g));
+}
+
+template<class ObjT, class Method, class A, class B, class C, class D, class E,
+         class F, class G, class H>
+inline void DispatchToMethod(ObjT* obj, Method method,
+                             const Tuple8<A, B, C, D, E, F, G, H>& arg) {
+  (obj->*method)(base::cef_internal::UnwrapTraits<A>::Unwrap(arg.a),
+                 base::cef_internal::UnwrapTraits<B>::Unwrap(arg.b),
+                 base::cef_internal::UnwrapTraits<C>::Unwrap(arg.c),
+                 base::cef_internal::UnwrapTraits<D>::Unwrap(arg.d),
+                 base::cef_internal::UnwrapTraits<E>::Unwrap(arg.e),
+                 base::cef_internal::UnwrapTraits<F>::Unwrap(arg.f),
+                 base::cef_internal::UnwrapTraits<G>::Unwrap(arg.g),
+                 base::cef_internal::UnwrapTraits<H>::Unwrap(arg.h));
+}
+
+// Static Dispatchers with no out params.
+
+template <class Function>
+inline void DispatchToFunction(Function function, const Tuple0& arg) {
+  (*function)();
+}
+
+template <class Function, class A>
+inline void DispatchToFunction(Function function, const A& arg) {
+  (*function)(arg);
+}
+
+template <class Function, class A>
+inline void DispatchToFunction(Function function, const Tuple1<A>& arg) {
+  (*function)(base::cef_internal::UnwrapTraits<A>::Unwrap(arg.a));
+}
+
+template<class Function, class A, class B>
+inline void DispatchToFunction(Function function, const Tuple2<A, B>& arg) {
+  (*function)(base::cef_internal::UnwrapTraits<A>::Unwrap(arg.a),
+              base::cef_internal::UnwrapTraits<B>::Unwrap(arg.b));
+}
+
+template<class Function, class A, class B, class C>
+inline void DispatchToFunction(Function function, const Tuple3<A, B, C>& arg) {
+  (*function)(base::cef_internal::UnwrapTraits<A>::Unwrap(arg.a),
+              base::cef_internal::UnwrapTraits<B>::Unwrap(arg.b),
+              base::cef_internal::UnwrapTraits<C>::Unwrap(arg.c));
+}
+
+template<class Function, class A, class B, class C, class D>
+inline void DispatchToFunction(Function function,
+                               const Tuple4<A, B, C, D>& arg) {
+  (*function)(base::cef_internal::UnwrapTraits<A>::Unwrap(arg.a),
+              base::cef_internal::UnwrapTraits<B>::Unwrap(arg.b),
+              base::cef_internal::UnwrapTraits<C>::Unwrap(arg.c),
+              base::cef_internal::UnwrapTraits<D>::Unwrap(arg.d));
+}
+
+template<class Function, class A, class B, class C, class D, class E>
+inline void DispatchToFunction(Function function,
+                               const Tuple5<A, B, C, D, E>& arg) {
+  (*function)(base::cef_internal::UnwrapTraits<A>::Unwrap(arg.a),
+              base::cef_internal::UnwrapTraits<B>::Unwrap(arg.b),
+              base::cef_internal::UnwrapTraits<C>::Unwrap(arg.c),
+              base::cef_internal::UnwrapTraits<D>::Unwrap(arg.d),
+              base::cef_internal::UnwrapTraits<E>::Unwrap(arg.e));
+}
+
+template<class Function, class A, class B, class C, class D, class E, class F>
+inline void DispatchToFunction(Function function,
+                               const Tuple6<A, B, C, D, E, F>& arg) {
+  (*function)(base::cef_internal::UnwrapTraits<A>::Unwrap(arg.a),
+              base::cef_internal::UnwrapTraits<B>::Unwrap(arg.b),
+              base::cef_internal::UnwrapTraits<C>::Unwrap(arg.c),
+              base::cef_internal::UnwrapTraits<D>::Unwrap(arg.d),
+              base::cef_internal::UnwrapTraits<E>::Unwrap(arg.e),
+              base::cef_internal::UnwrapTraits<F>::Unwrap(arg.f));
+}
+
+template<class Function, class A, class B, class C, class D, class E, class F,
+         class G>
+inline void DispatchToFunction(Function function,
+                               const Tuple7<A, B, C, D, E, F, G>& arg) {
+  (*function)(base::cef_internal::UnwrapTraits<A>::Unwrap(arg.a),
+              base::cef_internal::UnwrapTraits<B>::Unwrap(arg.b),
+              base::cef_internal::UnwrapTraits<C>::Unwrap(arg.c),
+              base::cef_internal::UnwrapTraits<D>::Unwrap(arg.d),
+              base::cef_internal::UnwrapTraits<E>::Unwrap(arg.e),
+              base::cef_internal::UnwrapTraits<F>::Unwrap(arg.f),
+              base::cef_internal::UnwrapTraits<G>::Unwrap(arg.g));
+}
+
+template<class Function, class A, class B, class C, class D, class E, class F,
+         class G, class H>
+inline void DispatchToFunction(Function function,
+                               const Tuple8<A, B, C, D, E, F, G, H>& arg) {
+  (*function)(base::cef_internal::UnwrapTraits<A>::Unwrap(arg.a),
+              base::cef_internal::UnwrapTraits<B>::Unwrap(arg.b),
+              base::cef_internal::UnwrapTraits<C>::Unwrap(arg.c),
+              base::cef_internal::UnwrapTraits<D>::Unwrap(arg.d),
+              base::cef_internal::UnwrapTraits<E>::Unwrap(arg.e),
+              base::cef_internal::UnwrapTraits<F>::Unwrap(arg.f),
+              base::cef_internal::UnwrapTraits<G>::Unwrap(arg.g),
+              base::cef_internal::UnwrapTraits<H>::Unwrap(arg.h));
+}
+
+// Dispatchers with 0 out param (as a Tuple0).
+
+template <class ObjT, class Method>
+inline void DispatchToMethod(ObjT* obj,
+                             Method method,
+                             const Tuple0& arg, Tuple0*) {
+  (obj->*method)();
+}
+
+template <class ObjT, class Method, class A>
+inline void DispatchToMethod(ObjT* obj, Method method, const A& arg, Tuple0*) {
+  (obj->*method)(base::cef_internal::UnwrapTraits<A>::Unwrap(arg));
+}
+
+template <class ObjT, class Method, class A>
+inline void DispatchToMethod(ObjT* obj,
+                             Method method,
+                             const Tuple1<A>& arg, Tuple0*) {
+  (obj->*method)(base::cef_internal::UnwrapTraits<A>::Unwrap(arg.a));
+}
+
+template<class ObjT, class Method, class A, class B>
+inline void DispatchToMethod(ObjT* obj,
+                             Method method,
+                             const Tuple2<A, B>& arg, Tuple0*) {
+  (obj->*method)(base::cef_internal::UnwrapTraits<A>::Unwrap(arg.a),
+                 base::cef_internal::UnwrapTraits<B>::Unwrap(arg.b));
+}
+
+template<class ObjT, class Method, class A, class B, class C>
+inline void DispatchToMethod(ObjT* obj, Method method,
+                             const Tuple3<A, B, C>& arg, Tuple0*) {
+  (obj->*method)(base::cef_internal::UnwrapTraits<A>::Unwrap(arg.a),
+                 base::cef_internal::UnwrapTraits<B>::Unwrap(arg.b),
+                 base::cef_internal::UnwrapTraits<C>::Unwrap(arg.c));
+}
+
+template<class ObjT, class Method, class A, class B, class C, class D>
+inline void DispatchToMethod(ObjT* obj, Method method,
+                             const Tuple4<A, B, C, D>& arg, Tuple0*) {
+  (obj->*method)(base::cef_internal::UnwrapTraits<A>::Unwrap(arg.a),
+                 base::cef_internal::UnwrapTraits<B>::Unwrap(arg.b),
+                 base::cef_internal::UnwrapTraits<C>::Unwrap(arg.c),
+                 base::cef_internal::UnwrapTraits<D>::Unwrap(arg.d));
+}
+
+template<class ObjT, class Method, class A, class B, class C, class D, class E>
+inline void DispatchToMethod(ObjT* obj, Method method,
+                             const Tuple5<A, B, C, D, E>& arg, Tuple0*) {
+  (obj->*method)(base::cef_internal::UnwrapTraits<A>::Unwrap(arg.a),
+                 base::cef_internal::UnwrapTraits<B>::Unwrap(arg.b),
+                 base::cef_internal::UnwrapTraits<C>::Unwrap(arg.c),
+                 base::cef_internal::UnwrapTraits<D>::Unwrap(arg.d),
+                 base::cef_internal::UnwrapTraits<E>::Unwrap(arg.e));
+}
+
+template<class ObjT, class Method, class A, class B, class C, class D, class E,
+         class F>
+inline void DispatchToMethod(ObjT* obj, Method method,
+                             const Tuple6<A, B, C, D, E, F>& arg, Tuple0*) {
+  (obj->*method)(base::cef_internal::UnwrapTraits<A>::Unwrap(arg.a),
+                 base::cef_internal::UnwrapTraits<B>::Unwrap(arg.b),
+                 base::cef_internal::UnwrapTraits<C>::Unwrap(arg.c),
+                 base::cef_internal::UnwrapTraits<D>::Unwrap(arg.d),
+                 base::cef_internal::UnwrapTraits<E>::Unwrap(arg.e),
+                 base::cef_internal::UnwrapTraits<F>::Unwrap(arg.f));
+}
+
+// Dispatchers with 1 out param.
+
+template<class ObjT, class Method,
+         class OutA>
+inline void DispatchToMethod(ObjT* obj, Method method,
+                             const Tuple0& in,
+                             Tuple1<OutA>* out) {
+  (obj->*method)(&out->a);
+}
+
+template<class ObjT, class Method, class InA,
+         class OutA>
+inline void DispatchToMethod(ObjT* obj, Method method,
+                             const InA& in,
+                             Tuple1<OutA>* out) {
+  (obj->*method)(in, &out->a);
+}
+
+template<class ObjT, class Method, class InA,
+         class OutA>
+inline void DispatchToMethod(ObjT* obj, Method method,
+                             const Tuple1<InA>& in,
+                             Tuple1<OutA>* out) {
+  (obj->*method)(base::cef_internal::UnwrapTraits<InA>::Unwrap(in.a), &out->a);
+}
+
+template<class ObjT, class Method, class InA, class InB,
+         class OutA>
+inline void DispatchToMethod(ObjT* obj, Method method,
+                             const Tuple2<InA, InB>& in,
+                             Tuple1<OutA>* out) {
+  (obj->*method)(base::cef_internal::UnwrapTraits<InA>::Unwrap(in.a),
+                 base::cef_internal::UnwrapTraits<InB>::Unwrap(in.b),
+                 &out->a);
+}
+
+template<class ObjT, class Method, class InA, class InB, class InC,
+         class OutA>
+inline void DispatchToMethod(ObjT* obj, Method method,
+                             const Tuple3<InA, InB, InC>& in,
+                             Tuple1<OutA>* out) {
+  (obj->*method)(base::cef_internal::UnwrapTraits<InA>::Unwrap(in.a),
+                 base::cef_internal::UnwrapTraits<InB>::Unwrap(in.b),
+                 base::cef_internal::UnwrapTraits<InC>::Unwrap(in.c),
+                 &out->a);
+}
+
+template<class ObjT, class Method, class InA, class InB, class InC, class InD,
+         class OutA>
+inline void DispatchToMethod(ObjT* obj, Method method,
+                             const Tuple4<InA, InB, InC, InD>& in,
+                             Tuple1<OutA>* out) {
+  (obj->*method)(base::cef_internal::UnwrapTraits<InA>::Unwrap(in.a),
+                 base::cef_internal::UnwrapTraits<InB>::Unwrap(in.b),
+                 base::cef_internal::UnwrapTraits<InC>::Unwrap(in.c),
+                 base::cef_internal::UnwrapTraits<InD>::Unwrap(in.d),
+                 &out->a);
+}
+
+template<class ObjT, class Method, class InA, class InB, class InC, class InD,
+         class InE, class OutA>
+inline void DispatchToMethod(ObjT* obj, Method method,
+                             const Tuple5<InA, InB, InC, InD, InE>& in,
+                             Tuple1<OutA>* out) {
+  (obj->*method)(base::cef_internal::UnwrapTraits<InA>::Unwrap(in.a),
+                 base::cef_internal::UnwrapTraits<InB>::Unwrap(in.b),
+                 base::cef_internal::UnwrapTraits<InC>::Unwrap(in.c),
+                 base::cef_internal::UnwrapTraits<InD>::Unwrap(in.d),
+                 base::cef_internal::UnwrapTraits<InE>::Unwrap(in.e),
+                 &out->a);
+}
+
+template<class ObjT, class Method,
+         class InA, class InB, class InC, class InD, class InE, class InF,
+         class OutA>
+inline void DispatchToMethod(ObjT* obj, Method method,
+                             const Tuple6<InA, InB, InC, InD, InE, InF>& in,
+                             Tuple1<OutA>* out) {
+  (obj->*method)(base::cef_internal::UnwrapTraits<InA>::Unwrap(in.a),
+                 base::cef_internal::UnwrapTraits<InB>::Unwrap(in.b),
+                 base::cef_internal::UnwrapTraits<InC>::Unwrap(in.c),
+                 base::cef_internal::UnwrapTraits<InD>::Unwrap(in.d),
+                 base::cef_internal::UnwrapTraits<InE>::Unwrap(in.e),
+                 base::cef_internal::UnwrapTraits<InF>::Unwrap(in.f),
+                 &out->a);
+}
+
+// Dispatchers with 2 out params.
+
+template<class ObjT, class Method,
+         class OutA, class OutB>
+inline void DispatchToMethod(ObjT* obj, Method method,
+                             const Tuple0& in,
+                             Tuple2<OutA, OutB>* out) {
+  (obj->*method)(&out->a, &out->b);
+}
+
+template<class ObjT, class Method, class InA,
+         class OutA, class OutB>
+inline void DispatchToMethod(ObjT* obj, Method method,
+                             const InA& in,
+                             Tuple2<OutA, OutB>* out) {
+  (obj->*method)(in, &out->a, &out->b);
+}
+
+template<class ObjT, class Method, class InA,
+         class OutA, class OutB>
+inline void DispatchToMethod(ObjT* obj, Method method,
+                             const Tuple1<InA>& in,
+                             Tuple2<OutA, OutB>* out) {
+  (obj->*method)(
+      base::cef_internal::UnwrapTraits<InA>::Unwrap(in.a), &out->a, &out->b);
+}
+
+template<class ObjT, class Method, class InA, class InB,
+         class OutA, class OutB>
+inline void DispatchToMethod(ObjT* obj, Method method,
+                             const Tuple2<InA, InB>& in,
+                             Tuple2<OutA, OutB>* out) {
+  (obj->*method)(base::cef_internal::UnwrapTraits<InA>::Unwrap(in.a),
+                 base::cef_internal::UnwrapTraits<InB>::Unwrap(in.b),
+                 &out->a,
+                 &out->b);
+}
+
+template<class ObjT, class Method, class InA, class InB, class InC,
+         class OutA, class OutB>
+inline void DispatchToMethod(ObjT* obj, Method method,
+                             const Tuple3<InA, InB, InC>& in,
+                             Tuple2<OutA, OutB>* out) {
+  (obj->*method)(base::cef_internal::UnwrapTraits<InA>::Unwrap(in.a),
+                 base::cef_internal::UnwrapTraits<InB>::Unwrap(in.b),
+                 base::cef_internal::UnwrapTraits<InC>::Unwrap(in.c),
+                 &out->a,
+                 &out->b);
+}
+
+template<class ObjT, class Method, class InA, class InB, class InC, class InD,
+         class OutA, class OutB>
+inline void DispatchToMethod(ObjT* obj, Method method,
+                             const Tuple4<InA, InB, InC, InD>& in,
+                             Tuple2<OutA, OutB>* out) {
+  (obj->*method)(base::cef_internal::UnwrapTraits<InA>::Unwrap(in.a),
+                 base::cef_internal::UnwrapTraits<InB>::Unwrap(in.b),
+                 base::cef_internal::UnwrapTraits<InC>::Unwrap(in.c),
+                 base::cef_internal::UnwrapTraits<InD>::Unwrap(in.d),
+                 &out->a,
+                 &out->b);
+}
+
+template<class ObjT, class Method,
+         class InA, class InB, class InC, class InD, class InE,
+         class OutA, class OutB>
+inline void DispatchToMethod(ObjT* obj, Method method,
+                             const Tuple5<InA, InB, InC, InD, InE>& in,
+                             Tuple2<OutA, OutB>* out) {
+  (obj->*method)(base::cef_internal::UnwrapTraits<InA>::Unwrap(in.a),
+                 base::cef_internal::UnwrapTraits<InB>::Unwrap(in.b),
+                 base::cef_internal::UnwrapTraits<InC>::Unwrap(in.c),
+                 base::cef_internal::UnwrapTraits<InD>::Unwrap(in.d),
+                 base::cef_internal::UnwrapTraits<InE>::Unwrap(in.e),
+                 &out->a,
+                 &out->b);
+}
+
+template<class ObjT, class Method,
+         class InA, class InB, class InC, class InD, class InE, class InF,
+         class OutA, class OutB>
+inline void DispatchToMethod(ObjT* obj, Method method,
+                             const Tuple6<InA, InB, InC, InD, InE, InF>& in,
+                             Tuple2<OutA, OutB>* out) {
+  (obj->*method)(base::cef_internal::UnwrapTraits<InA>::Unwrap(in.a),
+                 base::cef_internal::UnwrapTraits<InB>::Unwrap(in.b),
+                 base::cef_internal::UnwrapTraits<InC>::Unwrap(in.c),
+                 base::cef_internal::UnwrapTraits<InD>::Unwrap(in.d),
+                 base::cef_internal::UnwrapTraits<InE>::Unwrap(in.e),
+                 base::cef_internal::UnwrapTraits<InF>::Unwrap(in.f),
+                 &out->a,
+                 &out->b);
+}
+
+// Dispatchers with 3 out params.
+
+template<class ObjT, class Method,
+         class OutA, class OutB, class OutC>
+inline void DispatchToMethod(ObjT* obj, Method method,
+                             const Tuple0& in,
+                             Tuple3<OutA, OutB, OutC>* out) {
+  (obj->*method)(&out->a, &out->b, &out->c);
+}
+
+template<class ObjT, class Method, class InA,
+         class OutA, class OutB, class OutC>
+inline void DispatchToMethod(ObjT* obj, Method method,
+                             const InA& in,
+                             Tuple3<OutA, OutB, OutC>* out) {
+  (obj->*method)(in, &out->a, &out->b, &out->c);
+}
+
+template<class ObjT, class Method, class InA,
+         class OutA, class OutB, class OutC>
+inline void DispatchToMethod(ObjT* obj, Method method,
+                             const Tuple1<InA>& in,
+                             Tuple3<OutA, OutB, OutC>* out) {
+  (obj->*method)(base::cef_internal::UnwrapTraits<InA>::Unwrap(in.a),
+                 &out->a,
+                 &out->b,
+                 &out->c);
+}
+
+template<class ObjT, class Method, class InA, class InB,
+         class OutA, class OutB, class OutC>
+inline void DispatchToMethod(ObjT* obj, Method method,
+                             const Tuple2<InA, InB>& in,
+                             Tuple3<OutA, OutB, OutC>* out) {
+  (obj->*method)(base::cef_internal::UnwrapTraits<InA>::Unwrap(in.a),
+                 base::cef_internal::UnwrapTraits<InB>::Unwrap(in.b),
+                 &out->a,
+                 &out->b,
+                 &out->c);
+}
+
+template<class ObjT, class Method, class InA, class InB, class InC,
+         class OutA, class OutB, class OutC>
+inline void DispatchToMethod(ObjT* obj, Method method,
+                             const Tuple3<InA, InB, InC>& in,
+                             Tuple3<OutA, OutB, OutC>* out) {
+  (obj->*method)(base::cef_internal::UnwrapTraits<InA>::Unwrap(in.a),
+                 base::cef_internal::UnwrapTraits<InB>::Unwrap(in.b),
+                 base::cef_internal::UnwrapTraits<InC>::Unwrap(in.c),
+                 &out->a,
+                 &out->b,
+                 &out->c);
+}
+
+template<class ObjT, class Method, class InA, class InB, class InC, class InD,
+         class OutA, class OutB, class OutC>
+inline void DispatchToMethod(ObjT* obj, Method method,
+                             const Tuple4<InA, InB, InC, InD>& in,
+                             Tuple3<OutA, OutB, OutC>* out) {
+  (obj->*method)(base::cef_internal::UnwrapTraits<InA>::Unwrap(in.a),
+                 base::cef_internal::UnwrapTraits<InB>::Unwrap(in.b),
+                 base::cef_internal::UnwrapTraits<InC>::Unwrap(in.c),
+                 base::cef_internal::UnwrapTraits<InD>::Unwrap(in.d),
+                 &out->a,
+                 &out->b,
+                 &out->c);
+}
+
+template<class ObjT, class Method,
+         class InA, class InB, class InC, class InD, class InE,
+         class OutA, class OutB, class OutC>
+inline void DispatchToMethod(ObjT* obj, Method method,
+                             const Tuple5<InA, InB, InC, InD, InE>& in,
+                             Tuple3<OutA, OutB, OutC>* out) {
+  (obj->*method)(base::cef_internal::UnwrapTraits<InA>::Unwrap(in.a),
+                 base::cef_internal::UnwrapTraits<InB>::Unwrap(in.b),
+                 base::cef_internal::UnwrapTraits<InC>::Unwrap(in.c),
+                 base::cef_internal::UnwrapTraits<InD>::Unwrap(in.d),
+                 base::cef_internal::UnwrapTraits<InE>::Unwrap(in.e),
+                 &out->a,
+                 &out->b,
+                 &out->c);
+}
+
+template<class ObjT, class Method,
+         class InA, class InB, class InC, class InD, class InE, class InF,
+         class OutA, class OutB, class OutC>
+inline void DispatchToMethod(ObjT* obj, Method method,
+                             const Tuple6<InA, InB, InC, InD, InE, InF>& in,
+                             Tuple3<OutA, OutB, OutC>* out) {
+  (obj->*method)(base::cef_internal::UnwrapTraits<InA>::Unwrap(in.a),
+                 base::cef_internal::UnwrapTraits<InB>::Unwrap(in.b),
+                 base::cef_internal::UnwrapTraits<InC>::Unwrap(in.c),
+                 base::cef_internal::UnwrapTraits<InD>::Unwrap(in.d),
+                 base::cef_internal::UnwrapTraits<InE>::Unwrap(in.e),
+                 base::cef_internal::UnwrapTraits<InF>::Unwrap(in.f),
+                 &out->a,
+                 &out->b,
+                 &out->c);
+}
+
+// Dispatchers with 4 out params.
+
+template<class ObjT, class Method,
+         class OutA, class OutB, class OutC, class OutD>
+inline void DispatchToMethod(ObjT* obj, Method method,
+                             const Tuple0& in,
+                             Tuple4<OutA, OutB, OutC, OutD>* out) {
+  (obj->*method)(&out->a, &out->b, &out->c, &out->d);
+}
+
+template<class ObjT, class Method, class InA,
+         class OutA, class OutB, class OutC, class OutD>
+inline void DispatchToMethod(ObjT* obj, Method method,
+                             const InA& in,
+                             Tuple4<OutA, OutB, OutC, OutD>* out) {
+  (obj->*method)(base::cef_internal::UnwrapTraits<InA>::Unwrap(in),
+                 &out->a,
+                 &out->b,
+                 &out->c,
+                 &out->d);
+}
+
+template<class ObjT, class Method, class InA,
+         class OutA, class OutB, class OutC, class OutD>
+inline void DispatchToMethod(ObjT* obj, Method method,
+                             const Tuple1<InA>& in,
+                             Tuple4<OutA, OutB, OutC, OutD>* out) {
+  (obj->*method)(base::cef_internal::UnwrapTraits<InA>::Unwrap(in.a),
+                 &out->a,
+                 &out->b,
+                 &out->c,
+                 &out->d);
+}
+
+template<class ObjT, class Method, class InA, class InB,
+         class OutA, class OutB, class OutC, class OutD>
+inline void DispatchToMethod(ObjT* obj, Method method,
+                             const Tuple2<InA, InB>& in,
+                             Tuple4<OutA, OutB, OutC, OutD>* out) {
+  (obj->*method)(base::cef_internal::UnwrapTraits<InA>::Unwrap(in.a),
+                 base::cef_internal::UnwrapTraits<InB>::Unwrap(in.b),
+                 &out->a,
+                 &out->b,
+                 &out->c,
+                 &out->d);
+}
+
+template<class ObjT, class Method, class InA, class InB, class InC,
+         class OutA, class OutB, class OutC, class OutD>
+inline void DispatchToMethod(ObjT* obj, Method method,
+                             const Tuple3<InA, InB, InC>& in,
+                             Tuple4<OutA, OutB, OutC, OutD>* out) {
+  (obj->*method)(base::cef_internal::UnwrapTraits<InA>::Unwrap(in.a),
+                 base::cef_internal::UnwrapTraits<InB>::Unwrap(in.b),
+                 base::cef_internal::UnwrapTraits<InC>::Unwrap(in.c),
+                 &out->a,
+                 &out->b,
+                 &out->c,
+                 &out->d);
+}
+
+template<class ObjT, class Method, class InA, class InB, class InC, class InD,
+         class OutA, class OutB, class OutC, class OutD>
+inline void DispatchToMethod(ObjT* obj, Method method,
+                             const Tuple4<InA, InB, InC, InD>& in,
+                             Tuple4<OutA, OutB, OutC, OutD>* out) {
+  (obj->*method)(base::cef_internal::UnwrapTraits<InA>::Unwrap(in.a),
+                 base::cef_internal::UnwrapTraits<InB>::Unwrap(in.b),
+                 base::cef_internal::UnwrapTraits<InC>::Unwrap(in.c),
+                 base::cef_internal::UnwrapTraits<InD>::Unwrap(in.d),
+                 &out->a,
+                 &out->b,
+                 &out->c,
+                 &out->d);
+}
+
+template<class ObjT, class Method,
+         class InA, class InB, class InC, class InD, class InE,
+         class OutA, class OutB, class OutC, class OutD>
+inline void DispatchToMethod(ObjT* obj, Method method,
+                             const Tuple5<InA, InB, InC, InD, InE>& in,
+                             Tuple4<OutA, OutB, OutC, OutD>* out) {
+  (obj->*method)(base::cef_internal::UnwrapTraits<InA>::Unwrap(in.a),
+                 base::cef_internal::UnwrapTraits<InB>::Unwrap(in.b),
+                 base::cef_internal::UnwrapTraits<InC>::Unwrap(in.c),
+                 base::cef_internal::UnwrapTraits<InD>::Unwrap(in.d),
+                 base::cef_internal::UnwrapTraits<InE>::Unwrap(in.e),
+                 &out->a,
+                 &out->b,
+                 &out->c,
+                 &out->d);
+}
+
+template<class ObjT, class Method,
+         class InA, class InB, class InC, class InD, class InE, class InF,
+         class OutA, class OutB, class OutC, class OutD>
+inline void DispatchToMethod(ObjT* obj, Method method,
+                             const Tuple6<InA, InB, InC, InD, InE, InF>& in,
+                             Tuple4<OutA, OutB, OutC, OutD>* out) {
+  (obj->*method)(base::cef_internal::UnwrapTraits<InA>::Unwrap(in.a),
+                 base::cef_internal::UnwrapTraits<InB>::Unwrap(in.b),
+                 base::cef_internal::UnwrapTraits<InC>::Unwrap(in.c),
+                 base::cef_internal::UnwrapTraits<InD>::Unwrap(in.d),
+                 base::cef_internal::UnwrapTraits<InE>::Unwrap(in.e),
+                 base::cef_internal::UnwrapTraits<InF>::Unwrap(in.f),
+                 &out->a,
+                 &out->b,
+                 &out->c,
+                 &out->d);
+}
+
+// Dispatchers with 5 out params.
+
+template<class ObjT, class Method,
+         class OutA, class OutB, class OutC, class OutD, class OutE>
+inline void DispatchToMethod(ObjT* obj, Method method,
+                             const Tuple0& in,
+                             Tuple5<OutA, OutB, OutC, OutD, OutE>* out) {
+  (obj->*method)(&out->a, &out->b, &out->c, &out->d, &out->e);
+}
+
+template<class ObjT, class Method, class InA,
+         class OutA, class OutB, class OutC, class OutD, class OutE>
+inline void DispatchToMethod(ObjT* obj, Method method,
+                             const InA& in,
+                             Tuple5<OutA, OutB, OutC, OutD, OutE>* out) {
+  (obj->*method)(base::cef_internal::UnwrapTraits<InA>::Unwrap(in),
+                 &out->a,
+                 &out->b,
+                 &out->c,
+                 &out->d,
+                 &out->e);
+}
+
+template<class ObjT, class Method, class InA,
+         class OutA, class OutB, class OutC, class OutD, class OutE>
+inline void DispatchToMethod(ObjT* obj, Method method,
+                             const Tuple1<InA>& in,
+                             Tuple5<OutA, OutB, OutC, OutD, OutE>* out) {
+  (obj->*method)(base::cef_internal::UnwrapTraits<InA>::Unwrap(in.a),
+                 &out->a,
+                 &out->b,
+                 &out->c,
+                 &out->d,
+                 &out->e);
+}
+
+template<class ObjT, class Method, class InA, class InB,
+         class OutA, class OutB, class OutC, class OutD, class OutE>
+inline void DispatchToMethod(ObjT* obj, Method method,
+                             const Tuple2<InA, InB>& in,
+                             Tuple5<OutA, OutB, OutC, OutD, OutE>* out) {
+  (obj->*method)(base::cef_internal::UnwrapTraits<InA>::Unwrap(in.a),
+                 base::cef_internal::UnwrapTraits<InB>::Unwrap(in.b),
+                 &out->a,
+                 &out->b,
+                 &out->c,
+                 &out->d,
+                 &out->e);
+}
+
+template<class ObjT, class Method, class InA, class InB, class InC,
+         class OutA, class OutB, class OutC, class OutD, class OutE>
+inline void DispatchToMethod(ObjT* obj, Method method,
+                             const Tuple3<InA, InB, InC>& in,
+                             Tuple5<OutA, OutB, OutC, OutD, OutE>* out) {
+  (obj->*method)(base::cef_internal::UnwrapTraits<InA>::Unwrap(in.a),
+                 base::cef_internal::UnwrapTraits<InB>::Unwrap(in.b),
+                 base::cef_internal::UnwrapTraits<InC>::Unwrap(in.c),
+                 &out->a,
+                 &out->b,
+                 &out->c,
+                 &out->d,
+                 &out->e);
+}
+
+template<class ObjT, class Method, class InA, class InB, class InC, class InD,
+         class OutA, class OutB, class OutC, class OutD, class OutE>
+inline void DispatchToMethod(ObjT* obj, Method method,
+                             const Tuple4<InA, InB, InC, InD>& in,
+                             Tuple5<OutA, OutB, OutC, OutD, OutE>* out) {
+  (obj->*method)(base::cef_internal::UnwrapTraits<InA>::Unwrap(in.a),
+                 base::cef_internal::UnwrapTraits<InB>::Unwrap(in.b),
+                 base::cef_internal::UnwrapTraits<InC>::Unwrap(in.c),
+                 base::cef_internal::UnwrapTraits<InD>::Unwrap(in.d),
+                 &out->a,
+                 &out->b,
+                 &out->c,
+                 &out->d,
+                 &out->e);
+}
+
+template<class ObjT, class Method,
+         class InA, class InB, class InC, class InD, class InE,
+         class OutA, class OutB, class OutC, class OutD, class OutE>
+inline void DispatchToMethod(ObjT* obj, Method method,
+                             const Tuple5<InA, InB, InC, InD, InE>& in,
+                             Tuple5<OutA, OutB, OutC, OutD, OutE>* out) {
+  (obj->*method)(base::cef_internal::UnwrapTraits<InA>::Unwrap(in.a),
+                 base::cef_internal::UnwrapTraits<InB>::Unwrap(in.b),
+                 base::cef_internal::UnwrapTraits<InC>::Unwrap(in.c),
+                 base::cef_internal::UnwrapTraits<InD>::Unwrap(in.d),
+                 base::cef_internal::UnwrapTraits<InE>::Unwrap(in.e),
+                 &out->a,
+                 &out->b,
+                 &out->c,
+                 &out->d,
+                 &out->e);
+}
+
+template<class ObjT, class Method,
+         class InA, class InB, class InC, class InD, class InE, class InF,
+         class OutA, class OutB, class OutC, class OutD, class OutE>
+inline void DispatchToMethod(ObjT* obj, Method method,
+                             const Tuple6<InA, InB, InC, InD, InE, InF>& in,
+                             Tuple5<OutA, OutB, OutC, OutD, OutE>* out) {
+  (obj->*method)(base::cef_internal::UnwrapTraits<InA>::Unwrap(in.a),
+                 base::cef_internal::UnwrapTraits<InB>::Unwrap(in.b),
+                 base::cef_internal::UnwrapTraits<InC>::Unwrap(in.c),
+                 base::cef_internal::UnwrapTraits<InD>::Unwrap(in.d),
+                 base::cef_internal::UnwrapTraits<InE>::Unwrap(in.e),
+                 base::cef_internal::UnwrapTraits<InF>::Unwrap(in.f),
+                 &out->a,
+                 &out->b,
+                 &out->c,
+                 &out->d,
+                 &out->e);
+}
+
+}  // namespace base
+
+#endif // !BUILDING_CEF_SHARED
+
+#endif  // CEF_INCLUDE_BASE_CEF_TUPLE_H_

+ 382 - 0
Source/ThirdParty/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<Controller> weak_factory_;
+//  };
+//
+//  class Worker {
+//   public:
+//    static void StartNew(const WeakPtr<Controller>& controller) {
+//      Worker* worker = new Worker(controller);
+//      // Kick off asynchronous processing...
+//    }
+//   private:
+//    Worker(const WeakPtr<Controller>& controller)
+//        : controller_(controller) {}
+//    void DidCompleteAsynchronousProcessing(const Result& result) {
+//      if (controller_)
+//        controller_->WorkComplete(result);
+//    }
+//    WeakPtr<Controller> 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 <typename T> class SupportsWeakPtr;
+template <typename T> 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<Flag> {
+   public:
+    Flag();
+
+    void Invalidate();
+    bool IsValid() const;
+
+   private:
+    friend class base::RefCountedThreadSafe<Flag>;
+
+    ~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<const Flag> flag_;
+};
+
+class WeakReferenceOwner {
+ public:
+  WeakReferenceOwner();
+  ~WeakReferenceOwner();
+
+  WeakReference GetRef() const;
+
+  bool HasRefs() const {
+    return flag_.get() && !flag_->HasOneRef();
+  }
+
+  void Invalidate();
+
+ private:
+  mutable scoped_refptr<WeakReference::Flag> flag_;
+};
+
+// This class simplifies the implementation of WeakPtr's type conversion
+// constructor by avoiding the need for a public accessor for ref_.  A
+// WeakPtr<T> cannot access the private members of WeakPtr<U>, 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<Base> to WeakPtr<Derived>. This
+  // conversion will only compile if there is exists a Base which inherits
+  // from SupportsWeakPtr<Base>. See base::AsWeakPtr() below for a helper
+  // function that makes calling this easier.
+  template<typename Derived>
+  static WeakPtr<Derived> StaticAsWeakPtr(Derived* t) {
+    typedef
+        is_convertible<Derived, cef_internal::SupportsWeakPtrBase&> convertible;
+    COMPILE_ASSERT(convertible::value,
+                   AsWeakPtr_argument_inherits_from_SupportsWeakPtr);
+    return AsWeakPtrImpl<Derived>(t, *t);
+  }
+
+ private:
+  // This template function uses type inference to find a Base of Derived
+  // which is an instance of SupportsWeakPtr<Base>. We can then safely
+  // static_cast the Base* to a Derived*.
+  template <typename Derived, typename Base>
+  static WeakPtr<Derived> AsWeakPtrImpl(
+      Derived* t, const SupportsWeakPtr<Base>&) {
+    WeakPtr<Base> ptr = t->Base::AsWeakPtr();
+    return WeakPtr<Derived>(ptr.ref_, static_cast<Derived*>(ptr.ptr_));
+  }
+};
+
+}  // namespace cef_internal
+
+template <typename T> 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> foo;
+//   if (foo)
+//     foo->method();
+//
+template <typename T>
+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 <typename U>
+  WeakPtr(const WeakPtr<U>& 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<element_type> 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 <class U> bool operator==(WeakPtr<U> const&) const;
+  template <class U> bool operator!=(WeakPtr<U> const&) const;
+
+  friend class cef_internal::SupportsWeakPtrBase;
+  template <typename U> friend class WeakPtr;
+  friend class SupportsWeakPtr<T>;
+  friend class WeakPtrFactory<T>;
+
+  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<bool> that is used to pass around a weak reference to a bool.
+template <class T>
+class WeakPtrFactory {
+ public:
+  explicit WeakPtrFactory(T* ptr) : ptr_(ptr) {
+  }
+
+  ~WeakPtrFactory() {
+    ptr_ = NULL;
+  }
+
+  WeakPtr<T> GetWeakPtr() {
+    DCHECK(ptr_);
+    return WeakPtr<T>(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 T>
+class SupportsWeakPtr : public cef_internal::SupportsWeakPtrBase {
+ public:
+  SupportsWeakPtr() {}
+
+  WeakPtr<T> AsWeakPtr() {
+    return WeakPtr<T>(weak_reference_owner_.GetRef(), static_cast<T*>(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<Derived>
+// when Derived doesn't directly extend SupportsWeakPtr<Derived>, instead it
+// extends a Base that extends SupportsWeakPtr<Base>.
+//
+// EXAMPLE:
+//   class Base : public base::SupportsWeakPtr<Producer> {};
+//   class Derived : public Base {};
+//
+//   Derived derived;
+//   base::WeakPtr<Derived> ptr = base::AsWeakPtr(&derived);
+//
+// Note that the following doesn't work (invalid type conversion) since
+// Derived::AsWeakPtr() is WeakPtr<Base> SupportsWeakPtr<Base>::AsWeakPtr(),
+// and there's no way to safely cast WeakPtr<Base> to WeakPtr<Derived> at
+// the caller.
+//
+//   base::WeakPtr<Derived> ptr = derived.AsWeakPtr();  // Fails.
+
+template <typename Derived>
+WeakPtr<Derived> AsWeakPtr(Derived* t) {
+  return cef_internal::SupportsWeakPtrBase::StaticAsWeakPtr<Derived>(t);
+}
+
+}  // namespace base
+
+#endif  // !BUILDING_CEF_SHARED
+
+#endif  // CEF_INCLUDE_BASE_CEF_WEAK_PTR_H_

+ 126 - 0
Source/ThirdParty/CEF/include/base/internal/cef_atomicops_atomicword_compat.h

@@ -0,0 +1,126 @@
+// 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_atomicops.h
+// instead.
+
+#ifndef CEF_INCLUDE_BASE_INTERNAL_CEF_ATOMICOPS_ATOMICWORD_COMPAT_H_
+#define CEF_INCLUDE_BASE_INTERNAL_CEF_ATOMICOPS_ATOMICWORD_COMPAT_H_
+
+// AtomicWord is a synonym for intptr_t, and Atomic32 is a synonym for int32,
+// which in turn means int. On some LP32 platforms, intptr_t is an int, but
+// on others, it's a long. When AtomicWord and Atomic32 are based on different
+// fundamental types, their pointers are incompatible.
+//
+// This file defines function overloads to allow both AtomicWord and Atomic32
+// data to be used with this interface.
+//
+// On LP64 platforms, AtomicWord and Atomic64 are both always long,
+// so this problem doesn't occur.
+
+#if !defined(ARCH_CPU_64_BITS)
+
+namespace base {
+namespace subtle {
+
+inline AtomicWord NoBarrier_CompareAndSwap(volatile AtomicWord* ptr,
+                                           AtomicWord old_value,
+                                           AtomicWord new_value) {
+  return NoBarrier_CompareAndSwap(
+      reinterpret_cast<volatile Atomic32*>(ptr), old_value, new_value);
+}
+
+inline AtomicWord NoBarrier_AtomicExchange(volatile AtomicWord* ptr,
+                                           AtomicWord new_value) {
+  return NoBarrier_AtomicExchange(
+      reinterpret_cast<volatile Atomic32*>(ptr), new_value);
+}
+
+inline AtomicWord NoBarrier_AtomicIncrement(volatile AtomicWord* ptr,
+                                            AtomicWord increment) {
+  return NoBarrier_AtomicIncrement(
+      reinterpret_cast<volatile Atomic32*>(ptr), increment);
+}
+
+inline AtomicWord Barrier_AtomicIncrement(volatile AtomicWord* ptr,
+                                          AtomicWord increment) {
+  return Barrier_AtomicIncrement(
+      reinterpret_cast<volatile Atomic32*>(ptr), increment);
+}
+
+inline AtomicWord Acquire_CompareAndSwap(volatile AtomicWord* ptr,
+                                         AtomicWord old_value,
+                                         AtomicWord new_value) {
+  return base::subtle::Acquire_CompareAndSwap(
+      reinterpret_cast<volatile Atomic32*>(ptr), old_value, new_value);
+}
+
+inline AtomicWord Release_CompareAndSwap(volatile AtomicWord* ptr,
+                                         AtomicWord old_value,
+                                         AtomicWord new_value) {
+  return base::subtle::Release_CompareAndSwap(
+      reinterpret_cast<volatile Atomic32*>(ptr), old_value, new_value);
+}
+
+inline void NoBarrier_Store(volatile AtomicWord *ptr, AtomicWord value) {
+  NoBarrier_Store(
+      reinterpret_cast<volatile Atomic32*>(ptr), value);
+}
+
+inline void Acquire_Store(volatile AtomicWord* ptr, AtomicWord value) {
+  return base::subtle::Acquire_Store(
+      reinterpret_cast<volatile Atomic32*>(ptr), value);
+}
+
+inline void Release_Store(volatile AtomicWord* ptr, AtomicWord value) {
+  return base::subtle::Release_Store(
+      reinterpret_cast<volatile Atomic32*>(ptr), value);
+}
+
+inline AtomicWord NoBarrier_Load(volatile const AtomicWord *ptr) {
+  return NoBarrier_Load(
+      reinterpret_cast<volatile const Atomic32*>(ptr));
+}
+
+inline AtomicWord Acquire_Load(volatile const AtomicWord* ptr) {
+  return base::subtle::Acquire_Load(
+      reinterpret_cast<volatile const Atomic32*>(ptr));
+}
+
+inline AtomicWord Release_Load(volatile const AtomicWord* ptr) {
+  return base::subtle::Release_Load(
+      reinterpret_cast<volatile const Atomic32*>(ptr));
+}
+
+}   // namespace base::subtle
+}   // namespace base
+
+#endif  // !defined(ARCH_CPU_64_BITS)
+
+#endif  // CEF_INCLUDE_BASE_INTERNAL_CEF_ATOMICOPS_ATOMICWORD_COMPAT_H_

+ 223 - 0
Source/ThirdParty/CEF/include/base/internal/cef_atomicops_mac.h

@@ -0,0 +1,223 @@
+// 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_atomicops.h
+// instead.
+
+#ifndef CEF_INCLUDE_BASE_INTERNAL_CEF_ATOMICOPS_MAC_H_
+#define CEF_INCLUDE_BASE_INTERNAL_CEF_ATOMICOPS_MAC_H_
+
+#include <libkern/OSAtomic.h>
+
+namespace base {
+namespace subtle {
+
+inline Atomic32 NoBarrier_CompareAndSwap(volatile Atomic32* ptr,
+                                         Atomic32 old_value,
+                                         Atomic32 new_value) {
+  Atomic32 prev_value;
+  do {
+    if (OSAtomicCompareAndSwap32(old_value, new_value,
+                                 const_cast<Atomic32*>(ptr))) {
+      return old_value;
+    }
+    prev_value = *ptr;
+  } while (prev_value == old_value);
+  return prev_value;
+}
+
+inline Atomic32 NoBarrier_AtomicExchange(volatile Atomic32* ptr,
+                                         Atomic32 new_value) {
+  Atomic32 old_value;
+  do {
+    old_value = *ptr;
+  } while (!OSAtomicCompareAndSwap32(old_value, new_value,
+                                     const_cast<Atomic32*>(ptr)));
+  return old_value;
+}
+
+inline Atomic32 NoBarrier_AtomicIncrement(volatile Atomic32* ptr,
+                                          Atomic32 increment) {
+  return OSAtomicAdd32(increment, const_cast<Atomic32*>(ptr));
+}
+
+inline Atomic32 Barrier_AtomicIncrement(volatile Atomic32* ptr,
+                                        Atomic32 increment) {
+  return OSAtomicAdd32Barrier(increment, const_cast<Atomic32*>(ptr));
+}
+
+inline void MemoryBarrier() {
+  OSMemoryBarrier();
+}
+
+inline Atomic32 Acquire_CompareAndSwap(volatile Atomic32* ptr,
+                                       Atomic32 old_value,
+                                       Atomic32 new_value) {
+  Atomic32 prev_value;
+  do {
+    if (OSAtomicCompareAndSwap32Barrier(old_value, new_value,
+                                        const_cast<Atomic32*>(ptr))) {
+      return old_value;
+    }
+    prev_value = *ptr;
+  } while (prev_value == old_value);
+  return prev_value;
+}
+
+inline Atomic32 Release_CompareAndSwap(volatile Atomic32* ptr,
+                                       Atomic32 old_value,
+                                       Atomic32 new_value) {
+  return Acquire_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) {
+  *ptr = value;
+  MemoryBarrier();
+}
+
+inline void Release_Store(volatile Atomic32* ptr, Atomic32 value) {
+  MemoryBarrier();
+  *ptr = value;
+}
+
+inline Atomic32 NoBarrier_Load(volatile const Atomic32* ptr) {
+  return *ptr;
+}
+
+inline Atomic32 Acquire_Load(volatile const Atomic32* ptr) {
+  Atomic32 value = *ptr;
+  MemoryBarrier();
+  return value;
+}
+
+inline Atomic32 Release_Load(volatile const Atomic32* ptr) {
+  MemoryBarrier();
+  return *ptr;
+}
+
+#ifdef __LP64__
+
+// 64-bit implementation on 64-bit platform
+
+inline Atomic64 NoBarrier_CompareAndSwap(volatile Atomic64* ptr,
+                                         Atomic64 old_value,
+                                         Atomic64 new_value) {
+  Atomic64 prev_value;
+  do {
+    if (OSAtomicCompareAndSwap64(old_value, new_value,
+                                 reinterpret_cast<volatile int64_t*>(ptr))) {
+      return old_value;
+    }
+    prev_value = *ptr;
+  } while (prev_value == old_value);
+  return prev_value;
+}
+
+inline Atomic64 NoBarrier_AtomicExchange(volatile Atomic64* ptr,
+                                         Atomic64 new_value) {
+  Atomic64 old_value;
+  do {
+    old_value = *ptr;
+  } while (!OSAtomicCompareAndSwap64(old_value, new_value,
+                                     reinterpret_cast<volatile int64_t*>(ptr)));
+  return old_value;
+}
+
+inline Atomic64 NoBarrier_AtomicIncrement(volatile Atomic64* ptr,
+                                          Atomic64 increment) {
+  return OSAtomicAdd64(increment, reinterpret_cast<volatile int64_t*>(ptr));
+}
+
+inline Atomic64 Barrier_AtomicIncrement(volatile Atomic64* ptr,
+                                        Atomic64 increment) {
+  return OSAtomicAdd64Barrier(increment,
+                              reinterpret_cast<volatile int64_t*>(ptr));
+}
+
+inline Atomic64 Acquire_CompareAndSwap(volatile Atomic64* ptr,
+                                       Atomic64 old_value,
+                                       Atomic64 new_value) {
+  Atomic64 prev_value;
+  do {
+    if (OSAtomicCompareAndSwap64Barrier(
+        old_value, new_value, reinterpret_cast<volatile int64_t*>(ptr))) {
+      return old_value;
+    }
+    prev_value = *ptr;
+  } while (prev_value == old_value);
+  return prev_value;
+}
+
+inline Atomic64 Release_CompareAndSwap(volatile Atomic64* ptr,
+                                       Atomic64 old_value,
+                                       Atomic64 new_value) {
+  // The lib kern interface does not distinguish between
+  // Acquire and Release memory barriers; they are equivalent.
+  return Acquire_CompareAndSwap(ptr, old_value, new_value);
+}
+
+inline void NoBarrier_Store(volatile Atomic64* ptr, Atomic64 value) {
+  *ptr = value;
+}
+
+inline void Acquire_Store(volatile Atomic64* ptr, Atomic64 value) {
+  *ptr = value;
+  MemoryBarrier();
+}
+
+inline void Release_Store(volatile Atomic64* ptr, Atomic64 value) {
+  MemoryBarrier();
+  *ptr = value;
+}
+
+inline Atomic64 NoBarrier_Load(volatile const Atomic64* ptr) {
+  return *ptr;
+}
+
+inline Atomic64 Acquire_Load(volatile const Atomic64* ptr) {
+  Atomic64 value = *ptr;
+  MemoryBarrier();
+  return value;
+}
+
+inline Atomic64 Release_Load(volatile const Atomic64* ptr) {
+  MemoryBarrier();
+  return *ptr;
+}
+
+#endif  // defined(__LP64__)
+
+}   // namespace base::subtle
+}   // namespace base
+
+#endif  // CEF_INCLUDE_BASE_INTERNAL_CEF_ATOMICOPS_MAC_H_

+ 2852 - 0
Source/ThirdParty/CEF/include/base/internal/cef_bind_internal.h

@@ -0,0 +1,2852 @@
+// 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 <typename Functor>
+class RunnableAdapter;
+
+// Function: Arity 0.
+template <typename R>
+class RunnableAdapter<R(*)()> {
+ public:
+  typedef R (RunType)();
+
+  explicit RunnableAdapter(R(*function)())
+      : function_(function) {
+  }
+
+  R Run() {
+    return function_();
+  }
+
+ private:
+  R (*function_)();
+};
+
+// Method: Arity 0.
+template <typename R, typename T>
+class RunnableAdapter<R(T::*)()> {
+ 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 <typename R, typename T>
+class RunnableAdapter<R(T::*)() const> {
+ 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 <typename R, typename A1>
+class RunnableAdapter<R(*)(A1)> {
+ public:
+  typedef R (RunType)(A1);
+
+  explicit RunnableAdapter(R(*function)(A1))
+      : function_(function) {
+  }
+
+  R Run(typename CallbackParamTraits<A1>::ForwardType a1) {
+    return function_(CallbackForward(a1));
+  }
+
+ private:
+  R (*function_)(A1);
+};
+
+// Method: Arity 1.
+template <typename R, typename T, typename A1>
+class RunnableAdapter<R(T::*)(A1)> {
+ public:
+  typedef R (RunType)(T*, A1);
+  typedef true_type IsMethod;
+
+  explicit RunnableAdapter(R(T::*method)(A1))
+      : method_(method) {
+  }
+
+  R Run(T* object, typename CallbackParamTraits<A1>::ForwardType a1) {
+    return (object->*method_)(CallbackForward(a1));
+  }
+
+ private:
+  R (T::*method_)(A1);
+};
+
+// Const Method: Arity 1.
+template <typename R, typename T, typename A1>
+class RunnableAdapter<R(T::*)(A1) const> {
+ 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<A1>::ForwardType a1) {
+    return (object->*method_)(CallbackForward(a1));
+  }
+
+ private:
+  R (T::*method_)(A1) const;
+};
+
+// Function: Arity 2.
+template <typename R, typename A1, typename A2>
+class RunnableAdapter<R(*)(A1, A2)> {
+ public:
+  typedef R (RunType)(A1, A2);
+
+  explicit RunnableAdapter(R(*function)(A1, A2))
+      : function_(function) {
+  }
+
+  R Run(typename CallbackParamTraits<A1>::ForwardType a1,
+      typename CallbackParamTraits<A2>::ForwardType a2) {
+    return function_(CallbackForward(a1), CallbackForward(a2));
+  }
+
+ private:
+  R (*function_)(A1, A2);
+};
+
+// Method: Arity 2.
+template <typename R, typename T, typename A1, typename A2>
+class RunnableAdapter<R(T::*)(A1, A2)> {
+ 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<A1>::ForwardType a1,
+      typename CallbackParamTraits<A2>::ForwardType a2) {
+    return (object->*method_)(CallbackForward(a1), CallbackForward(a2));
+  }
+
+ private:
+  R (T::*method_)(A1, A2);
+};
+
+// Const Method: Arity 2.
+template <typename R, typename T, typename A1, typename A2>
+class RunnableAdapter<R(T::*)(A1, A2) const> {
+ 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<A1>::ForwardType a1,
+      typename CallbackParamTraits<A2>::ForwardType a2) {
+    return (object->*method_)(CallbackForward(a1), CallbackForward(a2));
+  }
+
+ private:
+  R (T::*method_)(A1, A2) const;
+};
+
+// Function: Arity 3.
+template <typename R, typename A1, typename A2, typename A3>
+class RunnableAdapter<R(*)(A1, A2, A3)> {
+ public:
+  typedef R (RunType)(A1, A2, A3);
+
+  explicit RunnableAdapter(R(*function)(A1, A2, A3))
+      : function_(function) {
+  }
+
+  R Run(typename CallbackParamTraits<A1>::ForwardType a1,
+      typename CallbackParamTraits<A2>::ForwardType a2,
+      typename CallbackParamTraits<A3>::ForwardType a3) {
+    return function_(CallbackForward(a1), CallbackForward(a2),
+        CallbackForward(a3));
+  }
+
+ private:
+  R (*function_)(A1, A2, A3);
+};
+
+// Method: Arity 3.
+template <typename R, typename T, typename A1, typename A2, typename A3>
+class RunnableAdapter<R(T::*)(A1, A2, A3)> {
+ 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<A1>::ForwardType a1,
+      typename CallbackParamTraits<A2>::ForwardType a2,
+      typename CallbackParamTraits<A3>::ForwardType a3) {
+    return (object->*method_)(CallbackForward(a1), CallbackForward(a2),
+        CallbackForward(a3));
+  }
+
+ private:
+  R (T::*method_)(A1, A2, A3);
+};
+
+// Const Method: Arity 3.
+template <typename R, typename T, typename A1, typename A2, typename A3>
+class RunnableAdapter<R(T::*)(A1, A2, A3) const> {
+ 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<A1>::ForwardType a1,
+      typename CallbackParamTraits<A2>::ForwardType a2,
+      typename CallbackParamTraits<A3>::ForwardType a3) {
+    return (object->*method_)(CallbackForward(a1), CallbackForward(a2),
+        CallbackForward(a3));
+  }
+
+ private:
+  R (T::*method_)(A1, A2, A3) const;
+};
+
+// Function: Arity 4.
+template <typename R, typename A1, typename A2, typename A3, typename A4>
+class RunnableAdapter<R(*)(A1, A2, A3, A4)> {
+ public:
+  typedef R (RunType)(A1, A2, A3, A4);
+
+  explicit RunnableAdapter(R(*function)(A1, A2, A3, A4))
+      : function_(function) {
+  }
+
+  R Run(typename CallbackParamTraits<A1>::ForwardType a1,
+      typename CallbackParamTraits<A2>::ForwardType a2,
+      typename CallbackParamTraits<A3>::ForwardType a3,
+      typename CallbackParamTraits<A4>::ForwardType a4) {
+    return function_(CallbackForward(a1), CallbackForward(a2),
+        CallbackForward(a3), CallbackForward(a4));
+  }
+
+ private:
+  R (*function_)(A1, A2, A3, A4);
+};
+
+// Method: Arity 4.
+template <typename R, typename T, typename A1, typename A2, typename A3,
+    typename A4>
+class RunnableAdapter<R(T::*)(A1, A2, A3, A4)> {
+ 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<A1>::ForwardType a1,
+      typename CallbackParamTraits<A2>::ForwardType a2,
+      typename CallbackParamTraits<A3>::ForwardType a3,
+      typename CallbackParamTraits<A4>::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 <typename R, typename T, typename A1, typename A2, typename A3,
+    typename A4>
+class RunnableAdapter<R(T::*)(A1, A2, A3, A4) const> {
+ 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<A1>::ForwardType a1,
+      typename CallbackParamTraits<A2>::ForwardType a2,
+      typename CallbackParamTraits<A3>::ForwardType a3,
+      typename CallbackParamTraits<A4>::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 <typename R, typename A1, typename A2, typename A3, typename A4,
+    typename A5>
+class RunnableAdapter<R(*)(A1, A2, A3, A4, A5)> {
+ public:
+  typedef R (RunType)(A1, A2, A3, A4, A5);
+
+  explicit RunnableAdapter(R(*function)(A1, A2, A3, A4, A5))
+      : function_(function) {
+  }
+
+  R Run(typename CallbackParamTraits<A1>::ForwardType a1,
+      typename CallbackParamTraits<A2>::ForwardType a2,
+      typename CallbackParamTraits<A3>::ForwardType a3,
+      typename CallbackParamTraits<A4>::ForwardType a4,
+      typename CallbackParamTraits<A5>::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 <typename R, typename T, typename A1, typename A2, typename A3,
+    typename A4, typename A5>
+class RunnableAdapter<R(T::*)(A1, A2, A3, A4, A5)> {
+ 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<A1>::ForwardType a1,
+      typename CallbackParamTraits<A2>::ForwardType a2,
+      typename CallbackParamTraits<A3>::ForwardType a3,
+      typename CallbackParamTraits<A4>::ForwardType a4,
+      typename CallbackParamTraits<A5>::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 <typename R, typename T, typename A1, typename A2, typename A3,
+    typename A4, typename A5>
+class RunnableAdapter<R(T::*)(A1, A2, A3, A4, A5) const> {
+ 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<A1>::ForwardType a1,
+      typename CallbackParamTraits<A2>::ForwardType a2,
+      typename CallbackParamTraits<A3>::ForwardType a3,
+      typename CallbackParamTraits<A4>::ForwardType a4,
+      typename CallbackParamTraits<A5>::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 <typename R, typename A1, typename A2, typename A3, typename A4,
+    typename A5, typename A6>
+class RunnableAdapter<R(*)(A1, A2, A3, A4, A5, A6)> {
+ 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<A1>::ForwardType a1,
+      typename CallbackParamTraits<A2>::ForwardType a2,
+      typename CallbackParamTraits<A3>::ForwardType a3,
+      typename CallbackParamTraits<A4>::ForwardType a4,
+      typename CallbackParamTraits<A5>::ForwardType a5,
+      typename CallbackParamTraits<A6>::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 <typename R, typename T, typename A1, typename A2, typename A3,
+    typename A4, typename A5, typename A6>
+class RunnableAdapter<R(T::*)(A1, A2, A3, A4, A5, A6)> {
+ 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<A1>::ForwardType a1,
+      typename CallbackParamTraits<A2>::ForwardType a2,
+      typename CallbackParamTraits<A3>::ForwardType a3,
+      typename CallbackParamTraits<A4>::ForwardType a4,
+      typename CallbackParamTraits<A5>::ForwardType a5,
+      typename CallbackParamTraits<A6>::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 <typename R, typename T, typename A1, typename A2, typename A3,
+    typename A4, typename A5, typename A6>
+class RunnableAdapter<R(T::*)(A1, A2, A3, A4, A5, A6) const> {
+ 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<A1>::ForwardType a1,
+      typename CallbackParamTraits<A2>::ForwardType a2,
+      typename CallbackParamTraits<A3>::ForwardType a3,
+      typename CallbackParamTraits<A4>::ForwardType a4,
+      typename CallbackParamTraits<A5>::ForwardType a5,
+      typename CallbackParamTraits<A6>::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 <typename R, typename A1, typename A2, typename A3, typename A4,
+    typename A5, typename A6, typename A7>
+class RunnableAdapter<R(*)(A1, A2, A3, A4, A5, A6, A7)> {
+ 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<A1>::ForwardType a1,
+      typename CallbackParamTraits<A2>::ForwardType a2,
+      typename CallbackParamTraits<A3>::ForwardType a3,
+      typename CallbackParamTraits<A4>::ForwardType a4,
+      typename CallbackParamTraits<A5>::ForwardType a5,
+      typename CallbackParamTraits<A6>::ForwardType a6,
+      typename CallbackParamTraits<A7>::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 <typename R, typename T, typename A1, typename A2, typename A3,
+    typename A4, typename A5, typename A6, typename A7>
+class RunnableAdapter<R(T::*)(A1, A2, A3, A4, A5, A6, A7)> {
+ 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<A1>::ForwardType a1,
+      typename CallbackParamTraits<A2>::ForwardType a2,
+      typename CallbackParamTraits<A3>::ForwardType a3,
+      typename CallbackParamTraits<A4>::ForwardType a4,
+      typename CallbackParamTraits<A5>::ForwardType a5,
+      typename CallbackParamTraits<A6>::ForwardType a6,
+      typename CallbackParamTraits<A7>::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 <typename R, typename T, typename A1, typename A2, typename A3,
+    typename A4, typename A5, typename A6, typename A7>
+class RunnableAdapter<R(T::*)(A1, A2, A3, A4, A5, A6, A7) const> {
+ 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<A1>::ForwardType a1,
+      typename CallbackParamTraits<A2>::ForwardType a2,
+      typename CallbackParamTraits<A3>::ForwardType a3,
+      typename CallbackParamTraits<A4>::ForwardType a4,
+      typename CallbackParamTraits<A5>::ForwardType a5,
+      typename CallbackParamTraits<A6>::ForwardType a6,
+      typename CallbackParamTraits<A7>::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 <typename Sig>
+struct FunctionTraits;
+
+template <typename R>
+struct FunctionTraits<R()> {
+  typedef R ReturnType;
+};
+
+template <typename R, typename A1>
+struct FunctionTraits<R(A1)> {
+  typedef R ReturnType;
+  typedef A1 A1Type;
+};
+
+template <typename R, typename A1, typename A2>
+struct FunctionTraits<R(A1, A2)> {
+  typedef R ReturnType;
+  typedef A1 A1Type;
+  typedef A2 A2Type;
+};
+
+template <typename R, typename A1, typename A2, typename A3>
+struct FunctionTraits<R(A1, A2, A3)> {
+  typedef R ReturnType;
+  typedef A1 A1Type;
+  typedef A2 A2Type;
+  typedef A3 A3Type;
+};
+
+template <typename R, typename A1, typename A2, typename A3, typename A4>
+struct FunctionTraits<R(A1, A2, A3, A4)> {
+  typedef R ReturnType;
+  typedef A1 A1Type;
+  typedef A2 A2Type;
+  typedef A3 A3Type;
+  typedef A4 A4Type;
+};
+
+template <typename R, typename A1, typename A2, typename A3, typename A4,
+    typename A5>
+struct FunctionTraits<R(A1, A2, A3, A4, A5)> {
+  typedef R ReturnType;
+  typedef A1 A1Type;
+  typedef A2 A2Type;
+  typedef A3 A3Type;
+  typedef A4 A4Type;
+  typedef A5 A5Type;
+};
+
+template <typename R, typename A1, typename A2, typename A3, typename A4,
+    typename A5, typename A6>
+struct FunctionTraits<R(A1, A2, A3, A4, A5, A6)> {
+  typedef R ReturnType;
+  typedef A1 A1Type;
+  typedef A2 A2Type;
+  typedef A3 A3Type;
+  typedef A4 A4Type;
+  typedef A5 A5Type;
+  typedef A6 A6Type;
+};
+
+template <typename R, typename A1, typename A2, typename A3, typename A4,
+    typename A5, typename A6, typename A7>
+struct FunctionTraits<R(A1, A2, A3, A4, A5, A6, A7)> {
+  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 <typename Sig>
+struct ForceVoidReturn;
+
+template <typename R>
+struct ForceVoidReturn<R()> {
+  typedef void(RunType)();
+};
+
+template <typename R, typename A1>
+struct ForceVoidReturn<R(A1)> {
+  typedef void(RunType)(A1);
+};
+
+template <typename R, typename A1, typename A2>
+struct ForceVoidReturn<R(A1, A2)> {
+  typedef void(RunType)(A1, A2);
+};
+
+template <typename R, typename A1, typename A2, typename A3>
+struct ForceVoidReturn<R(A1, A2, A3)> {
+  typedef void(RunType)(A1, A2, A3);
+};
+
+template <typename R, typename A1, typename A2, typename A3, typename A4>
+struct ForceVoidReturn<R(A1, A2, A3, A4)> {
+  typedef void(RunType)(A1, A2, A3, A4);
+};
+
+template <typename R, typename A1, typename A2, typename A3, typename A4,
+    typename A5>
+struct ForceVoidReturn<R(A1, A2, A3, A4, A5)> {
+  typedef void(RunType)(A1, A2, A3, A4, A5);
+};
+
+template <typename R, typename A1, typename A2, typename A3, typename A4,
+    typename A5, typename A6>
+struct ForceVoidReturn<R(A1, A2, A3, A4, A5, A6)> {
+  typedef void(RunType)(A1, A2, A3, A4, A5, A6);
+};
+
+template <typename R, typename A1, typename A2, typename A3, typename A4,
+    typename A5, typename A6, typename A7>
+struct ForceVoidReturn<R(A1, A2, A3, A4, A5, A6, A7)> {
+  typedef void(RunType)(A1, A2, A3, A4, A5, A6, A7);
+};
+
+
+// FunctorTraits<>
+//
+// See description at top of file.
+template <typename T>
+struct FunctorTraits {
+  typedef RunnableAdapter<T> RunnableType;
+  typedef typename RunnableType::RunType RunType;
+};
+
+template <typename T>
+struct FunctorTraits<IgnoreResultHelper<T> > {
+  typedef typename FunctorTraits<T>::RunnableType RunnableType;
+  typedef typename ForceVoidReturn<
+      typename RunnableType::RunType>::RunType RunType;
+};
+
+template <typename T>
+struct FunctorTraits<Callback<T> > {
+  typedef Callback<T> RunnableType;
+  typedef typename Callback<T>::RunType RunType;
+};
+
+
+// MakeRunnable<>
+//
+// Converts a passed in functor to a RunnableType using type inference.
+
+template <typename T>
+typename FunctorTraits<T>::RunnableType MakeRunnable(const T& t) {
+  return RunnableAdapter<T>(t);
+}
+
+template <typename T>
+typename FunctorTraits<T>::RunnableType
+MakeRunnable(const IgnoreResultHelper<T>& t) {
+  return MakeRunnable(t.functor_);
+}
+
+template <typename T>
+const typename FunctorTraits<Callback<T> >::RunnableType&
+MakeRunnable(const Callback<T>& 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 <bool IsWeakCall, typename ReturnType, typename Runnable,
+          typename ArgsType>
+struct InvokeHelper;
+
+template <typename ReturnType, typename Runnable>
+struct InvokeHelper<false, ReturnType, Runnable,
+    void()>  {
+  static ReturnType MakeItSo(Runnable runnable) {
+    return runnable.Run();
+  }
+};
+
+template <typename Runnable>
+struct InvokeHelper<false, void, Runnable,
+    void()>  {
+  static void MakeItSo(Runnable runnable) {
+    runnable.Run();
+  }
+};
+
+template <typename ReturnType, typename Runnable,typename A1>
+struct InvokeHelper<false, ReturnType, Runnable,
+    void(A1)>  {
+  static ReturnType MakeItSo(Runnable runnable, A1 a1) {
+    return runnable.Run(CallbackForward(a1));
+  }
+};
+
+template <typename Runnable,typename A1>
+struct InvokeHelper<false, void, Runnable,
+    void(A1)>  {
+  static void MakeItSo(Runnable runnable, A1 a1) {
+    runnable.Run(CallbackForward(a1));
+  }
+};
+
+template <typename Runnable, typename BoundWeakPtr>
+struct InvokeHelper<true, void, Runnable,
+    void(BoundWeakPtr)>  {
+  static void MakeItSo(Runnable runnable, BoundWeakPtr weak_ptr) {
+    if (!weak_ptr.get()) {
+      return;
+    }
+    runnable.Run(weak_ptr.get());
+  }
+};
+
+template <typename ReturnType, typename Runnable,typename A1, typename A2>
+struct InvokeHelper<false, ReturnType, Runnable,
+    void(A1, A2)>  {
+  static ReturnType MakeItSo(Runnable runnable, A1 a1, A2 a2) {
+    return runnable.Run(CallbackForward(a1), CallbackForward(a2));
+  }
+};
+
+template <typename Runnable,typename A1, typename A2>
+struct InvokeHelper<false, void, Runnable,
+    void(A1, A2)>  {
+  static void MakeItSo(Runnable runnable, A1 a1, A2 a2) {
+    runnable.Run(CallbackForward(a1), CallbackForward(a2));
+  }
+};
+
+template <typename Runnable, typename BoundWeakPtr, typename A2>
+struct InvokeHelper<true, void, Runnable,
+    void(BoundWeakPtr, A2)>  {
+  static void MakeItSo(Runnable runnable, BoundWeakPtr weak_ptr, A2 a2) {
+    if (!weak_ptr.get()) {
+      return;
+    }
+    runnable.Run(weak_ptr.get(), CallbackForward(a2));
+  }
+};
+
+template <typename ReturnType, typename Runnable,typename A1, typename A2,
+    typename A3>
+struct InvokeHelper<false, ReturnType, Runnable,
+    void(A1, A2, A3)>  {
+  static ReturnType MakeItSo(Runnable runnable, A1 a1, A2 a2, A3 a3) {
+    return runnable.Run(CallbackForward(a1), CallbackForward(a2),
+        CallbackForward(a3));
+  }
+};
+
+template <typename Runnable,typename A1, typename A2, typename A3>
+struct InvokeHelper<false, void, Runnable,
+    void(A1, A2, A3)>  {
+  static void MakeItSo(Runnable runnable, A1 a1, A2 a2, A3 a3) {
+    runnable.Run(CallbackForward(a1), CallbackForward(a2), CallbackForward(a3));
+  }
+};
+
+template <typename Runnable, typename BoundWeakPtr, typename A2, typename A3>
+struct InvokeHelper<true, void, Runnable,
+    void(BoundWeakPtr, A2, A3)>  {
+  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 <typename ReturnType, typename Runnable,typename A1, typename A2,
+    typename A3, typename A4>
+struct InvokeHelper<false, ReturnType, Runnable,
+    void(A1, A2, A3, A4)>  {
+  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 <typename Runnable,typename A1, typename A2, typename A3, typename A4>
+struct InvokeHelper<false, void, Runnable,
+    void(A1, A2, A3, A4)>  {
+  static void MakeItSo(Runnable runnable, A1 a1, A2 a2, A3 a3, A4 a4) {
+    runnable.Run(CallbackForward(a1), CallbackForward(a2), CallbackForward(a3),
+        CallbackForward(a4));
+  }
+};
+
+template <typename Runnable, typename BoundWeakPtr, typename A2, typename A3,
+    typename A4>
+struct InvokeHelper<true, void, Runnable,
+    void(BoundWeakPtr, A2, A3, A4)>  {
+  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 <typename ReturnType, typename Runnable,typename A1, typename A2,
+    typename A3, typename A4, typename A5>
+struct InvokeHelper<false, ReturnType, Runnable,
+    void(A1, A2, A3, A4, A5)>  {
+  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 <typename Runnable,typename A1, typename A2, typename A3, typename A4,
+    typename A5>
+struct InvokeHelper<false, void, Runnable,
+    void(A1, A2, A3, A4, A5)>  {
+  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 <typename Runnable, typename BoundWeakPtr, typename A2, typename A3,
+    typename A4, typename A5>
+struct InvokeHelper<true, void, Runnable,
+    void(BoundWeakPtr, A2, A3, A4, A5)>  {
+  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 <typename ReturnType, typename Runnable,typename A1, typename A2,
+    typename A3, typename A4, typename A5, typename A6>
+struct InvokeHelper<false, ReturnType, Runnable,
+    void(A1, A2, A3, A4, A5, A6)>  {
+  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 <typename Runnable,typename A1, typename A2, typename A3, typename A4,
+    typename A5, typename A6>
+struct InvokeHelper<false, void, Runnable,
+    void(A1, A2, A3, A4, A5, A6)>  {
+  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 <typename Runnable, typename BoundWeakPtr, typename A2, typename A3,
+    typename A4, typename A5, typename A6>
+struct InvokeHelper<true, void, Runnable,
+    void(BoundWeakPtr, A2, A3, A4, A5, A6)>  {
+  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 <typename ReturnType, typename Runnable,typename A1, typename A2,
+    typename A3, typename A4, typename A5, typename A6, typename A7>
+struct InvokeHelper<false, ReturnType, Runnable,
+    void(A1, A2, A3, A4, A5, A6, A7)>  {
+  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 <typename Runnable,typename A1, typename A2, typename A3, typename A4,
+    typename A5, typename A6, typename A7>
+struct InvokeHelper<false, void, Runnable,
+    void(A1, A2, A3, A4, A5, A6, A7)>  {
+  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 <typename Runnable, typename BoundWeakPtr, typename A2, typename A3,
+    typename A4, typename A5, typename A6, typename A7>
+struct InvokeHelper<true, void, Runnable,
+    void(BoundWeakPtr, A2, A3, A4, A5, A6, A7)>  {
+  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 <typename ReturnType, typename Runnable, typename ArgsType>
+struct InvokeHelper<true, ReturnType, Runnable, ArgsType> {
+  // 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<ReturnType>::value,
+                 weak_ptrs_can_only_bind_to_methods_without_return_values);
+};
+
+#endif
+
+// Invoker<>
+//
+// See description at the top of the file.
+template <int NumBound, typename Storage, typename RunType>
+struct Invoker;
+
+// Arity 0 -> 0.
+template <typename StorageType, typename R>
+struct Invoker<0, StorageType, R()> {
+  typedef R(RunType)(BindStateBase*);
+
+  typedef R(UnboundRunType)();
+
+  static R Run(BindStateBase* base) {
+    StorageType* storage = static_cast<StorageType*>(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<StorageType::IsWeakCall::value, R,
+           typename StorageType::RunnableType,
+           void()>
+               ::MakeItSo(storage->runnable_);
+  }
+};
+
+// Arity 1 -> 1.
+template <typename StorageType, typename R,typename X1>
+struct Invoker<0, StorageType, R(X1)> {
+  typedef R(RunType)(BindStateBase*,
+      typename CallbackParamTraits<X1>::ForwardType);
+
+  typedef R(UnboundRunType)(X1);
+
+  static R Run(BindStateBase* base,
+      typename CallbackParamTraits<X1>::ForwardType x1) {
+    StorageType* storage = static_cast<StorageType*>(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<StorageType::IsWeakCall::value, R,
+           typename StorageType::RunnableType,
+           void(typename CallbackParamTraits<X1>::ForwardType x1)>
+               ::MakeItSo(storage->runnable_, CallbackForward(x1));
+  }
+};
+
+// Arity 1 -> 0.
+template <typename StorageType, typename R,typename X1>
+struct Invoker<1, StorageType, R(X1)> {
+  typedef R(RunType)(BindStateBase*);
+
+  typedef R(UnboundRunType)();
+
+  static R Run(BindStateBase* base) {
+    StorageType* storage = static_cast<StorageType*>(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<StorageType::IsWeakCall::value, R,
+           typename StorageType::RunnableType,
+           void(typename Bound1UnwrapTraits::ForwardType)>
+               ::MakeItSo(storage->runnable_, CallbackForward(x1));
+  }
+};
+
+// Arity 2 -> 2.
+template <typename StorageType, typename R,typename X1, typename X2>
+struct Invoker<0, StorageType, R(X1, X2)> {
+  typedef R(RunType)(BindStateBase*,
+      typename CallbackParamTraits<X1>::ForwardType,
+      typename CallbackParamTraits<X2>::ForwardType);
+
+  typedef R(UnboundRunType)(X1, X2);
+
+  static R Run(BindStateBase* base,
+      typename CallbackParamTraits<X1>::ForwardType x1,
+      typename CallbackParamTraits<X2>::ForwardType x2) {
+    StorageType* storage = static_cast<StorageType*>(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<StorageType::IsWeakCall::value, R,
+           typename StorageType::RunnableType,
+           void(typename CallbackParamTraits<X1>::ForwardType x1,
+               typename CallbackParamTraits<X2>::ForwardType x2)>
+               ::MakeItSo(storage->runnable_, CallbackForward(x1),
+                   CallbackForward(x2));
+  }
+};
+
+// Arity 2 -> 1.
+template <typename StorageType, typename R,typename X1, typename X2>
+struct Invoker<1, StorageType, R(X1, X2)> {
+  typedef R(RunType)(BindStateBase*,
+      typename CallbackParamTraits<X2>::ForwardType);
+
+  typedef R(UnboundRunType)(X2);
+
+  static R Run(BindStateBase* base,
+      typename CallbackParamTraits<X2>::ForwardType x2) {
+    StorageType* storage = static_cast<StorageType*>(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<StorageType::IsWeakCall::value, R,
+           typename StorageType::RunnableType,
+           void(typename Bound1UnwrapTraits::ForwardType,
+               typename CallbackParamTraits<X2>::ForwardType x2)>
+               ::MakeItSo(storage->runnable_, CallbackForward(x1),
+                   CallbackForward(x2));
+  }
+};
+
+// Arity 2 -> 0.
+template <typename StorageType, typename R,typename X1, typename X2>
+struct Invoker<2, StorageType, R(X1, X2)> {
+  typedef R(RunType)(BindStateBase*);
+
+  typedef R(UnboundRunType)();
+
+  static R Run(BindStateBase* base) {
+    StorageType* storage = static_cast<StorageType*>(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<StorageType::IsWeakCall::value, R,
+           typename StorageType::RunnableType,
+           void(typename Bound1UnwrapTraits::ForwardType,
+               typename Bound2UnwrapTraits::ForwardType)>
+               ::MakeItSo(storage->runnable_, CallbackForward(x1),
+                   CallbackForward(x2));
+  }
+};
+
+// Arity 3 -> 3.
+template <typename StorageType, typename R,typename X1, typename X2,
+    typename X3>
+struct Invoker<0, StorageType, R(X1, X2, X3)> {
+  typedef R(RunType)(BindStateBase*,
+      typename CallbackParamTraits<X1>::ForwardType,
+      typename CallbackParamTraits<X2>::ForwardType,
+      typename CallbackParamTraits<X3>::ForwardType);
+
+  typedef R(UnboundRunType)(X1, X2, X3);
+
+  static R Run(BindStateBase* base,
+      typename CallbackParamTraits<X1>::ForwardType x1,
+      typename CallbackParamTraits<X2>::ForwardType x2,
+      typename CallbackParamTraits<X3>::ForwardType x3) {
+    StorageType* storage = static_cast<StorageType*>(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<StorageType::IsWeakCall::value, R,
+           typename StorageType::RunnableType,
+           void(typename CallbackParamTraits<X1>::ForwardType x1,
+               typename CallbackParamTraits<X2>::ForwardType x2,
+               typename CallbackParamTraits<X3>::ForwardType x3)>
+               ::MakeItSo(storage->runnable_, CallbackForward(x1),
+                   CallbackForward(x2), CallbackForward(x3));
+  }
+};
+
+// Arity 3 -> 2.
+template <typename StorageType, typename R,typename X1, typename X2,
+    typename X3>
+struct Invoker<1, StorageType, R(X1, X2, X3)> {
+  typedef R(RunType)(BindStateBase*,
+      typename CallbackParamTraits<X2>::ForwardType,
+      typename CallbackParamTraits<X3>::ForwardType);
+
+  typedef R(UnboundRunType)(X2, X3);
+
+  static R Run(BindStateBase* base,
+      typename CallbackParamTraits<X2>::ForwardType x2,
+      typename CallbackParamTraits<X3>::ForwardType x3) {
+    StorageType* storage = static_cast<StorageType*>(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<StorageType::IsWeakCall::value, R,
+           typename StorageType::RunnableType,
+           void(typename Bound1UnwrapTraits::ForwardType,
+               typename CallbackParamTraits<X2>::ForwardType x2,
+               typename CallbackParamTraits<X3>::ForwardType x3)>
+               ::MakeItSo(storage->runnable_, CallbackForward(x1),
+                   CallbackForward(x2), CallbackForward(x3));
+  }
+};
+
+// Arity 3 -> 1.
+template <typename StorageType, typename R,typename X1, typename X2,
+    typename X3>
+struct Invoker<2, StorageType, R(X1, X2, X3)> {
+  typedef R(RunType)(BindStateBase*,
+      typename CallbackParamTraits<X3>::ForwardType);
+
+  typedef R(UnboundRunType)(X3);
+
+  static R Run(BindStateBase* base,
+      typename CallbackParamTraits<X3>::ForwardType x3) {
+    StorageType* storage = static_cast<StorageType*>(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<StorageType::IsWeakCall::value, R,
+           typename StorageType::RunnableType,
+           void(typename Bound1UnwrapTraits::ForwardType,
+               typename Bound2UnwrapTraits::ForwardType,
+               typename CallbackParamTraits<X3>::ForwardType x3)>
+               ::MakeItSo(storage->runnable_, CallbackForward(x1),
+                   CallbackForward(x2), CallbackForward(x3));
+  }
+};
+
+// Arity 3 -> 0.
+template <typename StorageType, typename R,typename X1, typename X2,
+    typename X3>
+struct Invoker<3, StorageType, R(X1, X2, X3)> {
+  typedef R(RunType)(BindStateBase*);
+
+  typedef R(UnboundRunType)();
+
+  static R Run(BindStateBase* base) {
+    StorageType* storage = static_cast<StorageType*>(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<StorageType::IsWeakCall::value, R,
+           typename StorageType::RunnableType,
+           void(typename Bound1UnwrapTraits::ForwardType,
+               typename Bound2UnwrapTraits::ForwardType,
+               typename Bound3UnwrapTraits::ForwardType)>
+               ::MakeItSo(storage->runnable_, CallbackForward(x1),
+                   CallbackForward(x2), CallbackForward(x3));
+  }
+};
+
+// Arity 4 -> 4.
+template <typename StorageType, typename R,typename X1, typename X2,
+    typename X3, typename X4>
+struct Invoker<0, StorageType, R(X1, X2, X3, X4)> {
+  typedef R(RunType)(BindStateBase*,
+      typename CallbackParamTraits<X1>::ForwardType,
+      typename CallbackParamTraits<X2>::ForwardType,
+      typename CallbackParamTraits<X3>::ForwardType,
+      typename CallbackParamTraits<X4>::ForwardType);
+
+  typedef R(UnboundRunType)(X1, X2, X3, X4);
+
+  static R Run(BindStateBase* base,
+      typename CallbackParamTraits<X1>::ForwardType x1,
+      typename CallbackParamTraits<X2>::ForwardType x2,
+      typename CallbackParamTraits<X3>::ForwardType x3,
+      typename CallbackParamTraits<X4>::ForwardType x4) {
+    StorageType* storage = static_cast<StorageType*>(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<StorageType::IsWeakCall::value, R,
+           typename StorageType::RunnableType,
+           void(typename CallbackParamTraits<X1>::ForwardType x1,
+               typename CallbackParamTraits<X2>::ForwardType x2,
+               typename CallbackParamTraits<X3>::ForwardType x3,
+               typename CallbackParamTraits<X4>::ForwardType x4)>
+               ::MakeItSo(storage->runnable_, CallbackForward(x1),
+                   CallbackForward(x2), CallbackForward(x3),
+                   CallbackForward(x4));
+  }
+};
+
+// Arity 4 -> 3.
+template <typename StorageType, typename R,typename X1, typename X2,
+    typename X3, typename X4>
+struct Invoker<1, StorageType, R(X1, X2, X3, X4)> {
+  typedef R(RunType)(BindStateBase*,
+      typename CallbackParamTraits<X2>::ForwardType,
+      typename CallbackParamTraits<X3>::ForwardType,
+      typename CallbackParamTraits<X4>::ForwardType);
+
+  typedef R(UnboundRunType)(X2, X3, X4);
+
+  static R Run(BindStateBase* base,
+      typename CallbackParamTraits<X2>::ForwardType x2,
+      typename CallbackParamTraits<X3>::ForwardType x3,
+      typename CallbackParamTraits<X4>::ForwardType x4) {
+    StorageType* storage = static_cast<StorageType*>(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<StorageType::IsWeakCall::value, R,
+           typename StorageType::RunnableType,
+           void(typename Bound1UnwrapTraits::ForwardType,
+               typename CallbackParamTraits<X2>::ForwardType x2,
+               typename CallbackParamTraits<X3>::ForwardType x3,
+               typename CallbackParamTraits<X4>::ForwardType x4)>
+               ::MakeItSo(storage->runnable_, CallbackForward(x1),
+                   CallbackForward(x2), CallbackForward(x3),
+                   CallbackForward(x4));
+  }
+};
+
+// Arity 4 -> 2.
+template <typename StorageType, typename R,typename X1, typename X2,
+    typename X3, typename X4>
+struct Invoker<2, StorageType, R(X1, X2, X3, X4)> {
+  typedef R(RunType)(BindStateBase*,
+      typename CallbackParamTraits<X3>::ForwardType,
+      typename CallbackParamTraits<X4>::ForwardType);
+
+  typedef R(UnboundRunType)(X3, X4);
+
+  static R Run(BindStateBase* base,
+      typename CallbackParamTraits<X3>::ForwardType x3,
+      typename CallbackParamTraits<X4>::ForwardType x4) {
+    StorageType* storage = static_cast<StorageType*>(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<StorageType::IsWeakCall::value, R,
+           typename StorageType::RunnableType,
+           void(typename Bound1UnwrapTraits::ForwardType,
+               typename Bound2UnwrapTraits::ForwardType,
+               typename CallbackParamTraits<X3>::ForwardType x3,
+               typename CallbackParamTraits<X4>::ForwardType x4)>
+               ::MakeItSo(storage->runnable_, CallbackForward(x1),
+                   CallbackForward(x2), CallbackForward(x3),
+                   CallbackForward(x4));
+  }
+};
+
+// Arity 4 -> 1.
+template <typename StorageType, typename R,typename X1, typename X2,
+    typename X3, typename X4>
+struct Invoker<3, StorageType, R(X1, X2, X3, X4)> {
+  typedef R(RunType)(BindStateBase*,
+      typename CallbackParamTraits<X4>::ForwardType);
+
+  typedef R(UnboundRunType)(X4);
+
+  static R Run(BindStateBase* base,
+      typename CallbackParamTraits<X4>::ForwardType x4) {
+    StorageType* storage = static_cast<StorageType*>(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<StorageType::IsWeakCall::value, R,
+           typename StorageType::RunnableType,
+           void(typename Bound1UnwrapTraits::ForwardType,
+               typename Bound2UnwrapTraits::ForwardType,
+               typename Bound3UnwrapTraits::ForwardType,
+               typename CallbackParamTraits<X4>::ForwardType x4)>
+               ::MakeItSo(storage->runnable_, CallbackForward(x1),
+                   CallbackForward(x2), CallbackForward(x3),
+                   CallbackForward(x4));
+  }
+};
+
+// Arity 4 -> 0.
+template <typename StorageType, typename R,typename X1, typename X2,
+    typename X3, typename X4>
+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<StorageType*>(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<StorageType::IsWeakCall::value, R,
+           typename StorageType::RunnableType,
+           void(typename Bound1UnwrapTraits::ForwardType,
+               typename Bound2UnwrapTraits::ForwardType,
+               typename Bound3UnwrapTraits::ForwardType,
+               typename Bound4UnwrapTraits::ForwardType)>
+               ::MakeItSo(storage->runnable_, CallbackForward(x1),
+                   CallbackForward(x2), CallbackForward(x3),
+                   CallbackForward(x4));
+  }
+};
+
+// Arity 5 -> 5.
+template <typename StorageType, typename R,typename X1, typename X2,
+    typename X3, typename X4, typename X5>
+struct Invoker<0, StorageType, R(X1, X2, X3, X4, X5)> {
+  typedef R(RunType)(BindStateBase*,
+      typename CallbackParamTraits<X1>::ForwardType,
+      typename CallbackParamTraits<X2>::ForwardType,
+      typename CallbackParamTraits<X3>::ForwardType,
+      typename CallbackParamTraits<X4>::ForwardType,
+      typename CallbackParamTraits<X5>::ForwardType);
+
+  typedef R(UnboundRunType)(X1, X2, X3, X4, X5);
+
+  static R Run(BindStateBase* base,
+      typename CallbackParamTraits<X1>::ForwardType x1,
+      typename CallbackParamTraits<X2>::ForwardType x2,
+      typename CallbackParamTraits<X3>::ForwardType x3,
+      typename CallbackParamTraits<X4>::ForwardType x4,
+      typename CallbackParamTraits<X5>::ForwardType x5) {
+    StorageType* storage = static_cast<StorageType*>(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<StorageType::IsWeakCall::value, R,
+           typename StorageType::RunnableType,
+           void(typename CallbackParamTraits<X1>::ForwardType x1,
+               typename CallbackParamTraits<X2>::ForwardType x2,
+               typename CallbackParamTraits<X3>::ForwardType x3,
+               typename CallbackParamTraits<X4>::ForwardType x4,
+               typename CallbackParamTraits<X5>::ForwardType x5)>
+               ::MakeItSo(storage->runnable_, CallbackForward(x1),
+                   CallbackForward(x2), CallbackForward(x3),
+                   CallbackForward(x4), CallbackForward(x5));
+  }
+};
+
+// Arity 5 -> 4.
+template <typename StorageType, typename R,typename X1, typename X2,
+    typename X3, typename X4, typename X5>
+struct Invoker<1, StorageType, R(X1, X2, X3, X4, X5)> {
+  typedef R(RunType)(BindStateBase*,
+      typename CallbackParamTraits<X2>::ForwardType,
+      typename CallbackParamTraits<X3>::ForwardType,
+      typename CallbackParamTraits<X4>::ForwardType,
+      typename CallbackParamTraits<X5>::ForwardType);
+
+  typedef R(UnboundRunType)(X2, X3, X4, X5);
+
+  static R Run(BindStateBase* base,
+      typename CallbackParamTraits<X2>::ForwardType x2,
+      typename CallbackParamTraits<X3>::ForwardType x3,
+      typename CallbackParamTraits<X4>::ForwardType x4,
+      typename CallbackParamTraits<X5>::ForwardType x5) {
+    StorageType* storage = static_cast<StorageType*>(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<StorageType::IsWeakCall::value, R,
+           typename StorageType::RunnableType,
+           void(typename Bound1UnwrapTraits::ForwardType,
+               typename CallbackParamTraits<X2>::ForwardType x2,
+               typename CallbackParamTraits<X3>::ForwardType x3,
+               typename CallbackParamTraits<X4>::ForwardType x4,
+               typename CallbackParamTraits<X5>::ForwardType x5)>
+               ::MakeItSo(storage->runnable_, CallbackForward(x1),
+                   CallbackForward(x2), CallbackForward(x3),
+                   CallbackForward(x4), CallbackForward(x5));
+  }
+};
+
+// Arity 5 -> 3.
+template <typename StorageType, typename R,typename X1, typename X2,
+    typename X3, typename X4, typename X5>
+struct Invoker<2, StorageType, R(X1, X2, X3, X4, X5)> {
+  typedef R(RunType)(BindStateBase*,
+      typename CallbackParamTraits<X3>::ForwardType,
+      typename CallbackParamTraits<X4>::ForwardType,
+      typename CallbackParamTraits<X5>::ForwardType);
+
+  typedef R(UnboundRunType)(X3, X4, X5);
+
+  static R Run(BindStateBase* base,
+      typename CallbackParamTraits<X3>::ForwardType x3,
+      typename CallbackParamTraits<X4>::ForwardType x4,
+      typename CallbackParamTraits<X5>::ForwardType x5) {
+    StorageType* storage = static_cast<StorageType*>(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<StorageType::IsWeakCall::value, R,
+           typename StorageType::RunnableType,
+           void(typename Bound1UnwrapTraits::ForwardType,
+               typename Bound2UnwrapTraits::ForwardType,
+               typename CallbackParamTraits<X3>::ForwardType x3,
+               typename CallbackParamTraits<X4>::ForwardType x4,
+               typename CallbackParamTraits<X5>::ForwardType x5)>
+               ::MakeItSo(storage->runnable_, CallbackForward(x1),
+                   CallbackForward(x2), CallbackForward(x3),
+                   CallbackForward(x4), CallbackForward(x5));
+  }
+};
+
+// Arity 5 -> 2.
+template <typename StorageType, typename R,typename X1, typename X2,
+    typename X3, typename X4, typename X5>
+struct Invoker<3, StorageType, R(X1, X2, X3, X4, X5)> {
+  typedef R(RunType)(BindStateBase*,
+      typename CallbackParamTraits<X4>::ForwardType,
+      typename CallbackParamTraits<X5>::ForwardType);
+
+  typedef R(UnboundRunType)(X4, X5);
+
+  static R Run(BindStateBase* base,
+      typename CallbackParamTraits<X4>::ForwardType x4,
+      typename CallbackParamTraits<X5>::ForwardType x5) {
+    StorageType* storage = static_cast<StorageType*>(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<StorageType::IsWeakCall::value, R,
+           typename StorageType::RunnableType,
+           void(typename Bound1UnwrapTraits::ForwardType,
+               typename Bound2UnwrapTraits::ForwardType,
+               typename Bound3UnwrapTraits::ForwardType,
+               typename CallbackParamTraits<X4>::ForwardType x4,
+               typename CallbackParamTraits<X5>::ForwardType x5)>
+               ::MakeItSo(storage->runnable_, CallbackForward(x1),
+                   CallbackForward(x2), CallbackForward(x3),
+                   CallbackForward(x4), CallbackForward(x5));
+  }
+};
+
+// Arity 5 -> 1.
+template <typename StorageType, typename R,typename X1, typename X2,
+    typename X3, typename X4, typename X5>
+struct Invoker<4, StorageType, R(X1, X2, X3, X4, X5)> {
+  typedef R(RunType)(BindStateBase*,
+      typename CallbackParamTraits<X5>::ForwardType);
+
+  typedef R(UnboundRunType)(X5);
+
+  static R Run(BindStateBase* base,
+      typename CallbackParamTraits<X5>::ForwardType x5) {
+    StorageType* storage = static_cast<StorageType*>(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<StorageType::IsWeakCall::value, R,
+           typename StorageType::RunnableType,
+           void(typename Bound1UnwrapTraits::ForwardType,
+               typename Bound2UnwrapTraits::ForwardType,
+               typename Bound3UnwrapTraits::ForwardType,
+               typename Bound4UnwrapTraits::ForwardType,
+               typename CallbackParamTraits<X5>::ForwardType x5)>
+               ::MakeItSo(storage->runnable_, CallbackForward(x1),
+                   CallbackForward(x2), CallbackForward(x3),
+                   CallbackForward(x4), CallbackForward(x5));
+  }
+};
+
+// Arity 5 -> 0.
+template <typename StorageType, typename R,typename X1, typename X2,
+    typename X3, typename X4, typename X5>
+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<StorageType*>(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<StorageType::IsWeakCall::value, R,
+           typename StorageType::RunnableType,
+           void(typename Bound1UnwrapTraits::ForwardType,
+               typename Bound2UnwrapTraits::ForwardType,
+               typename Bound3UnwrapTraits::ForwardType,
+               typename Bound4UnwrapTraits::ForwardType,
+               typename Bound5UnwrapTraits::ForwardType)>
+               ::MakeItSo(storage->runnable_, CallbackForward(x1),
+                   CallbackForward(x2), CallbackForward(x3),
+                   CallbackForward(x4), CallbackForward(x5));
+  }
+};
+
+// Arity 6 -> 6.
+template <typename StorageType, typename R,typename X1, typename X2,
+    typename X3, typename X4, typename X5, typename X6>
+struct Invoker<0, StorageType, R(X1, X2, X3, X4, X5, X6)> {
+  typedef R(RunType)(BindStateBase*,
+      typename CallbackParamTraits<X1>::ForwardType,
+      typename CallbackParamTraits<X2>::ForwardType,
+      typename CallbackParamTraits<X3>::ForwardType,
+      typename CallbackParamTraits<X4>::ForwardType,
+      typename CallbackParamTraits<X5>::ForwardType,
+      typename CallbackParamTraits<X6>::ForwardType);
+
+  typedef R(UnboundRunType)(X1, X2, X3, X4, X5, X6);
+
+  static R Run(BindStateBase* base,
+      typename CallbackParamTraits<X1>::ForwardType x1,
+      typename CallbackParamTraits<X2>::ForwardType x2,
+      typename CallbackParamTraits<X3>::ForwardType x3,
+      typename CallbackParamTraits<X4>::ForwardType x4,
+      typename CallbackParamTraits<X5>::ForwardType x5,
+      typename CallbackParamTraits<X6>::ForwardType x6) {
+    StorageType* storage = static_cast<StorageType*>(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<StorageType::IsWeakCall::value, R,
+           typename StorageType::RunnableType,
+           void(typename CallbackParamTraits<X1>::ForwardType x1,
+               typename CallbackParamTraits<X2>::ForwardType x2,
+               typename CallbackParamTraits<X3>::ForwardType x3,
+               typename CallbackParamTraits<X4>::ForwardType x4,
+               typename CallbackParamTraits<X5>::ForwardType x5,
+               typename CallbackParamTraits<X6>::ForwardType x6)>
+               ::MakeItSo(storage->runnable_, CallbackForward(x1),
+                   CallbackForward(x2), CallbackForward(x3),
+                   CallbackForward(x4), CallbackForward(x5),
+                   CallbackForward(x6));
+  }
+};
+
+// Arity 6 -> 5.
+template <typename StorageType, typename R,typename X1, typename X2,
+    typename X3, typename X4, typename X5, typename X6>
+struct Invoker<1, StorageType, R(X1, X2, X3, X4, X5, X6)> {
+  typedef R(RunType)(BindStateBase*,
+      typename CallbackParamTraits<X2>::ForwardType,
+      typename CallbackParamTraits<X3>::ForwardType,
+      typename CallbackParamTraits<X4>::ForwardType,
+      typename CallbackParamTraits<X5>::ForwardType,
+      typename CallbackParamTraits<X6>::ForwardType);
+
+  typedef R(UnboundRunType)(X2, X3, X4, X5, X6);
+
+  static R Run(BindStateBase* base,
+      typename CallbackParamTraits<X2>::ForwardType x2,
+      typename CallbackParamTraits<X3>::ForwardType x3,
+      typename CallbackParamTraits<X4>::ForwardType x4,
+      typename CallbackParamTraits<X5>::ForwardType x5,
+      typename CallbackParamTraits<X6>::ForwardType x6) {
+    StorageType* storage = static_cast<StorageType*>(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<StorageType::IsWeakCall::value, R,
+           typename StorageType::RunnableType,
+           void(typename Bound1UnwrapTraits::ForwardType,
+               typename CallbackParamTraits<X2>::ForwardType x2,
+               typename CallbackParamTraits<X3>::ForwardType x3,
+               typename CallbackParamTraits<X4>::ForwardType x4,
+               typename CallbackParamTraits<X5>::ForwardType x5,
+               typename CallbackParamTraits<X6>::ForwardType x6)>
+               ::MakeItSo(storage->runnable_, CallbackForward(x1),
+                   CallbackForward(x2), CallbackForward(x3),
+                   CallbackForward(x4), CallbackForward(x5),
+                   CallbackForward(x6));
+  }
+};
+
+// Arity 6 -> 4.
+template <typename StorageType, typename R,typename X1, typename X2,
+    typename X3, typename X4, typename X5, typename X6>
+struct Invoker<2, StorageType, R(X1, X2, X3, X4, X5, X6)> {
+  typedef R(RunType)(BindStateBase*,
+      typename CallbackParamTraits<X3>::ForwardType,
+      typename CallbackParamTraits<X4>::ForwardType,
+      typename CallbackParamTraits<X5>::ForwardType,
+      typename CallbackParamTraits<X6>::ForwardType);
+
+  typedef R(UnboundRunType)(X3, X4, X5, X6);
+
+  static R Run(BindStateBase* base,
+      typename CallbackParamTraits<X3>::ForwardType x3,
+      typename CallbackParamTraits<X4>::ForwardType x4,
+      typename CallbackParamTraits<X5>::ForwardType x5,
+      typename CallbackParamTraits<X6>::ForwardType x6) {
+    StorageType* storage = static_cast<StorageType*>(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<StorageType::IsWeakCall::value, R,
+           typename StorageType::RunnableType,
+           void(typename Bound1UnwrapTraits::ForwardType,
+               typename Bound2UnwrapTraits::ForwardType,
+               typename CallbackParamTraits<X3>::ForwardType x3,
+               typename CallbackParamTraits<X4>::ForwardType x4,
+               typename CallbackParamTraits<X5>::ForwardType x5,
+               typename CallbackParamTraits<X6>::ForwardType x6)>
+               ::MakeItSo(storage->runnable_, CallbackForward(x1),
+                   CallbackForward(x2), CallbackForward(x3),
+                   CallbackForward(x4), CallbackForward(x5),
+                   CallbackForward(x6));
+  }
+};
+
+// Arity 6 -> 3.
+template <typename StorageType, typename R,typename X1, typename X2,
+    typename X3, typename X4, typename X5, typename X6>
+struct Invoker<3, StorageType, R(X1, X2, X3, X4, X5, X6)> {
+  typedef R(RunType)(BindStateBase*,
+      typename CallbackParamTraits<X4>::ForwardType,
+      typename CallbackParamTraits<X5>::ForwardType,
+      typename CallbackParamTraits<X6>::ForwardType);
+
+  typedef R(UnboundRunType)(X4, X5, X6);
+
+  static R Run(BindStateBase* base,
+      typename CallbackParamTraits<X4>::ForwardType x4,
+      typename CallbackParamTraits<X5>::ForwardType x5,
+      typename CallbackParamTraits<X6>::ForwardType x6) {
+    StorageType* storage = static_cast<StorageType*>(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<StorageType::IsWeakCall::value, R,
+           typename StorageType::RunnableType,
+           void(typename Bound1UnwrapTraits::ForwardType,
+               typename Bound2UnwrapTraits::ForwardType,
+               typename Bound3UnwrapTraits::ForwardType,
+               typename CallbackParamTraits<X4>::ForwardType x4,
+               typename CallbackParamTraits<X5>::ForwardType x5,
+               typename CallbackParamTraits<X6>::ForwardType x6)>
+               ::MakeItSo(storage->runnable_, CallbackForward(x1),
+                   CallbackForward(x2), CallbackForward(x3),
+                   CallbackForward(x4), CallbackForward(x5),
+                   CallbackForward(x6));
+  }
+};
+
+// Arity 6 -> 2.
+template <typename StorageType, typename R,typename X1, typename X2,
+    typename X3, typename X4, typename X5, typename X6>
+struct Invoker<4, StorageType, R(X1, X2, X3, X4, X5, X6)> {
+  typedef R(RunType)(BindStateBase*,
+      typename CallbackParamTraits<X5>::ForwardType,
+      typename CallbackParamTraits<X6>::ForwardType);
+
+  typedef R(UnboundRunType)(X5, X6);
+
+  static R Run(BindStateBase* base,
+      typename CallbackParamTraits<X5>::ForwardType x5,
+      typename CallbackParamTraits<X6>::ForwardType x6) {
+    StorageType* storage = static_cast<StorageType*>(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<StorageType::IsWeakCall::value, R,
+           typename StorageType::RunnableType,
+           void(typename Bound1UnwrapTraits::ForwardType,
+               typename Bound2UnwrapTraits::ForwardType,
+               typename Bound3UnwrapTraits::ForwardType,
+               typename Bound4UnwrapTraits::ForwardType,
+               typename CallbackParamTraits<X5>::ForwardType x5,
+               typename CallbackParamTraits<X6>::ForwardType x6)>
+               ::MakeItSo(storage->runnable_, CallbackForward(x1),
+                   CallbackForward(x2), CallbackForward(x3),
+                   CallbackForward(x4), CallbackForward(x5),
+                   CallbackForward(x6));
+  }
+};
+
+// Arity 6 -> 1.
+template <typename StorageType, typename R,typename X1, typename X2,
+    typename X3, typename X4, typename X5, typename X6>
+struct Invoker<5, StorageType, R(X1, X2, X3, X4, X5, X6)> {
+  typedef R(RunType)(BindStateBase*,
+      typename CallbackParamTraits<X6>::ForwardType);
+
+  typedef R(UnboundRunType)(X6);
+
+  static R Run(BindStateBase* base,
+      typename CallbackParamTraits<X6>::ForwardType x6) {
+    StorageType* storage = static_cast<StorageType*>(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<StorageType::IsWeakCall::value, R,
+           typename StorageType::RunnableType,
+           void(typename Bound1UnwrapTraits::ForwardType,
+               typename Bound2UnwrapTraits::ForwardType,
+               typename Bound3UnwrapTraits::ForwardType,
+               typename Bound4UnwrapTraits::ForwardType,
+               typename Bound5UnwrapTraits::ForwardType,
+               typename CallbackParamTraits<X6>::ForwardType x6)>
+               ::MakeItSo(storage->runnable_, CallbackForward(x1),
+                   CallbackForward(x2), CallbackForward(x3),
+                   CallbackForward(x4), CallbackForward(x5),
+                   CallbackForward(x6));
+  }
+};
+
+// Arity 6 -> 0.
+template <typename StorageType, typename R,typename X1, typename X2,
+    typename X3, typename X4, typename X5, typename X6>
+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<StorageType*>(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<StorageType::IsWeakCall::value, R,
+           typename StorageType::RunnableType,
+           void(typename Bound1UnwrapTraits::ForwardType,
+               typename Bound2UnwrapTraits::ForwardType,
+               typename Bound3UnwrapTraits::ForwardType,
+               typename Bound4UnwrapTraits::ForwardType,
+               typename Bound5UnwrapTraits::ForwardType,
+               typename Bound6UnwrapTraits::ForwardType)>
+               ::MakeItSo(storage->runnable_, CallbackForward(x1),
+                   CallbackForward(x2), CallbackForward(x3),
+                   CallbackForward(x4), CallbackForward(x5),
+                   CallbackForward(x6));
+  }
+};
+
+// Arity 7 -> 7.
+template <typename StorageType, typename R,typename X1, typename X2,
+    typename X3, typename X4, typename X5, typename X6, typename X7>
+struct Invoker<0, StorageType, R(X1, X2, X3, X4, X5, X6, X7)> {
+  typedef R(RunType)(BindStateBase*,
+      typename CallbackParamTraits<X1>::ForwardType,
+      typename CallbackParamTraits<X2>::ForwardType,
+      typename CallbackParamTraits<X3>::ForwardType,
+      typename CallbackParamTraits<X4>::ForwardType,
+      typename CallbackParamTraits<X5>::ForwardType,
+      typename CallbackParamTraits<X6>::ForwardType,
+      typename CallbackParamTraits<X7>::ForwardType);
+
+  typedef R(UnboundRunType)(X1, X2, X3, X4, X5, X6, X7);
+
+  static R Run(BindStateBase* base,
+      typename CallbackParamTraits<X1>::ForwardType x1,
+      typename CallbackParamTraits<X2>::ForwardType x2,
+      typename CallbackParamTraits<X3>::ForwardType x3,
+      typename CallbackParamTraits<X4>::ForwardType x4,
+      typename CallbackParamTraits<X5>::ForwardType x5,
+      typename CallbackParamTraits<X6>::ForwardType x6,
+      typename CallbackParamTraits<X7>::ForwardType x7) {
+    StorageType* storage = static_cast<StorageType*>(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<StorageType::IsWeakCall::value, R,
+           typename StorageType::RunnableType,
+           void(typename CallbackParamTraits<X1>::ForwardType x1,
+               typename CallbackParamTraits<X2>::ForwardType x2,
+               typename CallbackParamTraits<X3>::ForwardType x3,
+               typename CallbackParamTraits<X4>::ForwardType x4,
+               typename CallbackParamTraits<X5>::ForwardType x5,
+               typename CallbackParamTraits<X6>::ForwardType x6,
+               typename CallbackParamTraits<X7>::ForwardType x7)>
+               ::MakeItSo(storage->runnable_, CallbackForward(x1),
+                   CallbackForward(x2), CallbackForward(x3),
+                   CallbackForward(x4), CallbackForward(x5),
+                   CallbackForward(x6), CallbackForward(x7));
+  }
+};
+
+// Arity 7 -> 6.
+template <typename StorageType, typename R,typename X1, typename X2,
+    typename X3, typename X4, typename X5, typename X6, typename X7>
+struct Invoker<1, StorageType, R(X1, X2, X3, X4, X5, X6, X7)> {
+  typedef R(RunType)(BindStateBase*,
+      typename CallbackParamTraits<X2>::ForwardType,
+      typename CallbackParamTraits<X3>::ForwardType,
+      typename CallbackParamTraits<X4>::ForwardType,
+      typename CallbackParamTraits<X5>::ForwardType,
+      typename CallbackParamTraits<X6>::ForwardType,
+      typename CallbackParamTraits<X7>::ForwardType);
+
+  typedef R(UnboundRunType)(X2, X3, X4, X5, X6, X7);
+
+  static R Run(BindStateBase* base,
+      typename CallbackParamTraits<X2>::ForwardType x2,
+      typename CallbackParamTraits<X3>::ForwardType x3,
+      typename CallbackParamTraits<X4>::ForwardType x4,
+      typename CallbackParamTraits<X5>::ForwardType x5,
+      typename CallbackParamTraits<X6>::ForwardType x6,
+      typename CallbackParamTraits<X7>::ForwardType x7) {
+    StorageType* storage = static_cast<StorageType*>(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<StorageType::IsWeakCall::value, R,
+           typename StorageType::RunnableType,
+           void(typename Bound1UnwrapTraits::ForwardType,
+               typename CallbackParamTraits<X2>::ForwardType x2,
+               typename CallbackParamTraits<X3>::ForwardType x3,
+               typename CallbackParamTraits<X4>::ForwardType x4,
+               typename CallbackParamTraits<X5>::ForwardType x5,
+               typename CallbackParamTraits<X6>::ForwardType x6,
+               typename CallbackParamTraits<X7>::ForwardType x7)>
+               ::MakeItSo(storage->runnable_, CallbackForward(x1),
+                   CallbackForward(x2), CallbackForward(x3),
+                   CallbackForward(x4), CallbackForward(x5),
+                   CallbackForward(x6), CallbackForward(x7));
+  }
+};
+
+// Arity 7 -> 5.
+template <typename StorageType, typename R,typename X1, typename X2,
+    typename X3, typename X4, typename X5, typename X6, typename X7>
+struct Invoker<2, StorageType, R(X1, X2, X3, X4, X5, X6, X7)> {
+  typedef R(RunType)(BindStateBase*,
+      typename CallbackParamTraits<X3>::ForwardType,
+      typename CallbackParamTraits<X4>::ForwardType,
+      typename CallbackParamTraits<X5>::ForwardType,
+      typename CallbackParamTraits<X6>::ForwardType,
+      typename CallbackParamTraits<X7>::ForwardType);
+
+  typedef R(UnboundRunType)(X3, X4, X5, X6, X7);
+
+  static R Run(BindStateBase* base,
+      typename CallbackParamTraits<X3>::ForwardType x3,
+      typename CallbackParamTraits<X4>::ForwardType x4,
+      typename CallbackParamTraits<X5>::ForwardType x5,
+      typename CallbackParamTraits<X6>::ForwardType x6,
+      typename CallbackParamTraits<X7>::ForwardType x7) {
+    StorageType* storage = static_cast<StorageType*>(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<StorageType::IsWeakCall::value, R,
+           typename StorageType::RunnableType,
+           void(typename Bound1UnwrapTraits::ForwardType,
+               typename Bound2UnwrapTraits::ForwardType,
+               typename CallbackParamTraits<X3>::ForwardType x3,
+               typename CallbackParamTraits<X4>::ForwardType x4,
+               typename CallbackParamTraits<X5>::ForwardType x5,
+               typename CallbackParamTraits<X6>::ForwardType x6,
+               typename CallbackParamTraits<X7>::ForwardType x7)>
+               ::MakeItSo(storage->runnable_, CallbackForward(x1),
+                   CallbackForward(x2), CallbackForward(x3),
+                   CallbackForward(x4), CallbackForward(x5),
+                   CallbackForward(x6), CallbackForward(x7));
+  }
+};
+
+// Arity 7 -> 4.
+template <typename StorageType, typename R,typename X1, typename X2,
+    typename X3, typename X4, typename X5, typename X6, typename X7>
+struct Invoker<3, StorageType, R(X1, X2, X3, X4, X5, X6, X7)> {
+  typedef R(RunType)(BindStateBase*,
+      typename CallbackParamTraits<X4>::ForwardType,
+      typename CallbackParamTraits<X5>::ForwardType,
+      typename CallbackParamTraits<X6>::ForwardType,
+      typename CallbackParamTraits<X7>::ForwardType);
+
+  typedef R(UnboundRunType)(X4, X5, X6, X7);
+
+  static R Run(BindStateBase* base,
+      typename CallbackParamTraits<X4>::ForwardType x4,
+      typename CallbackParamTraits<X5>::ForwardType x5,
+      typename CallbackParamTraits<X6>::ForwardType x6,
+      typename CallbackParamTraits<X7>::ForwardType x7) {
+    StorageType* storage = static_cast<StorageType*>(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<StorageType::IsWeakCall::value, R,
+           typename StorageType::RunnableType,
+           void(typename Bound1UnwrapTraits::ForwardType,
+               typename Bound2UnwrapTraits::ForwardType,
+               typename Bound3UnwrapTraits::ForwardType,
+               typename CallbackParamTraits<X4>::ForwardType x4,
+               typename CallbackParamTraits<X5>::ForwardType x5,
+               typename CallbackParamTraits<X6>::ForwardType x6,
+               typename CallbackParamTraits<X7>::ForwardType x7)>
+               ::MakeItSo(storage->runnable_, CallbackForward(x1),
+                   CallbackForward(x2), CallbackForward(x3),
+                   CallbackForward(x4), CallbackForward(x5),
+                   CallbackForward(x6), CallbackForward(x7));
+  }
+};
+
+// Arity 7 -> 3.
+template <typename StorageType, typename R,typename X1, typename X2,
+    typename X3, typename X4, typename X5, typename X6, typename X7>
+struct Invoker<4, StorageType, R(X1, X2, X3, X4, X5, X6, X7)> {
+  typedef R(RunType)(BindStateBase*,
+      typename CallbackParamTraits<X5>::ForwardType,
+      typename CallbackParamTraits<X6>::ForwardType,
+      typename CallbackParamTraits<X7>::ForwardType);
+
+  typedef R(UnboundRunType)(X5, X6, X7);
+
+  static R Run(BindStateBase* base,
+      typename CallbackParamTraits<X5>::ForwardType x5,
+      typename CallbackParamTraits<X6>::ForwardType x6,
+      typename CallbackParamTraits<X7>::ForwardType x7) {
+    StorageType* storage = static_cast<StorageType*>(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<StorageType::IsWeakCall::value, R,
+           typename StorageType::RunnableType,
+           void(typename Bound1UnwrapTraits::ForwardType,
+               typename Bound2UnwrapTraits::ForwardType,
+               typename Bound3UnwrapTraits::ForwardType,
+               typename Bound4UnwrapTraits::ForwardType,
+               typename CallbackParamTraits<X5>::ForwardType x5,
+               typename CallbackParamTraits<X6>::ForwardType x6,
+               typename CallbackParamTraits<X7>::ForwardType x7)>
+               ::MakeItSo(storage->runnable_, CallbackForward(x1),
+                   CallbackForward(x2), CallbackForward(x3),
+                   CallbackForward(x4), CallbackForward(x5),
+                   CallbackForward(x6), CallbackForward(x7));
+  }
+};
+
+// Arity 7 -> 2.
+template <typename StorageType, typename R,typename X1, typename X2,
+    typename X3, typename X4, typename X5, typename X6, typename X7>
+struct Invoker<5, StorageType, R(X1, X2, X3, X4, X5, X6, X7)> {
+  typedef R(RunType)(BindStateBase*,
+      typename CallbackParamTraits<X6>::ForwardType,
+      typename CallbackParamTraits<X7>::ForwardType);
+
+  typedef R(UnboundRunType)(X6, X7);
+
+  static R Run(BindStateBase* base,
+      typename CallbackParamTraits<X6>::ForwardType x6,
+      typename CallbackParamTraits<X7>::ForwardType x7) {
+    StorageType* storage = static_cast<StorageType*>(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<StorageType::IsWeakCall::value, R,
+           typename StorageType::RunnableType,
+           void(typename Bound1UnwrapTraits::ForwardType,
+               typename Bound2UnwrapTraits::ForwardType,
+               typename Bound3UnwrapTraits::ForwardType,
+               typename Bound4UnwrapTraits::ForwardType,
+               typename Bound5UnwrapTraits::ForwardType,
+               typename CallbackParamTraits<X6>::ForwardType x6,
+               typename CallbackParamTraits<X7>::ForwardType x7)>
+               ::MakeItSo(storage->runnable_, CallbackForward(x1),
+                   CallbackForward(x2), CallbackForward(x3),
+                   CallbackForward(x4), CallbackForward(x5),
+                   CallbackForward(x6), CallbackForward(x7));
+  }
+};
+
+// Arity 7 -> 1.
+template <typename StorageType, typename R,typename X1, typename X2,
+    typename X3, typename X4, typename X5, typename X6, typename X7>
+struct Invoker<6, StorageType, R(X1, X2, X3, X4, X5, X6, X7)> {
+  typedef R(RunType)(BindStateBase*,
+      typename CallbackParamTraits<X7>::ForwardType);
+
+  typedef R(UnboundRunType)(X7);
+
+  static R Run(BindStateBase* base,
+      typename CallbackParamTraits<X7>::ForwardType x7) {
+    StorageType* storage = static_cast<StorageType*>(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<StorageType::IsWeakCall::value, R,
+           typename StorageType::RunnableType,
+           void(typename Bound1UnwrapTraits::ForwardType,
+               typename Bound2UnwrapTraits::ForwardType,
+               typename Bound3UnwrapTraits::ForwardType,
+               typename Bound4UnwrapTraits::ForwardType,
+               typename Bound5UnwrapTraits::ForwardType,
+               typename Bound6UnwrapTraits::ForwardType,
+               typename CallbackParamTraits<X7>::ForwardType x7)>
+               ::MakeItSo(storage->runnable_, CallbackForward(x1),
+                   CallbackForward(x2), CallbackForward(x3),
+                   CallbackForward(x4), CallbackForward(x5),
+                   CallbackForward(x6), CallbackForward(x7));
+  }
+};
+
+// Arity 7 -> 0.
+template <typename StorageType, typename R,typename X1, typename X2,
+    typename X3, typename X4, typename X5, typename X6, typename X7>
+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<StorageType*>(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<StorageType::IsWeakCall::value, R,
+           typename StorageType::RunnableType,
+           void(typename Bound1UnwrapTraits::ForwardType,
+               typename Bound2UnwrapTraits::ForwardType,
+               typename Bound3UnwrapTraits::ForwardType,
+               typename Bound4UnwrapTraits::ForwardType,
+               typename Bound5UnwrapTraits::ForwardType,
+               typename Bound6UnwrapTraits::ForwardType,
+               typename Bound7UnwrapTraits::ForwardType)>
+               ::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 <typename Runnable, typename RunType, typename BoundArgsType>
+struct BindState;
+
+template <typename Runnable, typename RunType>
+struct BindState<Runnable, RunType, void()> final : 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)
+      : BindStateBase(&Destroy),
+        runnable_(runnable) {
+  }
+
+  ~BindState() {  }
+
+  static void Destroy(BindStateBase* self) {
+    delete static_cast<BindState*>(self);
+  }
+
+  RunnableType runnable_;
+};
+
+template <typename Runnable, typename RunType, typename P1>
+struct BindState<Runnable, RunType, void(P1)> final : public BindStateBase {
+  typedef Runnable RunnableType;
+  typedef IsWeakMethod<HasIsMethodTag<Runnable>::value, P1> IsWeakCall;
+  typedef Invoker<1, BindState, RunType> InvokerType;
+  typedef typename InvokerType::UnboundRunType UnboundRunType;
+
+  // Convenience typedefs for bound argument types.
+  typedef UnwrapTraits<P1> Bound1UnwrapTraits;
+
+  BindState(const Runnable& runnable, const P1& p1)
+      : BindStateBase(&Destroy),
+        runnable_(runnable),
+        p1_(p1) {
+    MaybeRefcount<HasIsMethodTag<Runnable>::value, P1>::AddRef(p1_);
+  }
+
+  ~BindState() {    MaybeRefcount<HasIsMethodTag<Runnable>::value,
+      P1>::Release(p1_);  }
+
+  static void Destroy(BindStateBase* self) {
+    delete static_cast<BindState*>(self);
+  }
+
+  RunnableType runnable_;
+  P1 p1_;
+};
+
+template <typename Runnable, typename RunType, typename P1, typename P2>
+struct BindState<Runnable, RunType, void(P1, P2)> final : public BindStateBase {
+  typedef Runnable RunnableType;
+  typedef IsWeakMethod<HasIsMethodTag<Runnable>::value, P1> IsWeakCall;
+  typedef Invoker<2, BindState, RunType> InvokerType;
+  typedef typename InvokerType::UnboundRunType UnboundRunType;
+
+  // Convenience typedefs for bound argument types.
+  typedef UnwrapTraits<P1> Bound1UnwrapTraits;
+  typedef UnwrapTraits<P2> Bound2UnwrapTraits;
+
+  BindState(const Runnable& runnable, const P1& p1, const P2& p2)
+      : BindStateBase(&Destroy),
+        runnable_(runnable),
+        p1_(p1),
+        p2_(p2) {
+    MaybeRefcount<HasIsMethodTag<Runnable>::value, P1>::AddRef(p1_);
+  }
+
+  ~BindState() {    MaybeRefcount<HasIsMethodTag<Runnable>::value,
+      P1>::Release(p1_);  }
+
+  static void Destroy(BindStateBase* self) {
+    delete static_cast<BindState*>(self);
+  }
+
+  RunnableType runnable_;
+  P1 p1_;
+  P2 p2_;
+};
+
+template <typename Runnable, typename RunType, typename P1, typename P2,
+    typename P3>
+struct BindState<Runnable, RunType, void(P1, P2, P3)> final
+    : public BindStateBase {
+  typedef Runnable RunnableType;
+  typedef IsWeakMethod<HasIsMethodTag<Runnable>::value, P1> IsWeakCall;
+  typedef Invoker<3, BindState, RunType> InvokerType;
+  typedef typename InvokerType::UnboundRunType UnboundRunType;
+
+  // Convenience typedefs for bound argument types.
+  typedef UnwrapTraits<P1> Bound1UnwrapTraits;
+  typedef UnwrapTraits<P2> Bound2UnwrapTraits;
+  typedef UnwrapTraits<P3> Bound3UnwrapTraits;
+
+  BindState(const Runnable& runnable, const P1& p1, const P2& p2, const P3& p3)
+      : BindStateBase(&Destroy),
+        runnable_(runnable),
+        p1_(p1),
+        p2_(p2),
+        p3_(p3) {
+    MaybeRefcount<HasIsMethodTag<Runnable>::value, P1>::AddRef(p1_);
+  }
+
+  ~BindState() {    MaybeRefcount<HasIsMethodTag<Runnable>::value,
+      P1>::Release(p1_);  }
+
+  static void Destroy(BindStateBase* self) {
+    delete static_cast<BindState*>(self);
+  }
+
+  RunnableType runnable_;
+  P1 p1_;
+  P2 p2_;
+  P3 p3_;
+};
+
+template <typename Runnable, typename RunType, typename P1, typename P2,
+    typename P3, typename P4>
+struct BindState<Runnable, RunType, void(P1, P2, P3, P4)> final
+    : public BindStateBase {
+  typedef Runnable RunnableType;
+  typedef IsWeakMethod<HasIsMethodTag<Runnable>::value, P1> IsWeakCall;
+  typedef Invoker<4, BindState, RunType> InvokerType;
+  typedef typename InvokerType::UnboundRunType UnboundRunType;
+
+  // Convenience typedefs for bound argument types.
+  typedef UnwrapTraits<P1> Bound1UnwrapTraits;
+  typedef UnwrapTraits<P2> Bound2UnwrapTraits;
+  typedef UnwrapTraits<P3> Bound3UnwrapTraits;
+  typedef UnwrapTraits<P4> Bound4UnwrapTraits;
+
+  BindState(const Runnable& runnable, const P1& p1, const P2& p2, const P3& p3,
+      const P4& p4)
+      : BindStateBase(&Destroy),
+        runnable_(runnable),
+        p1_(p1),
+        p2_(p2),
+        p3_(p3),
+        p4_(p4) {
+    MaybeRefcount<HasIsMethodTag<Runnable>::value, P1>::AddRef(p1_);
+  }
+
+  ~BindState() {    MaybeRefcount<HasIsMethodTag<Runnable>::value,
+      P1>::Release(p1_);  }
+
+  static void Destroy(BindStateBase* self) {
+    delete static_cast<BindState*>(self);
+  }
+
+  RunnableType runnable_;
+  P1 p1_;
+  P2 p2_;
+  P3 p3_;
+  P4 p4_;
+};
+
+template <typename Runnable, typename RunType, typename P1, typename P2,
+    typename P3, typename P4, typename P5>
+struct BindState<Runnable, RunType, void(P1, P2, P3, P4, P5)> final
+    : public BindStateBase {
+  typedef Runnable RunnableType;
+  typedef IsWeakMethod<HasIsMethodTag<Runnable>::value, P1> IsWeakCall;
+  typedef Invoker<5, BindState, RunType> InvokerType;
+  typedef typename InvokerType::UnboundRunType UnboundRunType;
+
+  // Convenience typedefs for bound argument types.
+  typedef UnwrapTraits<P1> Bound1UnwrapTraits;
+  typedef UnwrapTraits<P2> Bound2UnwrapTraits;
+  typedef UnwrapTraits<P3> Bound3UnwrapTraits;
+  typedef UnwrapTraits<P4> Bound4UnwrapTraits;
+  typedef UnwrapTraits<P5> Bound5UnwrapTraits;
+
+  BindState(const Runnable& runnable, const P1& p1, const P2& p2, const P3& p3,
+      const P4& p4, const P5& p5)
+      : BindStateBase(&Destroy),
+        runnable_(runnable),
+        p1_(p1),
+        p2_(p2),
+        p3_(p3),
+        p4_(p4),
+        p5_(p5) {
+    MaybeRefcount<HasIsMethodTag<Runnable>::value, P1>::AddRef(p1_);
+  }
+
+  ~BindState() {    MaybeRefcount<HasIsMethodTag<Runnable>::value,
+      P1>::Release(p1_);  }
+
+  static void Destroy(BindStateBase* self) {
+    delete static_cast<BindState*>(self);
+  }
+
+  RunnableType runnable_;
+  P1 p1_;
+  P2 p2_;
+  P3 p3_;
+  P4 p4_;
+  P5 p5_;
+};
+
+template <typename Runnable, typename RunType, typename P1, typename P2,
+    typename P3, typename P4, typename P5, typename P6>
+struct BindState<Runnable, RunType, void(P1, P2, P3, P4, P5, P6)> final
+    : public BindStateBase {
+  typedef Runnable RunnableType;
+  typedef IsWeakMethod<HasIsMethodTag<Runnable>::value, P1> IsWeakCall;
+  typedef Invoker<6, BindState, RunType> InvokerType;
+  typedef typename InvokerType::UnboundRunType UnboundRunType;
+
+  // Convenience typedefs for bound argument types.
+  typedef UnwrapTraits<P1> Bound1UnwrapTraits;
+  typedef UnwrapTraits<P2> Bound2UnwrapTraits;
+  typedef UnwrapTraits<P3> Bound3UnwrapTraits;
+  typedef UnwrapTraits<P4> Bound4UnwrapTraits;
+  typedef UnwrapTraits<P5> Bound5UnwrapTraits;
+  typedef UnwrapTraits<P6> Bound6UnwrapTraits;
+
+  BindState(const Runnable& runnable, const P1& p1, const P2& p2, const P3& p3,
+      const P4& p4, const P5& p5, const P6& p6)
+      : BindStateBase(&Destroy),
+        runnable_(runnable),
+        p1_(p1),
+        p2_(p2),
+        p3_(p3),
+        p4_(p4),
+        p5_(p5),
+        p6_(p6) {
+    MaybeRefcount<HasIsMethodTag<Runnable>::value, P1>::AddRef(p1_);
+  }
+
+  ~BindState() {    MaybeRefcount<HasIsMethodTag<Runnable>::value,
+      P1>::Release(p1_);  }
+
+  static void Destroy(BindStateBase* self) {
+    delete static_cast<BindState*>(self);
+  }
+
+  RunnableType runnable_;
+  P1 p1_;
+  P2 p2_;
+  P3 p3_;
+  P4 p4_;
+  P5 p5_;
+  P6 p6_;
+};
+
+template <typename Runnable, typename RunType, typename P1, typename P2,
+    typename P3, typename P4, typename P5, typename P6, typename P7>
+struct BindState<Runnable, RunType, void(P1, P2, P3, P4, P5, P6, P7)> final
+    : public BindStateBase {
+  typedef Runnable RunnableType;
+  typedef IsWeakMethod<HasIsMethodTag<Runnable>::value, P1> IsWeakCall;
+  typedef Invoker<7, BindState, RunType> InvokerType;
+  typedef typename InvokerType::UnboundRunType UnboundRunType;
+
+  // Convenience typedefs for bound argument types.
+  typedef UnwrapTraits<P1> Bound1UnwrapTraits;
+  typedef UnwrapTraits<P2> Bound2UnwrapTraits;
+  typedef UnwrapTraits<P3> Bound3UnwrapTraits;
+  typedef UnwrapTraits<P4> Bound4UnwrapTraits;
+  typedef UnwrapTraits<P5> Bound5UnwrapTraits;
+  typedef UnwrapTraits<P6> Bound6UnwrapTraits;
+  typedef UnwrapTraits<P7> 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)
+      : BindStateBase(&Destroy),
+        runnable_(runnable),
+        p1_(p1),
+        p2_(p2),
+        p3_(p3),
+        p4_(p4),
+        p5_(p5),
+        p6_(p6),
+        p7_(p7) {
+    MaybeRefcount<HasIsMethodTag<Runnable>::value, P1>::AddRef(p1_);
+  }
+
+  ~BindState() {    MaybeRefcount<HasIsMethodTag<Runnable>::value,
+      P1>::Release(p1_);  }
+
+  static void Destroy(BindStateBase* self) {
+    delete static_cast<BindState*>(self);
+  }
+
+  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_

+ 223 - 0
Source/ThirdParty/CEF/include/base/internal/cef_callback_internal.h

@@ -0,0 +1,223 @@
+// 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 <stddef.h>
+
+#include "include/base/cef_atomic_ref_count.h"
+#include "include/base/cef_macros.h"
+#include "include/base/cef_ref_counted.h"
+#include "include/base/cef_scoped_ptr.h"
+#include "include/base/cef_template_util.h"
+
+template <typename T>
+class ScopedVector;
+
+namespace base {
+namespace cef_internal {
+class CallbackBase;
+
+// At the base level, the only task is to add reference counting data. Don't use
+// RefCountedThreadSafe since it requires the destructor to be a virtual method.
+// Creating a vtable for every BindState template instantiation results in a lot
+// of bloat. Its only task is to call the destructor which can be done with a
+// function pointer.
+class BindStateBase {
+ protected:
+  explicit BindStateBase(void (*destructor)(BindStateBase*))
+      : ref_count_(0), destructor_(destructor) {}
+  ~BindStateBase() {}
+
+ private:
+  friend class scoped_refptr<BindStateBase>;
+  friend class CallbackBase;
+
+  void AddRef();
+  void Release();
+
+  AtomicRefCount ref_count_;
+
+  // Pointer to a function that will properly destroy |this|.
+  void (*destructor_)(BindStateBase*);
+
+  DISALLOW_COPY_AND_ASSIGN(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<BindStateBase> 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 <typename T> struct IsMoveOnlyType {
+  template <typename U>
+  static YesType Test(const typename U::MoveOnlyTypeForCPP03*);
+
+  template <typename U>
+  static NoType Test(...);
+
+  static const bool value = sizeof(Test<T>(0)) == sizeof(YesType) &&
+                            !is_const<T>::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 <typename T, bool is_move_only = IsMoveOnlyType<T>::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 <typename T>
+struct CallbackParamTraits<T&, false> {
+  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 <typename T, size_t n>
+struct CallbackParamTraits<T[n], false> {
+  typedef const T* ForwardType;
+  typedef const T* StorageType;
+};
+
+// See comment for CallbackParamTraits<T[n]>.
+template <typename T>
+struct CallbackParamTraits<T[], false> {
+  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 <typename T>
+struct CallbackParamTraits<T, true> {
+  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 T>
+typename enable_if<!IsMoveOnlyType<T>::value, T>::type& CallbackForward(T& t) {
+  return t;
+}
+
+template <typename T>
+typename enable_if<IsMoveOnlyType<T>::value, T>::type CallbackForward(T& t) {
+  return t.Pass();
+}
+
+}  // namespace cef_internal
+}  // namespace base
+
+#endif  // CEF_INCLUDE_BASE_INTERNAL_CEF_CALLBACK_INTERNAL_H_

+ 87 - 0
Source/ThirdParty/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 <windows.h>
+#elif defined(OS_POSIX)
+#include <pthread.h>
+#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_

+ 154 - 0
Source/ThirdParty/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 <typename T>
+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<T>::value &&
+             (is_convertible<T, subtle::RefCountedBase*>::value ||
+              is_convertible<T, subtle::RefCountedThreadSafeBase*>::value))
+  };
+#endif
+};
+
+template <typename Params>
+struct ParamsUseScopedRefptrCorrectly {
+  enum { value = 0 };
+};
+
+template <>
+struct ParamsUseScopedRefptrCorrectly<Tuple0> {
+  enum { value = 1 };
+};
+
+template <typename A>
+struct ParamsUseScopedRefptrCorrectly<Tuple1<A> > {
+  enum { value = !NeedsScopedRefptrButGetsRawPtr<A>::value };
+};
+
+template <typename A, typename B>
+struct ParamsUseScopedRefptrCorrectly<Tuple2<A, B> > {
+  enum { value = !(NeedsScopedRefptrButGetsRawPtr<A>::value ||
+                   NeedsScopedRefptrButGetsRawPtr<B>::value) };
+};
+
+template <typename A, typename B, typename C>
+struct ParamsUseScopedRefptrCorrectly<Tuple3<A, B, C> > {
+  enum { value = !(NeedsScopedRefptrButGetsRawPtr<A>::value ||
+                   NeedsScopedRefptrButGetsRawPtr<B>::value ||
+                   NeedsScopedRefptrButGetsRawPtr<C>::value) };
+};
+
+template <typename A, typename B, typename C, typename D>
+struct ParamsUseScopedRefptrCorrectly<Tuple4<A, B, C, D> > {
+  enum { value = !(NeedsScopedRefptrButGetsRawPtr<A>::value ||
+                   NeedsScopedRefptrButGetsRawPtr<B>::value ||
+                   NeedsScopedRefptrButGetsRawPtr<C>::value ||
+                   NeedsScopedRefptrButGetsRawPtr<D>::value) };
+};
+
+template <typename A, typename B, typename C, typename D, typename E>
+struct ParamsUseScopedRefptrCorrectly<Tuple5<A, B, C, D, E> > {
+  enum { value = !(NeedsScopedRefptrButGetsRawPtr<A>::value ||
+                   NeedsScopedRefptrButGetsRawPtr<B>::value ||
+                   NeedsScopedRefptrButGetsRawPtr<C>::value ||
+                   NeedsScopedRefptrButGetsRawPtr<D>::value ||
+                   NeedsScopedRefptrButGetsRawPtr<E>::value) };
+};
+
+template <typename A, typename B, typename C, typename D, typename E,
+          typename F>
+struct ParamsUseScopedRefptrCorrectly<Tuple6<A, B, C, D, E, F> > {
+  enum { value = !(NeedsScopedRefptrButGetsRawPtr<A>::value ||
+                   NeedsScopedRefptrButGetsRawPtr<B>::value ||
+                   NeedsScopedRefptrButGetsRawPtr<C>::value ||
+                   NeedsScopedRefptrButGetsRawPtr<D>::value ||
+                   NeedsScopedRefptrButGetsRawPtr<E>::value ||
+                   NeedsScopedRefptrButGetsRawPtr<F>::value) };
+};
+
+template <typename A, typename B, typename C, typename D, typename E,
+          typename F, typename G>
+struct ParamsUseScopedRefptrCorrectly<Tuple7<A, B, C, D, E, F, G> > {
+  enum { value = !(NeedsScopedRefptrButGetsRawPtr<A>::value ||
+                   NeedsScopedRefptrButGetsRawPtr<B>::value ||
+                   NeedsScopedRefptrButGetsRawPtr<C>::value ||
+                   NeedsScopedRefptrButGetsRawPtr<D>::value ||
+                   NeedsScopedRefptrButGetsRawPtr<E>::value ||
+                   NeedsScopedRefptrButGetsRawPtr<F>::value ||
+                   NeedsScopedRefptrButGetsRawPtr<G>::value) };
+};
+
+template <typename A, typename B, typename C, typename D, typename E,
+          typename F, typename G, typename H>
+struct ParamsUseScopedRefptrCorrectly<Tuple8<A, B, C, D, E, F, G, H> > {
+  enum { value = !(NeedsScopedRefptrButGetsRawPtr<A>::value ||
+                   NeedsScopedRefptrButGetsRawPtr<B>::value ||
+                   NeedsScopedRefptrButGetsRawPtr<C>::value ||
+                   NeedsScopedRefptrButGetsRawPtr<D>::value ||
+                   NeedsScopedRefptrButGetsRawPtr<E>::value ||
+                   NeedsScopedRefptrButGetsRawPtr<F>::value ||
+                   NeedsScopedRefptrButGetsRawPtr<G>::value ||
+                   NeedsScopedRefptrButGetsRawPtr<H>::value) };
+};
+
+}  // namespace cef_internal
+
+}  // namespace base
+
+#endif  // CEF_INCLUDE_BASE_INTERNAL_CEF_RAW_SCOPED_REFPTR_MISMATCH_CHECKER_H_

+ 70 - 0
Source/ThirdParty/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_

+ 189 - 0
Source/ThirdParty/CEF/include/capi/cef_app_capi.h

@@ -0,0 +1,189 @@
+// 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);
+
+///
+// Call during process startup to enable High-DPI support on Windows 7 or newer.
+// Older versions of Windows should be left DPI-unaware because they do not
+// support DirectWrite and GDI fonts are kerned very badly.
+///
+CEF_EXPORT void cef_enable_highdpi_support();
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif  // CEF_INCLUDE_CAPI_CEF_APP_CAPI_H_

+ 75 - 0
Source/ThirdParty/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_

+ 90 - 0
Source/ThirdParty/CEF/include/capi/cef_base_capi.h

@@ -0,0 +1,90 @@
+// 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 <stdint.h>
+
+#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) <= \
+  reinterpret_cast<cef_base_t*>(s)->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_

+ 673 - 0
Source/ThirdParty/CEF/include/capi/cef_browser_capi.h

@@ -0,0 +1,673 @@
+// 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;
+
+
+///
+// Callback structure for cef_browser_host_t::PrintToPDF. The functions of this
+// structure will be called on the browser process UI thread.
+///
+typedef struct _cef_pdf_print_callback_t {
+  ///
+  // Base structure.
+  ///
+  cef_base_t base;
+
+  ///
+  // Method that will be executed when the PDF printing has completed. |path| is
+  // the output path. |ok| will be true (1) if the printing completed
+  // successfully or false (0) otherwise.
+  ///
+  void (CEF_CALLBACK *on_pdf_print_finished)(
+      struct _cef_pdf_print_callback_t* self, const cef_string_t* path,
+      int ok);
+} cef_pdf_print_callback_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);
+
+  ///
+  // Print the current browser contents to the PDF file specified by |path| and
+  // execute |callback| on completion. The caller is responsible for deleting
+  // |path| when done. For PDF printing to work on Linux you must implement the
+  // cef_print_handler_t::GetPdfPaperSize function.
+  ///
+  void (CEF_CALLBACK *print_to_pdf)(struct _cef_browser_host_t* self,
+      const cef_string_t* path,
+      const struct _cef_pdf_print_settings_t* settings,
+      struct _cef_pdf_print_callback_t* callback);
+
+  ///
+  // 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);
+
+  ///
+  // Returns the maximum rate in frames per second (fps) that
+  // cef_render_handler_t:: 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). This function can only be called on the UI thread.
+  ///
+  int (CEF_CALLBACK *get_windowless_frame_rate)(
+      struct _cef_browser_host_t* self);
+
+  ///
+  // Set the maximum rate in frames per second (fps) that cef_render_handler_t::
+  // 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). Can also be
+  // set at browser creation via cef_browser_tSettings.windowless_frame_rate.
+  ///
+  void (CEF_CALLBACK *set_windowless_frame_rate)(
+      struct _cef_browser_host_t* self, int frame_rate);
+
+  ///
+  // 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_

+ 104 - 0
Source/ThirdParty/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_

+ 89 - 0
Source/ThirdParty/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_

+ 176 - 0
Source/ThirdParty/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_

+ 213 - 0
Source/ThirdParty/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_

+ 242 - 0
Source/ThirdParty/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_

+ 232 - 0
Source/ThirdParty/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. The default schemes ("http",
+  // "https", "ws" and "wss") will always be 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_

+ 112 - 0
Source/ThirdParty/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_

+ 122 - 0
Source/ThirdParty/CEF/include/capi/cef_display_handler_capi.h

@@ -0,0 +1,122 @@
+// 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 web content in the page has toggled fullscreen mode. If
+  // |fullscreen| is true (1) the content will automatically be sized to fill
+  // the browser content area. If |fullscreen| is false (0) the content will
+  // automatically return to its original size and position. The client is
+  // responsible for resizing the browser if desired.
+  ///
+  void (CEF_CALLBACK *on_fullscreen_mode_change)(
+      struct _cef_display_handler_t* self, struct _cef_browser_t* browser,
+      int fullscreen);
+
+  ///
+  // 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_

+ 341 - 0
Source/ThirdParty/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_

+ 137 - 0
Source/ThirdParty/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_

+ 162 - 0
Source/ThirdParty/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_

+ 211 - 0
Source/ThirdParty/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_

+ 87 - 0
Source/ThirdParty/CEF/include/capi/cef_drag_handler_capi.h

@@ -0,0 +1,87 @@
+// 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);
+
+  ///
+  // Called whenever draggable regions for the browser window change. These can
+  // be specified using the '-webkit-app-region: drag/no-drag' CSS-property. If
+  // draggable regions are never defined in a document this function will also
+  // never be called. If the last draggable region is removed from a document
+  // this function will be called with an NULL vector.
+  ///
+  void (CEF_CALLBACK *on_draggable_regions_changed)(
+      struct _cef_drag_handler_t* self, struct _cef_browser_t* browser,
+      size_t regionsCount, cef_draggable_region_t const* regions);
+} cef_drag_handler_t;
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif  // CEF_INCLUDE_CAPI_CEF_DRAG_HANDLER_CAPI_H_

+ 78 - 0
Source/ThirdParty/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_

+ 90 - 0
Source/ThirdParty/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_

+ 220 - 0
Source/ThirdParty/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_

+ 79 - 0
Source/ThirdParty/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_

+ 106 - 0
Source/ThirdParty/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_

+ 133 - 0
Source/ThirdParty/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_

+ 84 - 0
Source/ThirdParty/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_

+ 177 - 0
Source/ThirdParty/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_

+ 112 - 0
Source/ThirdParty/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_

+ 388 - 0
Source/ThirdParty/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_

+ 126 - 0
Source/ThirdParty/CEF/include/capi/cef_navigation_entry_capi.h

@@ -0,0 +1,126 @@
+// 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 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_

+ 106 - 0
Source/ThirdParty/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_

+ 149 - 0
Source/ThirdParty/CEF/include/capi/cef_parser_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_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);
+
+// Parses the specified |json_string| and returns a dictionary or list
+// representation. If JSON parsing fails this function returns NULL.
+CEF_EXPORT struct _cef_value_t* cef_parse_json(const cef_string_t* json_string,
+    cef_json_parser_options_t options);
+
+// Parses the specified |json_string| and returns a dictionary or list
+// representation. If JSON parsing fails this function returns NULL and
+// populates |error_code_out| and |error_msg_out| with an error code and a
+// formatted error message respectively.
+CEF_EXPORT struct _cef_value_t* cef_parse_jsonand_return_error(
+    const cef_string_t* json_string, cef_json_parser_options_t options,
+    cef_json_parser_error_t* error_code_out, cef_string_t* error_msg_out);
+
+// Generates a JSON string from the specified root |node| which should be a
+// dictionary or list value. Returns an NULL string on failure. This function
+// requires exclusive access to |node| including any underlying data.
+// The resulting string must be freed by calling cef_string_userfree_free().
+CEF_EXPORT cef_string_userfree_t cef_write_json(struct _cef_value_t* node,
+    cef_json_writer_options_t options);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif  // CEF_INCLUDE_CAPI_CEF_PARSER_CAPI_H_

+ 58 - 0
Source/ThirdParty/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_

+ 141 - 0
Source/ThirdParty/CEF/include/capi/cef_print_handler_capi.h

@@ -0,0 +1,141 @@
+// 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);
+
+  ///
+  // Return the PDF paper size in device units. Used in combination with
+  // cef_browser_host_t::print_to_pdf().
+  ///
+  cef_size_t (CEF_CALLBACK *get_pdf_paper_size)(
+      struct _cef_print_handler_t* self, int device_units_per_inch);
+} cef_print_handler_t;
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif  // CEF_INCLUDE_CAPI_CEF_PRINT_HANDLER_CAPI_H_

+ 207 - 0
Source/ThirdParty/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_

+ 102 - 0
Source/ThirdParty/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_

+ 64 - 0
Source/ThirdParty/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_

+ 171 - 0
Source/ThirdParty/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_

+ 177 - 0
Source/ThirdParty/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_

+ 300 - 0
Source/ThirdParty/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_

+ 172 - 0
Source/ThirdParty/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_

+ 74 - 0
Source/ThirdParty/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_

+ 254 - 0
Source/ThirdParty/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_

+ 86 - 0
Source/ThirdParty/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_

+ 124 - 0
Source/ThirdParty/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_

+ 130 - 0
Source/ThirdParty/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_

+ 173 - 0
Source/ThirdParty/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:
+  // <pre>
+  //  [scheme]://[username]:[password]@[host]:[port]/[url-path]
+  // </pre> 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_

+ 180 - 0
Source/ThirdParty/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_

+ 252 - 0
Source/ThirdParty/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_

+ 69 - 0
Source/ThirdParty/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_

+ 159 - 0
Source/ThirdParty/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_

+ 118 - 0
Source/ThirdParty/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_

+ 194 - 0
Source/ThirdParty/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_

+ 852 - 0
Source/ThirdParty/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: <pre>
+//   // 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;
+//     };
+//   })();
+// </pre> Example usage in the page: <pre>
+//   // 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();
+// </pre>
+///
+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_

+ 734 - 0
Source/ThirdParty/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_

Some files were not shown because too many files changed in this diff