diff --git a/CHROMIUM_BUILD_COMPATIBILITY.txt b/CHROMIUM_BUILD_COMPATIBILITY.txt index 669dcfc77..a82148b47 100644 --- a/CHROMIUM_BUILD_COMPATIBILITY.txt +++ b/CHROMIUM_BUILD_COMPATIBILITY.txt @@ -7,5 +7,5 @@ # https://bitbucket.org/chromiumembedded/cef/wiki/BranchesAndBuilding { - 'chromium_checkout': '088f14a08fb102ca523424290965c04052eca325', + 'chromium_checkout': '0bfd25d460a1cff98f9f0573a0d6cc072ecbe359', } diff --git a/cef.gyp b/cef.gyp index 93168ee29..144151f56 100644 --- a/cef.gyp +++ b/cef.gyp @@ -29,9 +29,6 @@ 'dependencies': [ 'libcef_dll_wrapper', ], - 'defines': [ - 'USING_CEF_SHARED', - ], 'include_dirs': [ '.', # cefclient includes are relative to the tests directory to make @@ -203,9 +200,6 @@ 'dependencies': [ 'libcef_dll_wrapper', ], - 'defines': [ - 'USING_CEF_SHARED', - ], 'include_dirs': [ '.', # cefsimple includes are relative to the tests directory to make @@ -366,7 +360,7 @@ '<(DEPTH)/third_party/icu/icu.gyp:icuuc', '<(DEPTH)/third_party/zlib/google/zip.gyp:zip', '<(DEPTH)/ui/base/ui_base.gyp:ui_base', - 'libcef_dll_wrapper', + 'libcef_dll_wrapper_unittests', ], 'sources': [ 'tests/cefclient/browser/client_app_browser.cc', @@ -573,12 +567,57 @@ 'target_name': 'libcef_dll_wrapper', 'type': 'static_library', 'msvs_guid': 'A9D6DC71-C0DC-4549-AEA0-3B15B44E86A9', + 'all_dependent_settings': { + 'defines': [ + 'USING_CEF_SHARED', + ], + }, 'defines': [ 'USING_CEF_SHARED', ], 'include_dirs': [ '.', ], + 'sources': [ + '<@(includes_common)', + '<@(includes_capi)', + '<@(includes_wrapper)', + '<@(libcef_dll_wrapper_sources_base)', + '<@(libcef_dll_wrapper_sources_common)', + ], + 'conditions': [ + [ 'OS=="mac"', { + 'dependencies': [ + 'cef_framework', + ], + }, { # OS!="mac" + 'dependencies': [ + 'libcef', + ], + }], + ], + }, + { + # Like the libcef_dll_wrapper target but using Chromium base/ includes + # instead of CEF base/ includes. A separate target is necessary to resolve + # cef_unittests linker errors as the Chromium base/ implementation + # diverges from the CEF implementation. + 'target_name': 'libcef_dll_wrapper_unittests', + 'type': 'static_library', + 'msvs_guid': 'A9D6DC71-C0DC-4549-AEA0-3B15B44E86A9', + 'all_dependent_settings': { + 'defines': [ + 'USING_CEF_SHARED', + 'USING_CHROMIUM_INCLUDES', + ], + }, + 'defines': [ + 'USING_CEF_SHARED', + 'USING_CHROMIUM_INCLUDES', + ], + 'include_dirs': [ + '.', + ], 'sources': [ '<@(includes_common)', '<@(includes_capi)', @@ -852,6 +891,7 @@ 'msvs_guid': 'FA39524D-3067-4141-888D-28A86C66F2B9', 'defines': [ 'BUILDING_CEF_SHARED', + 'USING_CHROMIUM_INCLUDES', ], 'include_dirs': [ '.', @@ -1575,13 +1615,14 @@ 'DYLIB_CURRENT_VERSION': '<(version_mac_dylib)', 'INFOPLIST_FILE': 'libcef/resources/framework-Info.plist', }, + 'defines': [ + 'BUILDING_CEF_SHARED', + 'USING_CHROMIUM_INCLUDES', + ], 'dependencies': [ 'cef_pak', 'libcef_static', ], - 'defines': [ - 'BUILDING_CEF_SHARED', - ], 'include_dirs': [ '.', ], @@ -1629,9 +1670,6 @@ 'cef_framework', 'libcef_dll_wrapper', ], - 'defines': [ - 'USING_CEF_SHARED', - ], 'include_dirs': [ '.', # cefclient includes are relative to the tests directory to make @@ -1703,9 +1741,6 @@ 'cef_framework', 'libcef_dll_wrapper', ], - 'defines': [ - 'USING_CEF_SHARED', - ], 'include_dirs': [ '.', # cefsimple includes are relative to the tests directory to make @@ -1780,10 +1815,7 @@ '<(DEPTH)/third_party/icu/icu.gyp:icui18n', '<(DEPTH)/third_party/icu/icu.gyp:icuuc', 'cef_framework', - 'libcef_dll_wrapper', - ], - 'defines': [ - 'USING_CEF_SHARED', + 'libcef_dll_wrapper_unittests', ], 'include_dirs': [ '.', @@ -1883,11 +1915,12 @@ 'target_name': 'libcef', 'type': 'shared_library', 'msvs_guid': 'C13650D5-CF1A-4259-BE45-B1EBA6280E47', - 'dependencies': [ - 'libcef_static', - ], 'defines': [ 'BUILDING_CEF_SHARED', + 'USING_CHROMIUM_INCLUDES', + ], + 'dependencies': [ + 'libcef_static', ], 'include_dirs': [ '.', diff --git a/cef_paths2.gypi b/cef_paths2.gypi index 6b9476852..4363fa7c4 100644 --- a/cef_paths2.gypi +++ b/cef_paths2.gypi @@ -42,7 +42,6 @@ 'include/cef_base.h', 'include/cef_pack_resources.h', 'include/cef_pack_strings.h', - 'include/cef_runnable.h', 'include/cef_version.h', 'include/internal/cef_export.h', 'include/internal/cef_logging_internal.h', @@ -107,7 +106,7 @@ 'libcef_dll/wrapper_types.h', '<@(autogen_library_side)', ], - 'libcef_dll_wrapper_sources_common': [ + 'libcef_dll_wrapper_sources_base': [ 'libcef_dll/base/cef_atomicops_x86_gcc.cc', 'libcef_dll/base/cef_bind_helpers.cc', 'libcef_dll/base/cef_callback_helpers.cc', @@ -120,6 +119,8 @@ 'libcef_dll/base/cef_thread_checker_impl.cc', 'libcef_dll/base/cef_thread_collision_warner.cc', 'libcef_dll/base/cef_weak_ptr.cc', + ], + 'libcef_dll_wrapper_sources_common': [ 'libcef_dll/cpptoc/base_cpptoc.cc', 'libcef_dll/cpptoc/base_cpptoc.h', 'libcef_dll/cpptoc/cpptoc.h', diff --git a/include/base/cef_atomic_ref_count.h b/include/base/cef_atomic_ref_count.h index cd9b648be..bdbad6c92 100644 --- a/include/base/cef_atomic_ref_count.h +++ b/include/base/cef_atomic_ref_count.h @@ -44,10 +44,10 @@ // 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) +#elif defined(USING_CHROMIUM_INCLUDES) // When building CEF include the Chromium header directly. #include "base/atomic_ref_count.h" -#else // !BUILDING_CEF_SHARED +#else // !USING_CHROMIUM_INCLUDES // The following is substantially similar to the Chromium implementation. // If the Chromium implementation diverges the below implementation should be // updated to match. @@ -121,6 +121,6 @@ inline bool AtomicRefCountIsZero(volatile AtomicRefCount *ptr) { } // namespace base -#endif // !BUILDING_CEF_SHARED +#endif // !USING_CHROMIUM_INCLUDES #endif // CEF_INCLUDE_BASE_CEF_ATOMIC_REF_COUNT_H_ diff --git a/include/base/cef_atomicops.h b/include/base/cef_atomicops.h index cd83115c0..dc1639b59 100644 --- a/include/base/cef_atomicops.h +++ b/include/base/cef_atomicops.h @@ -59,10 +59,10 @@ // 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) +#elif defined(USING_CHROMIUM_INCLUDES) // When building CEF include the Chromium header directly. #include "base/atomicops.h" -#else // !BUILDING_CEF_SHARED +#else // !USING_CHROMIUM_INCLUDES // The following is substantially similar to the Chromium implementation. // If the Chromium implementation diverges the below implementation should be // updated to match. @@ -193,6 +193,6 @@ Atomic64 Release_Load(volatile const Atomic64* ptr); #include "include/base/internal/cef_atomicops_atomicword_compat.h" #endif -#endif // !BUILDING_CEF_SHARED +#endif // !USING_CHROMIUM_INCLUDES #endif // CEF_INCLUDE_BASE_CEF_ATOMICOPS_H_ diff --git a/include/base/cef_bind.h b/include/base/cef_bind.h index dcf86ac7e..8ee406d75 100644 --- a/include/base/cef_bind.h +++ b/include/base/cef_bind.h @@ -37,10 +37,10 @@ // 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) +#elif defined(USING_CHROMIUM_INCLUDES) // When building CEF include the Chromium header directly. #include "base/bind.h" -#else // !BUILDING_CEF_SHARED +#else // !USING_CHROMIUM_INCLUDES // The following is substantially similar to the Chromium implementation. // If the Chromium implementation diverges the below implementation should be // updated to match. @@ -543,6 +543,6 @@ Bind(Functor functor, const P1& p1, const P2& p2, const P3& p3, const P4& p4, } // namespace base -#endif // !BUILDING_CEF_SHARED +#endif // !USING_CHROMIUM_INCLUDES #endif // CEF_INCLUDE_BASE_CEF_BIND_H_ diff --git a/include/base/cef_bind_helpers.h b/include/base/cef_bind_helpers.h index e8c4cffd8..dde1d0dc0 100644 --- a/include/base/cef_bind_helpers.h +++ b/include/base/cef_bind_helpers.h @@ -175,10 +175,10 @@ // 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) +#elif defined(USING_CHROMIUM_INCLUDES) // When building CEF include the Chromium header directly. #include "base/bind_helpers.h" -#else // !BUILDING_CEF_SHARED +#else // !USING_CHROMIUM_INCLUDES // The following is substantially similar to the Chromium implementation. // If the Chromium implementation diverges the below implementation should be // updated to match. @@ -581,6 +581,6 @@ void DeletePointer(T* obj) { } // namespace base -#endif // !BUILDING_CEF_SHARED +#endif // !USING_CHROMIUM_INCLUDES #endif // CEF_INCLUDE_BASE_CEF_BIND_HELPERS_H_ diff --git a/include/base/cef_build.h b/include/base/cef_build.h index 0451913bf..7cca8222e 100644 --- a/include/base/cef_build.h +++ b/include/base/cef_build.h @@ -32,10 +32,10 @@ #define CEF_INCLUDE_BASE_CEF_BUILD_H_ #pragma once -#if defined(BUILDING_CEF_SHARED) +#if defined(USING_CHROMIUM_INCLUDES) // When building CEF include the Chromium header directly. #include "base/compiler_specific.h" -#else // !BUILDING_CEF_SHARED +#else // !USING_CHROMIUM_INCLUDES // The following is substantially similar to the Chromium implementation. // If the Chromium implementation diverges the below implementation should be // updated to match. @@ -165,7 +165,7 @@ #define ALLOW_UNUSED_LOCAL(x) false ? (void)x : (void)0 #endif -#endif // !BUILDING_CEF_SHARED +#endif // !USING_CHROMIUM_INCLUDES // Annotate a virtual method indicating it must be overriding a virtual method // in the parent class. diff --git a/include/base/cef_callback.h b/include/base/cef_callback.h index 75783271d..611fba50d 100644 --- a/include/base/cef_callback.h +++ b/include/base/cef_callback.h @@ -37,10 +37,10 @@ // 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) +#elif defined(USING_CHROMIUM_INCLUDES) // When building CEF include the Chromium header directly. #include "base/callback.h" -#else // !BUILDING_CEF_SHARED +#else // !USING_CHROMIUM_INCLUDES // The following is substantially similar to the Chromium implementation. // If the Chromium implementation diverges the below implementation should be // updated to match. @@ -802,6 +802,6 @@ typedef Callback Closure; } // namespace base -#endif // !BUILDING_CEF_SHARED +#endif // !USING_CHROMIUM_INCLUDES #endif // CEF_INCLUDE_BASE_CEF_CALLBACK_H_ diff --git a/include/base/cef_callback_forward.h b/include/base/cef_callback_forward.h index 4986b8f76..d604d7cfa 100644 --- a/include/base/cef_callback_forward.h +++ b/include/base/cef_callback_forward.h @@ -37,10 +37,10 @@ // 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) +#elif defined(USING_CHROMIUM_INCLUDES) // When building CEF include the Chromium header directly. #include "base/callback_forward.h" -#else // !BUILDING_CEF_SHARED +#else // !USING_CHROMIUM_INCLUDES // The following is substantially similar to the Chromium implementation. // If the Chromium implementation diverges the below implementation should be // updated to match. @@ -54,6 +54,6 @@ typedef Callback Closure; } // namespace base -#endif // !!BUILDING_CEF_SHARED +#endif // !!USING_CHROMIUM_INCLUDES #endif // INCLUDE_BASE_CEF_CALLBACK_FORWARD_H_ diff --git a/include/base/cef_callback_helpers.h b/include/base/cef_callback_helpers.h index 62a0c8752..ebe074a1f 100644 --- a/include/base/cef_callback_helpers.h +++ b/include/base/cef_callback_helpers.h @@ -46,10 +46,10 @@ // 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) +#elif defined(USING_CHROMIUM_INCLUDES) // When building CEF include the Chromium header directly. #include "base/callback_helpers.h" -#else // !BUILDING_CEF_SHARED +#else // !USING_CHROMIUM_INCLUDES // The following is substantially similar to the Chromium implementation. // If the Chromium implementation diverges the below implementation should be // updated to match. @@ -88,6 +88,6 @@ class ScopedClosureRunner { } // namespace base -#endif // !BUILDING_CEF_SHARED +#endif // !USING_CHROMIUM_INCLUDES #endif // CEF_INCLUDE_BASE_CEF_CALLBACK_HELPERS_H_ diff --git a/include/base/cef_callback_list.h b/include/base/cef_callback_list.h index 558b36f86..73dd9f757 100644 --- a/include/base/cef_callback_list.h +++ b/include/base/cef_callback_list.h @@ -37,10 +37,10 @@ // 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) +#elif defined(USING_CHROMIUM_INCLUDES) // When building CEF include the Chromium header directly. #include "base/callback_list.h" -#else // !BUILDING_CEF_SHARED +#else // !USING_CHROMIUM_INCLUDES // The following is substantially similar to the Chromium implementation. // If the Chromium implementation diverges the below implementation should be // updated to match. @@ -439,6 +439,6 @@ class CallbackList } // namespace base -#endif // !BUILDING_CEF_SHARED +#endif // !USING_CHROMIUM_INCLUDES #endif // CEF_INCLUDE_BASE_CEF_CALLBACK_LIST_H_ diff --git a/include/base/cef_cancelable_callback.h b/include/base/cef_cancelable_callback.h index 8ad3bf3bb..8f5979eb4 100644 --- a/include/base/cef_cancelable_callback.h +++ b/include/base/cef_cancelable_callback.h @@ -74,10 +74,10 @@ // 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) +#elif defined(USING_CHROMIUM_INCLUDES) // When building CEF include the Chromium header directly. #include "base/cancelable_callback.h" -#else // !BUILDING_CEF_SHARED +#else // !USING_CHROMIUM_INCLUDES // The following is substantially similar to the Chromium implementation. // If the Chromium implementation diverges the below implementation should be // updated to match. @@ -309,6 +309,6 @@ typedef CancelableCallback CancelableClosure; } // namespace base -#endif // !BUILDING_CEF_SHARED +#endif // !USING_CHROMIUM_INCLUDES #endif // CEF_INCLUDE_BASE_CEF_CANCELABLE_CALLBACK_H_ diff --git a/include/base/cef_lock.h b/include/base/cef_lock.h index febcc9a96..230bf419b 100644 --- a/include/base/cef_lock.h +++ b/include/base/cef_lock.h @@ -37,10 +37,10 @@ // 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) +#elif defined(USING_CHROMIUM_INCLUDES) // When building CEF include the Chromium header directly. #include "base/synchronization/lock.h" -#else // !BUILDING_CEF_SHARED +#else // !USING_CHROMIUM_INCLUDES // The following is substantially similar to the Chromium implementation. // If the Chromium implementation diverges the below implementation should be // updated to match. @@ -162,6 +162,6 @@ class AutoUnlock { } // namespace base -#endif // !BUILDING_CEF_SHARED +#endif // !USING_CHROMIUM_INCLUDES #endif // CEF_INCLUDE_BASE_CEF_LOCK_H_ diff --git a/include/base/cef_logging.h b/include/base/cef_logging.h index 914855ef5..75e35d961 100644 --- a/include/base/cef_logging.h +++ b/include/base/cef_logging.h @@ -149,10 +149,10 @@ #define DCHECK_IS_ON() 1 #endif -#elif defined(BUILDING_CEF_SHARED) +#elif defined(USING_CHROMIUM_INCLUDES) // When building CEF include the Chromium header directly. #include "base/logging.h" -#else // !BUILDING_CEF_SHARED +#else // !USING_CHROMIUM_INCLUDES // The following is substantially similar to the Chromium implementation. // If the Chromium implementation diverges the below implementation should be // updated to match. @@ -747,6 +747,6 @@ inline std::ostream& operator<<(std::ostream& out, const std::wstring& wstr) { EAT_STREAM_PARAMETERS #endif -#endif // !BUILDING_CEF_SHARED +#endif // !USING_CHROMIUM_INCLUDES #endif // CEF_INCLUDE_BASE_CEF_LOGGING_H_ diff --git a/include/base/cef_macros.h b/include/base/cef_macros.h index 67c42e14f..4e5075070 100644 --- a/include/base/cef_macros.h +++ b/include/base/cef_macros.h @@ -32,10 +32,14 @@ #define CEF_INCLUDE_BASE_CEF_MACROS_H_ #pragma once -#if defined(BUILDING_CEF_SHARED) +#if defined(USING_CHROMIUM_INCLUDES) // When building CEF include the Chromium header directly. #include "base/macros.h" -#else // !BUILDING_CEF_SHARED + +// Chromium uses movable types. +#define MOVE_SCOPED_PTR(var) std::move(var) + +#else // !USING_CHROMIUM_INCLUDES // The following is substantially similar to the Chromium implementation. // If the Chromium implementation diverges the below implementation should be // updated to match. @@ -43,40 +47,8 @@ #include // For size_t. #include "include/base/cef_build.h" // For COMPILER_MSVC -#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 +// CEF does not use movable types. +#define MOVE_SCOPED_PTR(var) var.Pass() #if !defined(arraysize) @@ -214,6 +186,41 @@ struct CompileAssert { #endif // !defined(COMPILE_ASSERT) -#endif // !BUILDING_CEF_SHARED +#endif // !USING_CHROMIUM_INCLUDES + +#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 #endif // CEF_INCLUDE_BASE_CEF_MACROS_H_ diff --git a/include/base/cef_move.h b/include/base/cef_move.h index 91069297d..3c3c4913f 100644 --- a/include/base/cef_move.h +++ b/include/base/cef_move.h @@ -36,10 +36,10 @@ // 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) +#elif defined(USING_CHROMIUM_INCLUDES) // When building CEF include the Chromium header directly. #include "base/move.h" -#else // !BUILDING_CEF_SHARED +#else // !USING_CHROMIUM_INCLUDES // The following is substantially similar to the Chromium implementation. // If the Chromium implementation diverges the below implementation should be // updated to match. @@ -254,6 +254,6 @@ typedef void MoveOnlyTypeForCPP03; \ private: -#endif // !BUILDING_CEF_SHARED +#endif // !USING_CHROMIUM_INCLUDES #endif // CEF_INCLUDE_BASE_CEF_MOVE_H_ diff --git a/include/base/cef_platform_thread.h b/include/base/cef_platform_thread.h index cda1dc45b..916113606 100644 --- a/include/base/cef_platform_thread.h +++ b/include/base/cef_platform_thread.h @@ -40,10 +40,10 @@ // 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) +#elif defined(USING_CHROMIUM_INCLUDES) // When building CEF include the Chromium header directly. #include "base/threading/platform_thread.h" -#else // !BUILDING_CEF_SHARED +#else // !USING_CHROMIUM_INCLUDES // The following is substantially similar to the Chromium implementation. // If the Chromium implementation diverges the below implementation should be // updated to match. @@ -108,6 +108,6 @@ inline PlatformThreadRef CurrentRef() { } // namespace base -#endif // !BUILDING_CEF_SHARED +#endif // !USING_CHROMIUM_INCLUDES #endif // CEF_INCLUDE_BASE_PLATFORM_THREAD_H_ diff --git a/include/base/cef_ref_counted.h b/include/base/cef_ref_counted.h index dd451f3d2..bb94a6ee4 100644 --- a/include/base/cef_ref_counted.h +++ b/include/base/cef_ref_counted.h @@ -38,10 +38,10 @@ // 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) +#elif defined(USING_CHROMIUM_INCLUDES) // When building CEF include the Chromium header directly. #include "base/memory/ref_counted.h" -#else // !BUILDING_CEF_SHARED +#else // !USING_CHROMIUM_INCLUDES // The following is substantially similar to the Chromium implementation. // If the Chromium implementation diverges the below implementation should be // updated to match. @@ -381,6 +381,6 @@ scoped_refptr make_scoped_refptr(T* t) { return scoped_refptr(t); } -#endif // !BUILDING_CEF_SHARED +#endif // !USING_CHROMIUM_INCLUDES #endif // CEF_INCLUDE_BASE_CEF_REF_COUNTED_H_ diff --git a/include/base/cef_scoped_ptr.h b/include/base/cef_scoped_ptr.h index ed6c706f7..0bca79286 100644 --- a/include/base/cef_scoped_ptr.h +++ b/include/base/cef_scoped_ptr.h @@ -119,10 +119,10 @@ // 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) +#elif defined(USING_CHROMIUM_INCLUDES) // When building CEF include the Chromium header directly. #include "base/memory/scoped_ptr.h" -#else // !BUILDING_CEF_SHARED +#else // !USING_CHROMIUM_INCLUDES // The following is substantially similar to the Chromium implementation. // If the Chromium implementation diverges the below implementation should be // updated to match. @@ -619,6 +619,6 @@ scoped_ptr make_scoped_ptr(T* ptr) { return scoped_ptr(ptr); } -#endif // !BUILDING_CEF_SHARED +#endif // !USING_CHROMIUM_INCLUDES #endif // CEF_INCLUDE_BASE_CEF_MEMORY_SCOPED_PTR_H_ diff --git a/include/base/cef_string16.h b/include/base/cef_string16.h index 0d642b2df..51760f435 100644 --- a/include/base/cef_string16.h +++ b/include/base/cef_string16.h @@ -37,10 +37,10 @@ // 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) +#elif defined(USING_CHROMIUM_INCLUDES) // When building CEF include the Chromium header directly. #include "base/strings/string16.h" -#else // !BUILDING_CEF_SHARED +#else // !USING_CHROMIUM_INCLUDES // The following is substantially similar to the Chromium implementation. // If the Chromium implementation diverges the below implementation should be // updated to match. @@ -222,6 +222,6 @@ class std::basic_string; #endif // WCHAR_T_IS_UTF32 -#endif // !BUILDING_CEF_SHARED +#endif // !USING_CHROMIUM_INCLUDES #endif // CEF_INCLUDE_BASE_CEF_STRING16_H_ diff --git a/include/base/cef_template_util.h b/include/base/cef_template_util.h index 5fa228b5f..098bf463e 100644 --- a/include/base/cef_template_util.h +++ b/include/base/cef_template_util.h @@ -37,10 +37,10 @@ // 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) +#elif defined(USING_CHROMIUM_INCLUDES) // When building CEF include the Chromium header directly. #include "base/template_util.h" -#else // !BUILDING_CEF_SHARED +#else // !USING_CHROMIUM_INCLUDES // The following is substantially similar to the Chromium implementation. // If the Chromium implementation diverges the below implementation should be // updated to match. @@ -187,6 +187,6 @@ struct enable_if { typedef T type; }; } // namespace base -#endif // !BUILDING_CEF_SHARED +#endif // !USING_CHROMIUM_INCLUDES #endif // CEF_INCLUDE_BASE_CEF_TEMPLATE_UTIL_H_ diff --git a/include/base/cef_thread_checker.h b/include/base/cef_thread_checker.h index 73f3fb51d..42bac7fc0 100644 --- a/include/base/cef_thread_checker.h +++ b/include/base/cef_thread_checker.h @@ -37,10 +37,10 @@ // 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) +#elif defined(USING_CHROMIUM_INCLUDES) // When building CEF include the Chromium header directly. #include "base/threading/thread_checker.h" -#else // !BUILDING_CEF_SHARED +#else // !USING_CHROMIUM_INCLUDES // The following is substantially similar to the Chromium implementation. // If the Chromium implementation diverges the below implementation should be // updated to match. @@ -121,6 +121,6 @@ class ThreadChecker : public cef_internal::ThreadCheckerDoNothing { } // namespace base -#endif // !BUILDING_CEF_SHARED +#endif // !USING_CHROMIUM_INCLUDES #endif // CEF_INCLUDE_BASE_THREAD_CHECKER_H_ diff --git a/include/base/cef_thread_collision_warner.h b/include/base/cef_thread_collision_warner.h index bbc88759c..2016e3c51 100644 --- a/include/base/cef_thread_collision_warner.h +++ b/include/base/cef_thread_collision_warner.h @@ -37,10 +37,10 @@ // 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) +#elif defined(USING_CHROMIUM_INCLUDES) // When building CEF include the Chromium header directly. #include "base/threading/thread_collision_warner.h" -#else // !BUILDING_CEF_SHARED +#else // !USING_CHROMIUM_INCLUDES // The following is substantially similar to the Chromium implementation. // If the Chromium implementation diverges the below implementation should be // updated to match. @@ -282,6 +282,6 @@ class ThreadCollisionWarner { } // namespace base -#endif // !BUILDING_CEF_SHARED +#endif // !USING_CHROMIUM_INCLUDES #endif // CEF_INCLUDE_BASE_CEF_THREAD_COLLISION_WARNER_H_ diff --git a/include/base/cef_trace_event.h b/include/base/cef_trace_event.h index a24146cd0..20723fbb9 100644 --- a/include/base/cef_trace_event.h +++ b/include/base/cef_trace_event.h @@ -145,10 +145,10 @@ // 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) +#elif defined(USING_CHROMIUM_INCLUDES) // When building CEF include the Chromium header directly. -#include "base/debug/trace_event.h" -#else // !BUILDING_CEF_SHARED +#include "base/trace_event/trace_event.h" +#else // !USING_CHROMIUM_INCLUDES // The following is substantially similar to the Chromium implementation. // If the Chromium implementation diverges the below implementation should be // updated to match. @@ -422,6 +422,6 @@ class CefTraceEndOnScopeClose { } // cef_trace_event -#endif // !BUILDING_CEF_SHARED +#endif // !USING_CHROMIUM_INCLUDES #endif // CEF_INCLUDE_BASE_CEF_TRACE_EVENT_H_ diff --git a/include/base/cef_tuple.h b/include/base/cef_tuple.h index 1d038430f..2268792dd 100644 --- a/include/base/cef_tuple.h +++ b/include/base/cef_tuple.h @@ -57,84 +57,14 @@ #pragma once #if defined(BASE_TUPLE_H_) -// The Chromium header has already been included. +// 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. - -// 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 \ - struct TupleLeaf { \ - TupleLeaf() {} \ - explicit TupleLeaf(typename TupleTraits::ParamType x) : x(x) {} \ - \ - T& get() { return x; } \ - const T& get() const { return x; } \ - \ - T x; \ - } - -DEFINE_TUPLE_LEAF(0, a); -DEFINE_TUPLE_LEAF(1, b); -DEFINE_TUPLE_LEAF(2, c); -DEFINE_TUPLE_LEAF(3, d); -DEFINE_TUPLE_LEAF(4, e); -DEFINE_TUPLE_LEAF(5, f); -DEFINE_TUPLE_LEAF(6, g); -DEFINE_TUPLE_LEAF(7, h); - -#undef DEFINE_TUPLE_LEAF - -// Deprecated compat aliases -// TODO(cef): Remove this code when cef_runnable.h is deleted. - -using Tuple0 = Tuple<>; -template -using Tuple1 = Tuple; -template -using Tuple2 = Tuple; -template -using Tuple3 = Tuple; -template -using Tuple4 = Tuple; -template -using Tuple5 = Tuple; -template -using Tuple6 = Tuple; -template -using Tuple7 = Tuple; -template -using Tuple8 = Tuple; - -} // namespace base - -#elif defined(BUILDING_CEF_SHARED) +#elif defined(USING_CHROMIUM_INCLUDES) // When building CEF include the Chromium header directly. #include "base/tuple.h" -#else // !BUILDING_CEF_SHARED +#else // !USING_CHROMIUM_INCLUDES // The following is substantially similar to the Chromium implementation. // If the Chromium implementation diverges the below implementation should be // updated to match. @@ -1402,6 +1332,6 @@ inline void DispatchToMethod(ObjT* obj, Method method, } // namespace base -#endif // !BUILDING_CEF_SHARED +#endif // !USING_CHROMIUM_INCLUDES #endif // CEF_INCLUDE_BASE_CEF_TUPLE_H_ diff --git a/include/base/cef_weak_ptr.h b/include/base/cef_weak_ptr.h index 11fabbdc8..217f12cf5 100644 --- a/include/base/cef_weak_ptr.h +++ b/include/base/cef_weak_ptr.h @@ -101,10 +101,10 @@ // 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) +#elif defined(USING_CHROMIUM_INCLUDES) // When building CEF include the Chromium header directly. #include "base/memory/weak_ptr.h" -#else // !BUILDING_CEF_SHARED +#else // !USING_CHROMIUM_INCLUDES // The following is substantially similar to the Chromium implementation. // If the Chromium implementation diverges the below implementation should be // updated to match. @@ -383,6 +383,6 @@ WeakPtr AsWeakPtr(Derived* t) { } // namespace base -#endif // !BUILDING_CEF_SHARED +#endif // !USING_CHROMIUM_INCLUDES #endif // CEF_INCLUDE_BASE_CEF_WEAK_PTR_H_ diff --git a/include/cef_application_mac.h b/include/cef_application_mac.h index b4e85db22..db00b3fa7 100644 --- a/include/cef_application_mac.h +++ b/include/cef_application_mac.h @@ -35,7 +35,7 @@ #if defined(OS_MACOSX) && defined(__OBJC__) -#ifdef BUILDING_CEF_SHARED +#ifdef USING_CHROMIUM_INCLUDES // Use the existing CrAppControlProtocol definition. #import "base/mac/scoped_sending_event.h" @@ -52,7 +52,7 @@ // Use the existing empty protocol definitions. #import "base/mac/sdk_forward_declarations.h" -#else // BUILDING_CEF_SHARED +#else // USING_CHROMIUM_INCLUDES #import #import @@ -146,7 +146,7 @@ DEFINE_EMPTY_PROTOCOL(NSWindowDelegate) #endif -#endif // BUILDING_CEF_SHARED +#endif // USING_CHROMIUM_INCLUDES // Forward declarations for APIs that are part of the 10.7 SDK. This will allow // using them when building with the 10.6 SDK. diff --git a/include/cef_runnable.h b/include/cef_runnable.h deleted file mode 100644 index 9b3955402..000000000 --- a/include/cef_runnable.h +++ /dev/null @@ -1,333 +0,0 @@ -// Copyright (c) 2013 Marshall A. Greenblatt. Portions Copyright (c) -// 2006-2011 Google Inc. All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the name Chromium Embedded -// Framework nor the names of its contributors may be used to endorse -// or promote products derived from this software without specific prior -// written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// The contents of this file are a modified extract of base/task.h - -#ifndef CEF_INCLUDE_CEF_RUNNABLE_H_ -#define CEF_INCLUDE_CEF_RUNNABLE_H_ -#pragma once - -#if defined(BUILDING_CEF_SHARED) -// The implementation of cef_runnable.h depends on an obsolete version of -// base/tuple.h that is implemented by cef_tuple.h for client applications but -// is not compatible with the version used when building Chromium/CEF. -#error This header cannot be used when building Chromium/CEF. -#endif - -#include "include/base/cef_tuple.h" -#include "include/cef_base.h" -#include "include/cef_task.h" - -// CefRunnableMethodTraits ----------------------------------------------------- -// -// This traits-class is used by CefRunnableMethod to manage the lifetime of the -// callee object. By default, it is assumed that the callee supports AddRef -// and Release methods. A particular class can specialize this template to -// define other lifetime management. For example, if the callee is known to -// live longer than the CefRunnableMethod object, then a CefRunnableMethodTraits -// struct could be defined with empty RetainCallee and ReleaseCallee methods. -// -// The DISABLE_RUNNABLE_METHOD_REFCOUNT macro is provided as a convenient way -// for declaring a CefRunnableMethodTraits that disables refcounting. - -template -struct CefRunnableMethodTraits { - CefRunnableMethodTraits() { - } - - ~CefRunnableMethodTraits() { - } - - void RetainCallee(T* obj) { -#ifndef NDEBUG - // Catch NewCefRunnableMethod being called in an object's constructor. - // This isn't safe since the method can be invoked before the constructor - // completes, causing the object to be deleted. - obj->AddRef(); - obj->Release(); -#endif - obj->AddRef(); - } - - void ReleaseCallee(T* obj) { - obj->Release(); - } -}; - -// Convenience macro for declaring a CefRunnableMethodTraits that disables -// refcounting of a class. This is useful if you know that the callee -// will outlive the CefRunnableMethod object and thus do not need the ref -// counts. -// -// The invocation of DISABLE_RUNNABLE_METHOD_REFCOUNT should be done at the -// global namespace scope. Example: -// -// namespace foo { -// class Bar { -// ... -// }; -// } // namespace foo -// -// DISABLE_RUNNABLE_METHOD_REFCOUNT(foo::Bar); -// -// This is different from DISALLOW_COPY_AND_ASSIGN which is declared inside the -// class. -#define DISABLE_RUNNABLE_METHOD_REFCOUNT(TypeName) \ - template <> \ - struct CefRunnableMethodTraits { \ - void RetainCallee(TypeName* manager) {} \ - void ReleaseCallee(TypeName* manager) {} \ - } - -// CefRunnableMethod and CefRunnableFunction ---------------------------------- -// -// CefRunnable methods are a type of task that call a function on an object -// when they are run. We implement both an object and a set of -// NewCefRunnableMethod and NewCefRunnableFunction functions for convenience. -// These functions are overloaded and will infer the template types, -// simplifying calling code. -// -// The template definitions all use the following names: -// T - the class type of the object you're supplying -// this is not needed for the Static version of the call -// Method/Function - the signature of a pointer to the method or function you -// want to call -// Param - the parameter(s) to the method, possibly packed as a Tuple -// A - the first parameter (if any) to the method -// B - the second parameter (if any) to the method -// -// Put these all together and you get an object that can call a method whose -// signature is: -// R T::MyFunction([A[, B]]) -// -// Usage: -// CefPostTask(TID_UI, NewCefRunnableMethod(object, &Object::method[, a[, b]]) -// CefPostTask(TID_UI, NewCefRunnableFunction(&function[, a[, b]]) - -// CefRunnableMethod and NewCefRunnableMethod implementation ------------------ - -template -class CefRunnableMethod : public CefTask { - public: - CefRunnableMethod(T* obj, Method meth, const Params& params) - : obj_(obj), meth_(meth), params_(params) { - traits_.RetainCallee(obj_); - } - - ~CefRunnableMethod() { - T* obj = obj_; - obj_ = NULL; - if (obj) - traits_.ReleaseCallee(obj); - } - - void Execute() OVERRIDE { - if (obj_) - DispatchToMethod(obj_, meth_, params_); - } - - private: - T* obj_; - Method meth_; - Params params_; - CefRunnableMethodTraits traits_; - - IMPLEMENT_REFCOUNTING(CefRunnableMethod); -}; - -template -inline CefRefPtr NewCefRunnableMethod(T* object, Method method) { - return new CefRunnableMethod( - object, method, base::MakeTuple()); -} - -template -inline CefRefPtr NewCefRunnableMethod(T* object, Method method, - const A& a) { - return new CefRunnableMethod >( - object, method, base::MakeTuple(a)); -} - -template -inline CefRefPtr NewCefRunnableMethod(T* object, Method method, - const A& a, const B& b) { - return new CefRunnableMethod >( - object, method, base::MakeTuple(a, b)); -} - -template -inline CefRefPtr NewCefRunnableMethod(T* object, Method method, - const A& a, const B& b, - const C& c) { - return new CefRunnableMethod >( - object, method, base::MakeTuple(a, b, c)); -} - -template -inline CefRefPtr NewCefRunnableMethod(T* object, Method method, - const A& a, const B& b, - const C& c, const D& d) { - return new CefRunnableMethod >( - object, method, base::MakeTuple(a, b, c, d)); -} - -template -inline CefRefPtr NewCefRunnableMethod(T* object, Method method, - const A& a, const B& b, - const C& c, const D& d, - const E& e) { - return new CefRunnableMethod >( - object, method, base::MakeTuple(a, b, c, d, e)); -} - -template -inline CefRefPtr NewCefRunnableMethod(T* object, Method method, - const A& a, const B& b, - const C& c, const D& d, - const E& e, const F& f) { - return new CefRunnableMethod >( - object, method, base::MakeTuple(a, b, c, d, e, f)); -} - -template -inline CefRefPtr NewCefRunnableMethod(T* object, Method method, - const A& a, const B& b, - const C& c, const D& d, - const E& e, const F& f, - const G& g) { - return new CefRunnableMethod >( - object, method, base::MakeTuple(a, b, c, d, e, f, g)); -} - -// CefRunnableFunction and NewCefRunnableFunction implementation -------------- - -template -class CefRunnableFunction : public CefTask { - public: - CefRunnableFunction(Function function, const Params& params) - : function_(function), params_(params) { - } - - ~CefRunnableFunction() { - } - - void Execute() OVERRIDE { - if (function_) - DispatchToFunction(function_, params_); - } - - private: - Function function_; - Params params_; - - IMPLEMENT_REFCOUNTING(CefRunnableFunction); -}; - -template -inline CefRefPtr NewCefRunnableFunction(Function function) { - return new CefRunnableFunction( - function, base::MakeTuple()); -} - -template -inline CefRefPtr NewCefRunnableFunction(Function function, - const A& a) { - return new CefRunnableFunction >( - function, base::MakeTuple(a)); -} - -template -inline CefRefPtr NewCefRunnableFunction(Function function, - const A& a, const B& b) { - return new CefRunnableFunction >( - function, base::MakeTuple(a, b)); -} - -template -inline CefRefPtr NewCefRunnableFunction(Function function, - const A& a, const B& b, - const C& c) { - return new CefRunnableFunction >( - function, base::MakeTuple(a, b, c)); -} - -template -inline CefRefPtr NewCefRunnableFunction(Function function, - const A& a, const B& b, - const C& c, const D& d) { - return new CefRunnableFunction >( - function, base::MakeTuple(a, b, c, d)); -} - -template -inline CefRefPtr NewCefRunnableFunction(Function function, - const A& a, const B& b, - const C& c, const D& d, - const E& e) { - return new CefRunnableFunction >( - function, base::MakeTuple(a, b, c, d, e)); -} - -template -inline CefRefPtr NewCefRunnableFunction(Function function, - const A& a, const B& b, - const C& c, const D& d, - const E& e, const F& f) { - return new CefRunnableFunction >( - function, base::MakeTuple(a, b, c, d, e, f)); -} - -template -inline CefRefPtr NewCefRunnableFunction(Function function, - const A& a, const B& b, - const C& c, const D& d, - const E& e, const F& f, - const G& g) { - return new CefRunnableFunction >( - function, base::MakeTuple(a, b, c, d, e, f, g)); -} - -template -inline CefRefPtr NewCefRunnableFunction(Function function, - const A& a, const B& b, - const C& c, const D& d, - const E& e, const F& f, - const G& g, const H& h) { - return new CefRunnableFunction >( - function, base::MakeTuple(a, b, c, d, e, f, g, h)); -} - -#endif // CEF_INCLUDE_CEF_RUNNABLE_H_ diff --git a/include/internal/cef_string_wrappers.h b/include/internal/cef_string_wrappers.h index 48c909572..f5d6ab9ec 100644 --- a/include/internal/cef_string_wrappers.h +++ b/include/internal/cef_string_wrappers.h @@ -37,7 +37,7 @@ #include "include/base/cef_string16.h" #include "include/internal/cef_string_types.h" -#if defined(BUILDING_CEF_SHARED) +#if defined(USING_CHROMIUM_INCLUDES) #include "base/files/file_path.h" #endif @@ -696,7 +696,7 @@ class CefStringBase { return *this; } #endif // WCHAR_T_IS_UTF32 -#if defined(BUILDING_CEF_SHARED) +#if defined(USING_CHROMIUM_INCLUDES) // The base::FilePath constructor is marked as explicit so provide the // conversion here for convenience. operator base::FilePath() const { @@ -706,7 +706,7 @@ class CefStringBase { return base::FilePath(ToString()); #endif } -#endif // BUILDING_CEF_SHARED +#endif // USING_CHROMIUM_INCLUDES private: // Allocate the string structure if it doesn't already exist. diff --git a/include/internal/cef_types.h b/include/internal/cef_types.h index aa1d7f9d2..8cebadf85 100644 --- a/include/internal/cef_types.h +++ b/include/internal/cef_types.h @@ -2119,7 +2119,7 @@ typedef enum { // addition to their special meaning. Things like escaped letters, digits, // and most symbols will get unescaped with this mode. /// - UU_NORMAL = 1, + UU_NORMAL = 1 << 0, /// // Convert %20 to spaces. In some places where we're showing URLs, we may @@ -2127,31 +2127,42 @@ typedef enum { // you wouldn't want this since it might not be interpreted in one piece // by other applications. /// - UU_SPACES = 2, + UU_SPACES = 1 << 1, + + /// + // Unescapes '/' and '\\'. If these characters were unescaped, the resulting + // URL won't be the same as the source one. Moreover, they are dangerous to + // unescape in strings that will be used as file paths or names. This value + // should only be used when slashes don't have special meaning, like data + // URLs. + /// + UU_PATH_SEPARATORS = 1 << 2, /// // Unescapes various characters that will change the meaning of URLs, - // including '%', '+', '&', '/', '#'. If we unescaped these characters, the - // resulting URL won't be the same as the source one. This flag is used when - // generating final output like filenames for URLs where we won't be - // interpreting as a URL and want to do as much unescaping as possible. + // including '%', '+', '&', '#'. Does not unescape path separators. + // If these characters were unescaped, the resulting URL won't be the same + // as the source one. This flag is used when generating final output like + // filenames for URLs where we won't be interpreting as a URL and want to do + // as much unescaping as possible. /// - UU_URL_SPECIAL_CHARS = 4, + UU_URL_SPECIAL_CHARS_EXCEPT_PATH_SEPARATORS = 1 << 3, /// - // Unescapes control characters such as %01. This INCLUDES NULLs. This is - // used for rare cases such as data: URL decoding where the result is binary - // data. This flag also unescapes BiDi control characters. + // Unescapes characters that can be used in spoofing attempts (such as LOCK) + // and control characters (such as BiDi control characters and %01). This + // INCLUDES NULLs. This is used for rare cases such as data: URL decoding + // where the result is binary data. // - // DO NOT use CONTROL_CHARS if the URL is going to be displayed in the UI - // for security reasons. + // DO NOT use UU_SPOOFING_AND_CONTROL_CHARS if the URL is going to be + // displayed in the UI for security reasons. /// - UU_CONTROL_CHARS = 8, + UU_SPOOFING_AND_CONTROL_CHARS = 1 << 4, /// // URL queries use "+" for space. This flag controls that replacement. /// - UU_REPLACE_PLUS_WITH_SPACE = 16, + UU_REPLACE_PLUS_WITH_SPACE = 1 << 5, } cef_uri_unescape_rule_t; /// diff --git a/libcef/browser/browser_context.cc b/libcef/browser/browser_context.cc index fe5418177..25de4e242 100644 --- a/libcef/browser/browser_context.cc +++ b/libcef/browser/browser_context.cc @@ -36,6 +36,8 @@ CefBrowserContext::~CefBrowserContext() { } void CefBrowserContext::Initialize() { + content::BrowserContext::Initialize(this, GetPath()); + const bool extensions_enabled = extensions::ExtensionsEnabled(); if (extensions_enabled) { // Create the custom ExtensionSystem first because other KeyedServices diff --git a/libcef/browser/browser_context_impl.cc b/libcef/browser/browser_context_impl.cc index 084dba944..0bc1a033d 100644 --- a/libcef/browser/browser_context_impl.cc +++ b/libcef/browser/browser_context_impl.cc @@ -449,8 +449,8 @@ net::URLRequestContextGetter* CefBrowserContextImpl::CreateRequestContext( url_request_getter_ = new CefURLRequestContextGetterImpl( settings_, GetPrefs(), - BrowserThread::UnsafeGetMessageLoopForThread(BrowserThread::IO), - BrowserThread::UnsafeGetMessageLoopForThread(BrowserThread::FILE), + BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO), + BrowserThread::GetMessageLoopProxyForThread(BrowserThread::FILE), protocol_handlers, std::move(proxy_config_service), std::move(request_interceptors)); diff --git a/libcef/browser/chrome_browser_process_stub.cc b/libcef/browser/chrome_browser_process_stub.cc index 749beb108..72fae9929 100644 --- a/libcef/browser/chrome_browser_process_stub.cc +++ b/libcef/browser/chrome_browser_process_stub.cc @@ -127,9 +127,13 @@ GpuModeManager* ChromeBrowserProcessStub::gpu_mode_manager() { } void ChromeBrowserProcessStub::CreateDevToolsHttpProtocolHandler( - chrome::HostDesktopType host_desktop_type, const std::string& ip, uint16_t port) { + NOTIMPLEMENTED(); +} + +void ChromeBrowserProcessStub::CreateDevToolsAutoOpener() { + NOTIMPLEMENTED(); } unsigned int ChromeBrowserProcessStub::AddRefModule() { @@ -276,10 +280,10 @@ gcm::GCMDriver* ChromeBrowserProcessStub::gcm_driver() { return NULL; } -ShellIntegration::DefaultWebClientState +shell_integration::DefaultWebClientState ChromeBrowserProcessStub::CachedDefaultWebClientState() { NOTIMPLEMENTED(); - return ShellIntegration::UNKNOWN_DEFAULT; + return shell_integration::UNKNOWN_DEFAULT; } memory::TabManager* ChromeBrowserProcessStub::GetTabManager() { diff --git a/libcef/browser/chrome_browser_process_stub.h b/libcef/browser/chrome_browser_process_stub.h index 8535edbab..194565a65 100644 --- a/libcef/browser/chrome_browser_process_stub.h +++ b/libcef/browser/chrome_browser_process_stub.h @@ -52,10 +52,9 @@ class ChromeBrowserProcessStub : public BrowserProcess { IconManager* icon_manager() override; GLStringManager* gl_string_manager() override; GpuModeManager* gpu_mode_manager() override; - void CreateDevToolsHttpProtocolHandler( - chrome::HostDesktopType host_desktop_type, - const std::string& ip, - uint16_t port) override; + void CreateDevToolsHttpProtocolHandler(const std::string& ip, + uint16_t port) override; + void CreateDevToolsAutoOpener() override; unsigned int AddRefModule() override; unsigned int ReleaseModule() override; bool IsShuttingDown() override; @@ -97,7 +96,7 @@ class ChromeBrowserProcessStub : public BrowserProcess { #endif network_time::NetworkTimeTracker* network_time_tracker() override; gcm::GCMDriver* gcm_driver() override; - ShellIntegration::DefaultWebClientState + shell_integration::DefaultWebClientState CachedDefaultWebClientState() override; memory::TabManager* GetTabManager() override; diff --git a/libcef/browser/component_updater/cef_component_updater_configurator.cc b/libcef/browser/component_updater/cef_component_updater_configurator.cc index e50e616ee..0984aa691 100644 --- a/libcef/browser/component_updater/cef_component_updater_configurator.cc +++ b/libcef/browser/component_updater/cef_component_updater_configurator.cc @@ -112,6 +112,7 @@ class CefConfigurator : public Configurator { CreateOutOfProcessPatcher() const override; bool DeltasEnabled() const override; bool UseBackgroundDownloader() const override; + bool UseCupSigning() const override; scoped_refptr GetSequencedTaskRunner() const override; @@ -264,6 +265,10 @@ bool CefConfigurator::UseBackgroundDownloader() const { return background_downloads_enabled_; } +bool CefConfigurator::UseCupSigning() const { + return true; +} + scoped_refptr CefConfigurator::GetSequencedTaskRunner() const { return content::BrowserThread::GetBlockingPool() diff --git a/libcef/browser/content_browser_client.cc b/libcef/browser/content_browser_client.cc index 632f0796b..004934b68 100644 --- a/libcef/browser/content_browser_client.cc +++ b/libcef/browser/content_browser_client.cc @@ -101,19 +101,18 @@ class CefAccessTokenStore : public content::AccessTokenStore { explicit CefAccessTokenStore(net::URLRequestContextGetter* system_context) : system_context_(system_context) {} - void LoadAccessTokens( - const LoadAccessTokensCallbackType& callback) override { - callback.Run(access_token_set_, system_context_); + void LoadAccessTokens(const LoadAccessTokensCallback& callback) override { + callback.Run(access_token_map_, system_context_); } void SaveAccessToken( const GURL& server_url, const base::string16& access_token) override { - access_token_set_[server_url] = access_token; + access_token_map_[server_url] = access_token; } private: net::URLRequestContextGetter* system_context_; - AccessTokenSet access_token_set_; + AccessTokenMap access_token_map_; DISALLOW_COPY_AND_ASSIGN(CefAccessTokenStore); }; diff --git a/libcef/browser/cookie_manager_impl.cc b/libcef/browser/cookie_manager_impl.cc index da718a9ac..c4a31cc84 100644 --- a/libcef/browser/cookie_manager_impl.cc +++ b/libcef/browser/cookie_manager_impl.cc @@ -11,7 +11,6 @@ #include "libcef/browser/content_browser_client.h" #include "libcef/browser/context.h" #include "libcef/browser/net/network_delegate.h" -#include "libcef/browser/thread_util.h" #include "libcef/common/time_util.h" #include "base/bind.h" @@ -33,9 +32,9 @@ namespace { class VisitCookiesCallback : public base::RefCounted { public: explicit VisitCookiesCallback( - scoped_refptr cookie_monster, + const CefCookieManagerImpl::CookieStoreGetter& cookie_store_getter, CefRefPtr visitor) - : cookie_monster_(cookie_monster), + : cookie_store_getter_(cookie_store_getter), visitor_(visitor) { } @@ -53,8 +52,11 @@ class VisitCookiesCallback : public base::RefCounted { bool deleteCookie = false; bool keepLooping = visitor_->Visit(cookie, count, total, deleteCookie); if (deleteCookie) { - cookie_monster_->DeleteCanonicalCookieAsync(cc, - net::CookieMonster::DeleteCookieCallback()); + net::CookieStore* cookie_store = cookie_store_getter_.Run(); + if (cookie_store) { + cookie_store->DeleteCanonicalCookieAsync(cc, + net::CookieMonster::DeleteCallback()); + } } if (!keepLooping) break; @@ -66,12 +68,12 @@ class VisitCookiesCallback : public base::RefCounted { ~VisitCookiesCallback() {} - scoped_refptr cookie_monster_; + CefCookieManagerImpl::CookieStoreGetter cookie_store_getter_; CefRefPtr visitor_; }; -// Methods extracted from net/cookies/cookie_monster.cc +// Methods extracted from net/cookies/cookie_store.cc // Determine the cookie domain to use for setting the specified cookie. bool GetCookieDomain(const GURL& url, @@ -118,6 +120,7 @@ CefCookieManagerImpl::CefCookieManagerImpl() { } CefCookieManagerImpl::~CefCookieManagerImpl() { + CEF_REQUIRE_IOT(); } void CefCookieManagerImpl::Initialize( @@ -135,53 +138,54 @@ void CefCookieManagerImpl::Initialize( } } -void CefCookieManagerImpl::GetCookieMonster( +void CefCookieManagerImpl::GetCookieStore( scoped_refptr task_runner, - const CookieMonsterCallback& callback) { + const CookieStoreCallback& callback) { if (!task_runner.get()) task_runner = base::MessageLoop::current()->task_runner(); if (!CEF_CURRENTLY_ON_IOT()) { CEF_POST_TASK(CEF_IOT, - base::Bind(&CefCookieManagerImpl::GetCookieMonster, this, task_runner, + base::Bind(&CefCookieManagerImpl::GetCookieStore, this, task_runner, callback)); return; } if (HasContext()) { RunMethodWithContext( - base::Bind(&CefCookieManagerImpl::GetCookieMonsterWithContext, this, + base::Bind(&CefCookieManagerImpl::GetCookieStoreWithContext, this, task_runner, callback)); return; } - DCHECK(cookie_monster_.get()); - if (cookie_monster_.get()) { - if (task_runner->BelongsToCurrentThread()) { - // Execute the callback immediately. - callback.Run(cookie_monster_); - } else { - // Execute the callback on the target thread. - task_runner->PostTask(FROM_HERE, base::Bind(callback, cookie_monster_)); - } - return; + DCHECK(cookie_store_.get()); + + const CookieStoreGetter& cookie_store_getter = + base::Bind(&CefCookieManagerImpl::GetExistingCookieStore, this); + + if (task_runner->BelongsToCurrentThread()) { + // Execute the callback immediately. + callback.Run(cookie_store_getter); + } else { + // Execute the callback on the target thread. + task_runner->PostTask(FROM_HERE, + base::Bind(callback, cookie_store_getter)); } } -scoped_refptr -CefCookieManagerImpl::GetExistingCookieMonster() { +net::CookieStore* CefCookieManagerImpl::GetExistingCookieStore() { CEF_REQUIRE_IOT(); - if (cookie_monster_.get()) { - return cookie_monster_; + if (cookie_store_.get()) { + return cookie_store_.get(); } else if (request_context_impl_.get()) { - scoped_refptr cookie_monster = - request_context_impl_->GetCookieMonster(); - DCHECK(cookie_monster.get()); - return cookie_monster; + net::CookieStore* cookie_store = + request_context_impl_->GetExistingCookieStore(); + DCHECK(cookie_store); + return cookie_store; } - LOG(ERROR) << "Cookie manager backing store does not exist yet"; - return NULL; + LOG(ERROR) << "Cookie store does not exist"; + return nullptr; } void CefCookieManagerImpl::SetSupportedSchemes( @@ -204,7 +208,7 @@ void CefCookieManagerImpl::SetSupportedSchemes( bool CefCookieManagerImpl::VisitAllCookies( CefRefPtr visitor) { - GetCookieMonster( + GetCookieStore( BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO), base::Bind(&CefCookieManagerImpl::VisitAllCookiesInternal, this, visitor)); @@ -215,7 +219,7 @@ bool CefCookieManagerImpl::VisitUrlCookies( const CefString& url, bool includeHttpOnly, CefRefPtr visitor) { - GetCookieMonster( + GetCookieStore( BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO), base::Bind(&CefCookieManagerImpl::VisitUrlCookiesInternal, this, url, includeHttpOnly, visitor)); @@ -230,7 +234,7 @@ bool CefCookieManagerImpl::SetCookie( if (!gurl.is_valid()) return false; - GetCookieMonster( + GetCookieStore( BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO), base::Bind(&CefCookieManagerImpl::SetCookieInternal, this, gurl, cookie, callback)); @@ -246,7 +250,7 @@ bool CefCookieManagerImpl::DeleteCookies( if (!gurl.is_empty() && !gurl.is_valid()) return false; - GetCookieMonster( + GetCookieStore( BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO), base::Bind(&CefCookieManagerImpl::DeleteCookiesInternal, this, gurl, cookie_name, callback)); @@ -275,7 +279,7 @@ bool CefCookieManagerImpl::SetStoragePath( if (!path.empty()) new_path = base::FilePath(path); - if (cookie_monster_.get() && ((storage_path_.empty() && path.empty()) || + if (cookie_store_.get() && ((storage_path_.empty() && path.empty()) || storage_path_ == new_path)) { // The path has not changed so don't do anything. RunAsyncCompletionOnIOThread(callback); @@ -306,9 +310,9 @@ bool CefCookieManagerImpl::SetStoragePath( // Set the new cookie store that will be used for all new requests. The old // cookie store, if any, will be automatically flushed and closed when no // longer referenced. - cookie_monster_ = new net::CookieMonster(persistent_store.get(), NULL); + cookie_store_.reset(new net::CookieMonster(persistent_store.get(), NULL)); if (persistent_store.get() && persist_session_cookies) - cookie_monster_->SetPersistSessionCookies(true); + cookie_store_->SetPersistSessionCookies(true); storage_path_ = new_path; // Restore the previously supported schemes. @@ -319,7 +323,7 @@ bool CefCookieManagerImpl::SetStoragePath( bool CefCookieManagerImpl::FlushStore( CefRefPtr callback) { - GetCookieMonster( + GetCookieStore( BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO), base::Bind(&CefCookieManagerImpl::FlushStoreInternal, this, callback)); return true; @@ -457,27 +461,29 @@ void CefCookieManagerImpl::SetSupportedSchemesWithContext( RunAsyncCompletionOnIOThread(callback); } -void CefCookieManagerImpl::GetCookieMonsterWithContext( +void CefCookieManagerImpl::GetCookieStoreWithContext( scoped_refptr task_runner, - const CookieMonsterCallback& callback, + const CookieStoreCallback& callback, scoped_refptr request_context) { CEF_REQUIRE_IOT(); + DCHECK(request_context->GetExistingCookieStore()); - scoped_refptr cookie_monster = - request_context->GetCookieMonster(); + const CookieStoreGetter& cookie_store_getter = + base::Bind(&CefURLRequestContextGetterImpl::GetExistingCookieStore, + request_context); if (task_runner->BelongsToCurrentThread()) { // Execute the callback immediately. - callback.Run(cookie_monster); + callback.Run(cookie_store_getter); } else { // Execute the callback on the target thread. - task_runner->PostTask(FROM_HERE, base::Bind(callback, cookie_monster)); + task_runner->PostTask(FROM_HERE, base::Bind(callback, cookie_store_getter)); } } void CefCookieManagerImpl::SetSupportedSchemesInternal( const std::vector& schemes, - CefRefPtr callback){ + CefRefPtr callback) { CEF_REQUIRE_IOT(); if (HasContext()) { @@ -487,25 +493,29 @@ void CefCookieManagerImpl::SetSupportedSchemesInternal( return; } - DCHECK(cookie_monster_.get()); - if (!cookie_monster_.get()) + DCHECK(cookie_store_.get()); + if (!cookie_store_.get()) return; supported_schemes_ = schemes; - SetCookieMonsterSchemes(cookie_monster_.get(), supported_schemes_); + SetCookieMonsterSchemes(cookie_store_.get(), supported_schemes_); RunAsyncCompletionOnIOThread(callback); } void CefCookieManagerImpl::VisitAllCookiesInternal( CefRefPtr visitor, - scoped_refptr cookie_monster) { + const CookieStoreGetter& cookie_store_getter) { CEF_REQUIRE_IOT(); - scoped_refptr callback( - new VisitCookiesCallback(cookie_monster, visitor)); + net::CookieStore* cookie_store = cookie_store_getter.Run(); + if (!cookie_store) + return; - cookie_monster->GetAllCookiesAsync( + scoped_refptr callback( + new VisitCookiesCallback(cookie_store_getter, visitor)); + + cookie_store->GetAllCookiesAsync( base::Bind(&VisitCookiesCallback::Run, callback.get())); } @@ -513,18 +523,22 @@ void CefCookieManagerImpl::VisitUrlCookiesInternal( const CefString& url, bool includeHttpOnly, CefRefPtr visitor, - scoped_refptr cookie_monster) { + const CookieStoreGetter& cookie_store_getter) { CEF_REQUIRE_IOT(); + net::CookieStore* cookie_store = cookie_store_getter.Run(); + if (!cookie_store) + return; + net::CookieOptions options; if (includeHttpOnly) options.set_include_httponly(); scoped_refptr callback( - new VisitCookiesCallback(cookie_monster, visitor)); + new VisitCookiesCallback(cookie_store_getter, visitor)); GURL gurl = GURL(url.ToString()); - cookie_monster->GetAllCookiesForURLWithOptionsAsync(gurl, options, + cookie_store->GetCookieListWithOptionsAsync(gurl, options, base::Bind(&VisitCookiesCallback::Run, callback.get())); } @@ -532,9 +546,13 @@ void CefCookieManagerImpl::SetCookieInternal( const GURL& url, const CefCookie& cookie, CefRefPtr callback, - scoped_refptr cookie_monster) { + const CookieStoreGetter& cookie_store_getter) { CEF_REQUIRE_IOT(); + net::CookieStore* cookie_store = cookie_store_getter.Run(); + if (!cookie_store) + return; + std::string name = CefString(&cookie.name).ToString(); std::string value = CefString(&cookie.value).ToString(); std::string domain = CefString(&cookie.domain).ToString(); @@ -544,13 +562,14 @@ void CefCookieManagerImpl::SetCookieInternal( if (cookie.has_expires) cef_time_to_basetime(cookie.expires, expiration_time); - cookie_monster->SetCookieWithDetailsAsync( + cookie_store->SetCookieWithDetailsAsync( url, name, value, domain, path, base::Time(), // Creation time. expiration_time, + base::Time(), // Last access time. cookie.secure ? true : false, cookie.httponly ? true : false, - false, // First-party only. + net::CookieSameSite::DEFAULT_MODE, CefNetworkDelegate::AreStrictSecureCookiesEnabled(), net::COOKIE_PRIORITY_DEFAULT, base::Bind(SetCookieCallbackImpl, callback)); @@ -560,31 +579,39 @@ void CefCookieManagerImpl::DeleteCookiesInternal( const GURL& url, const CefString& cookie_name, CefRefPtr callback, - scoped_refptr cookie_monster) { + const CookieStoreGetter& cookie_store_getter) { CEF_REQUIRE_IOT(); + net::CookieStore* cookie_store = cookie_store_getter.Run(); + if (!cookie_store) + return; + if (url.is_empty()) { // Delete all cookies. - cookie_monster->DeleteAllAsync( + cookie_store->DeleteAllAsync( base::Bind(DeleteCookiesCallbackImpl, callback)); } else if (cookie_name.empty()) { // Delete all matching host cookies. - cookie_monster->DeleteAllCreatedBetweenForHostAsync( + cookie_store->DeleteAllCreatedBetweenForHostAsync( base::Time(), base::Time::Max(), url, base::Bind(DeleteCookiesCallbackImpl, callback)); } else { // Delete all matching host and domain cookies. - cookie_monster->DeleteCookieAsync(url, cookie_name, + cookie_store->DeleteCookieAsync(url, cookie_name, base::Bind(DeleteCookiesCallbackImpl, callback, -1)); } } void CefCookieManagerImpl::FlushStoreInternal( CefRefPtr callback, - scoped_refptr cookie_monster) { + const CookieStoreGetter& cookie_store_getter) { CEF_REQUIRE_IOT(); - cookie_monster->FlushStore( + net::CookieStore* cookie_store = cookie_store_getter.Run(); + if (!cookie_store) + return; + + cookie_store->FlushStore( base::Bind(RunAsyncCompletionOnIOThread, callback)); } diff --git a/libcef/browser/cookie_manager_impl.h b/libcef/browser/cookie_manager_impl.h index 28290b5f4..5fa24fba6 100644 --- a/libcef/browser/cookie_manager_impl.h +++ b/libcef/browser/cookie_manager_impl.h @@ -9,6 +9,7 @@ #include "include/cef_cookie.h" #include "libcef/browser/request_context_impl.h" +#include "libcef/browser/thread_util.h" #include "base/files/file_path.h" #include "net/cookies/cookie_monster.h" @@ -25,19 +26,20 @@ class CefCookieManagerImpl : public CefCookieManager { bool persist_session_cookies, CefRefPtr callback); - // Executes |callback| either synchronously or asynchronously with the cookie - // monster object when it's available. If |task_runner| is NULL the callback - // will be executed on the originating thread. The resulting cookie monster - // object can only be accessed on the IO thread. - typedef base::Callback)> - CookieMonsterCallback; - void GetCookieMonster( + // Executes |callback| either synchronously or asynchronously with the + // CookieStoreGetter when the cookie store object is available. If + // |task_runner| is NULL the callback will be executed on the originating + // thread. CookieStoreGetter can only be executed on, and the resulting cookie + // store object can only be accessed on, the IO thread. + typedef base::Callback CookieStoreGetter; + typedef base::Callback CookieStoreCallback; + void GetCookieStore( scoped_refptr task_runner, - const CookieMonsterCallback& callback); + const CookieStoreCallback& callback); - // Returns the existing cookie monster object. Logs an error if the cookie - // monster does not yet exist. Must be called on the IO thread. - scoped_refptr GetExistingCookieMonster(); + // Returns the existing cookie store object. Logs an error if the cookie + // store does not yet exist. Must be called on the IO thread. + net::CookieStore* GetExistingCookieStore(); // CefCookieManager methods. void SetSupportedSchemes(const std::vector& schemes, @@ -85,9 +87,9 @@ class CefCookieManagerImpl : public CefCookieManager { const std::vector& schemes, CefRefPtr callback, scoped_refptr request_context); - void GetCookieMonsterWithContext( + void GetCookieStoreWithContext( scoped_refptr task_runner, - const CookieMonsterCallback& callback, + const CookieStoreCallback& callback, scoped_refptr request_context); void SetSupportedSchemesInternal( @@ -95,25 +97,25 @@ class CefCookieManagerImpl : public CefCookieManager { CefRefPtr callback); void VisitAllCookiesInternal( CefRefPtr visitor, - scoped_refptr cookie_monster); + const CookieStoreGetter& cookie_store_getter); void VisitUrlCookiesInternal( const CefString& url, bool includeHttpOnly, CefRefPtr visitor, - scoped_refptr cookie_monster); + const CookieStoreGetter& cookie_store_getter); void SetCookieInternal( const GURL& url, const CefCookie& cookie, CefRefPtr callback, - scoped_refptr cookie_monster); + const CookieStoreGetter& cookie_store_getter); void DeleteCookiesInternal( const GURL& url, const CefString& cookie_name, CefRefPtr callback, - scoped_refptr cookie_monster); + const CookieStoreGetter& cookie_store_getter); void FlushStoreInternal( CefRefPtr callback, - scoped_refptr cookie_monster); + const CookieStoreGetter& cookie_store_getter); // Used for cookie monsters owned by the context. CefRefPtr request_context_; @@ -122,9 +124,9 @@ class CefCookieManagerImpl : public CefCookieManager { // Used for cookie monsters owned by this object. base::FilePath storage_path_; std::vector supported_schemes_; - scoped_refptr cookie_monster_; + scoped_ptr cookie_store_; - IMPLEMENT_REFCOUNTING(CefCookieManagerImpl); + IMPLEMENT_REFCOUNTING_DELETE_ON_IOT(CefCookieManagerImpl); }; #endif // CEF_LIBCEF_BROWSER_COOKIE_MANAGER_IMPL_H_ diff --git a/libcef/browser/devtools_frontend.cc b/libcef/browser/devtools_frontend.cc index 523a91f56..a0c0329f6 100644 --- a/libcef/browser/devtools_frontend.cc +++ b/libcef/browser/devtools_frontend.cc @@ -70,15 +70,18 @@ int ResponseWriter::Initialize(const net::CompletionCallback& callback) { int ResponseWriter::Write(net::IOBuffer* buffer, int num_bytes, const net::CompletionCallback& callback) { + std::string chunk = std::string(buffer->data(), num_bytes); + if (!base::IsStringUTF8(chunk)) + return num_bytes; + base::FundamentalValue* id = new base::FundamentalValue(stream_id_); - base::StringValue* chunk = - new base::StringValue(std::string(buffer->data(), num_bytes)); + base::StringValue* chunkValue = new base::StringValue(chunk); content::BrowserThread::PostTask( content::BrowserThread::UI, FROM_HERE, base::Bind(&CefDevToolsFrontend::CallClientFunction, devtools_, "DevToolsAPI.streamWrite", - base::Owned(id), base::Owned(chunk), nullptr)); + base::Owned(id), base::Owned(chunkValue), nullptr)); return num_bytes; } diff --git a/libcef/browser/file_dialog_manager.cc b/libcef/browser/file_dialog_manager.cc index d806c2efc..a0d7ba0dc 100644 --- a/libcef/browser/file_dialog_manager.cc +++ b/libcef/browser/file_dialog_manager.cc @@ -11,6 +11,7 @@ #include "libcef/browser/browser_host_impl.h" #include "libcef/browser/thread_util.h" +#include "base/threading/worker_pool.h" #include "content/public/browser/render_view_host.h" #include "content/public/common/file_chooser_file_info.h" #include "net/base/directory_lister.h" @@ -364,7 +365,7 @@ void CefFileDialogManager::OnRunFileChooserUploadFolderDelegateCallback( new UploadFolderHelper( base::Bind(&CefFileDialogManager::OnRunFileChooserDelegateCallback, weak_ptr_factory_.GetWeakPtr(), mode)))); - lister_->Start(); + lister_->Start(base::WorkerPool::GetTaskRunner(true).get()); } } diff --git a/libcef/browser/javascript_dialog_manager.cc b/libcef/browser/javascript_dialog_manager.cc index 68232729b..e042f500e 100644 --- a/libcef/browser/javascript_dialog_manager.cc +++ b/libcef/browser/javascript_dialog_manager.cc @@ -14,7 +14,6 @@ #include "base/logging.h" #include "base/strings/utf_string_conversions.h" #include "components/url_formatter/elide_url.h" -#include "net/base/net_util.h" namespace { @@ -148,7 +147,6 @@ void CefJavaScriptDialogManager::RunJavaScriptDialog( void CefJavaScriptDialogManager::RunBeforeUnloadDialog( content::WebContents* web_contents, - const base::string16& message_text, bool is_reload, const DialogClosedCallback& callback) { if (browser_->destruction_state() >= @@ -159,6 +157,9 @@ void CefJavaScriptDialogManager::RunBeforeUnloadDialog( return; } + const base::string16& message_text = + base::ASCIIToUTF16("Is it OK to leave/reload this page?"); + CefRefPtr client = browser_->GetClient(); if (client.get()) { CefRefPtr handler = client->GetJSDialogHandler(); @@ -187,14 +188,10 @@ void CefJavaScriptDialogManager::RunBeforeUnloadDialog( dialog_running_ = true; - base::string16 new_message_text = - message_text + - base::ASCIIToUTF16("\n\nIs it OK to leave/reload this page?"); - runner_->Run(browser_, content::JAVASCRIPT_MESSAGE_TYPE_CONFIRM, base::string16(), // display_url - new_message_text, + message_text, base::string16(), // default_prompt_text base::Bind(&CefJavaScriptDialogManager::DialogClosed, weak_ptr_factory_.GetWeakPtr(), callback)); diff --git a/libcef/browser/javascript_dialog_manager.h b/libcef/browser/javascript_dialog_manager.h index d695285f8..8bcaaf837 100644 --- a/libcef/browser/javascript_dialog_manager.h +++ b/libcef/browser/javascript_dialog_manager.h @@ -41,7 +41,6 @@ class CefJavaScriptDialogManager : public content::JavaScriptDialogManager { bool* did_suppress_message) override; void RunBeforeUnloadDialog( content::WebContents* web_contents, - const base::string16& message_text, bool is_reload, const DialogClosedCallback& callback) override; void CancelActiveAndPendingDialogs( diff --git a/libcef/browser/native/javascript_dialog_runner_win.cc b/libcef/browser/native/javascript_dialog_runner_win.cc index 87a8cab68..7dcecc6d4 100644 --- a/libcef/browser/native/javascript_dialog_runner_win.cc +++ b/libcef/browser/native/javascript_dialog_runner_win.cc @@ -52,7 +52,7 @@ INT_PTR CALLBACK CefJavaScriptDialogRunnerWin::DialogProc( GetWindowLongPtr(dialog, DWLP_USER)); base::string16 user_input; bool finish = false; - bool result; + bool result = false; switch (LOWORD(wparam)) { case IDOK: finish = true; diff --git a/libcef/browser/native/window_x11.cc b/libcef/browser/native/window_x11.cc index d52b4adf6..942bea99c 100644 --- a/libcef/browser/native/window_x11.cc +++ b/libcef/browser/native/window_x11.cc @@ -11,6 +11,7 @@ #include #include "ui/base/x/x11_util.h" +#include "ui/events/platform/platform_event_source.h" #include "ui/events/platform/x11/x11_event_source.h" #include "ui/views/widget/desktop_aura/desktop_window_tree_host_x11.h" #include "ui/views/widget/desktop_aura/x11_topmost_window_finder.h" diff --git a/libcef/browser/net/cookie_store_proxy.cc b/libcef/browser/net/cookie_store_proxy.cc index e8d9a9fa5..b0b40af3f 100644 --- a/libcef/browser/net/cookie_store_proxy.cc +++ b/libcef/browser/net/cookie_store_proxy.cc @@ -25,18 +25,13 @@ CefCookieStoreProxy::~CefCookieStoreProxy() { CEF_REQUIRE_IOT(); } -void CefCookieStoreProxy::Detach() { - CEF_REQUIRE_IOT(); - parent_ = NULL; -} - void CefCookieStoreProxy::SetCookieWithOptionsAsync( const GURL& url, const std::string& cookie_line, const net::CookieOptions& options, const SetCookiesCallback& callback) { - scoped_refptr cookie_store = GetCookieStore(); - if (cookie_store.get()) { + net::CookieStore* cookie_store = GetCookieStore(); + if (cookie_store) { cookie_store->SetCookieWithOptionsAsync(url, cookie_line, options, callback); } @@ -48,36 +43,47 @@ void CefCookieStoreProxy::SetCookieWithDetailsAsync( const std::string& value, const std::string& domain, const std::string& path, - const base::Time creation_time, - const base::Time expiration_time, + base::Time creation_time, + base::Time expiration_time, + base::Time last_access_time, bool secure, bool http_only, - bool same_site, + net::CookieSameSite same_site, bool enforce_strict_secure, net::CookiePriority priority, const SetCookiesCallback& callback) { - scoped_refptr cookie_store = GetCookieStore(); - if (cookie_store.get()) { + net::CookieStore* cookie_store = GetCookieStore(); + if (cookie_store) { cookie_store->SetCookieWithDetailsAsync(url, name, value, domain, path, creation_time, expiration_time, - secure, http_only, same_site, - enforce_strict_secure, priority, - callback); + last_access_time, secure, http_only, + same_site, enforce_strict_secure, + priority, callback); } } void CefCookieStoreProxy::GetCookiesWithOptionsAsync( - const GURL& url, const net::CookieOptions& options, + const GURL& url, + const net::CookieOptions& options, const GetCookiesCallback& callback) { - scoped_refptr cookie_store = GetCookieStore(); - if (cookie_store.get()) + net::CookieStore* cookie_store = GetCookieStore(); + if (cookie_store) cookie_store->GetCookiesWithOptionsAsync(url, options, callback); } +void CefCookieStoreProxy::GetCookieListWithOptionsAsync( + const GURL& url, + const net::CookieOptions& options, + const GetCookieListCallback& callback) { + net::CookieStore* cookie_store = GetCookieStore(); + if (cookie_store) + cookie_store->GetCookieListWithOptionsAsync(url, options, callback); +} + void CefCookieStoreProxy::GetAllCookiesAsync( const GetCookieListCallback& callback) { - scoped_refptr cookie_store = GetCookieStore(); - if (cookie_store.get()) + net::CookieStore* cookie_store = GetCookieStore(); + if (cookie_store) cookie_store->GetAllCookiesAsync(callback); } @@ -85,25 +91,25 @@ void CefCookieStoreProxy::DeleteCookieAsync( const GURL& url, const std::string& cookie_name, const base::Closure& callback) { - scoped_refptr cookie_store = GetCookieStore(); - if (cookie_store.get()) + net::CookieStore* cookie_store = GetCookieStore(); + if (cookie_store) cookie_store->DeleteCookieAsync(url, cookie_name, callback); } -void CefCookieStoreProxy::GetAllCookiesForURLAsync( - const GURL& url, - const GetCookieListCallback& callback) { - scoped_refptr cookie_store = GetCookieStore(); - if (cookie_store.get()) - cookie_store->GetAllCookiesForURLAsync(url, callback); +void CefCookieStoreProxy::DeleteCanonicalCookieAsync( + const net::CanonicalCookie& cookie, + const DeleteCallback& callback) { + net::CookieStore* cookie_store = GetCookieStore(); + if (cookie_store) + cookie_store->DeleteCanonicalCookieAsync(cookie, callback); } void CefCookieStoreProxy::DeleteAllCreatedBetweenAsync( const base::Time& delete_begin, const base::Time& delete_end, const DeleteCallback& callback) { - scoped_refptr cookie_store = GetCookieStore(); - if (cookie_store.get()) { + net::CookieStore* cookie_store = GetCookieStore(); + if (cookie_store) { cookie_store->DeleteAllCreatedBetweenAsync(delete_begin, delete_end, callback); } @@ -114,8 +120,8 @@ void CefCookieStoreProxy::DeleteAllCreatedBetweenForHostAsync( const base::Time delete_end, const GURL& url, const DeleteCallback& callback) { - scoped_refptr cookie_store = GetCookieStore(); - if (cookie_store.get()) { + net::CookieStore* cookie_store = GetCookieStore(); + if (cookie_store) { cookie_store->DeleteAllCreatedBetweenForHostAsync(delete_begin, delete_end, url, callback); } @@ -123,55 +129,57 @@ void CefCookieStoreProxy::DeleteAllCreatedBetweenForHostAsync( void CefCookieStoreProxy::DeleteSessionCookiesAsync( const DeleteCallback& callback) { - scoped_refptr cookie_store = GetCookieStore(); - if (cookie_store.get()) + net::CookieStore* cookie_store = GetCookieStore(); + if (cookie_store) cookie_store->DeleteSessionCookiesAsync(callback); } void CefCookieStoreProxy::FlushStore(const base::Closure& callback) { - scoped_refptr cookie_store = GetCookieStore(); - if (cookie_store.get()) + net::CookieStore* cookie_store = GetCookieStore(); + if (cookie_store) cookie_store->FlushStore(callback); } -net::CookieMonster* CefCookieStoreProxy::GetCookieMonster() { - scoped_refptr cookie_store = GetCookieStore(); - if (cookie_store.get()) - return cookie_store->GetCookieMonster(); - return NULL; -} - scoped_ptr CefCookieStoreProxy::AddCallbackForCookie( const GURL& url, const std::string& name, const CookieChangedCallback& callback) { - scoped_refptr cookie_store = GetCookieStore(); - if (cookie_store.get()) + net::CookieStore* cookie_store = GetCookieStore(); + if (cookie_store) return cookie_store->AddCallbackForCookie(url, name, callback); return NULL; } +bool CefCookieStoreProxy::IsEphemeral() { + net::CookieStore* cookie_store = GetCookieStore(); + if (cookie_store) + return cookie_store->IsEphemeral(); + return true; +} + net::CookieStore* CefCookieStoreProxy::GetCookieStore() { CEF_REQUIRE_IOT(); - scoped_refptr cookie_store; + net::CookieStore* cookie_store = nullptr; CefRefPtr manager = handler_->GetCookieManager(); if (manager.get()) { // Use the cookie store provided by the manager. cookie_store = reinterpret_cast(manager.get())-> - GetExistingCookieMonster(); - DCHECK(cookie_store.get()); - return cookie_store.get(); + GetExistingCookieStore(); + DCHECK(cookie_store); + return cookie_store; } DCHECK(parent_); if (parent_) { // Use the cookie store from the parent. cookie_store = parent_->cookie_store(); - DCHECK(cookie_store.get()); + DCHECK(cookie_store); + if (!cookie_store) + LOG(ERROR) << "Cookie store does not exist"; } - return cookie_store.get(); + return cookie_store; } diff --git a/libcef/browser/net/cookie_store_proxy.h b/libcef/browser/net/cookie_store_proxy.h index 247ed55cb..03a5241c0 100644 --- a/libcef/browser/net/cookie_store_proxy.h +++ b/libcef/browser/net/cookie_store_proxy.h @@ -21,9 +21,6 @@ class CefCookieStoreProxy : public net::CookieStore { CefRefPtr handler); ~CefCookieStoreProxy() override; - // The |parent_| object may no longer be valid after this method is called. - void Detach(); - // net::CookieStore methods. void SetCookieWithOptionsAsync( const GURL& url, @@ -36,24 +33,29 @@ class CefCookieStoreProxy : public net::CookieStore { const std::string& value, const std::string& domain, const std::string& path, - const base::Time creation_time, - const base::Time expiration_time, + base::Time creation_time, + base::Time expiration_time, + base::Time last_access_time, bool secure, bool http_only, - bool same_site, + net::CookieSameSite same_site, bool enforce_strict_secure, net::CookiePriority priority, const SetCookiesCallback& callback) override; void GetCookiesWithOptionsAsync( - const GURL& url, const net::CookieOptions& options, + const GURL& url, + const net::CookieOptions& options, const GetCookiesCallback& callback) override; + void GetCookieListWithOptionsAsync( + const GURL& url, + const net::CookieOptions& options, + const GetCookieListCallback& callback) override; void GetAllCookiesAsync(const GetCookieListCallback& callback) override; void DeleteCookieAsync(const GURL& url, const std::string& cookie_name, const base::Closure& callback) override; - void GetAllCookiesForURLAsync( - const GURL& url, - const GetCookieListCallback& callback) override; + void DeleteCanonicalCookieAsync(const net::CanonicalCookie& cookie, + const DeleteCallback& callback) override; void DeleteAllCreatedBetweenAsync(const base::Time& delete_begin, const base::Time& delete_end, const DeleteCallback& callback) override; @@ -64,18 +66,17 @@ class CefCookieStoreProxy : public net::CookieStore { const DeleteCallback& callback) override; void DeleteSessionCookiesAsync(const DeleteCallback& callback) override; void FlushStore(const base::Closure& callback) override; - net::CookieMonster* GetCookieMonster() override; scoped_ptr AddCallbackForCookie( const GURL& url, const std::string& name, const CookieChangedCallback& callback) override; + bool IsEphemeral() override; private: net::CookieStore* GetCookieStore(); // The |parent_| pointer is kept alive by CefURLRequestContextGetterProxy - // which has a ref to the owning CefURLRequestContextGetterImpl. Detach() will - // be called when the CefURLRequestContextGetterProxy is destroyed. + // which has a ref to the owning CefURLRequestContextGetterImpl. CefURLRequestContextImpl* parent_; CefRefPtr handler_; diff --git a/libcef/browser/net/resource_request_job.cc b/libcef/browser/net/resource_request_job.cc index 8ef9d6a72..3fbfabebe 100644 --- a/libcef/browser/net/resource_request_job.cc +++ b/libcef/browser/net/resource_request_job.cc @@ -383,19 +383,13 @@ void CefResourceRequestJob::AddCookieHeaderAndStart() { if (!request_) return; - net::CookieStore* cookie_store = - request_->context()->cookie_store(); + net::CookieStore* cookie_store = request_->context()->cookie_store(); if (cookie_store && !(request_->load_flags() & net::LOAD_DO_NOT_SEND_COOKIES)) { - net::CookieMonster* cookie_monster = cookie_store->GetCookieMonster(); - if (cookie_monster) { - cookie_monster->GetAllCookiesForURLAsync( - request_->url(), - base::Bind(&CefResourceRequestJob::CheckCookiePolicyAndLoad, - weak_factory_.GetWeakPtr())); - } else { - DoLoadCookies(); - } + cookie_store->GetAllCookiesForURLAsync( + request_->url(), + base::Bind(&CefResourceRequestJob::CheckCookiePolicyAndLoad, + weak_factory_.GetWeakPtr())); } else { DoStartTransaction(); } diff --git a/libcef/browser/net/url_request_context_getter_impl.cc b/libcef/browser/net/url_request_context_getter_impl.cc index 9b15526df..b6077503c 100644 --- a/libcef/browser/net/url_request_context_getter_impl.cc +++ b/libcef/browser/net/url_request_context_getter_impl.cc @@ -104,14 +104,14 @@ class CefHttpUserAgentSettings : public net::HttpUserAgentSettings { CefURLRequestContextGetterImpl::CefURLRequestContextGetterImpl( const CefRequestContextSettings& settings, PrefService* pref_service, - base::MessageLoop* io_loop, - base::MessageLoop* file_loop, + scoped_refptr io_task_runner, + scoped_refptr file_task_runner, content::ProtocolHandlerMap* protocol_handlers, scoped_ptr proxy_config_service, content::URLRequestInterceptorScopedVector request_interceptors) : settings_(settings), - io_loop_(io_loop), - file_loop_(file_loop), + io_task_runner_(std::move(io_task_runner)), + file_task_runner_(std::move(file_task_runner)), proxy_config_service_(std::move(proxy_config_service)), request_interceptors_(std::move(request_interceptors)) { // Must first be created on the UI thread. @@ -334,9 +334,8 @@ void CefURLRequestContextGetterImpl::SetCookieStoragePath( // Set the new cookie store that will be used for all new requests. The old // cookie store, if any, will be automatically flushed and closed when no // longer referenced. - scoped_refptr cookie_monster = - new net::CookieMonster(persistent_store.get(), NULL); - storage_->set_cookie_store(cookie_monster.get()); + scoped_ptr cookie_monster( + new net::CookieMonster(persistent_store.get(), NULL)); if (persistent_store.get() && persist_session_cookies) cookie_monster->SetPersistSessionCookies(true); cookie_store_path_ = path; @@ -344,6 +343,8 @@ void CefURLRequestContextGetterImpl::SetCookieStoragePath( // Restore the previously supported schemes. CefCookieManagerImpl::SetCookieMonsterSchemes(cookie_monster.get(), cookie_supported_schemes_); + + storage_->set_cookie_store(std::move(cookie_monster)); } void CefURLRequestContextGetterImpl::SetCookieSupportedSchemes( @@ -351,8 +352,9 @@ void CefURLRequestContextGetterImpl::SetCookieSupportedSchemes( CEF_REQUIRE_IOT(); cookie_supported_schemes_ = schemes; - CefCookieManagerImpl::SetCookieMonsterSchemes(GetCookieMonster(), - cookie_supported_schemes_); + CefCookieManagerImpl::SetCookieMonsterSchemes( + static_cast(GetExistingCookieStore()), + cookie_supported_schemes_); } void CefURLRequestContextGetterImpl::AddHandler( @@ -365,9 +367,14 @@ void CefURLRequestContextGetterImpl::AddHandler( handler_list_.push_back(handler); } -net::CookieMonster* CefURLRequestContextGetterImpl::GetCookieMonster() const { +net::CookieStore* + CefURLRequestContextGetterImpl::GetExistingCookieStore() const { CEF_REQUIRE_IOT(); - return url_request_context_->cookie_store()->GetCookieMonster(); + if (url_request_context_ && url_request_context_->cookie_store()) + return url_request_context_->cookie_store(); + + LOG(ERROR) << "Cookie store does not exist"; + return nullptr; } void CefURLRequestContextGetterImpl::CreateProxyConfigService() { @@ -376,5 +383,5 @@ void CefURLRequestContextGetterImpl::CreateProxyConfigService() { proxy_config_service_ = net::ProxyService::CreateSystemProxyConfigService( - io_loop_->task_runner(), file_loop_->task_runner()); + io_task_runner_, file_task_runner_); } diff --git a/libcef/browser/net/url_request_context_getter_impl.h b/libcef/browser/net/url_request_context_getter_impl.h index 87c062afb..24a18e467 100644 --- a/libcef/browser/net/url_request_context_getter_impl.h +++ b/libcef/browser/net/url_request_context_getter_impl.h @@ -46,8 +46,8 @@ class CefURLRequestContextGetterImpl : public CefURLRequestContextGetter { CefURLRequestContextGetterImpl( const CefRequestContextSettings& settings, PrefService* pref_service, - base::MessageLoop* io_loop, - base::MessageLoop* file_loop, + scoped_refptr io_task_runner, + scoped_refptr file_task_runner, content::ProtocolHandlerMap* protocol_handlers, scoped_ptr proxy_config_service, content::URLRequestInterceptorScopedVector request_interceptors); @@ -69,7 +69,9 @@ class CefURLRequestContextGetterImpl : public CefURLRequestContextGetter { // kept alive until the context is destroyed. void AddHandler(CefRefPtr handler); - net::CookieMonster* GetCookieMonster() const; + // Returns the existing cookie store object. Logs an error if the cookie + // store does not yet exist. Must be called on the IO thread. + net::CookieStore* GetExistingCookieStore() const; CefURLRequestManager* request_manager() const { return url_request_manager_.get(); @@ -80,8 +82,8 @@ class CefURLRequestContextGetterImpl : public CefURLRequestContextGetter { const CefRequestContextSettings settings_; - base::MessageLoop* io_loop_; - base::MessageLoop* file_loop_; + scoped_refptr io_task_runner_; + scoped_refptr file_task_runner_; #if defined(OS_POSIX) && !defined(OS_ANDROID) std::string gsapi_library_name_; diff --git a/libcef/browser/net/url_request_context_proxy.cc b/libcef/browser/net/url_request_context_proxy.cc index 8722ecedf..d1a905e59 100644 --- a/libcef/browser/net/url_request_context_proxy.cc +++ b/libcef/browser/net/url_request_context_proxy.cc @@ -16,7 +16,7 @@ CefURLRequestContextProxy::CefURLRequestContextProxy( DCHECK(handler.get()); // Cookie store that proxies to the browser implementation. - cookie_store_proxy_ = new CefCookieStoreProxy(parent, handler); + cookie_store_proxy_.reset(new CefCookieStoreProxy(parent, handler)); set_cookie_store(cookie_store_proxy_.get()); // All other values refer to the parent request context. @@ -39,6 +39,4 @@ CefURLRequestContextProxy::CefURLRequestContextProxy( CefURLRequestContextProxy::~CefURLRequestContextProxy() { CEF_REQUIRE_IOT(); - // The CookieStore may outlive this object. - cookie_store_proxy_->Detach(); } diff --git a/libcef/browser/net/url_request_context_proxy.h b/libcef/browser/net/url_request_context_proxy.h index 5fcd2dddf..26db9ca7e 100644 --- a/libcef/browser/net/url_request_context_proxy.h +++ b/libcef/browser/net/url_request_context_proxy.h @@ -7,12 +7,12 @@ #pragma once #include "include/cef_request_context_handler.h" -#include "libcef/browser/net/cookie_store_proxy.h" #include "libcef/browser/net/url_request_context.h" #include "base/memory/scoped_ptr.h" class CefBrowserHostImpl; +class CefCookieStoreProxy; class CefURLRequestContextImpl; // URLRequestContext implementation for a particular CefRequestContext. Life @@ -28,7 +28,7 @@ class CefURLRequestContextProxy : public CefURLRequestContext { ~CefURLRequestContextProxy() override; private: - scoped_refptr cookie_store_proxy_; + scoped_ptr cookie_store_proxy_; DISALLOW_COPY_AND_ASSIGN(CefURLRequestContextProxy); }; diff --git a/libcef/browser/osr/render_widget_host_view_osr_mac.mm b/libcef/browser/osr/render_widget_host_view_osr_mac.mm index 4d50347b2..618d73e36 100644 --- a/libcef/browser/osr/render_widget_host_view_osr_mac.mm +++ b/libcef/browser/osr/render_widget_host_view_osr_mac.mm @@ -5,6 +5,7 @@ #include "libcef/browser/osr/render_widget_host_view_osr.h" +#include #include #include @@ -267,7 +268,8 @@ bool CefRenderWidgetHostViewOSR::GetLineBreakIndex( // assume the line breaking as the next character's y offset is larger than // a threshold. Currently the threshold is determined as minimum y offset plus // 75% of maximum height. - const size_t loop_end_idx = std::min(bounds.size(), range.end()); + const size_t loop_end_idx = + std::min(bounds.size(), static_cast(range.end())); int max_height = 0; int min_y_offset = std::numeric_limits::max(); for (size_t idx = range.start(); idx < loop_end_idx; ++idx) { diff --git a/libcef/browser/permissions/permission_context.cc b/libcef/browser/permissions/permission_context.cc index 8a5e797ed..0bc1c88d3 100644 --- a/libcef/browser/permissions/permission_context.cc +++ b/libcef/browser/permissions/permission_context.cc @@ -77,7 +77,6 @@ void CefPermissionContext::RequestPermission( content::WebContents* web_contents, const PermissionRequestID& id, const GURL& requesting_frame, - bool user_gesture, const BrowserPermissionCallback& callback) { DCHECK_CURRENTLY_ON(content::BrowserThread::UI); @@ -86,7 +85,6 @@ void CefPermissionContext::RequestPermission( id, requesting_frame.GetOrigin(), web_contents->GetLastCommittedURL().GetOrigin(), - user_gesture, callback); } @@ -144,7 +142,6 @@ void CefPermissionContext::DecidePermission( const PermissionRequestID& id, const GURL& requesting_origin, const GURL& embedding_origin, - bool user_gesture, const BrowserPermissionCallback& callback) { DCHECK_CURRENTLY_ON(content::BrowserThread::UI); diff --git a/libcef/browser/permissions/permission_context.h b/libcef/browser/permissions/permission_context.h index 570370f88..be3361085 100644 --- a/libcef/browser/permissions/permission_context.h +++ b/libcef/browser/permissions/permission_context.h @@ -37,7 +37,6 @@ class CefPermissionContext { content::WebContents* web_contents, const PermissionRequestID& id, const GURL& requesting_frame, - bool user_gesture, const BrowserPermissionCallback& callback); // Withdraw an existing permission request, no op if the permission request @@ -65,7 +64,6 @@ class CefPermissionContext { const PermissionRequestID& id, const GURL& requesting_origin, const GURL& embedding_origin, - bool user_gesture, const BrowserPermissionCallback& callback); void QueryPermission(content::PermissionType permission, diff --git a/libcef/browser/permissions/permission_manager.cc b/libcef/browser/permissions/permission_manager.cc index 868cdfff7..859cb641b 100644 --- a/libcef/browser/permissions/permission_manager.cc +++ b/libcef/browser/permissions/permission_manager.cc @@ -175,13 +175,11 @@ int CefPermissionManager::RequestPermission( PermissionType permission, content::RenderFrameHost* render_frame_host, const GURL& requesting_origin, - bool user_gesture, const base::Callback& callback) { return RequestPermissions( std::vector(1, permission), render_frame_host, requesting_origin, - user_gesture, base::Bind(&PermissionRequestResponseCallbackWrapper, callback)); } @@ -189,7 +187,6 @@ int CefPermissionManager::RequestPermissions( const std::vector& permissions, content::RenderFrameHost* render_frame_host, const GURL& requesting_origin, - bool user_gesture, const base::Callback&)>& callback) { if (permissions.empty()) { @@ -218,7 +215,7 @@ int CefPermissionManager::RequestPermissions( } context_.RequestPermission( - permission, web_contents, request, requesting_origin, user_gesture, + permission, web_contents, request, requesting_origin, base::Bind(&ContentSettingToPermissionStatusCallbackWrapper, base::Bind( &CefPermissionManager::OnPermissionsRequestResponseStatus, diff --git a/libcef/browser/permissions/permission_manager.h b/libcef/browser/permissions/permission_manager.h index a1841f160..58a3d84f4 100644 --- a/libcef/browser/permissions/permission_manager.h +++ b/libcef/browser/permissions/permission_manager.h @@ -36,13 +36,11 @@ class CefPermissionManager : public KeyedService, content::PermissionType permission, content::RenderFrameHost* render_frame_host, const GURL& requesting_origin, - bool user_gesture, const base::Callback& callback) override; int RequestPermissions( const std::vector& permissions, content::RenderFrameHost* render_frame_host, const GURL& requesting_origin, - bool user_gesture, const base::Callback&)>& callback) override; void CancelPermissionRequest(int request_id) override; diff --git a/libcef/browser/permissions/permission_util.cc b/libcef/browser/permissions/permission_util.cc index 8688ba7d5..82804da7f 100644 --- a/libcef/browser/permissions/permission_util.cc +++ b/libcef/browser/permissions/permission_util.cc @@ -36,6 +36,8 @@ ContentSettingsType PermissionTypeToContentSetting(PermissionType permission) { return CONTENT_SETTINGS_TYPE_MEDIASTREAM_MIC; case PermissionType::VIDEO_CAPTURE: return CONTENT_SETTINGS_TYPE_MEDIASTREAM_CAMERA; + case PermissionType::BACKGROUND_SYNC: + return CONTENT_SETTINGS_TYPE_BACKGROUND_SYNC; case PermissionType::NUM: // This will hit the NOTREACHED below. break; diff --git a/libcef/browser/thread_util.h b/libcef/browser/thread_util.h index 2faf57128..49bc0bf8b 100644 --- a/libcef/browser/thread_util.h +++ b/libcef/browser/thread_util.h @@ -46,4 +46,31 @@ content::BrowserThread::PostDelayedTask(id, FROM_HERE, task, \ base::TimeDelta::FromMilliseconds(delay_ms)) +// Same as IMPLEMENT_REFCOUNTING() but using the specified Destructor. +#define IMPLEMENT_REFCOUNTING_EX(ClassName, Destructor) \ + public: \ + void AddRef() const OVERRIDE { \ + ref_count_.AddRef(); \ + } \ + bool Release() const OVERRIDE { \ + if (ref_count_.Release()) { \ + Destructor::Destruct(this); \ + return true; \ + } \ + return false; \ + } \ + bool HasOneRef() const OVERRIDE { \ + return ref_count_.HasOneRef(); \ + } \ + private: \ + CefRefCount ref_count_; + +#define IMPLEMENT_REFCOUNTING_DELETE_ON_UIT(ClassName) \ + IMPLEMENT_REFCOUNTING_EX(ClassName, \ + content::BrowserThread::DeleteOnUIThread) + +#define IMPLEMENT_REFCOUNTING_DELETE_ON_IOT(ClassName) \ + IMPLEMENT_REFCOUNTING_EX(ClassName, \ + content::BrowserThread::DeleteOnIOThread) + #endif // CEF_LIBCEF_BROWSER_THREAD_UTIL_H_ diff --git a/libcef/common/content_client.cc b/libcef/common/content_client.cc index cd69fdd9a..2e945debf 100644 --- a/libcef/common/content_client.cc +++ b/libcef/common/content_client.cc @@ -218,12 +218,11 @@ void AddWidevineCdmFromCommandLine( kWidevineCdmPluginMimeTypeDescription); // Add the supported codecs as if they came from the component manifest. + // This list must match the CDM that is being shipped with Chrome. std::vector codecs; - codecs.push_back(kCdmSupportedCodecVorbis); codecs.push_back(kCdmSupportedCodecVp8); codecs.push_back(kCdmSupportedCodecVp9); #if defined(USE_PROPRIETARY_CODECS) - codecs.push_back(kCdmSupportedCodecAac); codecs.push_back(kCdmSupportedCodecAvc1); #endif // defined(USE_PROPRIETARY_CODECS) std::string codec_string = base::JoinString( @@ -279,6 +278,7 @@ void CefContentClient::AddPepperPlugins( void CefContentClient::AddAdditionalSchemes( std::vector* standard_schemes, + std::vector* referrer_schemes, std::vector* savable_schemes) { DCHECK(!scheme_info_list_locked_); @@ -463,8 +463,3 @@ bool CefContentClient::GetLocalizedString(int message_id, return (pack_loading_disabled_ || !value->empty()); } - -scoped_ptr CefContentClient::GetFont( - ui::ResourceBundle::FontStyle style) { - return scoped_ptr(); -} diff --git a/libcef/common/content_client.h b/libcef/common/content_client.h index e0c1af53c..9e3fde70b 100644 --- a/libcef/common/content_client.h +++ b/libcef/common/content_client.h @@ -35,6 +35,7 @@ class CefContentClient : public content::ContentClient, std::vector* plugins) override; void AddAdditionalSchemes( std::vector* standard_schemes, + std::vector* referrer_schemes, std::vector* savable_schemes) override; std::string GetUserAgent() const override; base::string16 GetLocalizedString(int message_id) const override; @@ -101,8 +102,6 @@ class CefContentClient : public content::ContentClient, base::StringPiece* value) override; bool GetLocalizedString(int message_id, base::string16* value) override; - scoped_ptr GetFont( - ui::ResourceBundle::FontStyle style) override; CefRefPtr application_; bool pack_loading_disabled_; diff --git a/libcef/common/drag_data_impl.cc b/libcef/common/drag_data_impl.cc index 9f01b656a..6b632ab27 100644 --- a/libcef/common/drag_data_impl.cc +++ b/libcef/common/drag_data_impl.cc @@ -8,7 +8,6 @@ #include "libcef/common/drag_data_impl.h" #include "base/files/file_path.h" #include "net/base/filename_util.h" -#include "net/base/net_util.h" #define CHECK_READONLY_RETURN_VOID() \ if (read_only_) { \ diff --git a/libcef/common/request_impl.cc b/libcef/common/request_impl.cc index 3c4cdd017..34d96a120 100644 --- a/libcef/common/request_impl.cc +++ b/libcef/common/request_impl.cc @@ -540,7 +540,7 @@ void CefRequestImpl::Set(const blink::WebURLRequest& request) { first_party_for_cookies_ = request.firstPartyForCookies().string(); - if (request.cachePolicy() == blink::WebURLRequest::ReloadIgnoringCacheData) + if (request.getCachePolicy() == blink::WebURLRequest::ReloadIgnoringCacheData) flags_ |= UR_FLAG_SKIP_CACHE; if (request.allowStoredCredentials()) flags_ |= UR_FLAG_ALLOW_CACHED_CREDENTIALS; diff --git a/libcef/renderer/browser_impl.cc b/libcef/renderer/browser_impl.cc index 86d205d60..5c4cfc72b 100644 --- a/libcef/renderer/browser_impl.cc +++ b/libcef/renderer/browser_impl.cc @@ -33,6 +33,7 @@ #include "third_party/WebKit/public/web/WebDataSource.h" #include "third_party/WebKit/public/web/WebDocument.h" #include "third_party/WebKit/public/web/WebFrame.h" +#include "third_party/WebKit/public/web/WebFrameContentDumper.h" #include "third_party/WebKit/public/web/WebLocalFrame.h" #include "third_party/WebKit/public/web/WebNode.h" #include "third_party/WebKit/public/web/WebScriptSource.h" @@ -595,8 +596,11 @@ void CefBrowserImpl::OnRequest(const Cef_Request_Params& params) { DCHECK(!command.empty()); if (base::LowerCaseEqualsASCII(command, "getsource")) { - response = web_frame->contentAsMarkup().utf8(); - success = true; + if (web_frame->isWebLocalFrame()) { + response = blink::WebFrameContentDumper::dumpAsMarkup( + web_frame->toWebLocalFrame()).utf8(); + success = true; + } } else if (base::LowerCaseEqualsASCII(command, "gettext")) { response = webkit_glue::DumpDocumentText(web_frame); success = true; diff --git a/libcef/renderer/content_renderer_client.cc b/libcef/renderer/content_renderer_client.cc index 4ac7b664e..7808431ce 100644 --- a/libcef/renderer/content_renderer_client.cc +++ b/libcef/renderer/content_renderer_client.cc @@ -7,6 +7,14 @@ #include +#include "base/compiler_specific.h" + +// Enable deprecation warnings for MSVC. See http://crbug.com/585142. +#if defined(OS_WIN) +#pragma warning(push) +#pragma warning(default:4996) +#endif + #include "libcef/browser/context.h" #include "libcef/common/cef_messages.h" #include "libcef/common/cef_switches.h" @@ -497,7 +505,7 @@ bool CefContentRendererClient::OverrideCreatePlugin( GURL url(params.url); CefViewHostMsg_GetPluginInfo_Output output; - blink::WebString top_origin = frame->top()->securityOrigin().toString(); + blink::WebString top_origin = frame->top()->getSecurityOrigin().toString(); render_frame->Send(new CefViewHostMsg_GetPluginInfo( render_frame->GetRoutingID(), url, blink::WebStringToGURL(top_origin), orig_mime_type, &output)); @@ -888,3 +896,9 @@ void CefContentRendererClient::RunSingleProcessCleanupOnUIThread() { if (!CefContext::Get()->settings().multi_threaded_message_loop) delete host; } + + +// Enable deprecation warnings for MSVC. See http://crbug.com/585142. +#if defined(OS_WIN) +#pragma warning(pop) +#endif diff --git a/libcef/renderer/extensions/extensions_renderer_client.cc b/libcef/renderer/extensions/extensions_renderer_client.cc index 8f2fb91f0..126c91dfc 100644 --- a/libcef/renderer/extensions/extensions_renderer_client.cc +++ b/libcef/renderer/extensions/extensions_renderer_client.cc @@ -82,7 +82,8 @@ bool CrossesExtensionExtents(blink::WebLocalFrame* frame, // in an extension process (other than the Chrome Web Store), we want to // keep it in process to allow the opener to script it. blink::WebDocument opener_document = opener_frame->document(); - blink::WebSecurityOrigin opener_origin = opener_document.securityOrigin(); + blink::WebSecurityOrigin opener_origin = + opener_document.getSecurityOrigin(); bool opener_is_extension_url = !opener_origin.isUnique() && extension_registry->GetExtensionOrAppByURL( opener_document.url()) != nullptr; diff --git a/libcef/renderer/frame_impl.cc b/libcef/renderer/frame_impl.cc index 196ae76b7..19da7ec9f 100644 --- a/libcef/renderer/frame_impl.cc +++ b/libcef/renderer/frame_impl.cc @@ -4,6 +4,14 @@ #include "libcef/renderer/frame_impl.h" +#include "base/compiler_specific.h" + +// Enable deprecation warnings for MSVC. See http://crbug.com/585142. +#if defined(OS_WIN) +#pragma warning(push) +#pragma warning(default:4996) +#endif + #include "libcef/common/cef_messages.h" #include "libcef/common/net/http_header_utils.h" #include "libcef/common/request_impl.h" @@ -18,6 +26,7 @@ #include "third_party/WebKit/public/platform/WebURL.h" #include "third_party/WebKit/public/web/WebDocument.h" #include "third_party/WebKit/public/web/WebFrame.h" +#include "third_party/WebKit/public/web/WebFrameContentDumper.h" #include "third_party/WebKit/public/web/WebKit.h" #include "third_party/WebKit/public/web/WebView.h" #include "third_party/WebKit/public/web/WebScriptSource.h" @@ -88,9 +97,10 @@ void CefFrameImpl::ViewSource() { void CefFrameImpl::GetSource(CefRefPtr visitor) { CEF_REQUIRE_RT_RETURN_VOID(); - - if (frame_) { - CefString content = std::string(frame_->contentAsMarkup().utf8()); + if (frame_ && frame_->isWebLocalFrame()) { + const CefString& content = + std::string(blink::WebFrameContentDumper::dumpAsMarkup( + frame_->toWebLocalFrame()).utf8()); visitor->Visit(content); } } @@ -99,7 +109,7 @@ void CefFrameImpl::GetText(CefRefPtr visitor) { CEF_REQUIRE_RT_RETURN_VOID(); if (frame_) { - CefString content = webkit_glue::DumpDocumentText(frame_); + const CefString& content = webkit_glue::DumpDocumentText(frame_); visitor->Visit(content); } } @@ -270,3 +280,9 @@ void CefFrameImpl::Detach() { browser_ = NULL; frame_ = NULL; } + + +// Enable deprecation warnings for MSVC. See http://crbug.com/585142. +#if defined(OS_WIN) +#pragma warning(pop) +#endif diff --git a/libcef/renderer/media/cef_key_systems.cc b/libcef/renderer/media/cef_key_systems.cc index 26f8511f4..51183512f 100644 --- a/libcef/renderer/media/cef_key_systems.cc +++ b/libcef/renderer/media/cef_key_systems.cc @@ -119,7 +119,7 @@ static void AddPepperBasedWidevine( } cdm::AddWidevineWithCodecs( - cdm::WIDEVINE, supported_codecs, + supported_codecs, media::EmeRobustness::SW_SECURE_CRYPTO, // Maximum audio robustness. media::EmeRobustness::SW_SECURE_DECODE, // Maximum video robustness. media::EmeSessionTypeSupport::NOT_SUPPORTED, // persistent-license. diff --git a/libcef/renderer/plugins/cef_plugin_placeholder.cc b/libcef/renderer/plugins/cef_plugin_placeholder.cc index a82aeee9b..705fd61a5 100644 --- a/libcef/renderer/plugins/cef_plugin_placeholder.cc +++ b/libcef/renderer/plugins/cef_plugin_placeholder.cc @@ -17,6 +17,7 @@ #include "chrome/grit/generated_resources.h" #include "chrome/renderer/custom_menu_commands.h" #include "components/content_settings/content/common/content_settings_messages.h" +#include "components/strings/grit/components_strings.h" #include "content/public/common/content_switches.h" #include "content/public/common/context_menu_params.h" #include "content/public/renderer/render_frame.h" @@ -178,7 +179,8 @@ void CefPluginPlaceholder::PluginListChanged() { CefViewHostMsg_GetPluginInfo_Output output; std::string mime_type(GetPluginParams().mimeType.utf8()); - blink::WebString top_origin = GetFrame()->top()->securityOrigin().toString(); + blink::WebString top_origin = + GetFrame()->top()->getSecurityOrigin().toString(); render_frame()->Send( new CefViewHostMsg_GetPluginInfo(routing_id(), GURL(GetPluginParams().url), diff --git a/libcef/renderer/render_frame_observer.cc b/libcef/renderer/render_frame_observer.cc index d2bbecb43..6aa6581d5 100644 --- a/libcef/renderer/render_frame_observer.cc +++ b/libcef/renderer/render_frame_observer.cc @@ -7,10 +7,14 @@ #include "config.h" MSVC_PUSH_WARNING_LEVEL(0); -#include "bindings/core/v8/V8RecursionScope.h" +#include "platform/ScriptForbiddenScope.h" MSVC_POP_WARNING(); -#undef FROM_HERE -#undef LOG + +// Enable deprecation warnings for MSVC. See http://crbug.com/585142. +#if defined(OS_WIN) +#pragma warning(push) +#pragma warning(default:4996) +#endif #include "libcef/renderer/render_frame_observer.h" @@ -53,7 +57,8 @@ void CefRenderFrameObserver::DidCreateScriptContext( v8::Isolate* isolate = blink::mainThreadIsolate(); v8::HandleScope handle_scope(isolate); v8::Context::Scope scope(context); - blink::V8RecursionScope recursion_scope(isolate); + v8::MicrotasksScope microtasks_scope(isolate, + v8::MicrotasksScope::kRunMicrotasks); CefRefPtr contextPtr(new CefV8ContextImpl(isolate, context)); @@ -94,3 +99,9 @@ void CefRenderFrameObserver::WillReleaseScriptContext( CefV8ReleaseContext(context); } + + +// Enable deprecation warnings for MSVC. See http://crbug.com/585142. +#if defined(OS_WIN) +#pragma warning(pop) +#endif diff --git a/libcef/renderer/v8_impl.cc b/libcef/renderer/v8_impl.cc index 5a19a692c..2f0c14ee3 100644 --- a/libcef/renderer/v8_impl.cc +++ b/libcef/renderer/v8_impl.cc @@ -20,8 +20,6 @@ MSVC_PUSH_WARNING_LEVEL(0); #include "bindings/core/v8/ScriptController.h" #include "bindings/core/v8/V8Binding.h" MSVC_POP_WARNING(); -#undef FROM_HERE -#undef LOG // Enable deprecation warnings for MSVC. See http://crbug.com/585142. #if defined(OS_WIN) @@ -945,11 +943,8 @@ bool CefV8Context::InContext() { CefV8ContextImpl::CefV8ContextImpl(v8::Isolate* isolate, v8::Local context) - : handle_(new Handle(isolate, context, context)) -#ifndef NDEBUG - , enter_count_(0) -#endif -{ // NOLINT(whitespace/braces) + : handle_(new Handle(isolate, context, context)), + enter_count_(0) { } CefV8ContextImpl::~CefV8ContextImpl() { @@ -1019,11 +1014,15 @@ bool CefV8ContextImpl::Enter() { v8::Isolate* isolate = handle_->isolate(); v8::HandleScope handle_scope(isolate); - blink::V8PerIsolateData::from(isolate)->incrementRecursionLevel(); - handle_->GetNewV8Handle()->Enter(); -#ifndef NDEBUG + if (!microtasks_scope_) { + // Increment the MicrotasksScope recursion level. + microtasks_scope_.reset( + new v8::MicrotasksScope(isolate, v8::MicrotasksScope::kRunMicrotasks)); + } + ++enter_count_; -#endif + handle_->GetNewV8Handle()->Enter(); + return true; } @@ -1033,15 +1032,21 @@ bool CefV8ContextImpl::Exit() { if (blink::ScriptForbiddenScope::isScriptForbidden()) return false; - v8::Isolate* isolate = handle_->isolate(); + if (enter_count_ <= 0) { + LOG(ERROR) << "Call to CefV8Context::Exit() without matching call to " + "CefV8Context::Enter()"; + return false; + } + v8::HandleScope handle_scope(handle_->isolate()); - DLOG_ASSERT(enter_count_ > 0); handle_->GetNewV8Handle()->Exit(); - blink::V8PerIsolateData::from(isolate)->decrementRecursionLevel(); -#ifndef NDEBUG - --enter_count_; -#endif + + if (--enter_count_ == 0) { + // Decrement the MicrotasksScope recursion level. + microtasks_scope_.reset(nullptr); + } + return true; } diff --git a/libcef/renderer/v8_impl.h b/libcef/renderer/v8_impl.h index 457e83054..3933939a3 100644 --- a/libcef/renderer/v8_impl.h +++ b/libcef/renderer/v8_impl.h @@ -188,14 +188,12 @@ class CefV8ContextImpl : public CefV8Context { v8::Local GetV8Context(); blink::WebFrame* GetWebFrame(); - protected: + private: typedef CefV8Handle Handle; scoped_refptr handle_; -#ifndef NDEBUG - // Used in debug builds to catch missing Exits in destructor. int enter_count_; -#endif + scoped_ptr microtasks_scope_; IMPLEMENT_REFCOUNTING(CefV8ContextImpl); DISALLOW_COPY_AND_ASSIGN(CefV8ContextImpl); @@ -279,7 +277,7 @@ class CefV8ValueImpl : public CefV8Value { CefRefPtr object, const CefV8ValueList& arguments) override; - protected: + private: // Test for and record any exception. bool HasCaught(v8::Local context, v8::TryCatch& try_catch); @@ -299,7 +297,7 @@ class CefV8ValueImpl : public CefV8Value { void SetWeakIfNecessary(); - protected: + private: ~Handle() override; private: @@ -366,7 +364,7 @@ class CefV8StackTraceImpl : public CefV8StackTrace { int GetFrameCount() override; CefRefPtr GetFrame(int index) override; - protected: + private: std::vector > frames_; IMPLEMENT_REFCOUNTING(CefV8StackTraceImpl); @@ -388,7 +386,7 @@ class CefV8StackFrameImpl : public CefV8StackFrame { bool IsEval() override; bool IsConstructor() override; - protected: + private: CefString script_name_; CefString script_name_or_source_url_; CefString function_name_; diff --git a/libcef/renderer/webkit_glue.cc b/libcef/renderer/webkit_glue.cc index e9cbf081c..1c6d1e6cf 100644 --- a/libcef/renderer/webkit_glue.cc +++ b/libcef/renderer/webkit_glue.cc @@ -83,7 +83,7 @@ std::string DumpDocumentText(blink::WebFrame* frame) { cef_dom_node_type_t GetNodeType(const blink::WebNode& node) { const blink::Node* web_node = node.constUnwrap(); - switch (web_node->nodeType()) { + switch (web_node->getNodeType()) { case blink::Node::ELEMENT_NODE: return DOM_NODE_TYPE_ELEMENT; case blink::Node::ATTRIBUTE_NODE: diff --git a/libcef/resources/cef_strings.grd b/libcef/resources/cef_strings.grd index ad5fd6f4a..61a3d7a89 100644 --- a/libcef/resources/cef_strings.grd +++ b/libcef/resources/cef_strings.grd @@ -361,9 +361,6 @@ need to be translated for each locale.--> Hide this plugin - - This plugin is not supported. - Control-click to play $1Flash. @@ -404,14 +401,6 @@ need to be translated for each locale.--> - - - en-US,en - - - - windows-1252 - false diff --git a/libcef_dll/CMakeLists.txt.in b/libcef_dll/CMakeLists.txt.in index d50ed8de1..149263066 100644 --- a/libcef_dll/CMakeLists.txt.in +++ b/libcef_dll/CMakeLists.txt.in @@ -30,6 +30,7 @@ endmacro() 'includes_win:WINDOWS', 'includes_mac:MACOSX', 'includes_linux:LINUX', + 'libcef_dll_wrapper_sources_base', 'libcef_dll_wrapper_sources_common', 'autogen_client_side', ], diff --git a/libcef_dll/wrapper/cef_message_router.cc b/libcef_dll/wrapper/cef_message_router.cc index dc6af1c46..ffd03f8cc 100644 --- a/libcef_dll/wrapper/cef_message_router.cc +++ b/libcef_dll/wrapper/cef_message_router.cc @@ -95,7 +95,7 @@ class CefMessageRouterBrowserSideImpl : public CefMessageRouterBrowserSide { if (router_) { CefPostTask(TID_UI, base::Bind(&CefMessageRouterBrowserSideImpl::OnCallbackSuccess, - router_, browser_id_, query_id_, response)); + router_.get(), browser_id_, query_id_, response)); if (!persistent_) { // Non-persistent callbacks are only good for a single use. @@ -117,7 +117,7 @@ class CefMessageRouterBrowserSideImpl : public CefMessageRouterBrowserSide { if (router_) { CefPostTask(TID_UI, base::Bind(&CefMessageRouterBrowserSideImpl::OnCallbackFailure, - router_, browser_id_, query_id_, error_code, + router_.get(), browser_id_, query_id_, error_code, error_message)); // Failure always invalidates the callback. diff --git a/libcef_dll/wrapper/cef_resource_manager.cc b/libcef_dll/wrapper/cef_resource_manager.cc index 4ef459965..cc8879910 100644 --- a/libcef_dll/wrapper/cef_resource_manager.cc +++ b/libcef_dll/wrapper/cef_resource_manager.cc @@ -379,7 +379,7 @@ void CefResourceManager::Request::Stop() { } CefResourceManager::Request::Request(scoped_ptr state) - : state_(state.Pass()), + : state_(MOVE_SCOPED_PTR(state)), params_(state_->params_) { CEF_REQUIRE_IO_THREAD(); @@ -401,7 +401,7 @@ scoped_ptr CEF_REQUIRE_IO_THREAD(); Provider* provider = (*state_->current_entry_pos_)->provider_.get(); if (!provider->OnRequest(this)) - return state_.Pass(); + return MOVE_SCOPED_PTR(state_); return scoped_ptr(); } @@ -418,7 +418,7 @@ void CefResourceManager::Request::ContinueOnIOThread( // The manager may already have been deleted. base::WeakPtr manager = state->manager_; if (manager) - manager->ContinueRequest(state.Pass(), handler); + manager->ContinueRequest(MOVE_SCOPED_PTR(state), handler); } // static @@ -428,7 +428,7 @@ void CefResourceManager::Request::StopOnIOThread( // The manager may already have been deleted. base::WeakPtr manager = state->manager_; if (manager) - manager->StopRequest(state.Pass()); + manager->StopRequest(MOVE_SCOPED_PTR(state)); } @@ -611,7 +611,7 @@ cef_return_value_t CefResourceManager::OnBeforeResourceLoad( state->current_entry_pos_ = current_entry_pos; // If the request is potentially handled we need to continue asynchronously. - return SendRequest(state.Pass()) ? RV_CONTINUE_ASYNC : RV_CONTINUE; + return SendRequest(MOVE_SCOPED_PTR(state)) ? RV_CONTINUE_ASYNC : RV_CONTINUE; } CefRefPtr CefResourceManager::GetResourceHandler( @@ -643,7 +643,7 @@ bool CefResourceManager::SendRequest(scoped_ptr state) { do { // Should not be on the last provider entry. DCHECK(state->current_entry_pos_ != providers_.end()); - scoped_refptr request = new Request(state.Pass()); + scoped_refptr request = new Request(MOVE_SCOPED_PTR(state)); // Give the provider an opportunity to handle the request. state = request->SendRequest(); @@ -651,7 +651,7 @@ bool CefResourceManager::SendRequest(scoped_ptr state) { // The provider will not handle the request. Move to the next provider if // any. if (!IncrementProvider(state.get())) - StopRequest(state.Pass()); + StopRequest(MOVE_SCOPED_PTR(state)); } else { potentially_handled = true; } @@ -669,13 +669,13 @@ void CefResourceManager::ContinueRequest( // The request has been handled. Associate the request ID with the handler. pending_handlers_.insert( std::make_pair(state->params_.request_->GetIdentifier(), handler)); - StopRequest(state.Pass()); + StopRequest(MOVE_SCOPED_PTR(state)); } else { // Move to the next provider if any. if (IncrementProvider(state.get())) - SendRequest(state.Pass()); + SendRequest(MOVE_SCOPED_PTR(state)); else - StopRequest(state.Pass()); + StopRequest(MOVE_SCOPED_PTR(state)); } } diff --git a/patch/patch.cfg b/patch/patch.cfg index cae38bc28..540a76bb8 100644 --- a/patch/patch.cfg +++ b/patch/patch.cfg @@ -176,8 +176,6 @@ patches = [ # https://bitbucket.org/chromiumembedded/cef/issue/1478 # Fix printing of PDF documents via PrintToPDF. # https://bitbucket.org/chromiumembedded/cef/issues/1565 - # Fix header/footer scaling on Linux. - # https://code.google.com/p/chromium/issues/detail?id=583527 # Revert ENABLE_PRINT_PREVIEW changes from the following changeset. # https://codereview.chromium.org/1556463003 'name': 'print_header_footer_1478_1565', @@ -246,4 +244,10 @@ patches = [ 'name': 'net_filter_515', 'path': '../net/', }, + { + # Fix VS2015 Update 2 RC compile error. + # https://bugs.chromium.org/p/chromium/issues/detail?id=440500#c322 + 'name': 'gpu_service_440500', + 'path': '../gpu/command_buffer/service/', + }, ] diff --git a/patch/patches/browser_frame_host_guest_1687.patch b/patch/patches/browser_frame_host_guest_1687.patch index 6cbaba6fd..e26a2c6e9 100644 --- a/patch/patches/browser_frame_host_guest_1687.patch +++ b/patch/patches/browser_frame_host_guest_1687.patch @@ -1,8 +1,8 @@ diff --git render_widget_host_view_guest.cc render_widget_host_view_guest.cc -index a080567..8da4190 100644 +index 1312e52..3d1656c 100644 --- render_widget_host_view_guest.cc +++ render_widget_host_view_guest.cc -@@ -220,6 +220,9 @@ void RenderWidgetHostViewGuest::Destroy() { +@@ -191,6 +191,9 @@ void RenderWidgetHostViewGuest::Destroy() { } gfx::Size RenderWidgetHostViewGuest::GetPhysicalBackingSize() const { diff --git a/patch/patches/browser_plugin_guest_1565.patch b/patch/patches/browser_plugin_guest_1565.patch index 26204734b..2a59ce4b3 100644 --- a/patch/patches/browser_plugin_guest_1565.patch +++ b/patch/patches/browser_plugin_guest_1565.patch @@ -1,8 +1,8 @@ diff --git browser/browser_plugin/browser_plugin_guest.cc browser/browser_plugin/browser_plugin_guest.cc -index 1855e5d..4e0cd1d 100644 +index 007c977..069e8d4 100644 --- browser/browser_plugin/browser_plugin_guest.cc +++ browser/browser_plugin/browser_plugin_guest.cc -@@ -27,7 +27,7 @@ +@@ -28,7 +28,7 @@ #include "content/browser/renderer_host/render_widget_host_impl.h" #include "content/browser/renderer_host/render_widget_host_view_base.h" #include "content/browser/web_contents/web_contents_impl.h" @@ -11,7 +11,7 @@ index 1855e5d..4e0cd1d 100644 #include "content/common/browser_plugin/browser_plugin_constants.h" #include "content/common/browser_plugin/browser_plugin_messages.h" #include "content/common/content_constants_internal.h" -@@ -294,20 +294,19 @@ void BrowserPluginGuest::InitInternal( +@@ -286,20 +286,19 @@ void BrowserPluginGuest::InitInternal( guest_window_rect_ = params.view_rect; if (owner_web_contents_ != owner_web_contents) { @@ -36,7 +36,7 @@ index 1855e5d..4e0cd1d 100644 } RendererPreferences* renderer_prefs = -@@ -792,11 +791,10 @@ void BrowserPluginGuest::OnWillAttachComplete( +@@ -754,11 +753,10 @@ void BrowserPluginGuest::OnWillAttachComplete( ->GetWidget() ->Init(); GetWebContents()->GetMainFrame()->Init(); diff --git a/patch/patches/browser_web_contents_1257.patch b/patch/patches/browser_web_contents_1257.patch index b869a3112..03362f46a 100644 --- a/patch/patches/browser_web_contents_1257.patch +++ b/patch/patches/browser_web_contents_1257.patch @@ -1,10 +1,10 @@ diff --git web_contents_impl.cc web_contents_impl.cc -index 2af90ae..7580a73 100644 +index 4c9db9e..0f1429a 100644 --- web_contents_impl.cc +++ web_contents_impl.cc -@@ -1382,32 +1382,40 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params) { - main_frame_widget_routing_id); - frame_tree_.root()->SetFrameName(params.main_frame_name); +@@ -1391,32 +1391,40 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params) { + std::string unique_name = params.main_frame_name; + frame_tree_.root()->SetFrameName(params.main_frame_name, unique_name); - WebContentsViewDelegate* delegate = - GetContentClient()->browser()->GetWebContentsViewDelegate(this); @@ -62,7 +62,7 @@ index 2af90ae..7580a73 100644 CHECK(render_view_host_delegate_view_); CHECK(view_.get()); -@@ -1839,11 +1847,14 @@ void WebContentsImpl::CreateNewWindow( +@@ -1852,11 +1860,14 @@ void WebContentsImpl::CreateNewWindow( static_cast(session_storage_namespace); CHECK(session_storage_namespace_impl->IsFromContext(dom_storage_context)); @@ -78,7 +78,7 @@ index 2af90ae..7580a73 100644 if (route_id != MSG_ROUTING_NONE && !RenderViewHost::FromID(render_process_id, route_id)) { // If the embedder didn't create a WebContents for this route, we need to -@@ -1867,6 +1878,8 @@ void WebContentsImpl::CreateNewWindow( +@@ -1880,6 +1891,8 @@ void WebContentsImpl::CreateNewWindow( create_params.opener_render_process_id = render_process_id; create_params.opener_render_frame_id = params.opener_render_frame_id; create_params.opener_suppressed = params.opener_suppressed; diff --git a/patch/patches/build.patch b/patch/patches/build.patch index 15127311e..39a096cb3 100644 --- a/patch/patches/build.patch +++ b/patch/patches/build.patch @@ -1,5 +1,5 @@ diff --git common.gypi common.gypi -index 846dc3a..700284e 100644 +index 5f389b2..b8725d5 100644 --- common.gypi +++ common.gypi @@ -9,6 +9,9 @@ diff --git a/patch/patches/chrome_browser_1257.patch b/patch/patches/chrome_browser_1257.patch index c5eef03b1..437c92f0c 100644 --- a/patch/patches/chrome_browser_1257.patch +++ b/patch/patches/chrome_browser_1257.patch @@ -1,8 +1,8 @@ diff --git ui/browser.cc ui/browser.cc -index 8ceee96..da77140 100644 +index 1595e86..e9c7cce 100644 --- ui/browser.cc +++ ui/browser.cc -@@ -1726,7 +1726,9 @@ bool Browser::ShouldCreateWebContents( +@@ -1722,7 +1722,9 @@ bool Browser::ShouldCreateWebContents( const std::string& frame_name, const GURL& target_url, const std::string& partition_id, @@ -14,10 +14,10 @@ index 8ceee96..da77140 100644 // If a BackgroundContents is created, suppress the normal WebContents. return !MaybeCreateBackgroundContents( diff --git ui/browser.h ui/browser.h -index 37d23b3..37c9ea9 100644 +index f9a8392..ce76798 100644 --- ui/browser.h +++ ui/browser.h -@@ -600,7 +600,9 @@ class Browser : public TabStripModelObserver, +@@ -604,7 +604,9 @@ class Browser : public TabStripModelObserver, const std::string& frame_name, const GURL& target_url, const std::string& partition_id, diff --git a/patch/patches/compositor_1368.patch b/patch/patches/compositor_1368.patch index 0e49e7b49..d3a6a156d 100644 --- a/patch/patches/compositor_1368.patch +++ b/patch/patches/compositor_1368.patch @@ -1,8 +1,8 @@ diff --git content/browser/compositor/gpu_process_transport_factory.cc content/browser/compositor/gpu_process_transport_factory.cc -index eccd9dc..d0908c6 100644 +index 1d05689..139e7f4 100644 --- content/browser/compositor/gpu_process_transport_factory.cc +++ content/browser/compositor/gpu_process_transport_factory.cc -@@ -132,6 +132,13 @@ GpuProcessTransportFactory::CreateOffscreenCommandBufferContext() { +@@ -131,6 +131,13 @@ GpuProcessTransportFactory::CreateOffscreenCommandBufferContext() { scoped_ptr GpuProcessTransportFactory::CreateSoftwareOutputDevice( ui::Compositor* compositor) { diff --git a/patch/patches/content_nav_1129.patch b/patch/patches/content_nav_1129.patch index 09e3ea196..53c26362b 100644 --- a/patch/patches/content_nav_1129.patch +++ b/patch/patches/content_nav_1129.patch @@ -1,5 +1,5 @@ diff --git public/renderer/content_renderer_client.cc public/renderer/content_renderer_client.cc -index 3d0316f..ccd1f58 100644 +index d32eccc..17e3e38 100644 --- public/renderer/content_renderer_client.cc +++ public/renderer/content_renderer_client.cc @@ -98,7 +98,6 @@ bool ContentRendererClient::AllowPopup() { @@ -19,10 +19,10 @@ index 3d0316f..ccd1f58 100644 bool ContentRendererClient::ShouldFork(blink::WebLocalFrame* frame, const GURL& url, diff --git public/renderer/content_renderer_client.h public/renderer/content_renderer_client.h -index 45686b5..18548a0 100644 +index 880550c..3a59f3b 100644 --- public/renderer/content_renderer_client.h +++ public/renderer/content_renderer_client.h -@@ -194,7 +194,6 @@ class CONTENT_EXPORT ContentRendererClient { +@@ -198,7 +198,6 @@ class CONTENT_EXPORT ContentRendererClient { // Returns true if a popup window should be allowed. virtual bool AllowPopup(); @@ -30,7 +30,7 @@ index 45686b5..18548a0 100644 // TODO(sgurun) This callback is deprecated and will be removed as soon // as android webview completes implementation of a resource throttle based // shouldoverrideurl implementation. See crbug.com/325351 -@@ -209,7 +208,6 @@ class CONTENT_EXPORT ContentRendererClient { +@@ -213,7 +212,6 @@ class CONTENT_EXPORT ContentRendererClient { blink::WebNavigationType type, blink::WebNavigationPolicy default_policy, bool is_redirect); @@ -39,10 +39,10 @@ index 45686b5..18548a0 100644 // Returns true if we should fork a new process for the given navigation. // If |send_referrer| is set to false (which is the default), no referrer diff --git renderer/render_frame_impl.cc renderer/render_frame_impl.cc -index 0fc35cb..caed853 100644 +index 6d9f299..b90bf05 100644 --- renderer/render_frame_impl.cc +++ renderer/render_frame_impl.cc -@@ -4750,7 +4750,6 @@ WebNavigationPolicy RenderFrameImpl::decidePolicyForNavigation( +@@ -4703,7 +4703,6 @@ WebNavigationPolicy RenderFrameImpl::decidePolicyForNavigation( (pending_navigation_params_ && !pending_navigation_params_->request_params.redirects.empty()); @@ -50,7 +50,7 @@ index 0fc35cb..caed853 100644 // The handlenavigation API is deprecated and will be removed once // crbug.com/325351 is resolved. if (info.urlRequest.url() != GURL(kSwappedOutURL) && -@@ -4760,7 +4759,6 @@ WebNavigationPolicy RenderFrameImpl::decidePolicyForNavigation( +@@ -4713,7 +4712,6 @@ WebNavigationPolicy RenderFrameImpl::decidePolicyForNavigation( is_redirect)) { return blink::WebNavigationPolicyIgnore; } diff --git a/patch/patches/gpu_service_440500.patch b/patch/patches/gpu_service_440500.patch new file mode 100644 index 000000000..0231e32c1 --- /dev/null +++ b/patch/patches/gpu_service_440500.patch @@ -0,0 +1,20 @@ +diff --git texture_manager.h texture_manager.h +index 2485146..b31c3b9 100644 +--- texture_manager.h ++++ texture_manager.h +@@ -17,6 +17,7 @@ + #include "base/macros.h" + #include "base/memory/ref_counted.h" + #include "gpu/command_buffer/service/feature_info.h" ++#include "gpu/command_buffer/service/gl_stream_texture_image.h" + #include "gpu/command_buffer/service/gl_utils.h" + #include "gpu/command_buffer/service/memory_tracking.h" + #include "gpu/command_buffer/service/sampler_manager.h" +@@ -28,7 +29,6 @@ namespace gpu { + namespace gles2 { + + class GLES2Decoder; +-class GLStreamTextureImage; + struct ContextState; + struct DecoderFramebufferState; + class Display; diff --git a/patch/patches/gritsettings.patch b/patch/patches/gritsettings.patch index 9cc6012af..f40c860b4 100644 --- a/patch/patches/gritsettings.patch +++ b/patch/patches/gritsettings.patch @@ -1,5 +1,5 @@ diff --git resource_ids resource_ids -index 2943776..6d4b898 100644 +index c8dc083..7773a93b 100644 --- resource_ids +++ resource_ids @@ -14,6 +14,12 @@ diff --git a/patch/patches/gyp_331.patch b/patch/patches/gyp_331.patch index 3d8debffc..58fd743c0 100644 --- a/patch/patches/gyp_331.patch +++ b/patch/patches/gyp_331.patch @@ -1,5 +1,5 @@ diff --git gyp/generator/ninja.py gyp/generator/ninja.py -index 552b2f8..3d61233 100644 +index ffb3a85..02e0947 100644 --- gyp/generator/ninja.py +++ gyp/generator/ninja.py @@ -747,7 +747,16 @@ class NinjaWriter(object): diff --git a/patch/patches/hwnd_message_handler_1481.patch b/patch/patches/hwnd_message_handler_1481.patch index e7d091113..fdc374c42 100644 --- a/patch/patches/hwnd_message_handler_1481.patch +++ b/patch/patches/hwnd_message_handler_1481.patch @@ -1,8 +1,8 @@ diff --git hwnd_message_handler.cc hwnd_message_handler.cc -index f632827..b6c912c 100644 +index 1f4bf47..f145ca9 100644 --- hwnd_message_handler.cc +++ hwnd_message_handler.cc -@@ -2382,8 +2382,12 @@ LRESULT HWNDMessageHandler::HandleMouseEventInternal(UINT message, +@@ -2439,8 +2439,12 @@ LRESULT HWNDMessageHandler::HandleMouseEventInternal(UINT message, active_mouse_tracking_flags_ = 0; } else if (event.type() == ui::ET_MOUSEWHEEL) { // Reroute the mouse wheel to the window under the pointer if applicable. diff --git a/patch/patches/ime_1610.patch b/patch/patches/ime_1610.patch index 2decaa98b..4285ce6f3 100644 --- a/patch/patches/ime_1610.patch +++ b/patch/patches/ime_1610.patch @@ -1,8 +1,8 @@ diff --git input_method_win.cc input_method_win.cc -index 6ac7e6f..ad372ce 100644 +index 9b04a8d..f0578e7 100644 --- input_method_win.cc +++ input_method_win.cc -@@ -614,8 +614,9 @@ bool InputMethodWin::IsWindowFocused(const TextInputClient* client) const { +@@ -618,8 +618,9 @@ bool InputMethodWin::IsWindowFocused(const TextInputClient* client) const { // receiving keyboard input as long as it is an active window. This works well // even when the |attached_window_handle| becomes active but has not received // WM_FOCUS yet. diff --git a/patch/patches/message_loop_443.patch b/patch/patches/message_loop_443.patch index 32dd401ad..0610eafc3 100644 --- a/patch/patches/message_loop_443.patch +++ b/patch/patches/message_loop_443.patch @@ -1,5 +1,5 @@ diff --git message_loop.cc message_loop.cc -index 88f75e9..7abb471 100644 +index 04aa9a8..ec302b6 100644 --- message_loop.cc +++ message_loop.cc @@ -139,12 +139,6 @@ MessageLoop::~MessageLoop() { diff --git a/patch/patches/mime_handler_view_1565.patch b/patch/patches/mime_handler_view_1565.patch index a951953da..124c446b1 100644 --- a/patch/patches/mime_handler_view_1565.patch +++ b/patch/patches/mime_handler_view_1565.patch @@ -1,5 +1,5 @@ diff --git mime_handler_view_guest.cc mime_handler_view_guest.cc -index d704b9f..00d3c3f 100644 +index 27297f3..a7e0f40b 100644 --- mime_handler_view_guest.cc +++ mime_handler_view_guest.cc @@ -134,6 +134,8 @@ void MimeHandlerViewGuest::CreateWebContents( diff --git a/patch/patches/net_filter_515.patch b/patch/patches/net_filter_515.patch index 702078dc2..0594098cd 100644 --- a/patch/patches/net_filter_515.patch +++ b/patch/patches/net_filter_515.patch @@ -1,5 +1,5 @@ diff --git base/network_delegate.h base/network_delegate.h -index 0737137..60cfcd717 100644 +index 509a87b..c05483c 100644 --- base/network_delegate.h +++ base/network_delegate.h @@ -35,6 +35,7 @@ namespace net { @@ -10,7 +10,7 @@ index 0737137..60cfcd717 100644 class HttpRequestHeaders; class HttpResponseHeaders; class ProxyInfo; -@@ -119,6 +120,13 @@ class NET_EXPORT NetworkDelegate : public base::NonThreadSafe { +@@ -111,6 +112,13 @@ class NET_EXPORT NetworkDelegate : public base::NonThreadSafe { const GURL& target_url, const GURL& referrer_url) const; @@ -25,7 +25,7 @@ index 0737137..60cfcd717 100644 // This is the interface for subclasses of NetworkDelegate to implement. These // member functions will be called by the respective public notification diff --git filter/filter.h filter/filter.h -index e9df3db..768b7fc 100644 +index 31d08d4..1de8e84 100644 --- filter/filter.h +++ filter/filter.h @@ -59,6 +59,7 @@ @@ -36,8 +36,8 @@ index e9df3db..768b7fc 100644 class GURL; namespace net { -@@ -234,6 +235,7 @@ class NET_EXPORT_PRIVATE Filter { - std::string OrderedFilterList() const; +@@ -239,6 +240,7 @@ class NET_EXPORT_PRIVATE Filter { + FilterType type() const { return type_id_; } protected: + friend class ::CefNetworkDelegate; @@ -45,10 +45,10 @@ index e9df3db..768b7fc 100644 friend class GZipUnitTest; friend class SdchFilterChainingTest; diff --git url_request/url_request_job.cc url_request/url_request_job.cc -index e46d3f1..0c0430f 100644 +index cbefc9e..06a0123 100644 --- url_request/url_request_job.cc +++ url_request/url_request_job.cc -@@ -448,6 +448,9 @@ void URLRequestJob::NotifyHeadersComplete() { +@@ -447,6 +447,9 @@ void URLRequestJob::NotifyHeadersComplete() { if (request_->status().is_success()) filter_.reset(SetupFilter()); diff --git a/patch/patches/net_urlrequest_1327.patch b/patch/patches/net_urlrequest_1327.patch index 6b535d8ed..39bc5ea7f 100644 --- a/patch/patches/net_urlrequest_1327.patch +++ b/patch/patches/net_urlrequest_1327.patch @@ -1,8 +1,8 @@ diff --git url_request.h url_request.h -index 1a17470..bf51358 100644 +index d3b0b7a..0adec6f 100644 --- url_request.h +++ url_request.h -@@ -674,10 +674,10 @@ class NET_EXPORT URLRequest : NON_EXPORTED_BASE(public base::NonThreadSafe), +@@ -675,10 +675,10 @@ class NET_EXPORT URLRequest : NON_EXPORTED_BASE(public base::NonThreadSafe), // or after the response headers are received. void GetConnectionAttempts(ConnectionAttempts* out) const; diff --git a/patch/patches/pdfium_print_549365.patch b/patch/patches/pdfium_print_549365.patch index 6bc9439a9..076ef5778 100644 --- a/patch/patches/pdfium_print_549365.patch +++ b/patch/patches/pdfium_print_549365.patch @@ -1,8 +1,8 @@ -diff --git fpdfsdk/src/fpdfview.cpp fpdfsdk/src/fpdfview.cpp -index ba64709..02e1391 100644 ---- fpdfsdk/src/fpdfview.cpp -+++ fpdfsdk/src/fpdfview.cpp -@@ -14,6 +14,7 @@ +diff --git fpdfsdk/fpdfview.cpp fpdfsdk/fpdfview.cpp +index 4630ac1..9b5b36f 100644 +--- fpdfsdk/fpdfview.cpp ++++ fpdfsdk/fpdfview.cpp +@@ -16,6 +16,7 @@ #include "fpdfsdk/include/fsdk_mgr.h" #include "fpdfsdk/include/fsdk_rendercontext.h" #include "fpdfsdk/include/javascript/IJavaScript.h" @@ -10,7 +10,7 @@ index ba64709..02e1391 100644 #include "public/fpdf_ext.h" #include "public/fpdf_progressive.h" #include "third_party/base/numerics/safe_conversions_impl.h" -@@ -258,6 +259,7 @@ DLLEXPORT void STDCALL FPDF_DestroyLibrary() { +@@ -263,6 +264,7 @@ DLLEXPORT void STDCALL FPDF_DestroyLibrary() { #endif // PDF_ENABLE_XFA CPDF_ModuleMgr::Destroy(); CFX_GEModule::Destroy(); diff --git a/patch/patches/prefs_content_1161.patch b/patch/patches/prefs_content_1161.patch index 1905ecbcd..7b8b06a30 100644 --- a/patch/patches/prefs_content_1161.patch +++ b/patch/patches/prefs_content_1161.patch @@ -1,8 +1,8 @@ diff --git public/common/common_param_traits_macros.h public/common/common_param_traits_macros.h -index 45a9516..419f17e 100644 +index b0cf1d1..15285c0 100644 --- public/common/common_param_traits_macros.h +++ public/common/common_param_traits_macros.h -@@ -194,6 +194,7 @@ IPC_STRUCT_TRAITS_BEGIN(content::WebPreferences) +@@ -195,6 +195,7 @@ IPC_STRUCT_TRAITS_BEGIN(content::WebPreferences) IPC_STRUCT_TRAITS_MEMBER(main_frame_resizes_are_orientation_changes) IPC_STRUCT_TRAITS_MEMBER(initialize_at_minimum_page_scale) IPC_STRUCT_TRAITS_MEMBER(smart_insert_delete_enabled) @@ -11,19 +11,19 @@ index 45a9516..419f17e 100644 IPC_STRUCT_TRAITS_MEMBER(navigate_on_drag_drop) IPC_STRUCT_TRAITS_MEMBER(spatial_navigation_enabled) diff --git public/common/web_preferences.cc public/common/web_preferences.cc -index 62af1ce..23e31de 100644 +index c0563f5..4118b5a 100644 --- public/common/web_preferences.cc +++ public/common/web_preferences.cc -@@ -172,6 +172,7 @@ WebPreferences::WebPreferences() +@@ -157,6 +157,7 @@ WebPreferences::WebPreferences() pinch_overlay_scrollbar_thickness(0), use_solid_color_scrollbars(false), navigate_on_drag_drop(true), + base_background_color(0xFFFFFFFF), // Color::white v8_cache_options(V8_CACHE_OPTIONS_DEFAULT), + inert_visual_viewport(false), cookie_enabled(true), - pepper_accelerated_video_decode_enabled(false), diff --git public/common/web_preferences.h public/common/web_preferences.h -index 7d6ca7d..ba38861 100644 +index 636f7a2..1936bed 100644 --- public/common/web_preferences.h +++ public/common/web_preferences.h @@ -174,6 +174,7 @@ struct CONTENT_EXPORT WebPreferences { @@ -32,18 +32,18 @@ index 7d6ca7d..ba38861 100644 bool navigate_on_drag_drop; + uint32_t base_background_color; V8CacheOptions v8_cache_options; + bool inert_visual_viewport; - // This flags corresponds to a Page's Settings' setCookieEnabled state. It diff --git renderer/render_view_impl.cc renderer/render_view_impl.cc -index 36d226c..ce8fd74 100644 +index 9c56520..754ac04 100644 --- renderer/render_view_impl.cc +++ renderer/render_view_impl.cc -@@ -953,6 +953,8 @@ void RenderView::ApplyWebPreferences(const WebPreferences& prefs, - settings->setCookieEnabled(prefs.cookie_enabled); - settings->setNavigateOnDragDrop(prefs.navigate_on_drag_drop); - -+ web_view->setBaseBackgroundColor(prefs.base_background_color); -+ - // By default, allow_universal_access_from_file_urls is set to false and thus - // we mitigate attacks from local HTML files by not granting file:// URLs - // universal access. Only test shell will enable this. +@@ -1545,6 +1545,8 @@ void RenderViewImpl::ApplyWebPreferencesInternal( + blink::WebView* web_view, + CompositorDependencies* compositor_deps) { + ApplyWebPreferences(prefs, web_view); ++ if (GetWebFrameWidget()) ++ GetWebFrameWidget()->setBaseBackgroundColor(prefs.base_background_color); + #if defined(OS_MACOSX) && !defined(OS_IOS) + DCHECK(compositor_deps); + bool is_elastic_overscroll_enabled = diff --git a/patch/patches/prefs_tab_helper_1680.patch b/patch/patches/prefs_tab_helper_1680.patch index 5d6130d5d..4241e203c 100644 --- a/patch/patches/prefs_tab_helper_1680.patch +++ b/patch/patches/prefs_tab_helper_1680.patch @@ -1,17 +1,18 @@ diff --git prefs_tab_helper.cc prefs_tab_helper.cc -index 36d6fe9..a875d1e 100644 +index f8ca619..872050c 100644 --- prefs_tab_helper.cc +++ prefs_tab_helper.cc -@@ -12,7 +12,7 @@ +@@ -11,8 +11,8 @@ + #include #include "base/command_line.h" ++#include "base/lazy_instance.h" #include "base/macros.h" -#include "base/memory/singleton.h" -+#include "base/lazy_instance.h" - #include "base/metrics/field_trial.h" #include "base/strings/string_number_conversions.h" #include "base/strings/string_util.h" -@@ -431,12 +431,10 @@ class PrefWatcherFactory : public BrowserContextKeyedServiceFactory { + #include "base/strings/stringprintf.h" +@@ -423,12 +423,10 @@ class PrefWatcherFactory : public BrowserContextKeyedServiceFactory { GetInstance()->GetServiceForBrowserContext(profile, true)); } @@ -26,7 +27,7 @@ index 36d6fe9..a875d1e 100644 PrefWatcherFactory() : BrowserContextKeyedServiceFactory( "PrefWatcher", -@@ -457,6 +455,18 @@ class PrefWatcherFactory : public BrowserContextKeyedServiceFactory { +@@ -449,6 +447,18 @@ class PrefWatcherFactory : public BrowserContextKeyedServiceFactory { } }; diff --git a/patch/patches/print_header_footer_1478_1565.patch b/patch/patches/print_header_footer_1478_1565.patch index 28f44873c..dd5f9566d 100644 --- a/patch/patches/print_header_footer_1478_1565.patch +++ b/patch/patches/print_header_footer_1478_1565.patch @@ -1,8 +1,8 @@ diff --git printing/common/print_messages.cc printing/common/print_messages.cc -index c3469fc..9fc71ac 100644 +index e1a107a..1601811 100644 --- printing/common/print_messages.cc +++ printing/common/print_messages.cc -@@ -95,7 +95,6 @@ void PrintMsg_PrintPages_Params::Reset() { +@@ -97,7 +97,6 @@ void PrintMsg_PrintPages_Params::Reset() { pages = std::vector(); } @@ -10,13 +10,13 @@ index c3469fc..9fc71ac 100644 PrintHostMsg_RequestPrintPreview_Params:: PrintHostMsg_RequestPrintPreview_Params() : is_modifiable(false), -@@ -117,4 +116,3 @@ PrintHostMsg_SetOptionsFromDocument_Params:: +@@ -119,4 +118,3 @@ PrintHostMsg_SetOptionsFromDocument_Params:: PrintHostMsg_SetOptionsFromDocument_Params:: ~PrintHostMsg_SetOptionsFromDocument_Params() { } -#endif // defined(ENABLE_PRINT_PREVIEW) diff --git printing/common/print_messages.h printing/common/print_messages.h -index 6060a1c..d051297 100644 +index 771a4c5..1d8c5ca 100644 --- printing/common/print_messages.h +++ printing/common/print_messages.h @@ -70,7 +70,6 @@ struct PrintMsg_PrintPages_Params { @@ -35,7 +35,7 @@ index 6060a1c..d051297 100644 #endif // COMPONENTS_PRINTING_COMMON_PRINT_MESSAGES_H_ -@@ -182,7 +180,6 @@ IPC_STRUCT_TRAITS_BEGIN(printing::PageRange) +@@ -176,7 +174,6 @@ IPC_STRUCT_TRAITS_BEGIN(printing::PageRange) IPC_STRUCT_TRAITS_MEMBER(to) IPC_STRUCT_TRAITS_END() @@ -43,7 +43,7 @@ index 6060a1c..d051297 100644 IPC_STRUCT_TRAITS_BEGIN(PrintHostMsg_RequestPrintPreview_Params) IPC_STRUCT_TRAITS_MEMBER(is_modifiable) IPC_STRUCT_TRAITS_MEMBER(webnode_only) -@@ -203,7 +200,6 @@ IPC_STRUCT_TRAITS_BEGIN(PrintHostMsg_SetOptionsFromDocument_Params) +@@ -197,7 +194,6 @@ IPC_STRUCT_TRAITS_BEGIN(PrintHostMsg_SetOptionsFromDocument_Params) // Specifies page range to be printed. IPC_STRUCT_TRAITS_MEMBER(page_ranges) IPC_STRUCT_TRAITS_END() @@ -51,7 +51,7 @@ index 6060a1c..d051297 100644 IPC_STRUCT_TRAITS_BEGIN(printing::PageSizeMargins) IPC_STRUCT_TRAITS_MEMBER(content_width) -@@ -223,7 +219,6 @@ IPC_STRUCT_TRAITS_BEGIN(PrintMsg_PrintPages_Params) +@@ -217,7 +213,6 @@ IPC_STRUCT_TRAITS_BEGIN(PrintMsg_PrintPages_Params) IPC_STRUCT_TRAITS_MEMBER(pages) IPC_STRUCT_TRAITS_END() @@ -59,7 +59,7 @@ index 6060a1c..d051297 100644 // Parameters to describe a rendered document. IPC_STRUCT_BEGIN(PrintHostMsg_DidPreviewDocument_Params) // A shared memory handle to metafile data. -@@ -277,7 +272,6 @@ IPC_STRUCT_BEGIN(PrintHostMsg_DidGetPreviewPageCount_Params) +@@ -271,7 +266,6 @@ IPC_STRUCT_BEGIN(PrintHostMsg_DidGetPreviewPageCount_Params) // Indicates whether the existing preview data needs to be cleared or not. IPC_STRUCT_MEMBER(bool, clear_preview_data) IPC_STRUCT_END() @@ -67,7 +67,7 @@ index 6060a1c..d051297 100644 // Parameters to describe a rendered page. IPC_STRUCT_BEGIN(PrintHostMsg_DidPrintPage_Params) -@@ -315,22 +309,20 @@ IPC_STRUCT_END() +@@ -309,22 +303,20 @@ IPC_STRUCT_END() // Messages sent from the browser to the renderer. @@ -92,7 +92,7 @@ index 6060a1c..d051297 100644 #if defined(ENABLE_BASIC_PRINTING) // Tells the render view to switch the CSS to print media type, renders every -@@ -349,13 +341,11 @@ IPC_MESSAGE_ROUTED1(PrintMsg_PrintingDone, +@@ -343,13 +335,11 @@ IPC_MESSAGE_ROUTED1(PrintMsg_PrintingDone, IPC_MESSAGE_ROUTED1(PrintMsg_SetScriptedPrintingBlocked, bool /* blocked */) @@ -106,7 +106,7 @@ index 6060a1c..d051297 100644 // Messages sent from the renderer to the browser. -@@ -415,7 +405,6 @@ IPC_MESSAGE_CONTROL2(PrintHostMsg_TempFileForPrintingWritten, +@@ -409,7 +399,6 @@ IPC_MESSAGE_CONTROL2(PrintHostMsg_TempFileForPrintingWritten, int /* fd in browser */) // Used only by Chrome OS. #endif // defined(OS_ANDROID) @@ -114,7 +114,7 @@ index 6060a1c..d051297 100644 // Asks the browser to do print preview. IPC_MESSAGE_ROUTED1(PrintHostMsg_RequestPrintPreview, PrintHostMsg_RequestPrintPreview_Params /* params */) -@@ -449,7 +438,6 @@ IPC_SYNC_MESSAGE_ROUTED2_1(PrintHostMsg_CheckForCancel, +@@ -443,7 +432,6 @@ IPC_SYNC_MESSAGE_ROUTED2_1(PrintHostMsg_CheckForCancel, // The memory handle in this message is already valid in the browser process. IPC_MESSAGE_ROUTED1(PrintHostMsg_MetafileReadyForPrinting, PrintHostMsg_DidPreviewDocument_Params /* params */) @@ -122,7 +122,7 @@ index 6060a1c..d051297 100644 // This is sent when there are invalid printer settings. IPC_MESSAGE_ROUTED0(PrintHostMsg_ShowInvalidPrinterSettingsError) -@@ -458,7 +446,6 @@ IPC_MESSAGE_ROUTED0(PrintHostMsg_ShowInvalidPrinterSettingsError) +@@ -452,7 +440,6 @@ IPC_MESSAGE_ROUTED0(PrintHostMsg_ShowInvalidPrinterSettingsError) IPC_MESSAGE_ROUTED1(PrintHostMsg_PrintingFailed, int /* document cookie */) @@ -130,16 +130,16 @@ index 6060a1c..d051297 100644 // Tell the browser print preview failed. IPC_MESSAGE_ROUTED1(PrintHostMsg_PrintPreviewFailed, int /* document cookie */) -@@ -485,4 +472,3 @@ IPC_MESSAGE_ROUTED1(PrintHostMsg_ShowScriptedPrintPreview, +@@ -479,4 +466,3 @@ IPC_MESSAGE_ROUTED1(PrintHostMsg_ShowScriptedPrintPreview, // Notify the browser to set print presets based on source PDF document. IPC_MESSAGE_ROUTED1(PrintHostMsg_SetOptionsFromDocument, PrintHostMsg_SetOptionsFromDocument_Params /* params */) -#endif // defined(ENABLE_PRINT_PREVIEW) diff --git printing/renderer/print_web_view_helper.cc printing/renderer/print_web_view_helper.cc -index 6a8f1c3..f66469e 100644 +index 823c957..51d8aa5 100644 --- printing/renderer/print_web_view_helper.cc +++ printing/renderer/print_web_view_helper.cc -@@ -81,6 +81,9 @@ const double kMinDpi = 1.0; +@@ -80,6 +80,9 @@ const double kMinDpi = 1.0; #if defined(ENABLE_PRINT_PREVIEW) bool g_is_preview_enabled = true; @@ -149,7 +149,7 @@ index 6a8f1c3..f66469e 100644 const char kPageLoadScriptFormat[] = "document.open(); document.write(%s); document.close();"; -@@ -95,9 +98,6 @@ void ExecuteScript(blink::WebFrame* frame, +@@ -94,9 +97,6 @@ void ExecuteScript(blink::WebFrame* frame, std::string script = base::StringPrintf(script_format, json.c_str()); frame->executeScript(blink::WebString(base::UTF8ToUTF16(script))); } @@ -159,7 +159,7 @@ index 6a8f1c3..f66469e 100644 int GetDPI(const PrintMsg_Print_Params* print_params) { #if defined(OS_MACOSX) -@@ -307,7 +307,6 @@ bool PrintingNodeOrPdfFrame(const blink::WebLocalFrame* frame, +@@ -306,7 +306,6 @@ bool PrintingNodeOrPdfFrame(const blink::WebLocalFrame* frame, return plugin && plugin->supportsPaginatedPrint(); } @@ -167,7 +167,7 @@ index 6a8f1c3..f66469e 100644 // Returns true if the current destination printer is PRINT_TO_PDF. bool IsPrintToPdfRequested(const base::DictionaryValue& job_settings) { bool print_to_pdf = false; -@@ -329,7 +328,6 @@ bool PrintingFrameHasPageSizeStyle(blink::WebFrame* frame, +@@ -328,7 +327,6 @@ bool PrintingFrameHasPageSizeStyle(blink::WebFrame* frame, } return frame_has_custom_page_size_style; } @@ -175,7 +175,7 @@ index 6a8f1c3..f66469e 100644 // Disable scaling when either: // - The PDF specifies disabling scaling. -@@ -376,7 +374,6 @@ MarginType GetMarginsForPdf(blink::WebLocalFrame* frame, +@@ -375,7 +373,6 @@ MarginType GetMarginsForPdf(blink::WebLocalFrame* frame, } #endif @@ -183,7 +183,7 @@ index 6a8f1c3..f66469e 100644 bool FitToPageEnabled(const base::DictionaryValue& job_settings) { bool fit_to_paper_size = false; if (!job_settings.GetBoolean(kSettingFitToPageEnabled, &fit_to_paper_size)) { -@@ -418,7 +415,6 @@ blink::WebPrintScalingOption GetPrintScalingOption( +@@ -417,7 +414,6 @@ blink::WebPrintScalingOption GetPrintScalingOption( } return blink::WebPrintScalingOptionFitToPrintableArea; } @@ -191,7 +191,7 @@ index 6a8f1c3..f66469e 100644 PrintMsg_Print_Params CalculatePrintParamsForCss( blink::WebFrame* frame, -@@ -502,7 +498,6 @@ blink::WebView* FrameReference::view() { +@@ -501,7 +497,6 @@ blink::WebView* FrameReference::view() { return view_; } @@ -199,7 +199,7 @@ index 6a8f1c3..f66469e 100644 // static - Not anonymous so that platform implementations can use it. void PrintWebViewHelper::PrintHeaderAndFooter( blink::WebCanvas* canvas, -@@ -558,7 +553,6 @@ void PrintWebViewHelper::PrintHeaderAndFooter( +@@ -557,7 +552,6 @@ void PrintWebViewHelper::PrintHeaderAndFooter( web_view->close(); frame->close(); } @@ -207,7 +207,7 @@ index 6a8f1c3..f66469e 100644 // static - Not anonymous so that platform implementations can use it. float PrintWebViewHelper::RenderPageContent(blink::WebFrame* frame, -@@ -831,6 +825,7 @@ PrintWebViewHelper::PrintWebViewHelper(content::RenderView* render_view, +@@ -833,6 +827,7 @@ PrintWebViewHelper::PrintWebViewHelper(content::RenderView* render_view, print_for_preview_(false), delegate_(std::move(delegate)), print_node_in_progress_(false), @@ -215,7 +215,7 @@ index 6a8f1c3..f66469e 100644 is_loading_(false), is_scripted_preview_delayed_(false), ipc_nesting_level_(0), -@@ -889,10 +884,8 @@ void PrintWebViewHelper::PrintPage(blink::WebLocalFrame* frame, +@@ -891,10 +886,8 @@ void PrintWebViewHelper::PrintPage(blink::WebLocalFrame* frame, return; if (g_is_preview_enabled) { @@ -226,7 +226,7 @@ index 6a8f1c3..f66469e 100644 } else { #if defined(ENABLE_BASIC_PRINTING) Print(frame, blink::WebNode(), true); -@@ -916,14 +909,10 @@ bool PrintWebViewHelper::OnMessageReceived(const IPC::Message& message) { +@@ -918,14 +911,10 @@ bool PrintWebViewHelper::OnMessageReceived(const IPC::Message& message) { IPC_MESSAGE_HANDLER(PrintMsg_PrintPages, OnPrintPages) IPC_MESSAGE_HANDLER(PrintMsg_PrintForSystemDialog, OnPrintForSystemDialog) #endif // defined(ENABLE_BASIC_PRINTING) @@ -241,7 +241,7 @@ index 6a8f1c3..f66469e 100644 IPC_MESSAGE_HANDLER(PrintMsg_SetScriptedPrintingBlocked, SetScriptedPrintBlocked) IPC_MESSAGE_UNHANDLED(handled = false) -@@ -975,7 +964,6 @@ void PrintWebViewHelper::OnPrintForSystemDialog() { +@@ -977,7 +966,6 @@ void PrintWebViewHelper::OnPrintForSystemDialog() { } #endif // defined(ENABLE_BASIC_PRINTING) @@ -249,7 +249,7 @@ index 6a8f1c3..f66469e 100644 void PrintWebViewHelper::OnPrintForPrintPreview( const base::DictionaryValue& job_settings) { CHECK_LE(ipc_nesting_level_, 1); -@@ -1040,7 +1028,6 @@ void PrintWebViewHelper::OnPrintForPrintPreview( +@@ -1042,7 +1030,6 @@ void PrintWebViewHelper::OnPrintForPrintPreview( DidFinishPrinting(FAIL_PRINT); } } @@ -257,7 +257,7 @@ index 6a8f1c3..f66469e 100644 void PrintWebViewHelper::GetPageSizeAndContentAreaFromPageLayout( const PageSizeMargins& page_layout_in_points, -@@ -1065,7 +1052,6 @@ void PrintWebViewHelper::UpdateFrameMarginsCssInfo( +@@ -1067,7 +1054,6 @@ void PrintWebViewHelper::UpdateFrameMarginsCssInfo( ignore_css_margins_ = (margins_type != DEFAULT_MARGINS); } @@ -265,7 +265,7 @@ index 6a8f1c3..f66469e 100644 void PrintWebViewHelper::OnPrintPreview(const base::DictionaryValue& settings) { if (ipc_nesting_level_ > 1) return; -@@ -1226,7 +1212,7 @@ bool PrintWebViewHelper::CreatePreviewDocument() { +@@ -1228,7 +1214,7 @@ bool PrintWebViewHelper::CreatePreviewDocument() { return true; } @@ -274,7 +274,7 @@ index 6a8f1c3..f66469e 100644 bool PrintWebViewHelper::RenderPreviewPage( int page_number, const PrintMsg_Print_Params& print_params) { -@@ -1255,7 +1241,7 @@ bool PrintWebViewHelper::RenderPreviewPage( +@@ -1257,7 +1243,7 @@ bool PrintWebViewHelper::RenderPreviewPage( } return PreviewPageRendered(page_number, draft_metafile.get()); } @@ -283,7 +283,7 @@ index 6a8f1c3..f66469e 100644 bool PrintWebViewHelper::FinalizePrintReadyDocument() { DCHECK(!is_print_ready_metafile_sent_); -@@ -1285,7 +1271,6 @@ bool PrintWebViewHelper::FinalizePrintReadyDocument() { +@@ -1287,7 +1273,6 @@ bool PrintWebViewHelper::FinalizePrintReadyDocument() { Send(new PrintHostMsg_MetafileReadyForPrinting(routing_id(), preview_params)); return true; } @@ -291,7 +291,7 @@ index 6a8f1c3..f66469e 100644 void PrintWebViewHelper::OnPrintingDone(bool success) { if (ipc_nesting_level_ > 1) -@@ -1300,7 +1285,6 @@ void PrintWebViewHelper::SetScriptedPrintBlocked(bool blocked) { +@@ -1302,7 +1287,6 @@ void PrintWebViewHelper::SetScriptedPrintBlocked(bool blocked) { is_scripted_printing_blocked_ = blocked; } @@ -299,7 +299,7 @@ index 6a8f1c3..f66469e 100644 void PrintWebViewHelper::OnInitiatePrintPreview(bool selection_only) { if (ipc_nesting_level_ > 1) return; -@@ -1311,7 +1295,9 @@ void PrintWebViewHelper::OnInitiatePrintPreview(bool selection_only) { +@@ -1313,7 +1297,9 @@ void PrintWebViewHelper::OnInitiatePrintPreview(bool selection_only) { // that instead. auto plugin = delegate_->GetPdfElement(frame); if (!plugin.isNull()) { @@ -309,7 +309,7 @@ index 6a8f1c3..f66469e 100644 return; } print_preview_context_.InitWithFrame(frame); -@@ -1319,7 +1305,6 @@ void PrintWebViewHelper::OnInitiatePrintPreview(bool selection_only) { +@@ -1321,7 +1307,6 @@ void PrintWebViewHelper::OnInitiatePrintPreview(bool selection_only) { ? PRINT_PREVIEW_USER_INITIATED_SELECTION : PRINT_PREVIEW_USER_INITIATED_ENTIRE_FRAME); } @@ -317,7 +317,7 @@ index 6a8f1c3..f66469e 100644 bool PrintWebViewHelper::IsPrintingEnabled() { bool result = false; -@@ -1345,11 +1330,9 @@ void PrintWebViewHelper::PrintNode(const blink::WebNode& node) { +@@ -1347,11 +1332,9 @@ void PrintWebViewHelper::PrintNode(const blink::WebNode& node) { // Make a copy of the node, in case RenderView::OnContextMenuClosed resets // its |context_menu_node_|. @@ -330,7 +330,7 @@ index 6a8f1c3..f66469e 100644 } else { #if defined(ENABLE_BASIC_PRINTING) blink::WebNode duplicate_node(node); -@@ -1415,7 +1398,6 @@ void PrintWebViewHelper::DidFinishPrinting(PrintingResult result) { +@@ -1417,7 +1400,6 @@ void PrintWebViewHelper::DidFinishPrinting(PrintingResult result) { } break; @@ -338,7 +338,7 @@ index 6a8f1c3..f66469e 100644 case FAIL_PREVIEW: int cookie = print_pages_params_ ? print_pages_params_->params.document_cookie : 0; -@@ -1427,7 +1409,6 @@ void PrintWebViewHelper::DidFinishPrinting(PrintingResult result) { +@@ -1429,7 +1411,6 @@ void PrintWebViewHelper::DidFinishPrinting(PrintingResult result) { } print_preview_context_.Failed(notify_browser_of_print_failure_); break; @@ -346,7 +346,7 @@ index 6a8f1c3..f66469e 100644 } prep_frame_view_.reset(); print_pages_params_.reset(); -@@ -1559,7 +1540,6 @@ bool PrintWebViewHelper::CalculateNumberOfPages(blink::WebLocalFrame* frame, +@@ -1561,7 +1542,6 @@ bool PrintWebViewHelper::CalculateNumberOfPages(blink::WebLocalFrame* frame, return true; } @@ -354,7 +354,7 @@ index 6a8f1c3..f66469e 100644 bool PrintWebViewHelper::SetOptionsFromPdfDocument( PrintHostMsg_SetOptionsFromDocument_Params* options) { blink::WebLocalFrame* source_frame = print_preview_context_.source_frame(); -@@ -1668,7 +1648,6 @@ bool PrintWebViewHelper::UpdatePrintSettings( +@@ -1670,7 +1650,6 @@ bool PrintWebViewHelper::UpdatePrintSettings( return true; } @@ -362,46 +362,31 @@ index 6a8f1c3..f66469e 100644 #if defined(ENABLE_BASIC_PRINTING) bool PrintWebViewHelper::GetPrintSettingsFromUser(blink::WebLocalFrame* frame, -@@ -1760,11 +1739,14 @@ void PrintWebViewHelper::PrintPageInternal( - gfx::Rect canvas_area = - params.params.display_header_footer ? gfx::Rect(page_size) : content_area; - --#if defined(OS_WIN) || defined(ENABLE_PRINT_PREVIEW) -+#if defined(OS_WIN) - float webkit_page_shrink_factor = - frame->getPrintPageShrink(params.page_number); - float scale_factor = css_scale_factor * webkit_page_shrink_factor; -+#else -+ float scale_factor = css_scale_factor / 1.25f; - #endif -+ - // TODO(thestig) GetVectorCanvasForNewPage() and RenderPageContent() take a - // different scale factor vs Windows. Figure out why and combine the two. - #if defined(OS_WIN) -@@ -1780,14 +1762,12 @@ void PrintWebViewHelper::PrintPageInternal( +@@ -1778,7 +1757,6 @@ void PrintWebViewHelper::PrintPageInternal( MetafileSkiaWrapper::SetMetafileOnCanvas(*canvas, metafile); -#if defined(ENABLE_PRINT_PREVIEW) if (params.params.display_header_footer) { - // |page_number| is 0-based, so 1 is added. - PrintHeaderAndFooter(canvas, params.page_number + 1, - print_preview_context_.total_page_count(), *frame, - scale_factor, page_layout_in_points, params.params); + // TODO(thestig): Figure out why Linux needs this. The value may be + // |printingMinimumShrinkFactor|. +@@ -1793,7 +1771,6 @@ void PrintWebViewHelper::PrintPageInternal( + scale_factor / fudge_factor, page_layout_in_points, + params.params); } -#endif // defined(ENABLE_PRINT_PREVIEW) float webkit_scale_factor = RenderPageContent(frame, params.page_number, canvas_area, content_area, -@@ -1836,7 +1816,6 @@ bool PrintWebViewHelper::CopyMetafileDataToSharedMem( - #endif // defined(OS_WIN) +@@ -1829,7 +1806,6 @@ bool PrintWebViewHelper::CopyMetafileDataToSharedMem( + return true; } -#if defined(ENABLE_PRINT_PREVIEW) void PrintWebViewHelper::ShowScriptedPrintPreview() { if (is_scripted_preview_delayed_) { is_scripted_preview_delayed_ = false; -@@ -1964,7 +1943,6 @@ bool PrintWebViewHelper::PreviewPageRendered(int page_number, +@@ -1957,7 +1933,6 @@ bool PrintWebViewHelper::PreviewPageRendered(int page_number, Send(new PrintHostMsg_DidPreviewPage(routing_id(), preview_page_params)); return true; } @@ -410,7 +395,7 @@ index 6a8f1c3..f66469e 100644 PrintWebViewHelper::PrintPreviewContext::PrintPreviewContext() : total_page_count_(0), diff --git printing/renderer/print_web_view_helper.h printing/renderer/print_web_view_helper.h -index ca10384..7aacfbc 100644 +index 39ef858..3c4f89e 100644 --- printing/renderer/print_web_view_helper.h +++ printing/renderer/print_web_view_helper.h @@ -137,9 +137,7 @@ class PrintWebViewHelper @@ -507,10 +492,10 @@ index ca10384..7aacfbc 100644 bool is_loading_; bool is_scripted_preview_delayed_; diff --git printing/renderer/print_web_view_helper_mac.mm printing/renderer/print_web_view_helper_mac.mm -index 08a1c10..4a80a2d 100644 +index 6552666..8899b6d 100644 --- printing/renderer/print_web_view_helper_mac.mm +++ printing/renderer/print_web_view_helper_mac.mm -@@ -69,7 +69,6 @@ void PrintWebViewHelper::PrintPageInternal( +@@ -68,7 +68,6 @@ void PrintWebViewHelper::PrintPageInternal( Send(new PrintHostMsg_DidPrintPage(routing_id(), page_params)); } @@ -518,7 +503,7 @@ index 08a1c10..4a80a2d 100644 bool PrintWebViewHelper::RenderPreviewPage( int page_number, const PrintMsg_Print_Params& print_params) { -@@ -110,7 +109,6 @@ bool PrintWebViewHelper::RenderPreviewPage( +@@ -104,7 +103,6 @@ bool PrintWebViewHelper::RenderPreviewPage( } return PreviewPageRendered(page_number, draft_metafile.get()); } @@ -526,7 +511,7 @@ index 08a1c10..4a80a2d 100644 void PrintWebViewHelper::RenderPage(const PrintMsg_Print_Params& params, int page_number, -@@ -145,14 +143,12 @@ void PrintWebViewHelper::RenderPage(const PrintMsg_Print_Params& params, +@@ -139,14 +137,12 @@ void PrintWebViewHelper::RenderPage(const PrintMsg_Print_Params& params, MetafileSkiaWrapper::SetMetafileOnCanvas(*canvas, metafile); skia::SetIsPreviewMetafile(*canvas, is_preview); diff --git a/patch/patches/public_browser_1257.patch b/patch/patches/public_browser_1257.patch index f9c57be45..effbdf4f6 100644 --- a/patch/patches/public_browser_1257.patch +++ b/patch/patches/public_browser_1257.patch @@ -1,5 +1,5 @@ diff --git web_contents.cc web_contents.cc -index 1b6d8a6..b606a30 100644 +index d4b5fd0..b804902 100644 --- web_contents.cc +++ web_contents.cc @@ -26,7 +26,9 @@ WebContents::CreateParams::CreateParams(BrowserContext* context, @@ -11,10 +11,10 @@ index 1b6d8a6..b606a30 100644 + view(nullptr), + delegate_view(nullptr) {} - WebContents::CreateParams::~CreateParams() { - } + WebContents::CreateParams::CreateParams(const CreateParams& other) = default; + diff --git web_contents.h web_contents.h -index 5260b91..4495078 100644 +index 9dd14bf..7c7b7c9 100644 --- web_contents.h +++ web_contents.h @@ -54,9 +54,11 @@ class PageState; @@ -29,7 +29,7 @@ index 5260b91..4495078 100644 struct CustomContextMenuContext; struct DropData; struct Manifest; -@@ -146,6 +148,10 @@ class WebContents : public PageNavigator, +@@ -147,6 +149,10 @@ class WebContents : public PageNavigator, // RenderFrame, have already been created on the renderer side, and // WebContents construction should take this into account. bool renderer_initiated_creation; @@ -41,7 +41,7 @@ index 5260b91..4495078 100644 // Creates a new WebContents. diff --git web_contents_delegate.cc web_contents_delegate.cc -index 71c3075..7abcac3 100644 +index c937d66..4ce571f 100644 --- web_contents_delegate.cc +++ web_contents_delegate.cc @@ -144,7 +144,9 @@ bool WebContentsDelegate::ShouldCreateWebContents( @@ -56,12 +56,12 @@ index 71c3075..7abcac3 100644 } diff --git web_contents_delegate.h web_contents_delegate.h -index b6015b0..75b53d4 100644 +index 2c2ac76..8f87caf 100644 --- web_contents_delegate.h +++ web_contents_delegate.h -@@ -41,9 +41,11 @@ class DownloadItem; - class JavaScriptDialogManager; +@@ -42,9 +42,11 @@ class JavaScriptDialogManager; class PageState; + class RenderFrameHost; class RenderViewHost; +class RenderViewHostDelegateView; class SessionStorageNamespace; @@ -71,7 +71,7 @@ index b6015b0..75b53d4 100644 struct ColorSuggestion; struct ContextMenuParams; struct DropData; -@@ -309,7 +311,9 @@ class CONTENT_EXPORT WebContentsDelegate { +@@ -311,7 +313,9 @@ class CONTENT_EXPORT WebContentsDelegate { const std::string& frame_name, const GURL& target_url, const std::string& partition_id, diff --git a/patch/patches/render_widget_host_1070383005.patch b/patch/patches/render_widget_host_1070383005.patch index 731f94568..7dd27a173 100644 --- a/patch/patches/render_widget_host_1070383005.patch +++ b/patch/patches/render_widget_host_1070383005.patch @@ -1,8 +1,8 @@ diff --git render_widget_host_view_mac.mm render_widget_host_view_mac.mm -index acc1c8a..c07cb49 100644 +index 96e472e..4d61084 100644 --- render_widget_host_view_mac.mm +++ render_widget_host_view_mac.mm -@@ -530,9 +530,6 @@ RenderWidgetHostViewMac::RenderWidgetHostViewMac(RenderWidgetHost* widget, +@@ -534,9 +534,6 @@ RenderWidgetHostViewMac::RenderWidgetHostViewMac(RenderWidgetHost* widget, // Paint this view host with |background_color_| when there is no content // ready to draw. background_layer_.reset([[CALayer alloc] init]); diff --git a/patch/patches/views_widget_180_1677.patch b/patch/patches/views_widget_180_1677.patch index 4fccd1702..c1df67851 100644 --- a/patch/patches/views_widget_180_1677.patch +++ b/patch/patches/views_widget_180_1677.patch @@ -1,8 +1,8 @@ diff --git content/browser/renderer_host/render_widget_host_view_aura.cc content/browser/renderer_host/render_widget_host_view_aura.cc -index d06fde4..329432e 100644 +index 27e1809..b522166 100644 --- content/browser/renderer_host/render_widget_host_view_aura.cc +++ content/browser/renderer_host/render_widget_host_view_aura.cc -@@ -776,6 +776,13 @@ void RenderWidgetHostViewAura::SetKeyboardFocus() { +@@ -778,6 +778,13 @@ void RenderWidgetHostViewAura::SetKeyboardFocus() { } } #endif @@ -13,22 +13,22 @@ index d06fde4..329432e 100644 + host->Show(); + } +#endif + // TODO(wjmaclean): can host_ ever be null? if (host_ && set_focus_on_mouse_down_or_key_event_) { set_focus_on_mouse_down_or_key_event_ = false; - host_->Focus(); diff --git content/browser/renderer_host/render_widget_host_view_base.cc content/browser/renderer_host/render_widget_host_view_base.cc -index 780ced5..9409858 100644 +index 9cdceb5..250911d0 100644 --- content/browser/renderer_host/render_widget_host_view_base.cc +++ content/browser/renderer_host/render_widget_host_view_base.cc -@@ -376,6 +376,7 @@ RenderWidgetHostViewBase::RenderWidgetHostViewBase() +@@ -378,6 +378,7 @@ RenderWidgetHostViewBase::RenderWidgetHostViewBase() current_device_scale_factor_(0), current_display_rotation_(gfx::Display::ROTATE_0), pinch_zoom_enabled_(content::IsPinchToZoomEnabled()), + has_external_parent_(false), renderer_frame_number_(0), - weak_factory_(this) { - } -@@ -569,6 +570,10 @@ void RenderWidgetHostViewBase::EndFrameSubscription() { + weak_factory_(this) {} + +@@ -588,6 +589,10 @@ void RenderWidgetHostViewBase::EndFrameSubscription() { NOTREACHED(); } @@ -40,10 +40,10 @@ index 780ced5..9409858 100644 return renderer_frame_number_; } diff --git content/browser/renderer_host/render_widget_host_view_base.h content/browser/renderer_host/render_widget_host_view_base.h -index 9a2e25b..dd753a5 100644 +index 1cace30..d5ca100 100644 --- content/browser/renderer_host/render_widget_host_view_base.h +++ content/browser/renderer_host/render_widget_host_view_base.h -@@ -95,6 +95,7 @@ class CONTENT_EXPORT RenderWidgetHostViewBase : public RenderWidgetHostView, +@@ -98,6 +98,7 @@ class CONTENT_EXPORT RenderWidgetHostViewBase : public RenderWidgetHostView, void BeginFrameSubscription( scoped_ptr subscriber) override; void EndFrameSubscription() override; @@ -51,7 +51,7 @@ index 9a2e25b..dd753a5 100644 // This only needs to be overridden by RenderWidgetHostViewBase subclasses // that handle content embedded within other RenderWidgetHostViews. -@@ -445,6 +446,10 @@ class CONTENT_EXPORT RenderWidgetHostViewBase : public RenderWidgetHostView, +@@ -461,6 +462,10 @@ class CONTENT_EXPORT RenderWidgetHostViewBase : public RenderWidgetHostView, // renderer. bool pinch_zoom_enabled_; @@ -91,7 +91,7 @@ index a8e088c..838b6a0 100644 return host ? host->GetAcceleratedWidget() : NULL; } diff --git ui/views/widget/desktop_aura/desktop_window_tree_host_win.cc ui/views/widget/desktop_aura/desktop_window_tree_host_win.cc -index f79b3c4..f585bea 100644 +index 92cc44e..949b160 100644 --- ui/views/widget/desktop_aura/desktop_window_tree_host_win.cc +++ ui/views/widget/desktop_aura/desktop_window_tree_host_win.cc @@ -84,6 +84,7 @@ DesktopWindowTreeHostWin::DesktopWindowTreeHostWin( @@ -116,7 +116,7 @@ index f79b3c4..f585bea 100644 message_handler_->set_remove_standard_frame(params.remove_standard_frame); -@@ -800,11 +805,15 @@ void DesktopWindowTreeHostWin::HandleFrameChanged() { +@@ -801,11 +806,15 @@ void DesktopWindowTreeHostWin::HandleFrameChanged() { } void DesktopWindowTreeHostWin::HandleNativeFocus(HWND last_focused_window) { @@ -135,7 +135,7 @@ index f79b3c4..f585bea 100644 bool DesktopWindowTreeHostWin::HandleMouseEvent(const ui::MouseEvent& event) { diff --git ui/views/widget/desktop_aura/desktop_window_tree_host_win.h ui/views/widget/desktop_aura/desktop_window_tree_host_win.h -index 963658a..36c8d63 100644 +index dee68df..08a96e1 100644 --- ui/views/widget/desktop_aura/desktop_window_tree_host_win.h +++ ui/views/widget/desktop_aura/desktop_window_tree_host_win.h @@ -244,6 +244,10 @@ class VIEWS_EXPORT DesktopWindowTreeHostWin @@ -150,7 +150,7 @@ index 963658a..36c8d63 100644 // a reference. corewm::TooltipWin* tooltip_; diff --git ui/views/widget/desktop_aura/desktop_window_tree_host_x11.cc ui/views/widget/desktop_aura/desktop_window_tree_host_x11.cc -index e2eaf14..0652daa 100644 +index cecae1e..b9e80b6 100644 --- ui/views/widget/desktop_aura/desktop_window_tree_host_x11.cc +++ ui/views/widget/desktop_aura/desktop_window_tree_host_x11.cc @@ -167,6 +167,7 @@ DesktopWindowTreeHostX11::DesktopWindowTreeHostX11( @@ -237,10 +237,10 @@ index e2eaf14..0652daa 100644 if (xev->xfocus.mode != NotifyGrab) { ReleaseCapture(); diff --git ui/views/widget/desktop_aura/desktop_window_tree_host_x11.h ui/views/widget/desktop_aura/desktop_window_tree_host_x11.h -index 759194f..13af979 100644 +index 7e842fe..bc5376f 100644 --- ui/views/widget/desktop_aura/desktop_window_tree_host_x11.h +++ ui/views/widget/desktop_aura/desktop_window_tree_host_x11.h -@@ -87,6 +87,12 @@ class VIEWS_EXPORT DesktopWindowTreeHostX11 +@@ -86,6 +86,12 @@ class VIEWS_EXPORT DesktopWindowTreeHostX11 // internal list of open windows. static void CleanUpWindowList(void (*func)(aura::Window* window)); @@ -253,7 +253,7 @@ index 759194f..13af979 100644 protected: // Overridden from DesktopWindowTreeHost: void Init(aura::Window* content_window, -@@ -263,6 +269,9 @@ class VIEWS_EXPORT DesktopWindowTreeHostX11 +@@ -262,6 +268,9 @@ class VIEWS_EXPORT DesktopWindowTreeHostX11 // The bounds of |xwindow_|. gfx::Rect bounds_in_pixels_; @@ -263,7 +263,7 @@ index 759194f..13af979 100644 // Whenever the bounds are set, we keep the previous set of bounds around so // we can have a better chance of getting the real // |restored_bounds_in_pixels_|. Window managers tend to send a Configure -@@ -299,6 +308,10 @@ class VIEWS_EXPORT DesktopWindowTreeHostX11 +@@ -298,6 +307,10 @@ class VIEWS_EXPORT DesktopWindowTreeHostX11 // Whether we used an ARGB visual for our window. bool use_argb_visual_; @@ -274,7 +274,7 @@ index 759194f..13af979 100644 DesktopDragDropClientAuraX11* drag_drop_client_; scoped_ptr x11_non_client_event_filter_; -@@ -351,6 +364,9 @@ class VIEWS_EXPORT DesktopWindowTreeHostX11 +@@ -350,6 +363,9 @@ class VIEWS_EXPORT DesktopWindowTreeHostX11 base::WeakPtrFactory close_widget_factory_; @@ -346,10 +346,10 @@ index 5ab84f9..c4095fa 100644 x_active_window_ = None; } diff --git ui/views/widget/widget.cc ui/views/widget/widget.cc -index 88a68da..faf4da6 100644 +index 4c44b65..64f5833 100644 --- ui/views/widget/widget.cc +++ ui/views/widget/widget.cc -@@ -128,6 +128,7 @@ Widget::InitParams::InitParams(Type type) +@@ -129,6 +129,7 @@ Widget::InitParams::InitParams(Type type) use_system_default_icon(false), show_state(ui::SHOW_STATE_DEFAULT), parent(nullptr), @@ -357,7 +357,7 @@ index 88a68da..faf4da6 100644 native_widget(nullptr), desktop_window_tree_host(nullptr), layer_type(ui::LAYER_TEXTURED), -@@ -303,7 +304,7 @@ void Widget::Init(const InitParams& in_params) { +@@ -307,7 +308,7 @@ void Widget::Init(const InitParams& in_params) { InitParams params = in_params; params.child |= (params.type == InitParams::TYPE_CONTROL); @@ -366,7 +366,7 @@ index 88a68da..faf4da6 100644 if (params.opacity == views::Widget::InitParams::INFER_OPACITY && params.type != views::Widget::InitParams::TYPE_WINDOW && -@@ -365,7 +366,12 @@ void Widget::Init(const InitParams& in_params) { +@@ -369,7 +370,12 @@ void Widget::Init(const InitParams& in_params) { Minimize(); } else if (params.delegate) { SetContentsView(params.delegate->GetContentsView()); @@ -381,10 +381,10 @@ index 88a68da..faf4da6 100644 // This must come after SetContentsView() or it might not be able to find // the correct NativeTheme (on Linux). See http://crbug.com/384492 diff --git ui/views/widget/widget.h ui/views/widget/widget.h -index 8c92b90..869a7b8 100644 +index 3512453..af4f311 100644 --- ui/views/widget/widget.h +++ ui/views/widget/widget.h -@@ -233,6 +233,7 @@ class VIEWS_EXPORT Widget : public internal::NativeWidgetDelegate, +@@ -234,6 +234,7 @@ class VIEWS_EXPORT Widget : public internal::NativeWidgetDelegate, // Whether the widget should be maximized or minimized. ui::WindowShowState show_state; gfx::NativeView parent; diff --git a/patch/patches/webkit_popups.patch b/patch/patches/webkit_popups.patch index 0c1920c40..9e02714b2 100644 --- a/patch/patches/webkit_popups.patch +++ b/patch/patches/webkit_popups.patch @@ -1,8 +1,8 @@ diff --git Source/web/ChromeClientImpl.cpp Source/web/ChromeClientImpl.cpp -index 02bb02e..eca142e 100644 +index 59079de..819fb66 100644 --- Source/web/ChromeClientImpl.cpp +++ Source/web/ChromeClientImpl.cpp -@@ -834,7 +834,7 @@ bool ChromeClientImpl::hasOpenedPopup() const +@@ -873,7 +873,7 @@ bool ChromeClientImpl::hasOpenedPopup() const PassRefPtrWillBeRawPtr ChromeClientImpl::openPopupMenu(LocalFrame& frame, HTMLSelectElement& select) { notifyPopupOpeningObservers(); @@ -12,10 +12,10 @@ index 02bb02e..eca142e 100644 ASSERT(RuntimeEnabledFeatures::pagePopupEnabled()); diff --git Source/web/WebViewImpl.cpp Source/web/WebViewImpl.cpp -index 25425db..26aac0f 100644 +index c95ff4c..e17f16b 100644 --- Source/web/WebViewImpl.cpp +++ Source/web/WebViewImpl.cpp -@@ -476,6 +476,7 @@ WebViewImpl::WebViewImpl(WebViewClient* client) +@@ -417,6 +417,7 @@ WebViewImpl::WebViewImpl(WebViewClient* client) , m_enableFakePageScaleAnimationForTesting(false) , m_fakePageScaleAnimationPageScaleFactor(0) , m_fakePageScaleAnimationUseAnchor(false) @@ -23,7 +23,7 @@ index 25425db..26aac0f 100644 , m_doingDragAndDrop(false) , m_ignoreInputEvents(false) , m_compositorDeviceScaleFactorOverride(0) -@@ -4148,9 +4149,14 @@ void WebViewImpl::pageScaleFactorChanged() +@@ -4090,9 +4091,14 @@ void WebViewImpl::pageScaleFactorChanged() m_client->pageScaleFactorChanged(); } @@ -40,10 +40,10 @@ index 25425db..26aac0f 100644 void WebViewImpl::startDragging(LocalFrame* frame, diff --git Source/web/WebViewImpl.h Source/web/WebViewImpl.h -index 9ee6613..74e5494 100644 +index c250a64..5daba9d 100644 --- Source/web/WebViewImpl.h +++ Source/web/WebViewImpl.h -@@ -395,7 +395,8 @@ public: +@@ -390,7 +390,8 @@ public: // Returns true if popup menus should be rendered by the browser, false if // they should be rendered by WebKit (which is the default). @@ -53,7 +53,7 @@ index 9ee6613..74e5494 100644 bool shouldAutoResize() const { -@@ -691,6 +692,8 @@ private: +@@ -687,6 +688,8 @@ private: float m_fakePageScaleAnimationPageScaleFactor; bool m_fakePageScaleAnimationUseAnchor; @@ -63,10 +63,10 @@ index 9ee6613..74e5494 100644 bool m_ignoreInputEvents; diff --git public/web/WebView.h public/web/WebView.h -index 18b2e9d..8b0b784 100644 +index a04be6d..258e331 100644 --- public/web/WebView.h +++ public/web/WebView.h -@@ -408,6 +408,7 @@ public: +@@ -394,6 +394,7 @@ public: // Sets whether select popup menus should be rendered by the browser. BLINK_EXPORT static void setUseExternalPopupMenus(bool); diff --git a/tests/unittests/browser_info_map_unittest.cc b/tests/unittests/browser_info_map_unittest.cc index cede17bec..7930c200f 100644 --- a/tests/unittests/browser_info_map_unittest.cc +++ b/tests/unittests/browser_info_map_unittest.cc @@ -4,9 +4,6 @@ #include -// Include this first to avoid type conflicts with CEF headers. -#include "tests/unittests/chromium_includes.h" - #include "libcef_dll/wrapper/cef_browser_info_map.h" #include "testing/gtest/include/gtest/gtest.h" diff --git a/tests/unittests/chromium_includes.h b/tests/unittests/chromium_includes.h deleted file mode 100644 index 0611738a9..000000000 --- a/tests/unittests/chromium_includes.h +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright (c) 2012 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. - -#ifndef CEF_TESTS_UNITTESTS_CHROMIUM_INCLUDES_H_ -#define CEF_TESTS_UNITTESTS_CHROMIUM_INCLUDES_H_ -#pragma once - -// Include some Chromium headers first to avoid type conflicts with CEF headers. -#include "base/bind.h" -#include "base/strings/string16.h" -#include "base/synchronization/lock.h" - -#endif // CEF_TESTS_UNITTESTS_CHROMIUM_INCLUDES_H_ diff --git a/tests/unittests/command_line_unittest.cc b/tests/unittests/command_line_unittest.cc index 6c4ce0710..f7ad3f7e1 100644 --- a/tests/unittests/command_line_unittest.cc +++ b/tests/unittests/command_line_unittest.cc @@ -2,9 +2,6 @@ // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. -// Include this first to avoid type conflicts with CEF headers. -#include "tests/unittests/chromium_includes.h" - #include "include/cef_command_line.h" #include "testing/gtest/include/gtest/gtest.h" diff --git a/tests/unittests/cookie_unittest.cc b/tests/unittests/cookie_unittest.cc index 6e7694bd5..bea811593 100644 --- a/tests/unittests/cookie_unittest.cc +++ b/tests/unittests/cookie_unittest.cc @@ -4,9 +4,6 @@ #include -// Include this first to avoid type conflicts with CEF headers. -#include "tests/unittests/chromium_includes.h" - #include "base/files/scoped_temp_dir.h" #include "base/synchronization/waitable_event.h" diff --git a/tests/unittests/dialog_unittest.cc b/tests/unittests/dialog_unittest.cc index c16b1f9ae..139ccff64 100644 --- a/tests/unittests/dialog_unittest.cc +++ b/tests/unittests/dialog_unittest.cc @@ -2,9 +2,6 @@ // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. -// Include this first to avoid type conflicts with CEF headers. -#include "tests/unittests/chromium_includes.h" - #include "include/base/cef_bind.h" #include "include/wrapper/cef_closure_task.h" #include "testing/gtest/include/gtest/gtest.h" diff --git a/tests/unittests/display_unittest.cc b/tests/unittests/display_unittest.cc index 7b02b1347..485b6716d 100644 --- a/tests/unittests/display_unittest.cc +++ b/tests/unittests/display_unittest.cc @@ -4,9 +4,6 @@ #include -// Include this first to avoid type conflicts with CEF headers. -#include "tests/unittests/chromium_includes.h" - #include "include/base/cef_bind.h" #include "include/wrapper/cef_closure_task.h" #include "testing/gtest/include/gtest/gtest.h" diff --git a/tests/unittests/dom_unittest.cc b/tests/unittests/dom_unittest.cc index 0fe376006..dfa816bd0 100644 --- a/tests/unittests/dom_unittest.cc +++ b/tests/unittests/dom_unittest.cc @@ -2,9 +2,6 @@ // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. -// Include this first to avoid type conflicts with CEF headers. -#include "tests/unittests/chromium_includes.h" - #include "include/cef_dom.h" #include "testing/gtest/include/gtest/gtest.h" #include "tests/cefclient/renderer/client_app_renderer.h" diff --git a/tests/unittests/download_unittest.cc b/tests/unittests/download_unittest.cc index 9db4d813d..aee09a441 100644 --- a/tests/unittests/download_unittest.cc +++ b/tests/unittests/download_unittest.cc @@ -2,9 +2,6 @@ // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. -// Include this first to avoid type conflicts with CEF headers. -#include "tests/unittests/chromium_includes.h" - #include "base/files/file_util.h" #include "base/files/scoped_temp_dir.h" diff --git a/tests/unittests/draggable_regions_unittest.cc b/tests/unittests/draggable_regions_unittest.cc index a6c2a75dc..b60a2d84f 100644 --- a/tests/unittests/draggable_regions_unittest.cc +++ b/tests/unittests/draggable_regions_unittest.cc @@ -2,9 +2,6 @@ // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. -// Include this first to avoid type conflicts with CEF headers. -#include "tests/unittests/chromium_includes.h" - #include "include/wrapper/cef_closure_task.h" #include "testing/gtest/include/gtest/gtest.h" #include "tests/unittests/test_handler.h" diff --git a/tests/unittests/frame_unittest.cc b/tests/unittests/frame_unittest.cc index 89e6a987f..614594bb7 100644 --- a/tests/unittests/frame_unittest.cc +++ b/tests/unittests/frame_unittest.cc @@ -2,9 +2,6 @@ // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. -// Include this first to avoid type conflicts with CEF headers. -#include "tests/unittests/chromium_includes.h" - #include "include/base/cef_bind.h" #include "include/base/cef_scoped_ptr.h" #include "include/wrapper/cef_closure_task.h" diff --git a/tests/unittests/geolocation_unittest.cc b/tests/unittests/geolocation_unittest.cc index 9fe846e84..141ed1aaa 100644 --- a/tests/unittests/geolocation_unittest.cc +++ b/tests/unittests/geolocation_unittest.cc @@ -2,9 +2,6 @@ // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. -// Include this first to avoid type conflicts with CEF headers. -#include "tests/unittests/chromium_includes.h" - #include "base/synchronization/waitable_event.h" #include "include/base/cef_bind.h" diff --git a/tests/unittests/jsdialog_unittest.cc b/tests/unittests/jsdialog_unittest.cc index 4e1829d14..15ec83a2d 100644 --- a/tests/unittests/jsdialog_unittest.cc +++ b/tests/unittests/jsdialog_unittest.cc @@ -2,9 +2,6 @@ // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. -// Include this first to avoid type conflicts with CEF headers. -#include "tests/unittests/chromium_includes.h" - #include "include/base/cef_bind.h" #include "include/wrapper/cef_closure_task.h" #include "testing/gtest/include/gtest/gtest.h" @@ -145,7 +142,10 @@ class JSDialogTestHandler : public TestHandler { got_onbeforeunloaddialog_.yes(); if (type_ == TYPE_ONBEFOREUNLOAD) { - EXPECT_STREQ("My unload message", message_text.ToString().c_str()); + // The message is no longer configurable via JavaScript. + // See http://crbug.com/587940. + EXPECT_STREQ("Is it OK to leave/reload this page?", + message_text.ToString().c_str()); EXPECT_FALSE(is_reload); } diff --git a/tests/unittests/life_span_unittest.cc b/tests/unittests/life_span_unittest.cc index 31c96b566..3fce790a5 100644 --- a/tests/unittests/life_span_unittest.cc +++ b/tests/unittests/life_span_unittest.cc @@ -2,9 +2,6 @@ // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. -// Include this first to avoid type conflicts with CEF headers. -#include "tests/unittests/chromium_includes.h" - #include "include/base/cef_bind.h" #include "include/wrapper/cef_closure_task.h" #include "testing/gtest/include/gtest/gtest.h" @@ -101,7 +98,12 @@ class LifeSpanTestHandler : public RoutingTestHandler { } EXPECT_TRUE(browser->IsSame(GetBrowser())); - EXPECT_STREQ(kUnloadDialogText, message_text.ToString().c_str()); + + // The message is no longer configurable via JavaScript. + // See http://crbug.com/587940. + EXPECT_STREQ("Is it OK to leave/reload this page?", + message_text.ToString().c_str()); + EXPECT_FALSE(is_reload); EXPECT_TRUE(callback.get()); diff --git a/tests/unittests/message_router_unittest.cc b/tests/unittests/message_router_unittest.cc index 04b3623e7..608356152 100644 --- a/tests/unittests/message_router_unittest.cc +++ b/tests/unittests/message_router_unittest.cc @@ -6,9 +6,6 @@ #include #include -// Include this first to avoid type conflicts with CEF headers. -#include "tests/unittests/chromium_includes.h" - #include "base/strings/stringprintf.h" #include "include/base/cef_bind.h" diff --git a/tests/unittests/navigation_unittest.cc b/tests/unittests/navigation_unittest.cc index 58d74e7f3..82fbacc4d 100644 --- a/tests/unittests/navigation_unittest.cc +++ b/tests/unittests/navigation_unittest.cc @@ -5,9 +5,6 @@ #include #include -// Include this first to avoid type conflicts with CEF headers. -#include "tests/unittests/chromium_includes.h" - #include "include/base/cef_bind.h" #include "include/cef_callback.h" #include "include/cef_scheme.h" @@ -2049,6 +2046,7 @@ class PopupNavTestHandler : public TestHandler { CefRefPtr& client, CefBrowserSettings& settings, bool* no_javascript_access) override { + EXPECT_FALSE(got_on_before_popup_); got_on_before_popup_.yes(); EXPECT_TRUE(CefCurrentlyOn(TID_IO)); @@ -2066,15 +2064,35 @@ class PopupNavTestHandler : public TestHandler { void OnAfterCreated(CefRefPtr browser) override { TestHandler::OnAfterCreated(browser); - if (mode_ == NAVIGATE_AFTER_CREATION && browser->IsPopup()) + if (mode_ == NAVIGATE_AFTER_CREATION && browser->IsPopup()) { + // Navigate to the 2nd popup URL instead of the 1st popup URL. browser->GetMainFrame()->LoadURL(kPopupNavPopupUrl2); + } + } + + void OnLoadStart(CefRefPtr browser, + CefRefPtr frame) override { + const std::string& url = frame->GetURL(); + if (url == kPopupNavPageUrl) { + EXPECT_FALSE(got_load_start_); + got_load_start_.yes(); + } else if (url == kPopupNavPopupUrl) { + EXPECT_FALSE(got_popup_load_start_); + got_popup_load_start_.yes(); + } else if (url == kPopupNavPopupUrl2) { + EXPECT_FALSE(got_popup_load_start2_); + got_popup_load_start2_.yes(); + } } void OnLoadEnd(CefRefPtr browser, CefRefPtr frame, int httpStatusCode) override { - std::string url = frame->GetURL(); + const std::string& url = frame->GetURL(); if (url == kPopupNavPageUrl) { + EXPECT_FALSE(got_load_end_); + got_load_end_.yes(); + frame->ExecuteJavaScript("doPopup()", kPopupNavPageUrl, 0); if (mode_ == DENY) { @@ -2083,9 +2101,11 @@ class PopupNavTestHandler : public TestHandler { base::Bind(&PopupNavTestHandler::DestroyTest, this), 200); } } else if (url == kPopupNavPopupUrl) { + EXPECT_FALSE(got_popup_load_end_); + got_popup_load_end_.yes(); + if (mode_ != NAVIGATE_AFTER_CREATION) { if (mode_ != DENY) { - got_popup_load_end_.yes(); browser->GetHost()->CloseBrowser(false); DestroyTest(); } else { @@ -2093,8 +2113,10 @@ class PopupNavTestHandler : public TestHandler { } } } else if (url == kPopupNavPopupUrl2) { + EXPECT_FALSE(got_popup_load_end2_); + got_popup_load_end2_.yes(); + if (mode_ == NAVIGATE_AFTER_CREATION) { - got_popup_load_end_.yes(); browser->GetHost()->CloseBrowser(false); DestroyTest(); } else { @@ -2107,11 +2129,25 @@ class PopupNavTestHandler : public TestHandler { private: void DestroyTest() override { + EXPECT_TRUE(got_load_start_); + EXPECT_TRUE(got_load_end_); EXPECT_TRUE(got_on_before_popup_); - if (mode_ != DENY) + if (mode_ == ALLOW) { + EXPECT_TRUE(got_popup_load_start_); EXPECT_TRUE(got_popup_load_end_); - else + EXPECT_FALSE(got_popup_load_start2_); + EXPECT_FALSE(got_popup_load_end2_); + } else if (mode_ == DENY) { + EXPECT_FALSE(got_popup_load_start_); EXPECT_FALSE(got_popup_load_end_); + EXPECT_FALSE(got_popup_load_start2_); + EXPECT_FALSE(got_popup_load_end2_); + } else if (mode_ == NAVIGATE_AFTER_CREATION) { + EXPECT_FALSE(got_popup_load_start_); + EXPECT_FALSE(got_popup_load_end_); + EXPECT_TRUE(got_popup_load_start2_); + EXPECT_TRUE(got_popup_load_end2_); + } TestHandler::DestroyTest(); } @@ -2119,7 +2155,12 @@ class PopupNavTestHandler : public TestHandler { const Mode mode_; TrackCallback got_on_before_popup_; + TrackCallback got_load_start_; + TrackCallback got_load_end_; + TrackCallback got_popup_load_start_; TrackCallback got_popup_load_end_; + TrackCallback got_popup_load_start2_; + TrackCallback got_popup_load_end2_; IMPLEMENT_REFCOUNTING(PopupNavTestHandler); }; diff --git a/tests/unittests/os_rendering_unittest.cc b/tests/unittests/os_rendering_unittest.cc index cb5b0c458..8f4a622bc 100644 --- a/tests/unittests/os_rendering_unittest.cc +++ b/tests/unittests/os_rendering_unittest.cc @@ -2,9 +2,6 @@ // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. -// Include this first to avoid type conflicts with CEF headers. -#include "tests/unittests/chromium_includes.h" - #include "ui/events/keycodes/keyboard_codes.h" #include "ui/events/keycodes/keyboard_code_conversion.h" #include "ui/gfx/geometry/dip_util.h" diff --git a/tests/unittests/os_rendering_unittest_mac.mm b/tests/unittests/os_rendering_unittest_mac.mm index 75251a0df..1b39bf097 100644 --- a/tests/unittests/os_rendering_unittest_mac.mm +++ b/tests/unittests/os_rendering_unittest_mac.mm @@ -2,9 +2,6 @@ // reserved. Use of this source code is governed by a BSD-style license // that can be found in the LICENSE file. -// Include this first to avoid type conflicts with CEF headers. -#include "tests/unittests/chromium_includes.h" - #import #import diff --git a/tests/unittests/parser_unittest.cc b/tests/unittests/parser_unittest.cc index 1f485027b..444c98ab9 100644 --- a/tests/unittests/parser_unittest.cc +++ b/tests/unittests/parser_unittest.cc @@ -2,9 +2,6 @@ // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. -// Include this first to avoid type conflicts with CEF headers. -#include "tests/unittests/chromium_includes.h" - #include "include/cef_parser.h" #include "testing/gtest/include/gtest/gtest.h" @@ -299,7 +296,8 @@ TEST(ParserTest, URIDecode) { const CefString& decoded_value = CefURIDecode(test_str_encoded, false, static_cast( - UU_SPACES | UU_URL_SPECIAL_CHARS)); + UU_SPACES | + UU_URL_SPECIAL_CHARS_EXCEPT_PATH_SEPARATORS)); EXPECT_STREQ(test_str_decoded.c_str(), decoded_value.ToString().c_str()); } diff --git a/tests/unittests/plugin_unittest.cc b/tests/unittests/plugin_unittest.cc index 6a794e01d..e7774fba3 100644 --- a/tests/unittests/plugin_unittest.cc +++ b/tests/unittests/plugin_unittest.cc @@ -2,9 +2,6 @@ // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. -// Include this first to avoid type conflicts with CEF headers. -#include "tests/unittests/chromium_includes.h" - #include "include/base/cef_bind.h" #include "include/cef_pack_resources.h" #include "include/cef_resource_bundle.h" diff --git a/tests/unittests/preference_unittest.cc b/tests/unittests/preference_unittest.cc index 190c21954..dc8d348f2 100644 --- a/tests/unittests/preference_unittest.cc +++ b/tests/unittests/preference_unittest.cc @@ -2,9 +2,6 @@ // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. -// Include this first to avoid type conflicts with CEF headers. -#include "tests/unittests/chromium_includes.h" - #include "base/synchronization/waitable_event.h" #include "include/base/cef_bind.h" diff --git a/tests/unittests/print_unittest.cc b/tests/unittests/print_unittest.cc index eae9352c7..ead2a40e2 100644 --- a/tests/unittests/print_unittest.cc +++ b/tests/unittests/print_unittest.cc @@ -4,9 +4,6 @@ #include -// Include this first to avoid type conflicts with CEF headers. -#include "tests/unittests/chromium_includes.h" - #include "include/cef_print_settings.h" #include "testing/gtest/include/gtest/gtest.h" diff --git a/tests/unittests/process_message_unittest.cc b/tests/unittests/process_message_unittest.cc index 861305c79..b96257e74 100644 --- a/tests/unittests/process_message_unittest.cc +++ b/tests/unittests/process_message_unittest.cc @@ -2,9 +2,6 @@ // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. -// Include this first to avoid type conflicts with CEF headers. -#include "tests/unittests/chromium_includes.h" - #include "include/cef_process_message.h" #include "include/cef_task.h" #include "testing/gtest/include/gtest/gtest.h" diff --git a/tests/unittests/request_context_unittest.cc b/tests/unittests/request_context_unittest.cc index d8811e8b3..2a51790f7 100644 --- a/tests/unittests/request_context_unittest.cc +++ b/tests/unittests/request_context_unittest.cc @@ -2,9 +2,6 @@ // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. -// Include this first to avoid type conflicts with CEF headers. -#include "tests/unittests/chromium_includes.h" - #include "include/base/cef_bind.h" #include "base/files/scoped_temp_dir.h" #include "include/cef_request_context.h" diff --git a/tests/unittests/request_handler_unittest.cc b/tests/unittests/request_handler_unittest.cc index 1f1217a35..99a2f1ca6 100644 --- a/tests/unittests/request_handler_unittest.cc +++ b/tests/unittests/request_handler_unittest.cc @@ -2,9 +2,6 @@ // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. -// Include this first to avoid type conflicts with CEF headers. -#include "tests/unittests/chromium_includes.h" - #include #include diff --git a/tests/unittests/request_unittest.cc b/tests/unittests/request_unittest.cc index 18d110394..cd33d01a3 100644 --- a/tests/unittests/request_unittest.cc +++ b/tests/unittests/request_unittest.cc @@ -4,9 +4,6 @@ #include -// Include this first to avoid type conflicts with CEF headers. -#include "tests/unittests/chromium_includes.h" - #include "include/base/cef_bind.h" #include "include/cef_request.h" #include "include/wrapper/cef_closure_task.h" diff --git a/tests/unittests/resource_manager_unittest.cc b/tests/unittests/resource_manager_unittest.cc index 1b11aa545..490526664 100644 --- a/tests/unittests/resource_manager_unittest.cc +++ b/tests/unittests/resource_manager_unittest.cc @@ -2,9 +2,6 @@ // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. -// Include this first to avoid type conflicts with CEF headers. -#include "tests/unittests/chromium_includes.h" - #include #include "base/files/file_util.h" diff --git a/tests/unittests/routing_test_handler.cc b/tests/unittests/routing_test_handler.cc index b45343948..78ce19053 100644 --- a/tests/unittests/routing_test_handler.cc +++ b/tests/unittests/routing_test_handler.cc @@ -2,9 +2,6 @@ // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. -// Include this first to avoid type conflicts with CEF headers. -#include "tests/unittests/chromium_includes.h" - #include "tests/unittests/routing_test_handler.h" #include "tests/cefclient/renderer/client_app_renderer.h" diff --git a/tests/unittests/run_all_unittests.cc b/tests/unittests/run_all_unittests.cc index df8bc6aa7..416896d5b 100644 --- a/tests/unittests/run_all_unittests.cc +++ b/tests/unittests/run_all_unittests.cc @@ -2,8 +2,7 @@ // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. -// Include this first to avoid type conflicts with CEF headers. -#include "tests/unittests/chromium_includes.h" +#include "include/base/cef_build.h" #if defined(OS_LINUX) #include diff --git a/tests/unittests/run_all_unittests_mac.mm b/tests/unittests/run_all_unittests_mac.mm index 2b81f5f43..3bec6a435 100644 --- a/tests/unittests/run_all_unittests_mac.mm +++ b/tests/unittests/run_all_unittests_mac.mm @@ -2,9 +2,6 @@ // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. -// Include this first to avoid type conflicts with CEF headers. -#include "tests/unittests/chromium_includes.h" - #include "include/cef_app.h" #import "include/cef_application_mac.h" diff --git a/tests/unittests/scheme_handler_unittest.cc b/tests/unittests/scheme_handler_unittest.cc index 58eb7cd3f..7d321e2c0 100644 --- a/tests/unittests/scheme_handler_unittest.cc +++ b/tests/unittests/scheme_handler_unittest.cc @@ -4,9 +4,6 @@ #include -// Include this first to avoid type conflicts with CEF headers. -#include "tests/unittests/chromium_includes.h" - #include "include/base/cef_bind.h" #include "include/cef_origin_whitelist.h" #include "include/cef_callback.h" diff --git a/tests/unittests/stream_resource_handler_unittest.cc b/tests/unittests/stream_resource_handler_unittest.cc index 42c3a2306..639ad62f8 100644 --- a/tests/unittests/stream_resource_handler_unittest.cc +++ b/tests/unittests/stream_resource_handler_unittest.cc @@ -6,9 +6,6 @@ #include #include -// Include this first to avoid type conflicts with CEF headers. -#include "tests/unittests/chromium_includes.h" - #include "include/base/cef_bind.h" #include "include/cef_stream.h" #include "include/wrapper/cef_closure_task.h" diff --git a/tests/unittests/stream_unittest.cc b/tests/unittests/stream_unittest.cc index 589dbcfa1..c23af141a 100644 --- a/tests/unittests/stream_unittest.cc +++ b/tests/unittests/stream_unittest.cc @@ -4,9 +4,6 @@ #include -// Include this first to avoid type conflicts with CEF headers. -#include "tests/unittests/chromium_includes.h" - #include "include/cef_stream.h" #include "testing/gtest/include/gtest/gtest.h" diff --git a/tests/unittests/string_unittest.cc b/tests/unittests/string_unittest.cc index 08f88ab50..26c6cf50b 100644 --- a/tests/unittests/string_unittest.cc +++ b/tests/unittests/string_unittest.cc @@ -5,9 +5,6 @@ #include #include -// Include this first to avoid type conflicts with CEF headers. -#include "tests/unittests/chromium_includes.h" - #include "include/base/cef_string16.h" #include "include/internal/cef_string.h" #include "include/internal/cef_string_list.h" diff --git a/tests/unittests/task_unittest.cc b/tests/unittests/task_unittest.cc index aaa0738a7..e497e5b36 100644 --- a/tests/unittests/task_unittest.cc +++ b/tests/unittests/task_unittest.cc @@ -2,11 +2,9 @@ // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. -// Include this first to avoid type conflicts with CEF headers. -#include "tests/unittests/chromium_includes.h" - -#include "include/cef_runnable.h" +#include "include/base/cef_bind.h" #include "include/cef_task.h" +#include "include/wrapper/cef_closure_task.h" #include "testing/gtest/include/gtest/gtest.h" #include "tests/unittests/test_handler.h" @@ -101,7 +99,8 @@ void PostTask1(bool* ran_test) { EXPECT_TRUE(runner->BelongsToThread(TID_IO)); bool got_it = false; - runner->PostTask(NewCefRunnableFunction(&PostTaskEvent1, &got_it, runner)); + runner->PostTask( + CefCreateClosureTask(base::Bind(&PostTaskEvent1, &got_it, runner))); WaitForThread(runner); EXPECT_TRUE(got_it); @@ -118,7 +117,7 @@ void PostDelayedTask1(bool* ran_test) { bool got_it = false; runner->PostDelayedTask( - NewCefRunnableFunction(&PostTaskEvent1, &got_it, runner), 0); + CefCreateClosureTask(base::Bind(&PostTaskEvent1, &got_it, runner)), 0); WaitForThread(runner); EXPECT_TRUE(got_it); @@ -138,7 +137,8 @@ void PostTask2(bool* ran_test) { EXPECT_FALSE(CefCurrentlyOn(TID_IO)); bool got_it = false; - CefPostTask(TID_IO, NewCefRunnableFunction(&PostTaskEvent2, &got_it)); + CefPostTask(TID_IO, + CefCreateClosureTask(base::Bind(&PostTaskEvent2, &got_it))); WaitForThread(TID_IO); EXPECT_TRUE(got_it); @@ -152,7 +152,7 @@ void PostDelayedTask2(bool* ran_test) { bool got_it = false; CefPostDelayedTask(TID_IO, - NewCefRunnableFunction(&PostTaskEvent2, &got_it), 0); + CefCreateClosureTask(base::Bind(&PostTaskEvent2, &got_it)), 0); WaitForThread(TID_IO); EXPECT_TRUE(got_it); @@ -164,42 +164,46 @@ void PostDelayedTask2(bool* ran_test) { TEST(TaskTest, GetForCurrentThread) { bool ran_test = false; - CefPostTask(TID_UI, NewCefRunnableFunction(&GetForCurrentThread, &ran_test)); + CefPostTask(TID_UI, + CefCreateClosureTask(base::Bind(&GetForCurrentThread, &ran_test))); WaitForThread(TID_UI); EXPECT_TRUE(ran_test); } TEST(TaskTest, GetForThread) { bool ran_test = false; - CefPostTask(TID_UI, NewCefRunnableFunction(&GetForThread, &ran_test)); + CefPostTask(TID_UI, + CefCreateClosureTask(base::Bind(&GetForThread, &ran_test))); WaitForThread(TID_UI); EXPECT_TRUE(ran_test); } TEST(TaskTest, PostTask1) { bool ran_test = false; - CefPostTask(TID_UI, NewCefRunnableFunction(&PostTask1, &ran_test)); + CefPostTask(TID_UI, CefCreateClosureTask(base::Bind(&PostTask1, &ran_test))); WaitForThread(TID_UI); EXPECT_TRUE(ran_test); } TEST(TaskTest, PostDelayedTask1) { bool ran_test = false; - CefPostTask(TID_UI, NewCefRunnableFunction(&PostDelayedTask1, &ran_test)); + CefPostTask(TID_UI, + CefCreateClosureTask(base::Bind(&PostDelayedTask1, &ran_test))); WaitForThread(TID_UI); EXPECT_TRUE(ran_test); } TEST(TaskTest, PostTask2) { bool ran_test = false; - CefPostTask(TID_UI, NewCefRunnableFunction(&PostTask2, &ran_test)); + CefPostTask(TID_UI, CefCreateClosureTask(base::Bind(&PostTask2, &ran_test))); WaitForThread(TID_UI); EXPECT_TRUE(ran_test); } TEST(TaskTest, PostDelayedTask2) { bool ran_test = false; - CefPostTask(TID_UI, NewCefRunnableFunction(&PostDelayedTask2, &ran_test)); + CefPostTask(TID_UI, + CefCreateClosureTask(base::Bind(&PostDelayedTask2, &ran_test))); WaitForThread(TID_UI); EXPECT_TRUE(ran_test); } diff --git a/tests/unittests/test_handler.cc b/tests/unittests/test_handler.cc index b815e758c..2e8931920 100644 --- a/tests/unittests/test_handler.cc +++ b/tests/unittests/test_handler.cc @@ -2,9 +2,6 @@ // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. -// Include this first to avoid type conflicts with CEF headers. -#include "tests/unittests/chromium_includes.h" - #include "tests/unittests/test_handler.h" #include "include/base/cef_bind.h" diff --git a/tests/unittests/test_handler.h b/tests/unittests/test_handler.h index 8e1c1d6c4..6e4432b57 100644 --- a/tests/unittests/test_handler.h +++ b/tests/unittests/test_handler.h @@ -13,6 +13,7 @@ #include "base/synchronization/waitable_event.h" +#include "include/base/cef_bind.h" #include "include/cef_browser.h" #include "include/cef_client.h" #include "include/cef_frame.h" diff --git a/tests/unittests/test_suite.cc b/tests/unittests/test_suite.cc index dee0cf50e..54646a94a 100644 --- a/tests/unittests/test_suite.cc +++ b/tests/unittests/test_suite.cc @@ -2,9 +2,6 @@ // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. -// Include this first to avoid type conflicts with CEF headers. -#include "tests/unittests/chromium_includes.h" - #include "tests/unittests/test_suite.h" #include "base/command_line.h" diff --git a/tests/unittests/test_util.cc b/tests/unittests/test_util.cc index 89a26ea54..3109d7ec5 100644 --- a/tests/unittests/test_util.cc +++ b/tests/unittests/test_util.cc @@ -2,9 +2,6 @@ // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. -// Include this first to avoid type conflicts with CEF headers. -#include "tests/unittests/chromium_includes.h" - #include "tests/unittests/test_util.h" #include "testing/gtest/include/gtest/gtest.h" diff --git a/tests/unittests/tracing_unittest.cc b/tests/unittests/tracing_unittest.cc index 32be6668c..000b3603c 100644 --- a/tests/unittests/tracing_unittest.cc +++ b/tests/unittests/tracing_unittest.cc @@ -2,20 +2,20 @@ // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. -// Include this first to avoid type conflicts with CEF headers. -#include "tests/unittests/chromium_includes.h" - #include "base/files/file_util.h" #include "base/synchronization/waitable_event.h" #include "include/base/cef_bind.h" -#include "include/base/cef_trace_event.h" #include "include/cef_task.h" #include "include/cef_trace.h" #include "include/wrapper/cef_closure_task.h" #include "testing/gtest/include/gtest/gtest.h" #include "tests/unittests/test_handler.h" +// Use the CEF version of the TRACE_* macros instead of the Chromium version. +#undef USING_CHROMIUM_INCLUDES +#include "include/base/cef_trace_event.h" + enum TracingTestType { TT_TRACE_EVENT0, TT_TRACE_EVENT1, diff --git a/tests/unittests/translator_unittest.cc b/tests/unittests/translator_unittest.cc index 9450454c6..4481c0d14 100644 --- a/tests/unittests/translator_unittest.cc +++ b/tests/unittests/translator_unittest.cc @@ -2,9 +2,6 @@ // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. -// Include this first to avoid type conflicts with CEF headers. -#include "tests/unittests/chromium_includes.h" - #include "include/test/cef_translator_test.h" #include "testing/gtest/include/gtest/gtest.h" diff --git a/tests/unittests/urlrequest_unittest.cc b/tests/unittests/urlrequest_unittest.cc index d5048e91f..137dba8bb 100644 --- a/tests/unittests/urlrequest_unittest.cc +++ b/tests/unittests/urlrequest_unittest.cc @@ -5,9 +5,6 @@ #include #include -// Include this first to avoid type conflicts with CEF headers. -#include "tests/unittests/chromium_includes.h" - #include "base/files/file_util.h" #include "base/files/scoped_temp_dir.h" #include "base/strings/stringprintf.h" diff --git a/tests/unittests/v8_unittest.cc b/tests/unittests/v8_unittest.cc index b33afa6b6..8cdc159b1 100644 --- a/tests/unittests/v8_unittest.cc +++ b/tests/unittests/v8_unittest.cc @@ -4,9 +4,6 @@ #include -// Include this first to avoid type conflicts with CEF headers. -#include "tests/unittests/chromium_includes.h" - #include "include/base/cef_bind.h" #include "include/cef_task.h" #include "include/cef_v8.h" diff --git a/tests/unittests/values_unittest.cc b/tests/unittests/values_unittest.cc index 982d1ed02..9bd8d1185 100644 --- a/tests/unittests/values_unittest.cc +++ b/tests/unittests/values_unittest.cc @@ -2,9 +2,6 @@ // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. -// Include this first to avoid type conflicts with CEF headers. -#include "tests/unittests/chromium_includes.h" - #include "include/cef_task.h" #include "include/cef_values.h" #include "testing/gtest/include/gtest/gtest.h" diff --git a/tests/unittests/version_unittest.cc b/tests/unittests/version_unittest.cc index 47f86876f..958b2363a 100644 --- a/tests/unittests/version_unittest.cc +++ b/tests/unittests/version_unittest.cc @@ -2,9 +2,6 @@ // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. -// Include this first to avoid type conflicts with CEF headers. -#include "tests/unittests/chromium_includes.h" - #include "include/cef_version.h" #include "testing/gtest/include/gtest/gtest.h" diff --git a/tests/unittests/xml_reader_unittest.cc b/tests/unittests/xml_reader_unittest.cc index aa7f8b730..fcc85600e 100644 --- a/tests/unittests/xml_reader_unittest.cc +++ b/tests/unittests/xml_reader_unittest.cc @@ -2,9 +2,6 @@ // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. -// Include this first to avoid type conflicts with CEF headers. -#include "tests/unittests/chromium_includes.h" - #include "include/cef_stream.h" #include "include/cef_xml_reader.h" #include "include/wrapper/cef_xml_object.h" diff --git a/tests/unittests/zip_reader_unittest.cc b/tests/unittests/zip_reader_unittest.cc index 4ae10b8cc..3ecb789e9 100644 --- a/tests/unittests/zip_reader_unittest.cc +++ b/tests/unittests/zip_reader_unittest.cc @@ -2,9 +2,6 @@ // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. -// Include this first to avoid type conflicts with CEF headers. -#include "tests/unittests/chromium_includes.h" - #include "include/cef_stream.h" #include "include/cef_zip_reader.h" #include "include/wrapper/cef_zip_archive.h" diff --git a/tools/distrib/cefclient.gyp b/tools/distrib/cefclient.gyp index 9eb9a8da0..5f78656a0 100644 --- a/tools/distrib/cefclient.gyp +++ b/tools/distrib/cefclient.gyp @@ -498,6 +498,7 @@ '<@(includes_common)', '<@(includes_capi)', '<@(includes_wrapper)', + '<@(libcef_dll_wrapper_sources_base)', '<@(libcef_dll_wrapper_sources_common)', ], 'xcode_settings': { diff --git a/tools/make_cppdocs.bat b/tools/make_cppdocs.bat index bf620c068..dd9809c72 100644 --- a/tools/make_cppdocs.bat +++ b/tools/make_cppdocs.bat @@ -12,7 +12,7 @@ set CPPDOC_REV="%1" if not exist %CPPDOC_EXE% ( echo ERROR: Please install CppDoc from http://www.cppdoc.com/ ) else ( -%CPPDOC_EXE% -overwrite -title="CEF3 C++ API Docs - Revision %CPPDOC_REV%" -footer="
Chromium Embedded Framework (CEF) Copyright © 2016 Marshall A. Greenblatt
" -namespace-as-project -comment-format="///;//;///" -classdir=projects -module="cppdoc-standard" -extensions=h -languages="c=cpp,cc=cpp,cpp=cpp,cs=csharp,cxx=cpp,h=cpp,hpp=cpp,hxx=cpp,java=java" -D"OS_WIN" -D"USING_CEF_SHARED" -D"__cplusplus" -D"CEF_STRING_TYPE_UTF16" -enable-author=false -enable-deprecations=true -enable-since=true -enable-version=false -file-links-for-globals=false -generate-deprecations-list=false -generate-hierarchy=true -header-background-dark="#ccccff" -header-background-light="#eeeeff" -include-private=false -include-protected=true -index-file-base=index -overview-html=overview.html -reduce-summary-font=true -selected-text-background=navy -selected-text-foreground=white -separate-index-pages=false -show-cppdoc-version=false -show-timestamp=false -summary-html=project.html -suppress-details=false -suppress-frames-links=false -table-background=white -wrap-long-lines=false ..\include #cef_runnable.h #cef_tuple.h #capi "..\docs\index.html" +%CPPDOC_EXE% -overwrite -title="CEF3 C++ API Docs - Revision %CPPDOC_REV%" -footer="
Chromium Embedded Framework (CEF) Copyright © 2016 Marshall A. Greenblatt
" -namespace-as-project -comment-format="///;//;///" -classdir=projects -module="cppdoc-standard" -extensions=h -languages="c=cpp,cc=cpp,cpp=cpp,cs=csharp,cxx=cpp,h=cpp,hpp=cpp,hxx=cpp,java=java" -D"OS_WIN" -D"USING_CEF_SHARED" -D"__cplusplus" -D"CEF_STRING_TYPE_UTF16" -enable-author=false -enable-deprecations=true -enable-since=true -enable-version=false -file-links-for-globals=false -generate-deprecations-list=false -generate-hierarchy=true -header-background-dark="#ccccff" -header-background-light="#eeeeff" -include-private=false -include-protected=true -index-file-base=index -overview-html=overview.html -reduce-summary-font=true -selected-text-background=navy -selected-text-foreground=white -separate-index-pages=false -show-cppdoc-version=false -show-timestamp=false -summary-html=project.html -suppress-details=false -suppress-frames-links=false -table-background=white -wrap-long-lines=false ..\include #capi "..\docs\index.html" ) endlocal \ No newline at end of file diff --git a/tools/make_distrib.py b/tools/make_distrib.py index db18a63c0..ce5deed3f 100644 --- a/tools/make_distrib.py +++ b/tools/make_distrib.py @@ -385,6 +385,8 @@ if mode == 'standard': 'tests/cefsimple/', cefsimple_dir, options.quiet) # transfer common libcef_dll_wrapper files + transfer_gypi_files(cef_dir, cef_paths2['libcef_dll_wrapper_sources_base'], \ + 'libcef_dll/', wrapper_dir, options.quiet) transfer_gypi_files(cef_dir, cef_paths2['libcef_dll_wrapper_sources_common'], \ 'libcef_dll/', wrapper_dir, options.quiet) transfer_gypi_files(cef_dir, cef_paths['autogen_client_side'], \ diff --git a/tools/repack_locales.py b/tools/repack_locales.py index d83a57819..6b5d285ae 100644 --- a/tools/repack_locales.py +++ b/tools/repack_locales.py @@ -59,6 +59,11 @@ def calc_inputs(locale): inputs.append(os.path.join(SHARE_INT_DIR, 'chrome', 'platform_locale_settings_%s.pak' % locale)) + #e.g. + # '<(SHARED_INTERMEDIATE_DIR)/components/strings/components_locale_settings_da.pak' + inputs.append(os.path.join(SHARE_INT_DIR, 'components', 'strings', + 'components_locale_settings_%s.pak' % locale)) + #e.g. # '<(SHARED_INTERMEDIATE_DIR)/components/strings/components_strings_da.pak' inputs.append(os.path.join(SHARE_INT_DIR, 'components', 'strings',