Update to Chromium revision 0bfd25d4 (#381305)

- Delete include/cef_runnable.h (issue #1336).
- Build the cef_unittests target using all Chromium headers. Add a
  USING_CHROMIUM_INCLUDES define and libcef_dll_wrapper_unittests
  target to support this. This change avoids compile errors due to
  the divergence of CEF and Chromium base/ header implementations.
  The libcef_dll_wrapper sources must now compile successfully with
  both CEF and Chromium base/ headers (issue #1632).
- The onbeforeunload message specified via JavaScript is no longer
  passed to the client (see http://crbug.com/587940).
This commit is contained in:
Marshall Greenblatt
2016-03-15 22:55:59 -04:00
parent 77746cfd1b
commit 243a9c26d7
152 changed files with 902 additions and 1211 deletions

View File

@ -7,5 +7,5 @@
# https://bitbucket.org/chromiumembedded/cef/wiki/BranchesAndBuilding # https://bitbucket.org/chromiumembedded/cef/wiki/BranchesAndBuilding
{ {
'chromium_checkout': '088f14a08fb102ca523424290965c04052eca325', 'chromium_checkout': '0bfd25d460a1cff98f9f0573a0d6cc072ecbe359',
} }

79
cef.gyp
View File

@ -29,9 +29,6 @@
'dependencies': [ 'dependencies': [
'libcef_dll_wrapper', 'libcef_dll_wrapper',
], ],
'defines': [
'USING_CEF_SHARED',
],
'include_dirs': [ 'include_dirs': [
'.', '.',
# cefclient includes are relative to the tests directory to make # cefclient includes are relative to the tests directory to make
@ -203,9 +200,6 @@
'dependencies': [ 'dependencies': [
'libcef_dll_wrapper', 'libcef_dll_wrapper',
], ],
'defines': [
'USING_CEF_SHARED',
],
'include_dirs': [ 'include_dirs': [
'.', '.',
# cefsimple includes are relative to the tests directory to make # cefsimple includes are relative to the tests directory to make
@ -366,7 +360,7 @@
'<(DEPTH)/third_party/icu/icu.gyp:icuuc', '<(DEPTH)/third_party/icu/icu.gyp:icuuc',
'<(DEPTH)/third_party/zlib/google/zip.gyp:zip', '<(DEPTH)/third_party/zlib/google/zip.gyp:zip',
'<(DEPTH)/ui/base/ui_base.gyp:ui_base', '<(DEPTH)/ui/base/ui_base.gyp:ui_base',
'libcef_dll_wrapper', 'libcef_dll_wrapper_unittests',
], ],
'sources': [ 'sources': [
'tests/cefclient/browser/client_app_browser.cc', 'tests/cefclient/browser/client_app_browser.cc',
@ -573,9 +567,54 @@
'target_name': 'libcef_dll_wrapper', 'target_name': 'libcef_dll_wrapper',
'type': 'static_library', 'type': 'static_library',
'msvs_guid': 'A9D6DC71-C0DC-4549-AEA0-3B15B44E86A9', 'msvs_guid': 'A9D6DC71-C0DC-4549-AEA0-3B15B44E86A9',
'all_dependent_settings': {
'defines': [ 'defines': [
'USING_CEF_SHARED', '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': [ 'include_dirs': [
'.', '.',
], ],
@ -852,6 +891,7 @@
'msvs_guid': 'FA39524D-3067-4141-888D-28A86C66F2B9', 'msvs_guid': 'FA39524D-3067-4141-888D-28A86C66F2B9',
'defines': [ 'defines': [
'BUILDING_CEF_SHARED', 'BUILDING_CEF_SHARED',
'USING_CHROMIUM_INCLUDES',
], ],
'include_dirs': [ 'include_dirs': [
'.', '.',
@ -1575,13 +1615,14 @@
'DYLIB_CURRENT_VERSION': '<(version_mac_dylib)', 'DYLIB_CURRENT_VERSION': '<(version_mac_dylib)',
'INFOPLIST_FILE': 'libcef/resources/framework-Info.plist', 'INFOPLIST_FILE': 'libcef/resources/framework-Info.plist',
}, },
'defines': [
'BUILDING_CEF_SHARED',
'USING_CHROMIUM_INCLUDES',
],
'dependencies': [ 'dependencies': [
'cef_pak', 'cef_pak',
'libcef_static', 'libcef_static',
], ],
'defines': [
'BUILDING_CEF_SHARED',
],
'include_dirs': [ 'include_dirs': [
'.', '.',
], ],
@ -1629,9 +1670,6 @@
'cef_framework', 'cef_framework',
'libcef_dll_wrapper', 'libcef_dll_wrapper',
], ],
'defines': [
'USING_CEF_SHARED',
],
'include_dirs': [ 'include_dirs': [
'.', '.',
# cefclient includes are relative to the tests directory to make # cefclient includes are relative to the tests directory to make
@ -1703,9 +1741,6 @@
'cef_framework', 'cef_framework',
'libcef_dll_wrapper', 'libcef_dll_wrapper',
], ],
'defines': [
'USING_CEF_SHARED',
],
'include_dirs': [ 'include_dirs': [
'.', '.',
# cefsimple includes are relative to the tests directory to make # 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:icui18n',
'<(DEPTH)/third_party/icu/icu.gyp:icuuc', '<(DEPTH)/third_party/icu/icu.gyp:icuuc',
'cef_framework', 'cef_framework',
'libcef_dll_wrapper', 'libcef_dll_wrapper_unittests',
],
'defines': [
'USING_CEF_SHARED',
], ],
'include_dirs': [ 'include_dirs': [
'.', '.',
@ -1883,11 +1915,12 @@
'target_name': 'libcef', 'target_name': 'libcef',
'type': 'shared_library', 'type': 'shared_library',
'msvs_guid': 'C13650D5-CF1A-4259-BE45-B1EBA6280E47', 'msvs_guid': 'C13650D5-CF1A-4259-BE45-B1EBA6280E47',
'dependencies': [
'libcef_static',
],
'defines': [ 'defines': [
'BUILDING_CEF_SHARED', 'BUILDING_CEF_SHARED',
'USING_CHROMIUM_INCLUDES',
],
'dependencies': [
'libcef_static',
], ],
'include_dirs': [ 'include_dirs': [
'.', '.',

View File

@ -42,7 +42,6 @@
'include/cef_base.h', 'include/cef_base.h',
'include/cef_pack_resources.h', 'include/cef_pack_resources.h',
'include/cef_pack_strings.h', 'include/cef_pack_strings.h',
'include/cef_runnable.h',
'include/cef_version.h', 'include/cef_version.h',
'include/internal/cef_export.h', 'include/internal/cef_export.h',
'include/internal/cef_logging_internal.h', 'include/internal/cef_logging_internal.h',
@ -107,7 +106,7 @@
'libcef_dll/wrapper_types.h', 'libcef_dll/wrapper_types.h',
'<@(autogen_library_side)', '<@(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_atomicops_x86_gcc.cc',
'libcef_dll/base/cef_bind_helpers.cc', 'libcef_dll/base/cef_bind_helpers.cc',
'libcef_dll/base/cef_callback_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_checker_impl.cc',
'libcef_dll/base/cef_thread_collision_warner.cc', 'libcef_dll/base/cef_thread_collision_warner.cc',
'libcef_dll/base/cef_weak_ptr.cc', 'libcef_dll/base/cef_weak_ptr.cc',
],
'libcef_dll_wrapper_sources_common': [
'libcef_dll/cpptoc/base_cpptoc.cc', 'libcef_dll/cpptoc/base_cpptoc.cc',
'libcef_dll/cpptoc/base_cpptoc.h', 'libcef_dll/cpptoc/base_cpptoc.h',
'libcef_dll/cpptoc/cpptoc.h', 'libcef_dll/cpptoc/cpptoc.h',

View File

@ -44,10 +44,10 @@
// This can happen in cases where Chromium code is used directly by the // This can happen in cases where Chromium code is used directly by the
// client application. When using Chromium code directly always include // client application. When using Chromium code directly always include
// the Chromium header first to avoid type conflicts. // 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. // When building CEF include the Chromium header directly.
#include "base/atomic_ref_count.h" #include "base/atomic_ref_count.h"
#else // !BUILDING_CEF_SHARED #else // !USING_CHROMIUM_INCLUDES
// The following is substantially similar to the Chromium implementation. // The following is substantially similar to the Chromium implementation.
// If the Chromium implementation diverges the below implementation should be // If the Chromium implementation diverges the below implementation should be
// updated to match. // updated to match.
@ -121,6 +121,6 @@ inline bool AtomicRefCountIsZero(volatile AtomicRefCount *ptr) {
} // namespace base } // namespace base
#endif // !BUILDING_CEF_SHARED #endif // !USING_CHROMIUM_INCLUDES
#endif // CEF_INCLUDE_BASE_CEF_ATOMIC_REF_COUNT_H_ #endif // CEF_INCLUDE_BASE_CEF_ATOMIC_REF_COUNT_H_

View File

@ -59,10 +59,10 @@
// This can happen in cases where Chromium code is used directly by the // This can happen in cases where Chromium code is used directly by the
// client application. When using Chromium code directly always include // client application. When using Chromium code directly always include
// the Chromium header first to avoid type conflicts. // 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. // When building CEF include the Chromium header directly.
#include "base/atomicops.h" #include "base/atomicops.h"
#else // !BUILDING_CEF_SHARED #else // !USING_CHROMIUM_INCLUDES
// The following is substantially similar to the Chromium implementation. // The following is substantially similar to the Chromium implementation.
// If the Chromium implementation diverges the below implementation should be // If the Chromium implementation diverges the below implementation should be
// updated to match. // updated to match.
@ -193,6 +193,6 @@ Atomic64 Release_Load(volatile const Atomic64* ptr);
#include "include/base/internal/cef_atomicops_atomicword_compat.h" #include "include/base/internal/cef_atomicops_atomicword_compat.h"
#endif #endif
#endif // !BUILDING_CEF_SHARED #endif // !USING_CHROMIUM_INCLUDES
#endif // CEF_INCLUDE_BASE_CEF_ATOMICOPS_H_ #endif // CEF_INCLUDE_BASE_CEF_ATOMICOPS_H_

View File

@ -37,10 +37,10 @@
// This can happen in cases where Chromium code is used directly by the // This can happen in cases where Chromium code is used directly by the
// client application. When using Chromium code directly always include // client application. When using Chromium code directly always include
// the Chromium header first to avoid type conflicts. // 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. // When building CEF include the Chromium header directly.
#include "base/bind.h" #include "base/bind.h"
#else // !BUILDING_CEF_SHARED #else // !USING_CHROMIUM_INCLUDES
// The following is substantially similar to the Chromium implementation. // The following is substantially similar to the Chromium implementation.
// If the Chromium implementation diverges the below implementation should be // If the Chromium implementation diverges the below implementation should be
// updated to match. // updated to match.
@ -543,6 +543,6 @@ Bind(Functor functor, const P1& p1, const P2& p2, const P3& p3, const P4& p4,
} // namespace base } // namespace base
#endif // !BUILDING_CEF_SHARED #endif // !USING_CHROMIUM_INCLUDES
#endif // CEF_INCLUDE_BASE_CEF_BIND_H_ #endif // CEF_INCLUDE_BASE_CEF_BIND_H_

View File

@ -175,10 +175,10 @@
// This can happen in cases where Chromium code is used directly by the // This can happen in cases where Chromium code is used directly by the
// client application. When using Chromium code directly always include // client application. When using Chromium code directly always include
// the Chromium header first to avoid type conflicts. // 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. // When building CEF include the Chromium header directly.
#include "base/bind_helpers.h" #include "base/bind_helpers.h"
#else // !BUILDING_CEF_SHARED #else // !USING_CHROMIUM_INCLUDES
// The following is substantially similar to the Chromium implementation. // The following is substantially similar to the Chromium implementation.
// If the Chromium implementation diverges the below implementation should be // If the Chromium implementation diverges the below implementation should be
// updated to match. // updated to match.
@ -581,6 +581,6 @@ void DeletePointer(T* obj) {
} // namespace base } // namespace base
#endif // !BUILDING_CEF_SHARED #endif // !USING_CHROMIUM_INCLUDES
#endif // CEF_INCLUDE_BASE_CEF_BIND_HELPERS_H_ #endif // CEF_INCLUDE_BASE_CEF_BIND_HELPERS_H_

View File

@ -32,10 +32,10 @@
#define CEF_INCLUDE_BASE_CEF_BUILD_H_ #define CEF_INCLUDE_BASE_CEF_BUILD_H_
#pragma once #pragma once
#if defined(BUILDING_CEF_SHARED) #if defined(USING_CHROMIUM_INCLUDES)
// When building CEF include the Chromium header directly. // When building CEF include the Chromium header directly.
#include "base/compiler_specific.h" #include "base/compiler_specific.h"
#else // !BUILDING_CEF_SHARED #else // !USING_CHROMIUM_INCLUDES
// The following is substantially similar to the Chromium implementation. // The following is substantially similar to the Chromium implementation.
// If the Chromium implementation diverges the below implementation should be // If the Chromium implementation diverges the below implementation should be
// updated to match. // updated to match.
@ -165,7 +165,7 @@
#define ALLOW_UNUSED_LOCAL(x) false ? (void)x : (void)0 #define ALLOW_UNUSED_LOCAL(x) false ? (void)x : (void)0
#endif #endif
#endif // !BUILDING_CEF_SHARED #endif // !USING_CHROMIUM_INCLUDES
// Annotate a virtual method indicating it must be overriding a virtual method // Annotate a virtual method indicating it must be overriding a virtual method
// in the parent class. // in the parent class.

View File

@ -37,10 +37,10 @@
// This can happen in cases where Chromium code is used directly by the // This can happen in cases where Chromium code is used directly by the
// client application. When using Chromium code directly always include // client application. When using Chromium code directly always include
// the Chromium header first to avoid type conflicts. // 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. // When building CEF include the Chromium header directly.
#include "base/callback.h" #include "base/callback.h"
#else // !BUILDING_CEF_SHARED #else // !USING_CHROMIUM_INCLUDES
// The following is substantially similar to the Chromium implementation. // The following is substantially similar to the Chromium implementation.
// If the Chromium implementation diverges the below implementation should be // If the Chromium implementation diverges the below implementation should be
// updated to match. // updated to match.
@ -802,6 +802,6 @@ typedef Callback<void(void)> Closure;
} // namespace base } // namespace base
#endif // !BUILDING_CEF_SHARED #endif // !USING_CHROMIUM_INCLUDES
#endif // CEF_INCLUDE_BASE_CEF_CALLBACK_H_ #endif // CEF_INCLUDE_BASE_CEF_CALLBACK_H_

View File

@ -37,10 +37,10 @@
// This can happen in cases where Chromium code is used directly by the // This can happen in cases where Chromium code is used directly by the
// client application. When using Chromium code directly always include // client application. When using Chromium code directly always include
// the Chromium header first to avoid type conflicts. // 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. // When building CEF include the Chromium header directly.
#include "base/callback_forward.h" #include "base/callback_forward.h"
#else // !BUILDING_CEF_SHARED #else // !USING_CHROMIUM_INCLUDES
// The following is substantially similar to the Chromium implementation. // The following is substantially similar to the Chromium implementation.
// If the Chromium implementation diverges the below implementation should be // If the Chromium implementation diverges the below implementation should be
// updated to match. // updated to match.
@ -54,6 +54,6 @@ typedef Callback<void(void)> Closure;
} // namespace base } // namespace base
#endif // !!BUILDING_CEF_SHARED #endif // !!USING_CHROMIUM_INCLUDES
#endif // INCLUDE_BASE_CEF_CALLBACK_FORWARD_H_ #endif // INCLUDE_BASE_CEF_CALLBACK_FORWARD_H_

View File

@ -46,10 +46,10 @@
// This can happen in cases where Chromium code is used directly by the // This can happen in cases where Chromium code is used directly by the
// client application. When using Chromium code directly always include // client application. When using Chromium code directly always include
// the Chromium header first to avoid type conflicts. // 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. // When building CEF include the Chromium header directly.
#include "base/callback_helpers.h" #include "base/callback_helpers.h"
#else // !BUILDING_CEF_SHARED #else // !USING_CHROMIUM_INCLUDES
// The following is substantially similar to the Chromium implementation. // The following is substantially similar to the Chromium implementation.
// If the Chromium implementation diverges the below implementation should be // If the Chromium implementation diverges the below implementation should be
// updated to match. // updated to match.
@ -88,6 +88,6 @@ class ScopedClosureRunner {
} // namespace base } // namespace base
#endif // !BUILDING_CEF_SHARED #endif // !USING_CHROMIUM_INCLUDES
#endif // CEF_INCLUDE_BASE_CEF_CALLBACK_HELPERS_H_ #endif // CEF_INCLUDE_BASE_CEF_CALLBACK_HELPERS_H_

View File

@ -37,10 +37,10 @@
// This can happen in cases where Chromium code is used directly by the // This can happen in cases where Chromium code is used directly by the
// client application. When using Chromium code directly always include // client application. When using Chromium code directly always include
// the Chromium header first to avoid type conflicts. // 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. // When building CEF include the Chromium header directly.
#include "base/callback_list.h" #include "base/callback_list.h"
#else // !BUILDING_CEF_SHARED #else // !USING_CHROMIUM_INCLUDES
// The following is substantially similar to the Chromium implementation. // The following is substantially similar to the Chromium implementation.
// If the Chromium implementation diverges the below implementation should be // If the Chromium implementation diverges the below implementation should be
// updated to match. // updated to match.
@ -439,6 +439,6 @@ class CallbackList<void(A1, A2, A3, A4, A5, A6, A7)>
} // namespace base } // namespace base
#endif // !BUILDING_CEF_SHARED #endif // !USING_CHROMIUM_INCLUDES
#endif // CEF_INCLUDE_BASE_CEF_CALLBACK_LIST_H_ #endif // CEF_INCLUDE_BASE_CEF_CALLBACK_LIST_H_

View File

@ -74,10 +74,10 @@
// This can happen in cases where Chromium code is used directly by the // This can happen in cases where Chromium code is used directly by the
// client application. When using Chromium code directly always include // client application. When using Chromium code directly always include
// the Chromium header first to avoid type conflicts. // 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. // When building CEF include the Chromium header directly.
#include "base/cancelable_callback.h" #include "base/cancelable_callback.h"
#else // !BUILDING_CEF_SHARED #else // !USING_CHROMIUM_INCLUDES
// The following is substantially similar to the Chromium implementation. // The following is substantially similar to the Chromium implementation.
// If the Chromium implementation diverges the below implementation should be // If the Chromium implementation diverges the below implementation should be
// updated to match. // updated to match.
@ -309,6 +309,6 @@ typedef CancelableCallback<void(void)> CancelableClosure;
} // namespace base } // namespace base
#endif // !BUILDING_CEF_SHARED #endif // !USING_CHROMIUM_INCLUDES
#endif // CEF_INCLUDE_BASE_CEF_CANCELABLE_CALLBACK_H_ #endif // CEF_INCLUDE_BASE_CEF_CANCELABLE_CALLBACK_H_

View File

@ -37,10 +37,10 @@
// This can happen in cases where Chromium code is used directly by the // This can happen in cases where Chromium code is used directly by the
// client application. When using Chromium code directly always include // client application. When using Chromium code directly always include
// the Chromium header first to avoid type conflicts. // 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. // When building CEF include the Chromium header directly.
#include "base/synchronization/lock.h" #include "base/synchronization/lock.h"
#else // !BUILDING_CEF_SHARED #else // !USING_CHROMIUM_INCLUDES
// The following is substantially similar to the Chromium implementation. // The following is substantially similar to the Chromium implementation.
// If the Chromium implementation diverges the below implementation should be // If the Chromium implementation diverges the below implementation should be
// updated to match. // updated to match.
@ -162,6 +162,6 @@ class AutoUnlock {
} // namespace base } // namespace base
#endif // !BUILDING_CEF_SHARED #endif // !USING_CHROMIUM_INCLUDES
#endif // CEF_INCLUDE_BASE_CEF_LOCK_H_ #endif // CEF_INCLUDE_BASE_CEF_LOCK_H_

View File

@ -149,10 +149,10 @@
#define DCHECK_IS_ON() 1 #define DCHECK_IS_ON() 1
#endif #endif
#elif defined(BUILDING_CEF_SHARED) #elif defined(USING_CHROMIUM_INCLUDES)
// When building CEF include the Chromium header directly. // When building CEF include the Chromium header directly.
#include "base/logging.h" #include "base/logging.h"
#else // !BUILDING_CEF_SHARED #else // !USING_CHROMIUM_INCLUDES
// The following is substantially similar to the Chromium implementation. // The following is substantially similar to the Chromium implementation.
// If the Chromium implementation diverges the below implementation should be // If the Chromium implementation diverges the below implementation should be
// updated to match. // updated to match.
@ -747,6 +747,6 @@ inline std::ostream& operator<<(std::ostream& out, const std::wstring& wstr) {
EAT_STREAM_PARAMETERS EAT_STREAM_PARAMETERS
#endif #endif
#endif // !BUILDING_CEF_SHARED #endif // !USING_CHROMIUM_INCLUDES
#endif // CEF_INCLUDE_BASE_CEF_LOGGING_H_ #endif // CEF_INCLUDE_BASE_CEF_LOGGING_H_

View File

@ -32,10 +32,14 @@
#define CEF_INCLUDE_BASE_CEF_MACROS_H_ #define CEF_INCLUDE_BASE_CEF_MACROS_H_
#pragma once #pragma once
#if defined(BUILDING_CEF_SHARED) #if defined(USING_CHROMIUM_INCLUDES)
// When building CEF include the Chromium header directly. // When building CEF include the Chromium header directly.
#include "base/macros.h" #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. // The following is substantially similar to the Chromium implementation.
// If the Chromium implementation diverges the below implementation should be // If the Chromium implementation diverges the below implementation should be
// updated to match. // updated to match.
@ -43,40 +47,8 @@
#include <stddef.h> // For size_t. #include <stddef.h> // For size_t.
#include "include/base/cef_build.h" // For COMPILER_MSVC #include "include/base/cef_build.h" // For COMPILER_MSVC
#if !defined(ALLOW_THIS_IN_INITIALIZER_LIST) // CEF does not use movable types.
#if defined(COMPILER_MSVC) #define MOVE_SCOPED_PTR(var) var.Pass()
// MSVC_PUSH_DISABLE_WARNING pushes |n| onto a stack of warnings to be disabled.
// The warning remains disabled until popped by MSVC_POP_WARNING.
#define MSVC_PUSH_DISABLE_WARNING(n) __pragma(warning(push)) \
__pragma(warning(disable:n))
// MSVC_PUSH_WARNING_LEVEL pushes |n| as the global warning level. The level
// remains in effect until popped by MSVC_POP_WARNING(). Use 0 to disable all
// warnings.
#define MSVC_PUSH_WARNING_LEVEL(n) __pragma(warning(push, n))
// Pop effects of innermost MSVC_PUSH_* macro.
#define MSVC_POP_WARNING() __pragma(warning(pop))
// Allows |this| to be passed as an argument in constructor initializer lists.
// This uses push/pop instead of the seemingly simpler suppress feature to avoid
// having the warning be disabled for more than just |code|.
//
// Example usage:
// Foo::Foo() : x(NULL), ALLOW_THIS_IN_INITIALIZER_LIST(y(this)), z(3) {}
//
// Compiler warning C4355: 'this': used in base member initializer list:
// http://msdn.microsoft.com/en-us/library/3c594ae3(VS.80).aspx
#define ALLOW_THIS_IN_INITIALIZER_LIST(code) MSVC_PUSH_DISABLE_WARNING(4355) \
code \
MSVC_POP_WARNING()
#else // !COMPILER_MSVC
#define ALLOW_THIS_IN_INITIALIZER_LIST(code) code
#endif // !COMPILER_MSVC
#endif // !ALLOW_THIS_IN_INITIALIZER_LIST
#if !defined(arraysize) #if !defined(arraysize)
@ -214,6 +186,41 @@ struct CompileAssert {
#endif // !defined(COMPILE_ASSERT) #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_ #endif // CEF_INCLUDE_BASE_CEF_MACROS_H_

View File

@ -36,10 +36,10 @@
// This can happen in cases where Chromium code is used directly by the // This can happen in cases where Chromium code is used directly by the
// client application. When using Chromium code directly always include // client application. When using Chromium code directly always include
// the Chromium header first to avoid type conflicts. // 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. // When building CEF include the Chromium header directly.
#include "base/move.h" #include "base/move.h"
#else // !BUILDING_CEF_SHARED #else // !USING_CHROMIUM_INCLUDES
// The following is substantially similar to the Chromium implementation. // The following is substantially similar to the Chromium implementation.
// If the Chromium implementation diverges the below implementation should be // If the Chromium implementation diverges the below implementation should be
// updated to match. // updated to match.
@ -254,6 +254,6 @@
typedef void MoveOnlyTypeForCPP03; \ typedef void MoveOnlyTypeForCPP03; \
private: private:
#endif // !BUILDING_CEF_SHARED #endif // !USING_CHROMIUM_INCLUDES
#endif // CEF_INCLUDE_BASE_CEF_MOVE_H_ #endif // CEF_INCLUDE_BASE_CEF_MOVE_H_

View File

@ -40,10 +40,10 @@
// This can happen in cases where Chromium code is used directly by the // This can happen in cases where Chromium code is used directly by the
// client application. When using Chromium code directly always include // client application. When using Chromium code directly always include
// the Chromium header first to avoid type conflicts. // 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. // When building CEF include the Chromium header directly.
#include "base/threading/platform_thread.h" #include "base/threading/platform_thread.h"
#else // !BUILDING_CEF_SHARED #else // !USING_CHROMIUM_INCLUDES
// The following is substantially similar to the Chromium implementation. // The following is substantially similar to the Chromium implementation.
// If the Chromium implementation diverges the below implementation should be // If the Chromium implementation diverges the below implementation should be
// updated to match. // updated to match.
@ -108,6 +108,6 @@ inline PlatformThreadRef CurrentRef() {
} // namespace base } // namespace base
#endif // !BUILDING_CEF_SHARED #endif // !USING_CHROMIUM_INCLUDES
#endif // CEF_INCLUDE_BASE_PLATFORM_THREAD_H_ #endif // CEF_INCLUDE_BASE_PLATFORM_THREAD_H_

View File

@ -38,10 +38,10 @@
// This can happen in cases where Chromium code is used directly by the // This can happen in cases where Chromium code is used directly by the
// client application. When using Chromium code directly always include // client application. When using Chromium code directly always include
// the Chromium header first to avoid type conflicts. // 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. // When building CEF include the Chromium header directly.
#include "base/memory/ref_counted.h" #include "base/memory/ref_counted.h"
#else // !BUILDING_CEF_SHARED #else // !USING_CHROMIUM_INCLUDES
// The following is substantially similar to the Chromium implementation. // The following is substantially similar to the Chromium implementation.
// If the Chromium implementation diverges the below implementation should be // If the Chromium implementation diverges the below implementation should be
// updated to match. // updated to match.
@ -381,6 +381,6 @@ scoped_refptr<T> make_scoped_refptr(T* t) {
return scoped_refptr<T>(t); return scoped_refptr<T>(t);
} }
#endif // !BUILDING_CEF_SHARED #endif // !USING_CHROMIUM_INCLUDES
#endif // CEF_INCLUDE_BASE_CEF_REF_COUNTED_H_ #endif // CEF_INCLUDE_BASE_CEF_REF_COUNTED_H_

View File

@ -119,10 +119,10 @@
// This can happen in cases where Chromium code is used directly by the // This can happen in cases where Chromium code is used directly by the
// client application. When using Chromium code directly always include // client application. When using Chromium code directly always include
// the Chromium header first to avoid type conflicts. // 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. // When building CEF include the Chromium header directly.
#include "base/memory/scoped_ptr.h" #include "base/memory/scoped_ptr.h"
#else // !BUILDING_CEF_SHARED #else // !USING_CHROMIUM_INCLUDES
// The following is substantially similar to the Chromium implementation. // The following is substantially similar to the Chromium implementation.
// If the Chromium implementation diverges the below implementation should be // If the Chromium implementation diverges the below implementation should be
// updated to match. // updated to match.
@ -619,6 +619,6 @@ scoped_ptr<T> make_scoped_ptr(T* ptr) {
return scoped_ptr<T>(ptr); return scoped_ptr<T>(ptr);
} }
#endif // !BUILDING_CEF_SHARED #endif // !USING_CHROMIUM_INCLUDES
#endif // CEF_INCLUDE_BASE_CEF_MEMORY_SCOPED_PTR_H_ #endif // CEF_INCLUDE_BASE_CEF_MEMORY_SCOPED_PTR_H_

View File

@ -37,10 +37,10 @@
// This can happen in cases where Chromium code is used directly by the // This can happen in cases where Chromium code is used directly by the
// client application. When using Chromium code directly always include // client application. When using Chromium code directly always include
// the Chromium header first to avoid type conflicts. // 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. // When building CEF include the Chromium header directly.
#include "base/strings/string16.h" #include "base/strings/string16.h"
#else // !BUILDING_CEF_SHARED #else // !USING_CHROMIUM_INCLUDES
// The following is substantially similar to the Chromium implementation. // The following is substantially similar to the Chromium implementation.
// If the Chromium implementation diverges the below implementation should be // If the Chromium implementation diverges the below implementation should be
// updated to match. // updated to match.
@ -222,6 +222,6 @@ class std::basic_string<base::char16, base::string16_char_traits>;
#endif // WCHAR_T_IS_UTF32 #endif // WCHAR_T_IS_UTF32
#endif // !BUILDING_CEF_SHARED #endif // !USING_CHROMIUM_INCLUDES
#endif // CEF_INCLUDE_BASE_CEF_STRING16_H_ #endif // CEF_INCLUDE_BASE_CEF_STRING16_H_

View File

@ -37,10 +37,10 @@
// This can happen in cases where Chromium code is used directly by the // This can happen in cases where Chromium code is used directly by the
// client application. When using Chromium code directly always include // client application. When using Chromium code directly always include
// the Chromium header first to avoid type conflicts. // 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. // When building CEF include the Chromium header directly.
#include "base/template_util.h" #include "base/template_util.h"
#else // !BUILDING_CEF_SHARED #else // !USING_CHROMIUM_INCLUDES
// The following is substantially similar to the Chromium implementation. // The following is substantially similar to the Chromium implementation.
// If the Chromium implementation diverges the below implementation should be // If the Chromium implementation diverges the below implementation should be
// updated to match. // updated to match.
@ -187,6 +187,6 @@ struct enable_if<true, T> { typedef T type; };
} // namespace base } // namespace base
#endif // !BUILDING_CEF_SHARED #endif // !USING_CHROMIUM_INCLUDES
#endif // CEF_INCLUDE_BASE_CEF_TEMPLATE_UTIL_H_ #endif // CEF_INCLUDE_BASE_CEF_TEMPLATE_UTIL_H_

View File

@ -37,10 +37,10 @@
// This can happen in cases where Chromium code is used directly by the // This can happen in cases where Chromium code is used directly by the
// client application. When using Chromium code directly always include // client application. When using Chromium code directly always include
// the Chromium header first to avoid type conflicts. // 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. // When building CEF include the Chromium header directly.
#include "base/threading/thread_checker.h" #include "base/threading/thread_checker.h"
#else // !BUILDING_CEF_SHARED #else // !USING_CHROMIUM_INCLUDES
// The following is substantially similar to the Chromium implementation. // The following is substantially similar to the Chromium implementation.
// If the Chromium implementation diverges the below implementation should be // If the Chromium implementation diverges the below implementation should be
// updated to match. // updated to match.
@ -121,6 +121,6 @@ class ThreadChecker : public cef_internal::ThreadCheckerDoNothing {
} // namespace base } // namespace base
#endif // !BUILDING_CEF_SHARED #endif // !USING_CHROMIUM_INCLUDES
#endif // CEF_INCLUDE_BASE_THREAD_CHECKER_H_ #endif // CEF_INCLUDE_BASE_THREAD_CHECKER_H_

View File

@ -37,10 +37,10 @@
// This can happen in cases where Chromium code is used directly by the // This can happen in cases where Chromium code is used directly by the
// client application. When using Chromium code directly always include // client application. When using Chromium code directly always include
// the Chromium header first to avoid type conflicts. // 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. // When building CEF include the Chromium header directly.
#include "base/threading/thread_collision_warner.h" #include "base/threading/thread_collision_warner.h"
#else // !BUILDING_CEF_SHARED #else // !USING_CHROMIUM_INCLUDES
// The following is substantially similar to the Chromium implementation. // The following is substantially similar to the Chromium implementation.
// If the Chromium implementation diverges the below implementation should be // If the Chromium implementation diverges the below implementation should be
// updated to match. // updated to match.
@ -282,6 +282,6 @@ class ThreadCollisionWarner {
} // namespace base } // namespace base
#endif // !BUILDING_CEF_SHARED #endif // !USING_CHROMIUM_INCLUDES
#endif // CEF_INCLUDE_BASE_CEF_THREAD_COLLISION_WARNER_H_ #endif // CEF_INCLUDE_BASE_CEF_THREAD_COLLISION_WARNER_H_

View File

@ -145,10 +145,10 @@
// This can happen in cases where Chromium code is used directly by the // This can happen in cases where Chromium code is used directly by the
// client application. When using Chromium code directly always include // client application. When using Chromium code directly always include
// the Chromium header first to avoid type conflicts. // 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. // When building CEF include the Chromium header directly.
#include "base/debug/trace_event.h" #include "base/trace_event/trace_event.h"
#else // !BUILDING_CEF_SHARED #else // !USING_CHROMIUM_INCLUDES
// The following is substantially similar to the Chromium implementation. // The following is substantially similar to the Chromium implementation.
// If the Chromium implementation diverges the below implementation should be // If the Chromium implementation diverges the below implementation should be
// updated to match. // updated to match.
@ -422,6 +422,6 @@ class CefTraceEndOnScopeClose {
} // cef_trace_event } // cef_trace_event
#endif // !BUILDING_CEF_SHARED #endif // !USING_CHROMIUM_INCLUDES
#endif // CEF_INCLUDE_BASE_CEF_TRACE_EVENT_H_ #endif // CEF_INCLUDE_BASE_CEF_TRACE_EVENT_H_

View File

@ -57,84 +57,14 @@
#pragma once #pragma once
#if defined(BASE_TUPLE_H_) #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 // This can happen in cases where Chromium code is used directly by the
// client application. When using Chromium code directly always include // client application. When using Chromium code directly always include
// the Chromium header first to avoid type conflicts. // the Chromium header first to avoid type conflicts.
#elif defined(USING_CHROMIUM_INCLUDES)
// For legacy compatibility, we name the first 8 tuple elements "a", "b", ...
// TODO(cef): Remove this code when cef_runnable.h is deleted.
namespace base {
#define DEFINE_TUPLE_LEAF(N, x) \
template <typename T> \
struct TupleLeaf<N, T> { \
TupleLeaf() {} \
explicit TupleLeaf(typename TupleTraits<T>::ParamType x) : x(x) {} \
\
T& get() { return x; } \
const T& get() const { return x; } \
\
T x; \
}
DEFINE_TUPLE_LEAF(0, a);
DEFINE_TUPLE_LEAF(1, b);
DEFINE_TUPLE_LEAF(2, c);
DEFINE_TUPLE_LEAF(3, d);
DEFINE_TUPLE_LEAF(4, e);
DEFINE_TUPLE_LEAF(5, f);
DEFINE_TUPLE_LEAF(6, g);
DEFINE_TUPLE_LEAF(7, h);
#undef DEFINE_TUPLE_LEAF
// Deprecated compat aliases
// TODO(cef): Remove this code when cef_runnable.h is deleted.
using Tuple0 = Tuple<>;
template <typename A>
using Tuple1 = Tuple<A>;
template <typename A, typename B>
using Tuple2 = Tuple<A, B>;
template <typename A, typename B, typename C>
using Tuple3 = Tuple<A, B, C>;
template <typename A, typename B, typename C, typename D>
using Tuple4 = Tuple<A, B, C, D>;
template <typename A, typename B, typename C, typename D, typename E>
using Tuple5 = Tuple<A, B, C, D, E>;
template <typename A,
typename B,
typename C,
typename D,
typename E,
typename F>
using Tuple6 = Tuple<A, B, C, D, E, F>;
template <typename A,
typename B,
typename C,
typename D,
typename E,
typename F,
typename G>
using Tuple7 = Tuple<A, B, C, D, E, F, G>;
template <typename A,
typename B,
typename C,
typename D,
typename E,
typename F,
typename G,
typename H>
using Tuple8 = Tuple<A, B, C, D, E, F, G, H>;
} // namespace base
#elif defined(BUILDING_CEF_SHARED)
// When building CEF include the Chromium header directly. // When building CEF include the Chromium header directly.
#include "base/tuple.h" #include "base/tuple.h"
#else // !BUILDING_CEF_SHARED #else // !USING_CHROMIUM_INCLUDES
// The following is substantially similar to the Chromium implementation. // The following is substantially similar to the Chromium implementation.
// If the Chromium implementation diverges the below implementation should be // If the Chromium implementation diverges the below implementation should be
// updated to match. // updated to match.
@ -1402,6 +1332,6 @@ inline void DispatchToMethod(ObjT* obj, Method method,
} // namespace base } // namespace base
#endif // !BUILDING_CEF_SHARED #endif // !USING_CHROMIUM_INCLUDES
#endif // CEF_INCLUDE_BASE_CEF_TUPLE_H_ #endif // CEF_INCLUDE_BASE_CEF_TUPLE_H_

View File

@ -101,10 +101,10 @@
// This can happen in cases where Chromium code is used directly by the // This can happen in cases where Chromium code is used directly by the
// client application. When using Chromium code directly always include // client application. When using Chromium code directly always include
// the Chromium header first to avoid type conflicts. // 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. // When building CEF include the Chromium header directly.
#include "base/memory/weak_ptr.h" #include "base/memory/weak_ptr.h"
#else // !BUILDING_CEF_SHARED #else // !USING_CHROMIUM_INCLUDES
// The following is substantially similar to the Chromium implementation. // The following is substantially similar to the Chromium implementation.
// If the Chromium implementation diverges the below implementation should be // If the Chromium implementation diverges the below implementation should be
// updated to match. // updated to match.
@ -383,6 +383,6 @@ WeakPtr<Derived> AsWeakPtr(Derived* t) {
} // namespace base } // namespace base
#endif // !BUILDING_CEF_SHARED #endif // !USING_CHROMIUM_INCLUDES
#endif // CEF_INCLUDE_BASE_CEF_WEAK_PTR_H_ #endif // CEF_INCLUDE_BASE_CEF_WEAK_PTR_H_

View File

@ -35,7 +35,7 @@
#if defined(OS_MACOSX) && defined(__OBJC__) #if defined(OS_MACOSX) && defined(__OBJC__)
#ifdef BUILDING_CEF_SHARED #ifdef USING_CHROMIUM_INCLUDES
// Use the existing CrAppControlProtocol definition. // Use the existing CrAppControlProtocol definition.
#import "base/mac/scoped_sending_event.h" #import "base/mac/scoped_sending_event.h"
@ -52,7 +52,7 @@
// Use the existing empty protocol definitions. // Use the existing empty protocol definitions.
#import "base/mac/sdk_forward_declarations.h" #import "base/mac/sdk_forward_declarations.h"
#else // BUILDING_CEF_SHARED #else // USING_CHROMIUM_INCLUDES
#import <AppKit/AppKit.h> #import <AppKit/AppKit.h>
#import <Cocoa/Cocoa.h> #import <Cocoa/Cocoa.h>
@ -146,7 +146,7 @@ DEFINE_EMPTY_PROTOCOL(NSWindowDelegate)
#endif #endif
#endif // BUILDING_CEF_SHARED #endif // USING_CHROMIUM_INCLUDES
// Forward declarations for APIs that are part of the 10.7 SDK. This will allow // Forward declarations for APIs that are part of the 10.7 SDK. This will allow
// using them when building with the 10.6 SDK. // using them when building with the 10.6 SDK.

View File

@ -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 <class T>
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<TypeName> { \
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 T, class Method, class Params>
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<T> traits_;
IMPLEMENT_REFCOUNTING(CefRunnableMethod);
};
template <class T, class Method>
inline CefRefPtr<CefTask> NewCefRunnableMethod(T* object, Method method) {
return new CefRunnableMethod<T, Method, base::Tuple0>(
object, method, base::MakeTuple());
}
template <class T, class Method, class A>
inline CefRefPtr<CefTask> NewCefRunnableMethod(T* object, Method method,
const A& a) {
return new CefRunnableMethod<T, Method, base::Tuple1<A> >(
object, method, base::MakeTuple(a));
}
template <class T, class Method, class A, class B>
inline CefRefPtr<CefTask> NewCefRunnableMethod(T* object, Method method,
const A& a, const B& b) {
return new CefRunnableMethod<T, Method, base::Tuple2<A, B> >(
object, method, base::MakeTuple(a, b));
}
template <class T, class Method, class A, class B, class C>
inline CefRefPtr<CefTask> NewCefRunnableMethod(T* object, Method method,
const A& a, const B& b,
const C& c) {
return new CefRunnableMethod<T, Method, base::Tuple3<A, B, C> >(
object, method, base::MakeTuple(a, b, c));
}
template <class T, class Method, class A, class B, class C, class D>
inline CefRefPtr<CefTask> NewCefRunnableMethod(T* object, Method method,
const A& a, const B& b,
const C& c, const D& d) {
return new CefRunnableMethod<T, Method, base::Tuple4<A, B, C, D> >(
object, method, base::MakeTuple(a, b, c, d));
}
template <class T, class Method, class A, class B, class C, class D, class E>
inline CefRefPtr<CefTask> NewCefRunnableMethod(T* object, Method method,
const A& a, const B& b,
const C& c, const D& d,
const E& e) {
return new CefRunnableMethod<T, Method, base::Tuple5<A, B, C, D, E> >(
object, method, base::MakeTuple(a, b, c, d, e));
}
template <class T, class Method, class A, class B, class C, class D, class E,
class F>
inline CefRefPtr<CefTask> 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<T, Method, base::Tuple6<A, B, C, D, E, F> >(
object, method, base::MakeTuple(a, b, c, d, e, f));
}
template <class T, class Method, class A, class B, class C, class D, class E,
class F, class G>
inline CefRefPtr<CefTask> 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<T, Method, base::Tuple7<A, B, C, D, E, F, G> >(
object, method, base::MakeTuple(a, b, c, d, e, f, g));
}
// CefRunnableFunction and NewCefRunnableFunction implementation --------------
template <class Function, class Params>
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 <class Function>
inline CefRefPtr<CefTask> NewCefRunnableFunction(Function function) {
return new CefRunnableFunction<Function, base::Tuple0>(
function, base::MakeTuple());
}
template <class Function, class A>
inline CefRefPtr<CefTask> NewCefRunnableFunction(Function function,
const A& a) {
return new CefRunnableFunction<Function, base::Tuple1<A> >(
function, base::MakeTuple(a));
}
template <class Function, class A, class B>
inline CefRefPtr<CefTask> NewCefRunnableFunction(Function function,
const A& a, const B& b) {
return new CefRunnableFunction<Function, base::Tuple2<A, B> >(
function, base::MakeTuple(a, b));
}
template <class Function, class A, class B, class C>
inline CefRefPtr<CefTask> NewCefRunnableFunction(Function function,
const A& a, const B& b,
const C& c) {
return new CefRunnableFunction<Function, base::Tuple3<A, B, C> >(
function, base::MakeTuple(a, b, c));
}
template <class Function, class A, class B, class C, class D>
inline CefRefPtr<CefTask> NewCefRunnableFunction(Function function,
const A& a, const B& b,
const C& c, const D& d) {
return new CefRunnableFunction<Function, base::Tuple4<A, B, C, D> >(
function, base::MakeTuple(a, b, c, d));
}
template <class Function, class A, class B, class C, class D, class E>
inline CefRefPtr<CefTask> NewCefRunnableFunction(Function function,
const A& a, const B& b,
const C& c, const D& d,
const E& e) {
return new CefRunnableFunction<Function, base::Tuple5<A, B, C, D, E> >(
function, base::MakeTuple(a, b, c, d, e));
}
template <class Function, class A, class B, class C, class D, class E,
class F>
inline CefRefPtr<CefTask> 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::Tuple6<A, B, C, D, E, F> >(
function, base::MakeTuple(a, b, c, d, e, f));
}
template <class Function, class A, class B, class C, class D, class E,
class F, class G>
inline CefRefPtr<CefTask> 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::Tuple7<A, B, C, D, E, F, G> >(
function, base::MakeTuple(a, b, c, d, e, f, g));
}
template <class Function, class A, class B, class C, class D, class E,
class F, class G, class H>
inline CefRefPtr<CefTask> 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::Tuple8<A, B, C, D, E, F, G, H> >(
function, base::MakeTuple(a, b, c, d, e, f, g, h));
}
#endif // CEF_INCLUDE_CEF_RUNNABLE_H_

View File

@ -37,7 +37,7 @@
#include "include/base/cef_string16.h" #include "include/base/cef_string16.h"
#include "include/internal/cef_string_types.h" #include "include/internal/cef_string_types.h"
#if defined(BUILDING_CEF_SHARED) #if defined(USING_CHROMIUM_INCLUDES)
#include "base/files/file_path.h" #include "base/files/file_path.h"
#endif #endif
@ -696,7 +696,7 @@ class CefStringBase {
return *this; return *this;
} }
#endif // WCHAR_T_IS_UTF32 #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 // The base::FilePath constructor is marked as explicit so provide the
// conversion here for convenience. // conversion here for convenience.
operator base::FilePath() const { operator base::FilePath() const {
@ -706,7 +706,7 @@ class CefStringBase {
return base::FilePath(ToString()); return base::FilePath(ToString());
#endif #endif
} }
#endif // BUILDING_CEF_SHARED #endif // USING_CHROMIUM_INCLUDES
private: private:
// Allocate the string structure if it doesn't already exist. // Allocate the string structure if it doesn't already exist.

View File

@ -2119,7 +2119,7 @@ typedef enum {
// addition to their special meaning. Things like escaped letters, digits, // addition to their special meaning. Things like escaped letters, digits,
// and most symbols will get unescaped with this mode. // 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 // 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 // you wouldn't want this since it might not be interpreted in one piece
// by other applications. // 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, // Unescapes various characters that will change the meaning of URLs,
// including '%', '+', '&', '/', '#'. If we unescaped these characters, the // including '%', '+', '&', '#'. Does not unescape path separators.
// resulting URL won't be the same as the source one. This flag is used when // If these characters were unescaped, the resulting URL won't be the same
// generating final output like filenames for URLs where we won't be // as the source one. This flag is used when generating final output like
// interpreting as a URL and want to do as much unescaping as possible. // 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 // Unescapes characters that can be used in spoofing attempts (such as LOCK)
// used for rare cases such as data: URL decoding where the result is binary // and control characters (such as BiDi control characters and %01). This
// data. This flag also unescapes BiDi control characters. // 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 // DO NOT use UU_SPOOFING_AND_CONTROL_CHARS if the URL is going to be
// for security reasons. // 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. // 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; } cef_uri_unescape_rule_t;
/// ///

View File

@ -36,6 +36,8 @@ CefBrowserContext::~CefBrowserContext() {
} }
void CefBrowserContext::Initialize() { void CefBrowserContext::Initialize() {
content::BrowserContext::Initialize(this, GetPath());
const bool extensions_enabled = extensions::ExtensionsEnabled(); const bool extensions_enabled = extensions::ExtensionsEnabled();
if (extensions_enabled) { if (extensions_enabled) {
// Create the custom ExtensionSystem first because other KeyedServices // Create the custom ExtensionSystem first because other KeyedServices

View File

@ -449,8 +449,8 @@ net::URLRequestContextGetter* CefBrowserContextImpl::CreateRequestContext(
url_request_getter_ = new CefURLRequestContextGetterImpl( url_request_getter_ = new CefURLRequestContextGetterImpl(
settings_, settings_,
GetPrefs(), GetPrefs(),
BrowserThread::UnsafeGetMessageLoopForThread(BrowserThread::IO), BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO),
BrowserThread::UnsafeGetMessageLoopForThread(BrowserThread::FILE), BrowserThread::GetMessageLoopProxyForThread(BrowserThread::FILE),
protocol_handlers, protocol_handlers,
std::move(proxy_config_service), std::move(proxy_config_service),
std::move(request_interceptors)); std::move(request_interceptors));

View File

@ -127,9 +127,13 @@ GpuModeManager* ChromeBrowserProcessStub::gpu_mode_manager() {
} }
void ChromeBrowserProcessStub::CreateDevToolsHttpProtocolHandler( void ChromeBrowserProcessStub::CreateDevToolsHttpProtocolHandler(
chrome::HostDesktopType host_desktop_type,
const std::string& ip, const std::string& ip,
uint16_t port) { uint16_t port) {
NOTIMPLEMENTED();
}
void ChromeBrowserProcessStub::CreateDevToolsAutoOpener() {
NOTIMPLEMENTED();
} }
unsigned int ChromeBrowserProcessStub::AddRefModule() { unsigned int ChromeBrowserProcessStub::AddRefModule() {
@ -276,10 +280,10 @@ gcm::GCMDriver* ChromeBrowserProcessStub::gcm_driver() {
return NULL; return NULL;
} }
ShellIntegration::DefaultWebClientState shell_integration::DefaultWebClientState
ChromeBrowserProcessStub::CachedDefaultWebClientState() { ChromeBrowserProcessStub::CachedDefaultWebClientState() {
NOTIMPLEMENTED(); NOTIMPLEMENTED();
return ShellIntegration::UNKNOWN_DEFAULT; return shell_integration::UNKNOWN_DEFAULT;
} }
memory::TabManager* ChromeBrowserProcessStub::GetTabManager() { memory::TabManager* ChromeBrowserProcessStub::GetTabManager() {

View File

@ -52,10 +52,9 @@ class ChromeBrowserProcessStub : public BrowserProcess {
IconManager* icon_manager() override; IconManager* icon_manager() override;
GLStringManager* gl_string_manager() override; GLStringManager* gl_string_manager() override;
GpuModeManager* gpu_mode_manager() override; GpuModeManager* gpu_mode_manager() override;
void CreateDevToolsHttpProtocolHandler( void CreateDevToolsHttpProtocolHandler(const std::string& ip,
chrome::HostDesktopType host_desktop_type,
const std::string& ip,
uint16_t port) override; uint16_t port) override;
void CreateDevToolsAutoOpener() override;
unsigned int AddRefModule() override; unsigned int AddRefModule() override;
unsigned int ReleaseModule() override; unsigned int ReleaseModule() override;
bool IsShuttingDown() override; bool IsShuttingDown() override;
@ -97,7 +96,7 @@ class ChromeBrowserProcessStub : public BrowserProcess {
#endif #endif
network_time::NetworkTimeTracker* network_time_tracker() override; network_time::NetworkTimeTracker* network_time_tracker() override;
gcm::GCMDriver* gcm_driver() override; gcm::GCMDriver* gcm_driver() override;
ShellIntegration::DefaultWebClientState shell_integration::DefaultWebClientState
CachedDefaultWebClientState() override; CachedDefaultWebClientState() override;
memory::TabManager* GetTabManager() override; memory::TabManager* GetTabManager() override;

View File

@ -112,6 +112,7 @@ class CefConfigurator : public Configurator {
CreateOutOfProcessPatcher() const override; CreateOutOfProcessPatcher() const override;
bool DeltasEnabled() const override; bool DeltasEnabled() const override;
bool UseBackgroundDownloader() const override; bool UseBackgroundDownloader() const override;
bool UseCupSigning() const override;
scoped_refptr<base::SequencedTaskRunner> GetSequencedTaskRunner() scoped_refptr<base::SequencedTaskRunner> GetSequencedTaskRunner()
const override; const override;
@ -264,6 +265,10 @@ bool CefConfigurator::UseBackgroundDownloader() const {
return background_downloads_enabled_; return background_downloads_enabled_;
} }
bool CefConfigurator::UseCupSigning() const {
return true;
}
scoped_refptr<base::SequencedTaskRunner> scoped_refptr<base::SequencedTaskRunner>
CefConfigurator::GetSequencedTaskRunner() const { CefConfigurator::GetSequencedTaskRunner() const {
return content::BrowserThread::GetBlockingPool() return content::BrowserThread::GetBlockingPool()

View File

@ -101,19 +101,18 @@ class CefAccessTokenStore : public content::AccessTokenStore {
explicit CefAccessTokenStore(net::URLRequestContextGetter* system_context) explicit CefAccessTokenStore(net::URLRequestContextGetter* system_context)
: system_context_(system_context) {} : system_context_(system_context) {}
void LoadAccessTokens( void LoadAccessTokens(const LoadAccessTokensCallback& callback) override {
const LoadAccessTokensCallbackType& callback) override { callback.Run(access_token_map_, system_context_);
callback.Run(access_token_set_, system_context_);
} }
void SaveAccessToken( void SaveAccessToken(
const GURL& server_url, const base::string16& access_token) override { 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: private:
net::URLRequestContextGetter* system_context_; net::URLRequestContextGetter* system_context_;
AccessTokenSet access_token_set_; AccessTokenMap access_token_map_;
DISALLOW_COPY_AND_ASSIGN(CefAccessTokenStore); DISALLOW_COPY_AND_ASSIGN(CefAccessTokenStore);
}; };

View File

@ -11,7 +11,6 @@
#include "libcef/browser/content_browser_client.h" #include "libcef/browser/content_browser_client.h"
#include "libcef/browser/context.h" #include "libcef/browser/context.h"
#include "libcef/browser/net/network_delegate.h" #include "libcef/browser/net/network_delegate.h"
#include "libcef/browser/thread_util.h"
#include "libcef/common/time_util.h" #include "libcef/common/time_util.h"
#include "base/bind.h" #include "base/bind.h"
@ -33,9 +32,9 @@ namespace {
class VisitCookiesCallback : public base::RefCounted<VisitCookiesCallback> { class VisitCookiesCallback : public base::RefCounted<VisitCookiesCallback> {
public: public:
explicit VisitCookiesCallback( explicit VisitCookiesCallback(
scoped_refptr<net::CookieMonster> cookie_monster, const CefCookieManagerImpl::CookieStoreGetter& cookie_store_getter,
CefRefPtr<CefCookieVisitor> visitor) CefRefPtr<CefCookieVisitor> visitor)
: cookie_monster_(cookie_monster), : cookie_store_getter_(cookie_store_getter),
visitor_(visitor) { visitor_(visitor) {
} }
@ -53,8 +52,11 @@ class VisitCookiesCallback : public base::RefCounted<VisitCookiesCallback> {
bool deleteCookie = false; bool deleteCookie = false;
bool keepLooping = visitor_->Visit(cookie, count, total, deleteCookie); bool keepLooping = visitor_->Visit(cookie, count, total, deleteCookie);
if (deleteCookie) { if (deleteCookie) {
cookie_monster_->DeleteCanonicalCookieAsync(cc, net::CookieStore* cookie_store = cookie_store_getter_.Run();
net::CookieMonster::DeleteCookieCallback()); if (cookie_store) {
cookie_store->DeleteCanonicalCookieAsync(cc,
net::CookieMonster::DeleteCallback());
}
} }
if (!keepLooping) if (!keepLooping)
break; break;
@ -66,12 +68,12 @@ class VisitCookiesCallback : public base::RefCounted<VisitCookiesCallback> {
~VisitCookiesCallback() {} ~VisitCookiesCallback() {}
scoped_refptr<net::CookieMonster> cookie_monster_; CefCookieManagerImpl::CookieStoreGetter cookie_store_getter_;
CefRefPtr<CefCookieVisitor> visitor_; CefRefPtr<CefCookieVisitor> 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. // Determine the cookie domain to use for setting the specified cookie.
bool GetCookieDomain(const GURL& url, bool GetCookieDomain(const GURL& url,
@ -118,6 +120,7 @@ CefCookieManagerImpl::CefCookieManagerImpl() {
} }
CefCookieManagerImpl::~CefCookieManagerImpl() { CefCookieManagerImpl::~CefCookieManagerImpl() {
CEF_REQUIRE_IOT();
} }
void CefCookieManagerImpl::Initialize( void CefCookieManagerImpl::Initialize(
@ -135,53 +138,54 @@ void CefCookieManagerImpl::Initialize(
} }
} }
void CefCookieManagerImpl::GetCookieMonster( void CefCookieManagerImpl::GetCookieStore(
scoped_refptr<base::SingleThreadTaskRunner> task_runner, scoped_refptr<base::SingleThreadTaskRunner> task_runner,
const CookieMonsterCallback& callback) { const CookieStoreCallback& callback) {
if (!task_runner.get()) if (!task_runner.get())
task_runner = base::MessageLoop::current()->task_runner(); task_runner = base::MessageLoop::current()->task_runner();
if (!CEF_CURRENTLY_ON_IOT()) { if (!CEF_CURRENTLY_ON_IOT()) {
CEF_POST_TASK(CEF_IOT, CEF_POST_TASK(CEF_IOT,
base::Bind(&CefCookieManagerImpl::GetCookieMonster, this, task_runner, base::Bind(&CefCookieManagerImpl::GetCookieStore, this, task_runner,
callback)); callback));
return; return;
} }
if (HasContext()) { if (HasContext()) {
RunMethodWithContext( RunMethodWithContext(
base::Bind(&CefCookieManagerImpl::GetCookieMonsterWithContext, this, base::Bind(&CefCookieManagerImpl::GetCookieStoreWithContext, this,
task_runner, callback)); task_runner, callback));
return; return;
} }
DCHECK(cookie_monster_.get()); DCHECK(cookie_store_.get());
if (cookie_monster_.get()) {
const CookieStoreGetter& cookie_store_getter =
base::Bind(&CefCookieManagerImpl::GetExistingCookieStore, this);
if (task_runner->BelongsToCurrentThread()) { if (task_runner->BelongsToCurrentThread()) {
// Execute the callback immediately. // Execute the callback immediately.
callback.Run(cookie_monster_); callback.Run(cookie_store_getter);
} else { } else {
// Execute the callback on the target thread. // 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));
return;
} }
} }
scoped_refptr<net::CookieMonster> net::CookieStore* CefCookieManagerImpl::GetExistingCookieStore() {
CefCookieManagerImpl::GetExistingCookieMonster() {
CEF_REQUIRE_IOT(); CEF_REQUIRE_IOT();
if (cookie_monster_.get()) { if (cookie_store_.get()) {
return cookie_monster_; return cookie_store_.get();
} else if (request_context_impl_.get()) { } else if (request_context_impl_.get()) {
scoped_refptr<net::CookieMonster> cookie_monster = net::CookieStore* cookie_store =
request_context_impl_->GetCookieMonster(); request_context_impl_->GetExistingCookieStore();
DCHECK(cookie_monster.get()); DCHECK(cookie_store);
return cookie_monster; return cookie_store;
} }
LOG(ERROR) << "Cookie manager backing store does not exist yet"; LOG(ERROR) << "Cookie store does not exist";
return NULL; return nullptr;
} }
void CefCookieManagerImpl::SetSupportedSchemes( void CefCookieManagerImpl::SetSupportedSchemes(
@ -204,7 +208,7 @@ void CefCookieManagerImpl::SetSupportedSchemes(
bool CefCookieManagerImpl::VisitAllCookies( bool CefCookieManagerImpl::VisitAllCookies(
CefRefPtr<CefCookieVisitor> visitor) { CefRefPtr<CefCookieVisitor> visitor) {
GetCookieMonster( GetCookieStore(
BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO), BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO),
base::Bind(&CefCookieManagerImpl::VisitAllCookiesInternal, this, base::Bind(&CefCookieManagerImpl::VisitAllCookiesInternal, this,
visitor)); visitor));
@ -215,7 +219,7 @@ bool CefCookieManagerImpl::VisitUrlCookies(
const CefString& url, const CefString& url,
bool includeHttpOnly, bool includeHttpOnly,
CefRefPtr<CefCookieVisitor> visitor) { CefRefPtr<CefCookieVisitor> visitor) {
GetCookieMonster( GetCookieStore(
BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO), BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO),
base::Bind(&CefCookieManagerImpl::VisitUrlCookiesInternal, this, url, base::Bind(&CefCookieManagerImpl::VisitUrlCookiesInternal, this, url,
includeHttpOnly, visitor)); includeHttpOnly, visitor));
@ -230,7 +234,7 @@ bool CefCookieManagerImpl::SetCookie(
if (!gurl.is_valid()) if (!gurl.is_valid())
return false; return false;
GetCookieMonster( GetCookieStore(
BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO), BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO),
base::Bind(&CefCookieManagerImpl::SetCookieInternal, this, gurl, cookie, base::Bind(&CefCookieManagerImpl::SetCookieInternal, this, gurl, cookie,
callback)); callback));
@ -246,7 +250,7 @@ bool CefCookieManagerImpl::DeleteCookies(
if (!gurl.is_empty() && !gurl.is_valid()) if (!gurl.is_empty() && !gurl.is_valid())
return false; return false;
GetCookieMonster( GetCookieStore(
BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO), BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO),
base::Bind(&CefCookieManagerImpl::DeleteCookiesInternal, this, gurl, base::Bind(&CefCookieManagerImpl::DeleteCookiesInternal, this, gurl,
cookie_name, callback)); cookie_name, callback));
@ -275,7 +279,7 @@ bool CefCookieManagerImpl::SetStoragePath(
if (!path.empty()) if (!path.empty())
new_path = base::FilePath(path); 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)) { storage_path_ == new_path)) {
// The path has not changed so don't do anything. // The path has not changed so don't do anything.
RunAsyncCompletionOnIOThread(callback); RunAsyncCompletionOnIOThread(callback);
@ -306,9 +310,9 @@ bool CefCookieManagerImpl::SetStoragePath(
// Set the new cookie store that will be used for all new requests. The old // 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 // cookie store, if any, will be automatically flushed and closed when no
// longer referenced. // 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) if (persistent_store.get() && persist_session_cookies)
cookie_monster_->SetPersistSessionCookies(true); cookie_store_->SetPersistSessionCookies(true);
storage_path_ = new_path; storage_path_ = new_path;
// Restore the previously supported schemes. // Restore the previously supported schemes.
@ -319,7 +323,7 @@ bool CefCookieManagerImpl::SetStoragePath(
bool CefCookieManagerImpl::FlushStore( bool CefCookieManagerImpl::FlushStore(
CefRefPtr<CefCompletionCallback> callback) { CefRefPtr<CefCompletionCallback> callback) {
GetCookieMonster( GetCookieStore(
BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO), BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO),
base::Bind(&CefCookieManagerImpl::FlushStoreInternal, this, callback)); base::Bind(&CefCookieManagerImpl::FlushStoreInternal, this, callback));
return true; return true;
@ -457,21 +461,23 @@ void CefCookieManagerImpl::SetSupportedSchemesWithContext(
RunAsyncCompletionOnIOThread(callback); RunAsyncCompletionOnIOThread(callback);
} }
void CefCookieManagerImpl::GetCookieMonsterWithContext( void CefCookieManagerImpl::GetCookieStoreWithContext(
scoped_refptr<base::SingleThreadTaskRunner> task_runner, scoped_refptr<base::SingleThreadTaskRunner> task_runner,
const CookieMonsterCallback& callback, const CookieStoreCallback& callback,
scoped_refptr<CefURLRequestContextGetterImpl> request_context) { scoped_refptr<CefURLRequestContextGetterImpl> request_context) {
CEF_REQUIRE_IOT(); CEF_REQUIRE_IOT();
DCHECK(request_context->GetExistingCookieStore());
scoped_refptr<net::CookieMonster> cookie_monster = const CookieStoreGetter& cookie_store_getter =
request_context->GetCookieMonster(); base::Bind(&CefURLRequestContextGetterImpl::GetExistingCookieStore,
request_context);
if (task_runner->BelongsToCurrentThread()) { if (task_runner->BelongsToCurrentThread()) {
// Execute the callback immediately. // Execute the callback immediately.
callback.Run(cookie_monster); callback.Run(cookie_store_getter);
} else { } else {
// Execute the callback on the target thread. // 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));
} }
} }
@ -487,25 +493,29 @@ void CefCookieManagerImpl::SetSupportedSchemesInternal(
return; return;
} }
DCHECK(cookie_monster_.get()); DCHECK(cookie_store_.get());
if (!cookie_monster_.get()) if (!cookie_store_.get())
return; return;
supported_schemes_ = schemes; supported_schemes_ = schemes;
SetCookieMonsterSchemes(cookie_monster_.get(), supported_schemes_); SetCookieMonsterSchemes(cookie_store_.get(), supported_schemes_);
RunAsyncCompletionOnIOThread(callback); RunAsyncCompletionOnIOThread(callback);
} }
void CefCookieManagerImpl::VisitAllCookiesInternal( void CefCookieManagerImpl::VisitAllCookiesInternal(
CefRefPtr<CefCookieVisitor> visitor, CefRefPtr<CefCookieVisitor> visitor,
scoped_refptr<net::CookieMonster> cookie_monster) { const CookieStoreGetter& cookie_store_getter) {
CEF_REQUIRE_IOT(); CEF_REQUIRE_IOT();
scoped_refptr<VisitCookiesCallback> callback( net::CookieStore* cookie_store = cookie_store_getter.Run();
new VisitCookiesCallback(cookie_monster, visitor)); if (!cookie_store)
return;
cookie_monster->GetAllCookiesAsync( scoped_refptr<VisitCookiesCallback> callback(
new VisitCookiesCallback(cookie_store_getter, visitor));
cookie_store->GetAllCookiesAsync(
base::Bind(&VisitCookiesCallback::Run, callback.get())); base::Bind(&VisitCookiesCallback::Run, callback.get()));
} }
@ -513,18 +523,22 @@ void CefCookieManagerImpl::VisitUrlCookiesInternal(
const CefString& url, const CefString& url,
bool includeHttpOnly, bool includeHttpOnly,
CefRefPtr<CefCookieVisitor> visitor, CefRefPtr<CefCookieVisitor> visitor,
scoped_refptr<net::CookieMonster> cookie_monster) { const CookieStoreGetter& cookie_store_getter) {
CEF_REQUIRE_IOT(); CEF_REQUIRE_IOT();
net::CookieStore* cookie_store = cookie_store_getter.Run();
if (!cookie_store)
return;
net::CookieOptions options; net::CookieOptions options;
if (includeHttpOnly) if (includeHttpOnly)
options.set_include_httponly(); options.set_include_httponly();
scoped_refptr<VisitCookiesCallback> callback( scoped_refptr<VisitCookiesCallback> callback(
new VisitCookiesCallback(cookie_monster, visitor)); new VisitCookiesCallback(cookie_store_getter, visitor));
GURL gurl = GURL(url.ToString()); GURL gurl = GURL(url.ToString());
cookie_monster->GetAllCookiesForURLWithOptionsAsync(gurl, options, cookie_store->GetCookieListWithOptionsAsync(gurl, options,
base::Bind(&VisitCookiesCallback::Run, callback.get())); base::Bind(&VisitCookiesCallback::Run, callback.get()));
} }
@ -532,9 +546,13 @@ void CefCookieManagerImpl::SetCookieInternal(
const GURL& url, const GURL& url,
const CefCookie& cookie, const CefCookie& cookie,
CefRefPtr<CefSetCookieCallback> callback, CefRefPtr<CefSetCookieCallback> callback,
scoped_refptr<net::CookieMonster> cookie_monster) { const CookieStoreGetter& cookie_store_getter) {
CEF_REQUIRE_IOT(); CEF_REQUIRE_IOT();
net::CookieStore* cookie_store = cookie_store_getter.Run();
if (!cookie_store)
return;
std::string name = CefString(&cookie.name).ToString(); std::string name = CefString(&cookie.name).ToString();
std::string value = CefString(&cookie.value).ToString(); std::string value = CefString(&cookie.value).ToString();
std::string domain = CefString(&cookie.domain).ToString(); std::string domain = CefString(&cookie.domain).ToString();
@ -544,13 +562,14 @@ void CefCookieManagerImpl::SetCookieInternal(
if (cookie.has_expires) if (cookie.has_expires)
cef_time_to_basetime(cookie.expires, expiration_time); cef_time_to_basetime(cookie.expires, expiration_time);
cookie_monster->SetCookieWithDetailsAsync( cookie_store->SetCookieWithDetailsAsync(
url, name, value, domain, path, url, name, value, domain, path,
base::Time(), // Creation time. base::Time(), // Creation time.
expiration_time, expiration_time,
base::Time(), // Last access time.
cookie.secure ? true : false, cookie.secure ? true : false,
cookie.httponly ? true : false, cookie.httponly ? true : false,
false, // First-party only. net::CookieSameSite::DEFAULT_MODE,
CefNetworkDelegate::AreStrictSecureCookiesEnabled(), CefNetworkDelegate::AreStrictSecureCookiesEnabled(),
net::COOKIE_PRIORITY_DEFAULT, net::COOKIE_PRIORITY_DEFAULT,
base::Bind(SetCookieCallbackImpl, callback)); base::Bind(SetCookieCallbackImpl, callback));
@ -560,31 +579,39 @@ void CefCookieManagerImpl::DeleteCookiesInternal(
const GURL& url, const GURL& url,
const CefString& cookie_name, const CefString& cookie_name,
CefRefPtr<CefDeleteCookiesCallback> callback, CefRefPtr<CefDeleteCookiesCallback> callback,
scoped_refptr<net::CookieMonster> cookie_monster) { const CookieStoreGetter& cookie_store_getter) {
CEF_REQUIRE_IOT(); CEF_REQUIRE_IOT();
net::CookieStore* cookie_store = cookie_store_getter.Run();
if (!cookie_store)
return;
if (url.is_empty()) { if (url.is_empty()) {
// Delete all cookies. // Delete all cookies.
cookie_monster->DeleteAllAsync( cookie_store->DeleteAllAsync(
base::Bind(DeleteCookiesCallbackImpl, callback)); base::Bind(DeleteCookiesCallbackImpl, callback));
} else if (cookie_name.empty()) { } else if (cookie_name.empty()) {
// Delete all matching host cookies. // Delete all matching host cookies.
cookie_monster->DeleteAllCreatedBetweenForHostAsync( cookie_store->DeleteAllCreatedBetweenForHostAsync(
base::Time(), base::Time::Max(), url, base::Time(), base::Time::Max(), url,
base::Bind(DeleteCookiesCallbackImpl, callback)); base::Bind(DeleteCookiesCallbackImpl, callback));
} else { } else {
// Delete all matching host and domain cookies. // Delete all matching host and domain cookies.
cookie_monster->DeleteCookieAsync(url, cookie_name, cookie_store->DeleteCookieAsync(url, cookie_name,
base::Bind(DeleteCookiesCallbackImpl, callback, -1)); base::Bind(DeleteCookiesCallbackImpl, callback, -1));
} }
} }
void CefCookieManagerImpl::FlushStoreInternal( void CefCookieManagerImpl::FlushStoreInternal(
CefRefPtr<CefCompletionCallback> callback, CefRefPtr<CefCompletionCallback> callback,
scoped_refptr<net::CookieMonster> cookie_monster) { const CookieStoreGetter& cookie_store_getter) {
CEF_REQUIRE_IOT(); 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)); base::Bind(RunAsyncCompletionOnIOThread, callback));
} }

View File

@ -9,6 +9,7 @@
#include "include/cef_cookie.h" #include "include/cef_cookie.h"
#include "libcef/browser/request_context_impl.h" #include "libcef/browser/request_context_impl.h"
#include "libcef/browser/thread_util.h"
#include "base/files/file_path.h" #include "base/files/file_path.h"
#include "net/cookies/cookie_monster.h" #include "net/cookies/cookie_monster.h"
@ -25,19 +26,20 @@ class CefCookieManagerImpl : public CefCookieManager {
bool persist_session_cookies, bool persist_session_cookies,
CefRefPtr<CefCompletionCallback> callback); CefRefPtr<CefCompletionCallback> callback);
// Executes |callback| either synchronously or asynchronously with the cookie // Executes |callback| either synchronously or asynchronously with the
// monster object when it's available. If |task_runner| is NULL the callback // CookieStoreGetter when the cookie store object is available. If
// will be executed on the originating thread. The resulting cookie monster // |task_runner| is NULL the callback will be executed on the originating
// object can only be accessed on the IO thread. // thread. CookieStoreGetter can only be executed on, and the resulting cookie
typedef base::Callback<void(scoped_refptr<net::CookieMonster>)> // store object can only be accessed on, the IO thread.
CookieMonsterCallback; typedef base::Callback<net::CookieStore*()> CookieStoreGetter;
void GetCookieMonster( typedef base::Callback<void(const CookieStoreGetter&)> CookieStoreCallback;
void GetCookieStore(
scoped_refptr<base::SingleThreadTaskRunner> task_runner, scoped_refptr<base::SingleThreadTaskRunner> task_runner,
const CookieMonsterCallback& callback); const CookieStoreCallback& callback);
// Returns the existing cookie monster object. Logs an error if the cookie // Returns the existing cookie store object. Logs an error if the cookie
// monster does not yet exist. Must be called on the IO thread. // store does not yet exist. Must be called on the IO thread.
scoped_refptr<net::CookieMonster> GetExistingCookieMonster(); net::CookieStore* GetExistingCookieStore();
// CefCookieManager methods. // CefCookieManager methods.
void SetSupportedSchemes(const std::vector<CefString>& schemes, void SetSupportedSchemes(const std::vector<CefString>& schemes,
@ -85,9 +87,9 @@ class CefCookieManagerImpl : public CefCookieManager {
const std::vector<std::string>& schemes, const std::vector<std::string>& schemes,
CefRefPtr<CefCompletionCallback> callback, CefRefPtr<CefCompletionCallback> callback,
scoped_refptr<CefURLRequestContextGetterImpl> request_context); scoped_refptr<CefURLRequestContextGetterImpl> request_context);
void GetCookieMonsterWithContext( void GetCookieStoreWithContext(
scoped_refptr<base::SingleThreadTaskRunner> task_runner, scoped_refptr<base::SingleThreadTaskRunner> task_runner,
const CookieMonsterCallback& callback, const CookieStoreCallback& callback,
scoped_refptr<CefURLRequestContextGetterImpl> request_context); scoped_refptr<CefURLRequestContextGetterImpl> request_context);
void SetSupportedSchemesInternal( void SetSupportedSchemesInternal(
@ -95,25 +97,25 @@ class CefCookieManagerImpl : public CefCookieManager {
CefRefPtr<CefCompletionCallback> callback); CefRefPtr<CefCompletionCallback> callback);
void VisitAllCookiesInternal( void VisitAllCookiesInternal(
CefRefPtr<CefCookieVisitor> visitor, CefRefPtr<CefCookieVisitor> visitor,
scoped_refptr<net::CookieMonster> cookie_monster); const CookieStoreGetter& cookie_store_getter);
void VisitUrlCookiesInternal( void VisitUrlCookiesInternal(
const CefString& url, const CefString& url,
bool includeHttpOnly, bool includeHttpOnly,
CefRefPtr<CefCookieVisitor> visitor, CefRefPtr<CefCookieVisitor> visitor,
scoped_refptr<net::CookieMonster> cookie_monster); const CookieStoreGetter& cookie_store_getter);
void SetCookieInternal( void SetCookieInternal(
const GURL& url, const GURL& url,
const CefCookie& cookie, const CefCookie& cookie,
CefRefPtr<CefSetCookieCallback> callback, CefRefPtr<CefSetCookieCallback> callback,
scoped_refptr<net::CookieMonster> cookie_monster); const CookieStoreGetter& cookie_store_getter);
void DeleteCookiesInternal( void DeleteCookiesInternal(
const GURL& url, const GURL& url,
const CefString& cookie_name, const CefString& cookie_name,
CefRefPtr<CefDeleteCookiesCallback> callback, CefRefPtr<CefDeleteCookiesCallback> callback,
scoped_refptr<net::CookieMonster> cookie_monster); const CookieStoreGetter& cookie_store_getter);
void FlushStoreInternal( void FlushStoreInternal(
CefRefPtr<CefCompletionCallback> callback, CefRefPtr<CefCompletionCallback> callback,
scoped_refptr<net::CookieMonster> cookie_monster); const CookieStoreGetter& cookie_store_getter);
// Used for cookie monsters owned by the context. // Used for cookie monsters owned by the context.
CefRefPtr<CefRequestContextImpl> request_context_; CefRefPtr<CefRequestContextImpl> request_context_;
@ -122,9 +124,9 @@ class CefCookieManagerImpl : public CefCookieManager {
// Used for cookie monsters owned by this object. // Used for cookie monsters owned by this object.
base::FilePath storage_path_; base::FilePath storage_path_;
std::vector<std::string> supported_schemes_; std::vector<std::string> supported_schemes_;
scoped_refptr<net::CookieMonster> cookie_monster_; scoped_ptr<net::CookieMonster> cookie_store_;
IMPLEMENT_REFCOUNTING(CefCookieManagerImpl); IMPLEMENT_REFCOUNTING_DELETE_ON_IOT(CefCookieManagerImpl);
}; };
#endif // CEF_LIBCEF_BROWSER_COOKIE_MANAGER_IMPL_H_ #endif // CEF_LIBCEF_BROWSER_COOKIE_MANAGER_IMPL_H_

View File

@ -70,15 +70,18 @@ int ResponseWriter::Initialize(const net::CompletionCallback& callback) {
int ResponseWriter::Write(net::IOBuffer* buffer, int ResponseWriter::Write(net::IOBuffer* buffer,
int num_bytes, int num_bytes,
const net::CompletionCallback& callback) { 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::FundamentalValue* id = new base::FundamentalValue(stream_id_);
base::StringValue* chunk = base::StringValue* chunkValue = new base::StringValue(chunk);
new base::StringValue(std::string(buffer->data(), num_bytes));
content::BrowserThread::PostTask( content::BrowserThread::PostTask(
content::BrowserThread::UI, FROM_HERE, content::BrowserThread::UI, FROM_HERE,
base::Bind(&CefDevToolsFrontend::CallClientFunction, base::Bind(&CefDevToolsFrontend::CallClientFunction,
devtools_, "DevToolsAPI.streamWrite", devtools_, "DevToolsAPI.streamWrite",
base::Owned(id), base::Owned(chunk), nullptr)); base::Owned(id), base::Owned(chunkValue), nullptr));
return num_bytes; return num_bytes;
} }

View File

@ -11,6 +11,7 @@
#include "libcef/browser/browser_host_impl.h" #include "libcef/browser/browser_host_impl.h"
#include "libcef/browser/thread_util.h" #include "libcef/browser/thread_util.h"
#include "base/threading/worker_pool.h"
#include "content/public/browser/render_view_host.h" #include "content/public/browser/render_view_host.h"
#include "content/public/common/file_chooser_file_info.h" #include "content/public/common/file_chooser_file_info.h"
#include "net/base/directory_lister.h" #include "net/base/directory_lister.h"
@ -364,7 +365,7 @@ void CefFileDialogManager::OnRunFileChooserUploadFolderDelegateCallback(
new UploadFolderHelper( new UploadFolderHelper(
base::Bind(&CefFileDialogManager::OnRunFileChooserDelegateCallback, base::Bind(&CefFileDialogManager::OnRunFileChooserDelegateCallback,
weak_ptr_factory_.GetWeakPtr(), mode)))); weak_ptr_factory_.GetWeakPtr(), mode))));
lister_->Start(); lister_->Start(base::WorkerPool::GetTaskRunner(true).get());
} }
} }

View File

@ -14,7 +14,6 @@
#include "base/logging.h" #include "base/logging.h"
#include "base/strings/utf_string_conversions.h" #include "base/strings/utf_string_conversions.h"
#include "components/url_formatter/elide_url.h" #include "components/url_formatter/elide_url.h"
#include "net/base/net_util.h"
namespace { namespace {
@ -148,7 +147,6 @@ void CefJavaScriptDialogManager::RunJavaScriptDialog(
void CefJavaScriptDialogManager::RunBeforeUnloadDialog( void CefJavaScriptDialogManager::RunBeforeUnloadDialog(
content::WebContents* web_contents, content::WebContents* web_contents,
const base::string16& message_text,
bool is_reload, bool is_reload,
const DialogClosedCallback& callback) { const DialogClosedCallback& callback) {
if (browser_->destruction_state() >= if (browser_->destruction_state() >=
@ -159,6 +157,9 @@ void CefJavaScriptDialogManager::RunBeforeUnloadDialog(
return; return;
} }
const base::string16& message_text =
base::ASCIIToUTF16("Is it OK to leave/reload this page?");
CefRefPtr<CefClient> client = browser_->GetClient(); CefRefPtr<CefClient> client = browser_->GetClient();
if (client.get()) { if (client.get()) {
CefRefPtr<CefJSDialogHandler> handler = client->GetJSDialogHandler(); CefRefPtr<CefJSDialogHandler> handler = client->GetJSDialogHandler();
@ -187,14 +188,10 @@ void CefJavaScriptDialogManager::RunBeforeUnloadDialog(
dialog_running_ = true; dialog_running_ = true;
base::string16 new_message_text =
message_text +
base::ASCIIToUTF16("\n\nIs it OK to leave/reload this page?");
runner_->Run(browser_, runner_->Run(browser_,
content::JAVASCRIPT_MESSAGE_TYPE_CONFIRM, content::JAVASCRIPT_MESSAGE_TYPE_CONFIRM,
base::string16(), // display_url base::string16(), // display_url
new_message_text, message_text,
base::string16(), // default_prompt_text base::string16(), // default_prompt_text
base::Bind(&CefJavaScriptDialogManager::DialogClosed, base::Bind(&CefJavaScriptDialogManager::DialogClosed,
weak_ptr_factory_.GetWeakPtr(), callback)); weak_ptr_factory_.GetWeakPtr(), callback));

View File

@ -41,7 +41,6 @@ class CefJavaScriptDialogManager : public content::JavaScriptDialogManager {
bool* did_suppress_message) override; bool* did_suppress_message) override;
void RunBeforeUnloadDialog( void RunBeforeUnloadDialog(
content::WebContents* web_contents, content::WebContents* web_contents,
const base::string16& message_text,
bool is_reload, bool is_reload,
const DialogClosedCallback& callback) override; const DialogClosedCallback& callback) override;
void CancelActiveAndPendingDialogs( void CancelActiveAndPendingDialogs(

View File

@ -52,7 +52,7 @@ INT_PTR CALLBACK CefJavaScriptDialogRunnerWin::DialogProc(
GetWindowLongPtr(dialog, DWLP_USER)); GetWindowLongPtr(dialog, DWLP_USER));
base::string16 user_input; base::string16 user_input;
bool finish = false; bool finish = false;
bool result; bool result = false;
switch (LOWORD(wparam)) { switch (LOWORD(wparam)) {
case IDOK: case IDOK:
finish = true; finish = true;

View File

@ -11,6 +11,7 @@
#include <X11/Xutil.h> #include <X11/Xutil.h>
#include "ui/base/x/x11_util.h" #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/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/desktop_window_tree_host_x11.h"
#include "ui/views/widget/desktop_aura/x11_topmost_window_finder.h" #include "ui/views/widget/desktop_aura/x11_topmost_window_finder.h"

View File

@ -25,18 +25,13 @@ CefCookieStoreProxy::~CefCookieStoreProxy() {
CEF_REQUIRE_IOT(); CEF_REQUIRE_IOT();
} }
void CefCookieStoreProxy::Detach() {
CEF_REQUIRE_IOT();
parent_ = NULL;
}
void CefCookieStoreProxy::SetCookieWithOptionsAsync( void CefCookieStoreProxy::SetCookieWithOptionsAsync(
const GURL& url, const GURL& url,
const std::string& cookie_line, const std::string& cookie_line,
const net::CookieOptions& options, const net::CookieOptions& options,
const SetCookiesCallback& callback) { const SetCookiesCallback& callback) {
scoped_refptr<net::CookieStore> cookie_store = GetCookieStore(); net::CookieStore* cookie_store = GetCookieStore();
if (cookie_store.get()) { if (cookie_store) {
cookie_store->SetCookieWithOptionsAsync(url, cookie_line, options, cookie_store->SetCookieWithOptionsAsync(url, cookie_line, options,
callback); callback);
} }
@ -48,36 +43,47 @@ void CefCookieStoreProxy::SetCookieWithDetailsAsync(
const std::string& value, const std::string& value,
const std::string& domain, const std::string& domain,
const std::string& path, const std::string& path,
const base::Time creation_time, base::Time creation_time,
const base::Time expiration_time, base::Time expiration_time,
base::Time last_access_time,
bool secure, bool secure,
bool http_only, bool http_only,
bool same_site, net::CookieSameSite same_site,
bool enforce_strict_secure, bool enforce_strict_secure,
net::CookiePriority priority, net::CookiePriority priority,
const SetCookiesCallback& callback) { const SetCookiesCallback& callback) {
scoped_refptr<net::CookieStore> cookie_store = GetCookieStore(); net::CookieStore* cookie_store = GetCookieStore();
if (cookie_store.get()) { if (cookie_store) {
cookie_store->SetCookieWithDetailsAsync(url, name, value, domain, path, cookie_store->SetCookieWithDetailsAsync(url, name, value, domain, path,
creation_time, expiration_time, creation_time, expiration_time,
secure, http_only, same_site, last_access_time, secure, http_only,
enforce_strict_secure, priority, same_site, enforce_strict_secure,
callback); priority, callback);
} }
} }
void CefCookieStoreProxy::GetCookiesWithOptionsAsync( void CefCookieStoreProxy::GetCookiesWithOptionsAsync(
const GURL& url, const net::CookieOptions& options, const GURL& url,
const net::CookieOptions& options,
const GetCookiesCallback& callback) { const GetCookiesCallback& callback) {
scoped_refptr<net::CookieStore> cookie_store = GetCookieStore(); net::CookieStore* cookie_store = GetCookieStore();
if (cookie_store.get()) if (cookie_store)
cookie_store->GetCookiesWithOptionsAsync(url, options, callback); 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( void CefCookieStoreProxy::GetAllCookiesAsync(
const GetCookieListCallback& callback) { const GetCookieListCallback& callback) {
scoped_refptr<net::CookieStore> cookie_store = GetCookieStore(); net::CookieStore* cookie_store = GetCookieStore();
if (cookie_store.get()) if (cookie_store)
cookie_store->GetAllCookiesAsync(callback); cookie_store->GetAllCookiesAsync(callback);
} }
@ -85,25 +91,25 @@ void CefCookieStoreProxy::DeleteCookieAsync(
const GURL& url, const GURL& url,
const std::string& cookie_name, const std::string& cookie_name,
const base::Closure& callback) { const base::Closure& callback) {
scoped_refptr<net::CookieStore> cookie_store = GetCookieStore(); net::CookieStore* cookie_store = GetCookieStore();
if (cookie_store.get()) if (cookie_store)
cookie_store->DeleteCookieAsync(url, cookie_name, callback); cookie_store->DeleteCookieAsync(url, cookie_name, callback);
} }
void CefCookieStoreProxy::GetAllCookiesForURLAsync( void CefCookieStoreProxy::DeleteCanonicalCookieAsync(
const GURL& url, const net::CanonicalCookie& cookie,
const GetCookieListCallback& callback) { const DeleteCallback& callback) {
scoped_refptr<net::CookieStore> cookie_store = GetCookieStore(); net::CookieStore* cookie_store = GetCookieStore();
if (cookie_store.get()) if (cookie_store)
cookie_store->GetAllCookiesForURLAsync(url, callback); cookie_store->DeleteCanonicalCookieAsync(cookie, callback);
} }
void CefCookieStoreProxy::DeleteAllCreatedBetweenAsync( void CefCookieStoreProxy::DeleteAllCreatedBetweenAsync(
const base::Time& delete_begin, const base::Time& delete_begin,
const base::Time& delete_end, const base::Time& delete_end,
const DeleteCallback& callback) { const DeleteCallback& callback) {
scoped_refptr<net::CookieStore> cookie_store = GetCookieStore(); net::CookieStore* cookie_store = GetCookieStore();
if (cookie_store.get()) { if (cookie_store) {
cookie_store->DeleteAllCreatedBetweenAsync(delete_begin, delete_end, cookie_store->DeleteAllCreatedBetweenAsync(delete_begin, delete_end,
callback); callback);
} }
@ -114,8 +120,8 @@ void CefCookieStoreProxy::DeleteAllCreatedBetweenForHostAsync(
const base::Time delete_end, const base::Time delete_end,
const GURL& url, const GURL& url,
const DeleteCallback& callback) { const DeleteCallback& callback) {
scoped_refptr<net::CookieStore> cookie_store = GetCookieStore(); net::CookieStore* cookie_store = GetCookieStore();
if (cookie_store.get()) { if (cookie_store) {
cookie_store->DeleteAllCreatedBetweenForHostAsync(delete_begin, delete_end, cookie_store->DeleteAllCreatedBetweenForHostAsync(delete_begin, delete_end,
url, callback); url, callback);
} }
@ -123,55 +129,57 @@ void CefCookieStoreProxy::DeleteAllCreatedBetweenForHostAsync(
void CefCookieStoreProxy::DeleteSessionCookiesAsync( void CefCookieStoreProxy::DeleteSessionCookiesAsync(
const DeleteCallback& callback) { const DeleteCallback& callback) {
scoped_refptr<net::CookieStore> cookie_store = GetCookieStore(); net::CookieStore* cookie_store = GetCookieStore();
if (cookie_store.get()) if (cookie_store)
cookie_store->DeleteSessionCookiesAsync(callback); cookie_store->DeleteSessionCookiesAsync(callback);
} }
void CefCookieStoreProxy::FlushStore(const base::Closure& callback) { void CefCookieStoreProxy::FlushStore(const base::Closure& callback) {
scoped_refptr<net::CookieStore> cookie_store = GetCookieStore(); net::CookieStore* cookie_store = GetCookieStore();
if (cookie_store.get()) if (cookie_store)
cookie_store->FlushStore(callback); cookie_store->FlushStore(callback);
} }
net::CookieMonster* CefCookieStoreProxy::GetCookieMonster() {
scoped_refptr<net::CookieStore> cookie_store = GetCookieStore();
if (cookie_store.get())
return cookie_store->GetCookieMonster();
return NULL;
}
scoped_ptr<net::CookieStore::CookieChangedSubscription> scoped_ptr<net::CookieStore::CookieChangedSubscription>
CefCookieStoreProxy::AddCallbackForCookie( CefCookieStoreProxy::AddCallbackForCookie(
const GURL& url, const GURL& url,
const std::string& name, const std::string& name,
const CookieChangedCallback& callback) { const CookieChangedCallback& callback) {
scoped_refptr<net::CookieStore> cookie_store = GetCookieStore(); net::CookieStore* cookie_store = GetCookieStore();
if (cookie_store.get()) if (cookie_store)
return cookie_store->AddCallbackForCookie(url, name, callback); return cookie_store->AddCallbackForCookie(url, name, callback);
return NULL; return NULL;
} }
bool CefCookieStoreProxy::IsEphemeral() {
net::CookieStore* cookie_store = GetCookieStore();
if (cookie_store)
return cookie_store->IsEphemeral();
return true;
}
net::CookieStore* CefCookieStoreProxy::GetCookieStore() { net::CookieStore* CefCookieStoreProxy::GetCookieStore() {
CEF_REQUIRE_IOT(); CEF_REQUIRE_IOT();
scoped_refptr<net::CookieStore> cookie_store; net::CookieStore* cookie_store = nullptr;
CefRefPtr<CefCookieManager> manager = handler_->GetCookieManager(); CefRefPtr<CefCookieManager> manager = handler_->GetCookieManager();
if (manager.get()) { if (manager.get()) {
// Use the cookie store provided by the manager. // Use the cookie store provided by the manager.
cookie_store = reinterpret_cast<CefCookieManagerImpl*>(manager.get())-> cookie_store = reinterpret_cast<CefCookieManagerImpl*>(manager.get())->
GetExistingCookieMonster(); GetExistingCookieStore();
DCHECK(cookie_store.get()); DCHECK(cookie_store);
return cookie_store.get(); return cookie_store;
} }
DCHECK(parent_); DCHECK(parent_);
if (parent_) { if (parent_) {
// Use the cookie store from the parent. // Use the cookie store from the parent.
cookie_store = parent_->cookie_store(); 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;
} }

View File

@ -21,9 +21,6 @@ class CefCookieStoreProxy : public net::CookieStore {
CefRefPtr<CefRequestContextHandler> handler); CefRefPtr<CefRequestContextHandler> handler);
~CefCookieStoreProxy() override; ~CefCookieStoreProxy() override;
// The |parent_| object may no longer be valid after this method is called.
void Detach();
// net::CookieStore methods. // net::CookieStore methods.
void SetCookieWithOptionsAsync( void SetCookieWithOptionsAsync(
const GURL& url, const GURL& url,
@ -36,24 +33,29 @@ class CefCookieStoreProxy : public net::CookieStore {
const std::string& value, const std::string& value,
const std::string& domain, const std::string& domain,
const std::string& path, const std::string& path,
const base::Time creation_time, base::Time creation_time,
const base::Time expiration_time, base::Time expiration_time,
base::Time last_access_time,
bool secure, bool secure,
bool http_only, bool http_only,
bool same_site, net::CookieSameSite same_site,
bool enforce_strict_secure, bool enforce_strict_secure,
net::CookiePriority priority, net::CookiePriority priority,
const SetCookiesCallback& callback) override; const SetCookiesCallback& callback) override;
void GetCookiesWithOptionsAsync( void GetCookiesWithOptionsAsync(
const GURL& url, const net::CookieOptions& options, const GURL& url,
const net::CookieOptions& options,
const GetCookiesCallback& callback) override; const GetCookiesCallback& callback) override;
void GetCookieListWithOptionsAsync(
const GURL& url,
const net::CookieOptions& options,
const GetCookieListCallback& callback) override;
void GetAllCookiesAsync(const GetCookieListCallback& callback) override; void GetAllCookiesAsync(const GetCookieListCallback& callback) override;
void DeleteCookieAsync(const GURL& url, void DeleteCookieAsync(const GURL& url,
const std::string& cookie_name, const std::string& cookie_name,
const base::Closure& callback) override; const base::Closure& callback) override;
void GetAllCookiesForURLAsync( void DeleteCanonicalCookieAsync(const net::CanonicalCookie& cookie,
const GURL& url, const DeleteCallback& callback) override;
const GetCookieListCallback& callback) override;
void DeleteAllCreatedBetweenAsync(const base::Time& delete_begin, void DeleteAllCreatedBetweenAsync(const base::Time& delete_begin,
const base::Time& delete_end, const base::Time& delete_end,
const DeleteCallback& callback) override; const DeleteCallback& callback) override;
@ -64,18 +66,17 @@ class CefCookieStoreProxy : public net::CookieStore {
const DeleteCallback& callback) override; const DeleteCallback& callback) override;
void DeleteSessionCookiesAsync(const DeleteCallback& callback) override; void DeleteSessionCookiesAsync(const DeleteCallback& callback) override;
void FlushStore(const base::Closure& callback) override; void FlushStore(const base::Closure& callback) override;
net::CookieMonster* GetCookieMonster() override;
scoped_ptr<CookieChangedSubscription> AddCallbackForCookie( scoped_ptr<CookieChangedSubscription> AddCallbackForCookie(
const GURL& url, const GURL& url,
const std::string& name, const std::string& name,
const CookieChangedCallback& callback) override; const CookieChangedCallback& callback) override;
bool IsEphemeral() override;
private: private:
net::CookieStore* GetCookieStore(); net::CookieStore* GetCookieStore();
// The |parent_| pointer is kept alive by CefURLRequestContextGetterProxy // The |parent_| pointer is kept alive by CefURLRequestContextGetterProxy
// which has a ref to the owning CefURLRequestContextGetterImpl. Detach() will // which has a ref to the owning CefURLRequestContextGetterImpl.
// be called when the CefURLRequestContextGetterProxy is destroyed.
CefURLRequestContextImpl* parent_; CefURLRequestContextImpl* parent_;
CefRefPtr<CefRequestContextHandler> handler_; CefRefPtr<CefRequestContextHandler> handler_;

View File

@ -383,19 +383,13 @@ void CefResourceRequestJob::AddCookieHeaderAndStart() {
if (!request_) if (!request_)
return; return;
net::CookieStore* cookie_store = net::CookieStore* cookie_store = request_->context()->cookie_store();
request_->context()->cookie_store();
if (cookie_store && if (cookie_store &&
!(request_->load_flags() & net::LOAD_DO_NOT_SEND_COOKIES)) { !(request_->load_flags() & net::LOAD_DO_NOT_SEND_COOKIES)) {
net::CookieMonster* cookie_monster = cookie_store->GetCookieMonster(); cookie_store->GetAllCookiesForURLAsync(
if (cookie_monster) {
cookie_monster->GetAllCookiesForURLAsync(
request_->url(), request_->url(),
base::Bind(&CefResourceRequestJob::CheckCookiePolicyAndLoad, base::Bind(&CefResourceRequestJob::CheckCookiePolicyAndLoad,
weak_factory_.GetWeakPtr())); weak_factory_.GetWeakPtr()));
} else {
DoLoadCookies();
}
} else { } else {
DoStartTransaction(); DoStartTransaction();
} }

View File

@ -104,14 +104,14 @@ class CefHttpUserAgentSettings : public net::HttpUserAgentSettings {
CefURLRequestContextGetterImpl::CefURLRequestContextGetterImpl( CefURLRequestContextGetterImpl::CefURLRequestContextGetterImpl(
const CefRequestContextSettings& settings, const CefRequestContextSettings& settings,
PrefService* pref_service, PrefService* pref_service,
base::MessageLoop* io_loop, scoped_refptr<base::SingleThreadTaskRunner> io_task_runner,
base::MessageLoop* file_loop, scoped_refptr<base::SingleThreadTaskRunner> file_task_runner,
content::ProtocolHandlerMap* protocol_handlers, content::ProtocolHandlerMap* protocol_handlers,
scoped_ptr<net::ProxyConfigService> proxy_config_service, scoped_ptr<net::ProxyConfigService> proxy_config_service,
content::URLRequestInterceptorScopedVector request_interceptors) content::URLRequestInterceptorScopedVector request_interceptors)
: settings_(settings), : settings_(settings),
io_loop_(io_loop), io_task_runner_(std::move(io_task_runner)),
file_loop_(file_loop), file_task_runner_(std::move(file_task_runner)),
proxy_config_service_(std::move(proxy_config_service)), proxy_config_service_(std::move(proxy_config_service)),
request_interceptors_(std::move(request_interceptors)) { request_interceptors_(std::move(request_interceptors)) {
// Must first be created on the UI thread. // 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 // 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 // cookie store, if any, will be automatically flushed and closed when no
// longer referenced. // longer referenced.
scoped_refptr<net::CookieMonster> cookie_monster = scoped_ptr<net::CookieMonster> cookie_monster(
new net::CookieMonster(persistent_store.get(), NULL); new net::CookieMonster(persistent_store.get(), NULL));
storage_->set_cookie_store(cookie_monster.get());
if (persistent_store.get() && persist_session_cookies) if (persistent_store.get() && persist_session_cookies)
cookie_monster->SetPersistSessionCookies(true); cookie_monster->SetPersistSessionCookies(true);
cookie_store_path_ = path; cookie_store_path_ = path;
@ -344,6 +343,8 @@ void CefURLRequestContextGetterImpl::SetCookieStoragePath(
// Restore the previously supported schemes. // Restore the previously supported schemes.
CefCookieManagerImpl::SetCookieMonsterSchemes(cookie_monster.get(), CefCookieManagerImpl::SetCookieMonsterSchemes(cookie_monster.get(),
cookie_supported_schemes_); cookie_supported_schemes_);
storage_->set_cookie_store(std::move(cookie_monster));
} }
void CefURLRequestContextGetterImpl::SetCookieSupportedSchemes( void CefURLRequestContextGetterImpl::SetCookieSupportedSchemes(
@ -351,7 +352,8 @@ void CefURLRequestContextGetterImpl::SetCookieSupportedSchemes(
CEF_REQUIRE_IOT(); CEF_REQUIRE_IOT();
cookie_supported_schemes_ = schemes; cookie_supported_schemes_ = schemes;
CefCookieManagerImpl::SetCookieMonsterSchemes(GetCookieMonster(), CefCookieManagerImpl::SetCookieMonsterSchemes(
static_cast<net::CookieMonster*>(GetExistingCookieStore()),
cookie_supported_schemes_); cookie_supported_schemes_);
} }
@ -365,9 +367,14 @@ void CefURLRequestContextGetterImpl::AddHandler(
handler_list_.push_back(handler); handler_list_.push_back(handler);
} }
net::CookieMonster* CefURLRequestContextGetterImpl::GetCookieMonster() const { net::CookieStore*
CefURLRequestContextGetterImpl::GetExistingCookieStore() const {
CEF_REQUIRE_IOT(); 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() { void CefURLRequestContextGetterImpl::CreateProxyConfigService() {
@ -376,5 +383,5 @@ void CefURLRequestContextGetterImpl::CreateProxyConfigService() {
proxy_config_service_ = proxy_config_service_ =
net::ProxyService::CreateSystemProxyConfigService( net::ProxyService::CreateSystemProxyConfigService(
io_loop_->task_runner(), file_loop_->task_runner()); io_task_runner_, file_task_runner_);
} }

View File

@ -46,8 +46,8 @@ class CefURLRequestContextGetterImpl : public CefURLRequestContextGetter {
CefURLRequestContextGetterImpl( CefURLRequestContextGetterImpl(
const CefRequestContextSettings& settings, const CefRequestContextSettings& settings,
PrefService* pref_service, PrefService* pref_service,
base::MessageLoop* io_loop, scoped_refptr<base::SingleThreadTaskRunner> io_task_runner,
base::MessageLoop* file_loop, scoped_refptr<base::SingleThreadTaskRunner> file_task_runner,
content::ProtocolHandlerMap* protocol_handlers, content::ProtocolHandlerMap* protocol_handlers,
scoped_ptr<net::ProxyConfigService> proxy_config_service, scoped_ptr<net::ProxyConfigService> proxy_config_service,
content::URLRequestInterceptorScopedVector request_interceptors); content::URLRequestInterceptorScopedVector request_interceptors);
@ -69,7 +69,9 @@ class CefURLRequestContextGetterImpl : public CefURLRequestContextGetter {
// kept alive until the context is destroyed. // kept alive until the context is destroyed.
void AddHandler(CefRefPtr<CefRequestContextHandler> handler); void AddHandler(CefRefPtr<CefRequestContextHandler> 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 { CefURLRequestManager* request_manager() const {
return url_request_manager_.get(); return url_request_manager_.get();
@ -80,8 +82,8 @@ class CefURLRequestContextGetterImpl : public CefURLRequestContextGetter {
const CefRequestContextSettings settings_; const CefRequestContextSettings settings_;
base::MessageLoop* io_loop_; scoped_refptr<base::SingleThreadTaskRunner> io_task_runner_;
base::MessageLoop* file_loop_; scoped_refptr<base::SingleThreadTaskRunner> file_task_runner_;
#if defined(OS_POSIX) && !defined(OS_ANDROID) #if defined(OS_POSIX) && !defined(OS_ANDROID)
std::string gsapi_library_name_; std::string gsapi_library_name_;

View File

@ -16,7 +16,7 @@ CefURLRequestContextProxy::CefURLRequestContextProxy(
DCHECK(handler.get()); DCHECK(handler.get());
// Cookie store that proxies to the browser implementation. // 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()); set_cookie_store(cookie_store_proxy_.get());
// All other values refer to the parent request context. // All other values refer to the parent request context.
@ -39,6 +39,4 @@ CefURLRequestContextProxy::CefURLRequestContextProxy(
CefURLRequestContextProxy::~CefURLRequestContextProxy() { CefURLRequestContextProxy::~CefURLRequestContextProxy() {
CEF_REQUIRE_IOT(); CEF_REQUIRE_IOT();
// The CookieStore may outlive this object.
cookie_store_proxy_->Detach();
} }

View File

@ -7,12 +7,12 @@
#pragma once #pragma once
#include "include/cef_request_context_handler.h" #include "include/cef_request_context_handler.h"
#include "libcef/browser/net/cookie_store_proxy.h"
#include "libcef/browser/net/url_request_context.h" #include "libcef/browser/net/url_request_context.h"
#include "base/memory/scoped_ptr.h" #include "base/memory/scoped_ptr.h"
class CefBrowserHostImpl; class CefBrowserHostImpl;
class CefCookieStoreProxy;
class CefURLRequestContextImpl; class CefURLRequestContextImpl;
// URLRequestContext implementation for a particular CefRequestContext. Life // URLRequestContext implementation for a particular CefRequestContext. Life
@ -28,7 +28,7 @@ class CefURLRequestContextProxy : public CefURLRequestContext {
~CefURLRequestContextProxy() override; ~CefURLRequestContextProxy() override;
private: private:
scoped_refptr<CefCookieStoreProxy> cookie_store_proxy_; scoped_ptr<CefCookieStoreProxy> cookie_store_proxy_;
DISALLOW_COPY_AND_ASSIGN(CefURLRequestContextProxy); DISALLOW_COPY_AND_ASSIGN(CefURLRequestContextProxy);
}; };

View File

@ -5,6 +5,7 @@
#include "libcef/browser/osr/render_widget_host_view_osr.h" #include "libcef/browser/osr/render_widget_host_view_osr.h"
#include <algorithm>
#include <limits> #include <limits>
#include <utility> #include <utility>
@ -267,7 +268,8 @@ bool CefRenderWidgetHostViewOSR::GetLineBreakIndex(
// assume the line breaking as the next character's y offset is larger than // 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 // a threshold. Currently the threshold is determined as minimum y offset plus
// 75% of maximum height. // 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<size_t>(range.end()));
int max_height = 0; int max_height = 0;
int min_y_offset = std::numeric_limits<int32_t>::max(); int min_y_offset = std::numeric_limits<int32_t>::max();
for (size_t idx = range.start(); idx < loop_end_idx; ++idx) { for (size_t idx = range.start(); idx < loop_end_idx; ++idx) {

View File

@ -77,7 +77,6 @@ void CefPermissionContext::RequestPermission(
content::WebContents* web_contents, content::WebContents* web_contents,
const PermissionRequestID& id, const PermissionRequestID& id,
const GURL& requesting_frame, const GURL& requesting_frame,
bool user_gesture,
const BrowserPermissionCallback& callback) { const BrowserPermissionCallback& callback) {
DCHECK_CURRENTLY_ON(content::BrowserThread::UI); DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
@ -86,7 +85,6 @@ void CefPermissionContext::RequestPermission(
id, id,
requesting_frame.GetOrigin(), requesting_frame.GetOrigin(),
web_contents->GetLastCommittedURL().GetOrigin(), web_contents->GetLastCommittedURL().GetOrigin(),
user_gesture,
callback); callback);
} }
@ -144,7 +142,6 @@ void CefPermissionContext::DecidePermission(
const PermissionRequestID& id, const PermissionRequestID& id,
const GURL& requesting_origin, const GURL& requesting_origin,
const GURL& embedding_origin, const GURL& embedding_origin,
bool user_gesture,
const BrowserPermissionCallback& callback) { const BrowserPermissionCallback& callback) {
DCHECK_CURRENTLY_ON(content::BrowserThread::UI); DCHECK_CURRENTLY_ON(content::BrowserThread::UI);

View File

@ -37,7 +37,6 @@ class CefPermissionContext {
content::WebContents* web_contents, content::WebContents* web_contents,
const PermissionRequestID& id, const PermissionRequestID& id,
const GURL& requesting_frame, const GURL& requesting_frame,
bool user_gesture,
const BrowserPermissionCallback& callback); const BrowserPermissionCallback& callback);
// Withdraw an existing permission request, no op if the permission request // Withdraw an existing permission request, no op if the permission request
@ -65,7 +64,6 @@ class CefPermissionContext {
const PermissionRequestID& id, const PermissionRequestID& id,
const GURL& requesting_origin, const GURL& requesting_origin,
const GURL& embedding_origin, const GURL& embedding_origin,
bool user_gesture,
const BrowserPermissionCallback& callback); const BrowserPermissionCallback& callback);
void QueryPermission(content::PermissionType permission, void QueryPermission(content::PermissionType permission,

View File

@ -175,13 +175,11 @@ int CefPermissionManager::RequestPermission(
PermissionType permission, PermissionType permission,
content::RenderFrameHost* render_frame_host, content::RenderFrameHost* render_frame_host,
const GURL& requesting_origin, const GURL& requesting_origin,
bool user_gesture,
const base::Callback<void(PermissionStatus)>& callback) { const base::Callback<void(PermissionStatus)>& callback) {
return RequestPermissions( return RequestPermissions(
std::vector<PermissionType>(1, permission), std::vector<PermissionType>(1, permission),
render_frame_host, render_frame_host,
requesting_origin, requesting_origin,
user_gesture,
base::Bind(&PermissionRequestResponseCallbackWrapper, callback)); base::Bind(&PermissionRequestResponseCallbackWrapper, callback));
} }
@ -189,7 +187,6 @@ int CefPermissionManager::RequestPermissions(
const std::vector<PermissionType>& permissions, const std::vector<PermissionType>& permissions,
content::RenderFrameHost* render_frame_host, content::RenderFrameHost* render_frame_host,
const GURL& requesting_origin, const GURL& requesting_origin,
bool user_gesture,
const base::Callback<void( const base::Callback<void(
const std::vector<PermissionStatus>&)>& callback) { const std::vector<PermissionStatus>&)>& callback) {
if (permissions.empty()) { if (permissions.empty()) {
@ -218,7 +215,7 @@ int CefPermissionManager::RequestPermissions(
} }
context_.RequestPermission( context_.RequestPermission(
permission, web_contents, request, requesting_origin, user_gesture, permission, web_contents, request, requesting_origin,
base::Bind(&ContentSettingToPermissionStatusCallbackWrapper, base::Bind(&ContentSettingToPermissionStatusCallbackWrapper,
base::Bind( base::Bind(
&CefPermissionManager::OnPermissionsRequestResponseStatus, &CefPermissionManager::OnPermissionsRequestResponseStatus,

View File

@ -36,13 +36,11 @@ class CefPermissionManager : public KeyedService,
content::PermissionType permission, content::PermissionType permission,
content::RenderFrameHost* render_frame_host, content::RenderFrameHost* render_frame_host,
const GURL& requesting_origin, const GURL& requesting_origin,
bool user_gesture,
const base::Callback<void(content::PermissionStatus)>& callback) override; const base::Callback<void(content::PermissionStatus)>& callback) override;
int RequestPermissions( int RequestPermissions(
const std::vector<content::PermissionType>& permissions, const std::vector<content::PermissionType>& permissions,
content::RenderFrameHost* render_frame_host, content::RenderFrameHost* render_frame_host,
const GURL& requesting_origin, const GURL& requesting_origin,
bool user_gesture,
const base::Callback<void( const base::Callback<void(
const std::vector<content::PermissionStatus>&)>& callback) override; const std::vector<content::PermissionStatus>&)>& callback) override;
void CancelPermissionRequest(int request_id) override; void CancelPermissionRequest(int request_id) override;

View File

@ -36,6 +36,8 @@ ContentSettingsType PermissionTypeToContentSetting(PermissionType permission) {
return CONTENT_SETTINGS_TYPE_MEDIASTREAM_MIC; return CONTENT_SETTINGS_TYPE_MEDIASTREAM_MIC;
case PermissionType::VIDEO_CAPTURE: case PermissionType::VIDEO_CAPTURE:
return CONTENT_SETTINGS_TYPE_MEDIASTREAM_CAMERA; return CONTENT_SETTINGS_TYPE_MEDIASTREAM_CAMERA;
case PermissionType::BACKGROUND_SYNC:
return CONTENT_SETTINGS_TYPE_BACKGROUND_SYNC;
case PermissionType::NUM: case PermissionType::NUM:
// This will hit the NOTREACHED below. // This will hit the NOTREACHED below.
break; break;

View File

@ -46,4 +46,31 @@
content::BrowserThread::PostDelayedTask(id, FROM_HERE, task, \ content::BrowserThread::PostDelayedTask(id, FROM_HERE, task, \
base::TimeDelta::FromMilliseconds(delay_ms)) 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_ #endif // CEF_LIBCEF_BROWSER_THREAD_UTIL_H_

View File

@ -218,12 +218,11 @@ void AddWidevineCdmFromCommandLine(
kWidevineCdmPluginMimeTypeDescription); kWidevineCdmPluginMimeTypeDescription);
// Add the supported codecs as if they came from the component manifest. // 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<std::string> codecs; std::vector<std::string> codecs;
codecs.push_back(kCdmSupportedCodecVorbis);
codecs.push_back(kCdmSupportedCodecVp8); codecs.push_back(kCdmSupportedCodecVp8);
codecs.push_back(kCdmSupportedCodecVp9); codecs.push_back(kCdmSupportedCodecVp9);
#if defined(USE_PROPRIETARY_CODECS) #if defined(USE_PROPRIETARY_CODECS)
codecs.push_back(kCdmSupportedCodecAac);
codecs.push_back(kCdmSupportedCodecAvc1); codecs.push_back(kCdmSupportedCodecAvc1);
#endif // defined(USE_PROPRIETARY_CODECS) #endif // defined(USE_PROPRIETARY_CODECS)
std::string codec_string = base::JoinString( std::string codec_string = base::JoinString(
@ -279,6 +278,7 @@ void CefContentClient::AddPepperPlugins(
void CefContentClient::AddAdditionalSchemes( void CefContentClient::AddAdditionalSchemes(
std::vector<url::SchemeWithType>* standard_schemes, std::vector<url::SchemeWithType>* standard_schemes,
std::vector<url::SchemeWithType>* referrer_schemes,
std::vector<std::string>* savable_schemes) { std::vector<std::string>* savable_schemes) {
DCHECK(!scheme_info_list_locked_); DCHECK(!scheme_info_list_locked_);
@ -463,8 +463,3 @@ bool CefContentClient::GetLocalizedString(int message_id,
return (pack_loading_disabled_ || !value->empty()); return (pack_loading_disabled_ || !value->empty());
} }
scoped_ptr<gfx::Font> CefContentClient::GetFont(
ui::ResourceBundle::FontStyle style) {
return scoped_ptr<gfx::Font>();
}

View File

@ -35,6 +35,7 @@ class CefContentClient : public content::ContentClient,
std::vector<content::PepperPluginInfo>* plugins) override; std::vector<content::PepperPluginInfo>* plugins) override;
void AddAdditionalSchemes( void AddAdditionalSchemes(
std::vector<url::SchemeWithType>* standard_schemes, std::vector<url::SchemeWithType>* standard_schemes,
std::vector<url::SchemeWithType>* referrer_schemes,
std::vector<std::string>* savable_schemes) override; std::vector<std::string>* savable_schemes) override;
std::string GetUserAgent() const override; std::string GetUserAgent() const override;
base::string16 GetLocalizedString(int message_id) const override; base::string16 GetLocalizedString(int message_id) const override;
@ -101,8 +102,6 @@ class CefContentClient : public content::ContentClient,
base::StringPiece* value) override; base::StringPiece* value) override;
bool GetLocalizedString(int message_id, bool GetLocalizedString(int message_id,
base::string16* value) override; base::string16* value) override;
scoped_ptr<gfx::Font> GetFont(
ui::ResourceBundle::FontStyle style) override;
CefRefPtr<CefApp> application_; CefRefPtr<CefApp> application_;
bool pack_loading_disabled_; bool pack_loading_disabled_;

View File

@ -8,7 +8,6 @@
#include "libcef/common/drag_data_impl.h" #include "libcef/common/drag_data_impl.h"
#include "base/files/file_path.h" #include "base/files/file_path.h"
#include "net/base/filename_util.h" #include "net/base/filename_util.h"
#include "net/base/net_util.h"
#define CHECK_READONLY_RETURN_VOID() \ #define CHECK_READONLY_RETURN_VOID() \
if (read_only_) { \ if (read_only_) { \

View File

@ -540,7 +540,7 @@ void CefRequestImpl::Set(const blink::WebURLRequest& request) {
first_party_for_cookies_ = request.firstPartyForCookies().string(); first_party_for_cookies_ = request.firstPartyForCookies().string();
if (request.cachePolicy() == blink::WebURLRequest::ReloadIgnoringCacheData) if (request.getCachePolicy() == blink::WebURLRequest::ReloadIgnoringCacheData)
flags_ |= UR_FLAG_SKIP_CACHE; flags_ |= UR_FLAG_SKIP_CACHE;
if (request.allowStoredCredentials()) if (request.allowStoredCredentials())
flags_ |= UR_FLAG_ALLOW_CACHED_CREDENTIALS; flags_ |= UR_FLAG_ALLOW_CACHED_CREDENTIALS;

View File

@ -33,6 +33,7 @@
#include "third_party/WebKit/public/web/WebDataSource.h" #include "third_party/WebKit/public/web/WebDataSource.h"
#include "third_party/WebKit/public/web/WebDocument.h" #include "third_party/WebKit/public/web/WebDocument.h"
#include "third_party/WebKit/public/web/WebFrame.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/WebLocalFrame.h"
#include "third_party/WebKit/public/web/WebNode.h" #include "third_party/WebKit/public/web/WebNode.h"
#include "third_party/WebKit/public/web/WebScriptSource.h" #include "third_party/WebKit/public/web/WebScriptSource.h"
@ -595,8 +596,11 @@ void CefBrowserImpl::OnRequest(const Cef_Request_Params& params) {
DCHECK(!command.empty()); DCHECK(!command.empty());
if (base::LowerCaseEqualsASCII(command, "getsource")) { if (base::LowerCaseEqualsASCII(command, "getsource")) {
response = web_frame->contentAsMarkup().utf8(); if (web_frame->isWebLocalFrame()) {
response = blink::WebFrameContentDumper::dumpAsMarkup(
web_frame->toWebLocalFrame()).utf8();
success = true; success = true;
}
} else if (base::LowerCaseEqualsASCII(command, "gettext")) { } else if (base::LowerCaseEqualsASCII(command, "gettext")) {
response = webkit_glue::DumpDocumentText(web_frame); response = webkit_glue::DumpDocumentText(web_frame);
success = true; success = true;

View File

@ -7,6 +7,14 @@
#include <utility> #include <utility>
#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/browser/context.h"
#include "libcef/common/cef_messages.h" #include "libcef/common/cef_messages.h"
#include "libcef/common/cef_switches.h" #include "libcef/common/cef_switches.h"
@ -497,7 +505,7 @@ bool CefContentRendererClient::OverrideCreatePlugin(
GURL url(params.url); GURL url(params.url);
CefViewHostMsg_GetPluginInfo_Output output; 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->Send(new CefViewHostMsg_GetPluginInfo(
render_frame->GetRoutingID(), url, blink::WebStringToGURL(top_origin), render_frame->GetRoutingID(), url, blink::WebStringToGURL(top_origin),
orig_mime_type, &output)); orig_mime_type, &output));
@ -888,3 +896,9 @@ void CefContentRendererClient::RunSingleProcessCleanupOnUIThread() {
if (!CefContext::Get()->settings().multi_threaded_message_loop) if (!CefContext::Get()->settings().multi_threaded_message_loop)
delete host; delete host;
} }
// Enable deprecation warnings for MSVC. See http://crbug.com/585142.
#if defined(OS_WIN)
#pragma warning(pop)
#endif

View File

@ -82,7 +82,8 @@ bool CrossesExtensionExtents(blink::WebLocalFrame* frame,
// in an extension process (other than the Chrome Web Store), we want to // in an extension process (other than the Chrome Web Store), we want to
// keep it in process to allow the opener to script it. // keep it in process to allow the opener to script it.
blink::WebDocument opener_document = opener_frame->document(); 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() && bool opener_is_extension_url = !opener_origin.isUnique() &&
extension_registry->GetExtensionOrAppByURL( extension_registry->GetExtensionOrAppByURL(
opener_document.url()) != nullptr; opener_document.url()) != nullptr;

View File

@ -4,6 +4,14 @@
#include "libcef/renderer/frame_impl.h" #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/cef_messages.h"
#include "libcef/common/net/http_header_utils.h" #include "libcef/common/net/http_header_utils.h"
#include "libcef/common/request_impl.h" #include "libcef/common/request_impl.h"
@ -18,6 +26,7 @@
#include "third_party/WebKit/public/platform/WebURL.h" #include "third_party/WebKit/public/platform/WebURL.h"
#include "third_party/WebKit/public/web/WebDocument.h" #include "third_party/WebKit/public/web/WebDocument.h"
#include "third_party/WebKit/public/web/WebFrame.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/WebKit.h"
#include "third_party/WebKit/public/web/WebView.h" #include "third_party/WebKit/public/web/WebView.h"
#include "third_party/WebKit/public/web/WebScriptSource.h" #include "third_party/WebKit/public/web/WebScriptSource.h"
@ -88,9 +97,10 @@ void CefFrameImpl::ViewSource() {
void CefFrameImpl::GetSource(CefRefPtr<CefStringVisitor> visitor) { void CefFrameImpl::GetSource(CefRefPtr<CefStringVisitor> visitor) {
CEF_REQUIRE_RT_RETURN_VOID(); CEF_REQUIRE_RT_RETURN_VOID();
if (frame_ && frame_->isWebLocalFrame()) {
if (frame_) { const CefString& content =
CefString content = std::string(frame_->contentAsMarkup().utf8()); std::string(blink::WebFrameContentDumper::dumpAsMarkup(
frame_->toWebLocalFrame()).utf8());
visitor->Visit(content); visitor->Visit(content);
} }
} }
@ -99,7 +109,7 @@ void CefFrameImpl::GetText(CefRefPtr<CefStringVisitor> visitor) {
CEF_REQUIRE_RT_RETURN_VOID(); CEF_REQUIRE_RT_RETURN_VOID();
if (frame_) { if (frame_) {
CefString content = webkit_glue::DumpDocumentText(frame_); const CefString& content = webkit_glue::DumpDocumentText(frame_);
visitor->Visit(content); visitor->Visit(content);
} }
} }
@ -270,3 +280,9 @@ void CefFrameImpl::Detach() {
browser_ = NULL; browser_ = NULL;
frame_ = NULL; frame_ = NULL;
} }
// Enable deprecation warnings for MSVC. See http://crbug.com/585142.
#if defined(OS_WIN)
#pragma warning(pop)
#endif

View File

@ -119,7 +119,7 @@ static void AddPepperBasedWidevine(
} }
cdm::AddWidevineWithCodecs( cdm::AddWidevineWithCodecs(
cdm::WIDEVINE, supported_codecs, supported_codecs,
media::EmeRobustness::SW_SECURE_CRYPTO, // Maximum audio robustness. media::EmeRobustness::SW_SECURE_CRYPTO, // Maximum audio robustness.
media::EmeRobustness::SW_SECURE_DECODE, // Maximum video robustness. media::EmeRobustness::SW_SECURE_DECODE, // Maximum video robustness.
media::EmeSessionTypeSupport::NOT_SUPPORTED, // persistent-license. media::EmeSessionTypeSupport::NOT_SUPPORTED, // persistent-license.

View File

@ -17,6 +17,7 @@
#include "chrome/grit/generated_resources.h" #include "chrome/grit/generated_resources.h"
#include "chrome/renderer/custom_menu_commands.h" #include "chrome/renderer/custom_menu_commands.h"
#include "components/content_settings/content/common/content_settings_messages.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/content_switches.h"
#include "content/public/common/context_menu_params.h" #include "content/public/common/context_menu_params.h"
#include "content/public/renderer/render_frame.h" #include "content/public/renderer/render_frame.h"
@ -178,7 +179,8 @@ void CefPluginPlaceholder::PluginListChanged() {
CefViewHostMsg_GetPluginInfo_Output output; CefViewHostMsg_GetPluginInfo_Output output;
std::string mime_type(GetPluginParams().mimeType.utf8()); 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( render_frame()->Send(
new CefViewHostMsg_GetPluginInfo(routing_id(), new CefViewHostMsg_GetPluginInfo(routing_id(),
GURL(GetPluginParams().url), GURL(GetPluginParams().url),

View File

@ -7,10 +7,14 @@
#include "config.h" #include "config.h"
MSVC_PUSH_WARNING_LEVEL(0); MSVC_PUSH_WARNING_LEVEL(0);
#include "bindings/core/v8/V8RecursionScope.h" #include "platform/ScriptForbiddenScope.h"
MSVC_POP_WARNING(); 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" #include "libcef/renderer/render_frame_observer.h"
@ -53,7 +57,8 @@ void CefRenderFrameObserver::DidCreateScriptContext(
v8::Isolate* isolate = blink::mainThreadIsolate(); v8::Isolate* isolate = blink::mainThreadIsolate();
v8::HandleScope handle_scope(isolate); v8::HandleScope handle_scope(isolate);
v8::Context::Scope scope(context); v8::Context::Scope scope(context);
blink::V8RecursionScope recursion_scope(isolate); v8::MicrotasksScope microtasks_scope(isolate,
v8::MicrotasksScope::kRunMicrotasks);
CefRefPtr<CefV8Context> contextPtr(new CefV8ContextImpl(isolate, context)); CefRefPtr<CefV8Context> contextPtr(new CefV8ContextImpl(isolate, context));
@ -94,3 +99,9 @@ void CefRenderFrameObserver::WillReleaseScriptContext(
CefV8ReleaseContext(context); CefV8ReleaseContext(context);
} }
// Enable deprecation warnings for MSVC. See http://crbug.com/585142.
#if defined(OS_WIN)
#pragma warning(pop)
#endif

View File

@ -20,8 +20,6 @@ MSVC_PUSH_WARNING_LEVEL(0);
#include "bindings/core/v8/ScriptController.h" #include "bindings/core/v8/ScriptController.h"
#include "bindings/core/v8/V8Binding.h" #include "bindings/core/v8/V8Binding.h"
MSVC_POP_WARNING(); MSVC_POP_WARNING();
#undef FROM_HERE
#undef LOG
// Enable deprecation warnings for MSVC. See http://crbug.com/585142. // Enable deprecation warnings for MSVC. See http://crbug.com/585142.
#if defined(OS_WIN) #if defined(OS_WIN)
@ -945,11 +943,8 @@ bool CefV8Context::InContext() {
CefV8ContextImpl::CefV8ContextImpl(v8::Isolate* isolate, CefV8ContextImpl::CefV8ContextImpl(v8::Isolate* isolate,
v8::Local<v8::Context> context) v8::Local<v8::Context> context)
: handle_(new Handle(isolate, context, context)) : handle_(new Handle(isolate, context, context)),
#ifndef NDEBUG enter_count_(0) {
, enter_count_(0)
#endif
{ // NOLINT(whitespace/braces)
} }
CefV8ContextImpl::~CefV8ContextImpl() { CefV8ContextImpl::~CefV8ContextImpl() {
@ -1019,11 +1014,15 @@ bool CefV8ContextImpl::Enter() {
v8::Isolate* isolate = handle_->isolate(); v8::Isolate* isolate = handle_->isolate();
v8::HandleScope handle_scope(isolate); v8::HandleScope handle_scope(isolate);
blink::V8PerIsolateData::from(isolate)->incrementRecursionLevel(); if (!microtasks_scope_) {
handle_->GetNewV8Handle()->Enter(); // Increment the MicrotasksScope recursion level.
#ifndef NDEBUG microtasks_scope_.reset(
new v8::MicrotasksScope(isolate, v8::MicrotasksScope::kRunMicrotasks));
}
++enter_count_; ++enter_count_;
#endif handle_->GetNewV8Handle()->Enter();
return true; return true;
} }
@ -1033,15 +1032,21 @@ bool CefV8ContextImpl::Exit() {
if (blink::ScriptForbiddenScope::isScriptForbidden()) if (blink::ScriptForbiddenScope::isScriptForbidden())
return false; 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()); v8::HandleScope handle_scope(handle_->isolate());
DLOG_ASSERT(enter_count_ > 0);
handle_->GetNewV8Handle()->Exit(); handle_->GetNewV8Handle()->Exit();
blink::V8PerIsolateData::from(isolate)->decrementRecursionLevel();
#ifndef NDEBUG if (--enter_count_ == 0) {
--enter_count_; // Decrement the MicrotasksScope recursion level.
#endif microtasks_scope_.reset(nullptr);
}
return true; return true;
} }

View File

@ -188,14 +188,12 @@ class CefV8ContextImpl : public CefV8Context {
v8::Local<v8::Context> GetV8Context(); v8::Local<v8::Context> GetV8Context();
blink::WebFrame* GetWebFrame(); blink::WebFrame* GetWebFrame();
protected: private:
typedef CefV8Handle<v8::Context> Handle; typedef CefV8Handle<v8::Context> Handle;
scoped_refptr<Handle> handle_; scoped_refptr<Handle> handle_;
#ifndef NDEBUG
// Used in debug builds to catch missing Exits in destructor.
int enter_count_; int enter_count_;
#endif scoped_ptr<v8::MicrotasksScope> microtasks_scope_;
IMPLEMENT_REFCOUNTING(CefV8ContextImpl); IMPLEMENT_REFCOUNTING(CefV8ContextImpl);
DISALLOW_COPY_AND_ASSIGN(CefV8ContextImpl); DISALLOW_COPY_AND_ASSIGN(CefV8ContextImpl);
@ -279,7 +277,7 @@ class CefV8ValueImpl : public CefV8Value {
CefRefPtr<CefV8Value> object, CefRefPtr<CefV8Value> object,
const CefV8ValueList& arguments) override; const CefV8ValueList& arguments) override;
protected: private:
// Test for and record any exception. // Test for and record any exception.
bool HasCaught(v8::Local<v8::Context> context, v8::TryCatch& try_catch); bool HasCaught(v8::Local<v8::Context> context, v8::TryCatch& try_catch);
@ -299,7 +297,7 @@ class CefV8ValueImpl : public CefV8Value {
void SetWeakIfNecessary(); void SetWeakIfNecessary();
protected: private:
~Handle() override; ~Handle() override;
private: private:
@ -366,7 +364,7 @@ class CefV8StackTraceImpl : public CefV8StackTrace {
int GetFrameCount() override; int GetFrameCount() override;
CefRefPtr<CefV8StackFrame> GetFrame(int index) override; CefRefPtr<CefV8StackFrame> GetFrame(int index) override;
protected: private:
std::vector<CefRefPtr<CefV8StackFrame> > frames_; std::vector<CefRefPtr<CefV8StackFrame> > frames_;
IMPLEMENT_REFCOUNTING(CefV8StackTraceImpl); IMPLEMENT_REFCOUNTING(CefV8StackTraceImpl);
@ -388,7 +386,7 @@ class CefV8StackFrameImpl : public CefV8StackFrame {
bool IsEval() override; bool IsEval() override;
bool IsConstructor() override; bool IsConstructor() override;
protected: private:
CefString script_name_; CefString script_name_;
CefString script_name_or_source_url_; CefString script_name_or_source_url_;
CefString function_name_; CefString function_name_;

View File

@ -83,7 +83,7 @@ std::string DumpDocumentText(blink::WebFrame* frame) {
cef_dom_node_type_t GetNodeType(const blink::WebNode& node) { cef_dom_node_type_t GetNodeType(const blink::WebNode& node) {
const blink::Node* web_node = node.constUnwrap<blink::Node>(); const blink::Node* web_node = node.constUnwrap<blink::Node>();
switch (web_node->nodeType()) { switch (web_node->getNodeType()) {
case blink::Node::ELEMENT_NODE: case blink::Node::ELEMENT_NODE:
return DOM_NODE_TYPE_ELEMENT; return DOM_NODE_TYPE_ELEMENT;
case blink::Node::ATTRIBUTE_NODE: case blink::Node::ATTRIBUTE_NODE:

View File

@ -361,9 +361,6 @@ need to be translated for each locale.-->
<message name="IDS_PLUGIN_HIDE" desc="The tooltip for hiding a blocked plugin, displayed in the click to play UI."> <message name="IDS_PLUGIN_HIDE" desc="The tooltip for hiding a blocked plugin, displayed in the click to play UI.">
Hide this plugin Hide this plugin
</message> </message>
<message name="IDS_PLUGIN_NOT_SUPPORTED" desc="The placeholder text for an unsupported plugin.">
This plugin is not supported.
</message>
<if expr="is_macosx"> <if expr="is_macosx">
<message name="IDS_PLUGIN_BLOCKED" desc="The placeholder text for a blocked plugin."> <message name="IDS_PLUGIN_BLOCKED" desc="The placeholder text for a blocked plugin.">
Control-click to play <ph name="PLUGIN_NAME">$1<ex>Flash</ex></ph>. Control-click to play <ph name="PLUGIN_NAME">$1<ex>Flash</ex></ph>.
@ -404,14 +401,6 @@ need to be translated for each locale.-->
</if> </if>
<!-- Preferences. --> <!-- Preferences. -->
<!-- The default value for HTTP Accept-Language header. -->
<message name="IDS_ACCEPT_LANGUAGES" use_name_for_id="true">
en-US,en
</message>
<!-- The default value for |WebPreference::default_encoding|. -->
<message name="IDS_DEFAULT_ENCODING" use_name_for_id="true">
windows-1252
</message>
<!-- The default value for |WebPreference::uses_universal_detector|. --> <!-- The default value for |WebPreference::uses_universal_detector|. -->
<message name="IDS_USES_UNIVERSAL_DETECTOR" use_name_for_id="true"> <message name="IDS_USES_UNIVERSAL_DETECTOR" use_name_for_id="true">
false false

View File

@ -30,6 +30,7 @@ endmacro()
'includes_win:WINDOWS', 'includes_win:WINDOWS',
'includes_mac:MACOSX', 'includes_mac:MACOSX',
'includes_linux:LINUX', 'includes_linux:LINUX',
'libcef_dll_wrapper_sources_base',
'libcef_dll_wrapper_sources_common', 'libcef_dll_wrapper_sources_common',
'autogen_client_side', 'autogen_client_side',
], ],

View File

@ -95,7 +95,7 @@ class CefMessageRouterBrowserSideImpl : public CefMessageRouterBrowserSide {
if (router_) { if (router_) {
CefPostTask(TID_UI, CefPostTask(TID_UI,
base::Bind(&CefMessageRouterBrowserSideImpl::OnCallbackSuccess, base::Bind(&CefMessageRouterBrowserSideImpl::OnCallbackSuccess,
router_, browser_id_, query_id_, response)); router_.get(), browser_id_, query_id_, response));
if (!persistent_) { if (!persistent_) {
// Non-persistent callbacks are only good for a single use. // Non-persistent callbacks are only good for a single use.
@ -117,7 +117,7 @@ class CefMessageRouterBrowserSideImpl : public CefMessageRouterBrowserSide {
if (router_) { if (router_) {
CefPostTask(TID_UI, CefPostTask(TID_UI,
base::Bind(&CefMessageRouterBrowserSideImpl::OnCallbackFailure, base::Bind(&CefMessageRouterBrowserSideImpl::OnCallbackFailure,
router_, browser_id_, query_id_, error_code, router_.get(), browser_id_, query_id_, error_code,
error_message)); error_message));
// Failure always invalidates the callback. // Failure always invalidates the callback.

View File

@ -379,7 +379,7 @@ void CefResourceManager::Request::Stop() {
} }
CefResourceManager::Request::Request(scoped_ptr<RequestState> state) CefResourceManager::Request::Request(scoped_ptr<RequestState> state)
: state_(state.Pass()), : state_(MOVE_SCOPED_PTR(state)),
params_(state_->params_) { params_(state_->params_) {
CEF_REQUIRE_IO_THREAD(); CEF_REQUIRE_IO_THREAD();
@ -401,7 +401,7 @@ scoped_ptr<CefResourceManager::RequestState>
CEF_REQUIRE_IO_THREAD(); CEF_REQUIRE_IO_THREAD();
Provider* provider = (*state_->current_entry_pos_)->provider_.get(); Provider* provider = (*state_->current_entry_pos_)->provider_.get();
if (!provider->OnRequest(this)) if (!provider->OnRequest(this))
return state_.Pass(); return MOVE_SCOPED_PTR(state_);
return scoped_ptr<RequestState>(); return scoped_ptr<RequestState>();
} }
@ -418,7 +418,7 @@ void CefResourceManager::Request::ContinueOnIOThread(
// The manager may already have been deleted. // The manager may already have been deleted.
base::WeakPtr<CefResourceManager> manager = state->manager_; base::WeakPtr<CefResourceManager> manager = state->manager_;
if (manager) if (manager)
manager->ContinueRequest(state.Pass(), handler); manager->ContinueRequest(MOVE_SCOPED_PTR(state), handler);
} }
// static // static
@ -428,7 +428,7 @@ void CefResourceManager::Request::StopOnIOThread(
// The manager may already have been deleted. // The manager may already have been deleted.
base::WeakPtr<CefResourceManager> manager = state->manager_; base::WeakPtr<CefResourceManager> manager = state->manager_;
if (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; state->current_entry_pos_ = current_entry_pos;
// If the request is potentially handled we need to continue asynchronously. // 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<CefResourceHandler> CefResourceManager::GetResourceHandler( CefRefPtr<CefResourceHandler> CefResourceManager::GetResourceHandler(
@ -643,7 +643,7 @@ bool CefResourceManager::SendRequest(scoped_ptr<RequestState> state) {
do { do {
// Should not be on the last provider entry. // Should not be on the last provider entry.
DCHECK(state->current_entry_pos_ != providers_.end()); DCHECK(state->current_entry_pos_ != providers_.end());
scoped_refptr<Request> request = new Request(state.Pass()); scoped_refptr<Request> request = new Request(MOVE_SCOPED_PTR(state));
// Give the provider an opportunity to handle the request. // Give the provider an opportunity to handle the request.
state = request->SendRequest(); state = request->SendRequest();
@ -651,7 +651,7 @@ bool CefResourceManager::SendRequest(scoped_ptr<RequestState> state) {
// The provider will not handle the request. Move to the next provider if // The provider will not handle the request. Move to the next provider if
// any. // any.
if (!IncrementProvider(state.get())) if (!IncrementProvider(state.get()))
StopRequest(state.Pass()); StopRequest(MOVE_SCOPED_PTR(state));
} else { } else {
potentially_handled = true; potentially_handled = true;
} }
@ -669,13 +669,13 @@ void CefResourceManager::ContinueRequest(
// The request has been handled. Associate the request ID with the handler. // The request has been handled. Associate the request ID with the handler.
pending_handlers_.insert( pending_handlers_.insert(
std::make_pair(state->params_.request_->GetIdentifier(), handler)); std::make_pair(state->params_.request_->GetIdentifier(), handler));
StopRequest(state.Pass()); StopRequest(MOVE_SCOPED_PTR(state));
} else { } else {
// Move to the next provider if any. // Move to the next provider if any.
if (IncrementProvider(state.get())) if (IncrementProvider(state.get()))
SendRequest(state.Pass()); SendRequest(MOVE_SCOPED_PTR(state));
else else
StopRequest(state.Pass()); StopRequest(MOVE_SCOPED_PTR(state));
} }
} }

View File

@ -176,8 +176,6 @@ patches = [
# https://bitbucket.org/chromiumembedded/cef/issue/1478 # https://bitbucket.org/chromiumembedded/cef/issue/1478
# Fix printing of PDF documents via PrintToPDF. # Fix printing of PDF documents via PrintToPDF.
# https://bitbucket.org/chromiumembedded/cef/issues/1565 # 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. # Revert ENABLE_PRINT_PREVIEW changes from the following changeset.
# https://codereview.chromium.org/1556463003 # https://codereview.chromium.org/1556463003
'name': 'print_header_footer_1478_1565', 'name': 'print_header_footer_1478_1565',
@ -246,4 +244,10 @@ patches = [
'name': 'net_filter_515', 'name': 'net_filter_515',
'path': '../net/', '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/',
},
] ]

View File

@ -1,8 +1,8 @@
diff --git render_widget_host_view_guest.cc render_widget_host_view_guest.cc 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
+++ 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 { gfx::Size RenderWidgetHostViewGuest::GetPhysicalBackingSize() const {

View File

@ -1,8 +1,8 @@
diff --git browser/browser_plugin/browser_plugin_guest.cc browser/browser_plugin/browser_plugin_guest.cc 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
+++ 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_impl.h"
#include "content/browser/renderer_host/render_widget_host_view_base.h" #include "content/browser/renderer_host/render_widget_host_view_base.h"
#include "content/browser/web_contents/web_contents_impl.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_constants.h"
#include "content/common/browser_plugin/browser_plugin_messages.h" #include "content/common/browser_plugin/browser_plugin_messages.h"
#include "content/common/content_constants_internal.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; guest_window_rect_ = params.view_rect;
if (owner_web_contents_ != owner_web_contents) { if (owner_web_contents_ != owner_web_contents) {
@ -36,7 +36,7 @@ index 1855e5d..4e0cd1d 100644
} }
RendererPreferences* renderer_prefs = RendererPreferences* renderer_prefs =
@@ -792,11 +791,10 @@ void BrowserPluginGuest::OnWillAttachComplete( @@ -754,11 +753,10 @@ void BrowserPluginGuest::OnWillAttachComplete(
->GetWidget() ->GetWidget()
->Init(); ->Init();
GetWebContents()->GetMainFrame()->Init(); GetWebContents()->GetMainFrame()->Init();

View File

@ -1,10 +1,10 @@
diff --git web_contents_impl.cc web_contents_impl.cc 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
+++ web_contents_impl.cc +++ web_contents_impl.cc
@@ -1382,32 +1382,40 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params) { @@ -1391,32 +1391,40 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params) {
main_frame_widget_routing_id); std::string unique_name = params.main_frame_name;
frame_tree_.root()->SetFrameName(params.main_frame_name); frame_tree_.root()->SetFrameName(params.main_frame_name, unique_name);
- WebContentsViewDelegate* delegate = - WebContentsViewDelegate* delegate =
- GetContentClient()->browser()->GetWebContentsViewDelegate(this); - GetContentClient()->browser()->GetWebContentsViewDelegate(this);
@ -62,7 +62,7 @@ index 2af90ae..7580a73 100644
CHECK(render_view_host_delegate_view_); CHECK(render_view_host_delegate_view_);
CHECK(view_.get()); CHECK(view_.get());
@@ -1839,11 +1847,14 @@ void WebContentsImpl::CreateNewWindow( @@ -1852,11 +1860,14 @@ void WebContentsImpl::CreateNewWindow(
static_cast<SessionStorageNamespaceImpl*>(session_storage_namespace); static_cast<SessionStorageNamespaceImpl*>(session_storage_namespace);
CHECK(session_storage_namespace_impl->IsFromContext(dom_storage_context)); CHECK(session_storage_namespace_impl->IsFromContext(dom_storage_context));
@ -78,7 +78,7 @@ index 2af90ae..7580a73 100644
if (route_id != MSG_ROUTING_NONE && if (route_id != MSG_ROUTING_NONE &&
!RenderViewHost::FromID(render_process_id, route_id)) { !RenderViewHost::FromID(render_process_id, route_id)) {
// If the embedder didn't create a WebContents for this route, we need to // 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_process_id = render_process_id;
create_params.opener_render_frame_id = params.opener_render_frame_id; create_params.opener_render_frame_id = params.opener_render_frame_id;
create_params.opener_suppressed = params.opener_suppressed; create_params.opener_suppressed = params.opener_suppressed;

View File

@ -1,5 +1,5 @@
diff --git common.gypi common.gypi diff --git common.gypi common.gypi
index 846dc3a..700284e 100644 index 5f389b2..b8725d5 100644
--- common.gypi --- common.gypi
+++ common.gypi +++ common.gypi
@@ -9,6 +9,9 @@ @@ -9,6 +9,9 @@

View File

@ -1,8 +1,8 @@
diff --git ui/browser.cc ui/browser.cc diff --git ui/browser.cc ui/browser.cc
index 8ceee96..da77140 100644 index 1595e86..e9c7cce 100644
--- ui/browser.cc --- ui/browser.cc
+++ 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 std::string& frame_name,
const GURL& target_url, const GURL& target_url,
const std::string& partition_id, const std::string& partition_id,
@ -14,10 +14,10 @@ index 8ceee96..da77140 100644
// If a BackgroundContents is created, suppress the normal WebContents. // If a BackgroundContents is created, suppress the normal WebContents.
return !MaybeCreateBackgroundContents( return !MaybeCreateBackgroundContents(
diff --git ui/browser.h ui/browser.h diff --git ui/browser.h ui/browser.h
index 37d23b3..37c9ea9 100644 index f9a8392..ce76798 100644
--- ui/browser.h --- ui/browser.h
+++ 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 std::string& frame_name,
const GURL& target_url, const GURL& target_url,
const std::string& partition_id, const std::string& partition_id,

View File

@ -1,8 +1,8 @@
diff --git content/browser/compositor/gpu_process_transport_factory.cc content/browser/compositor/gpu_process_transport_factory.cc 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
+++ 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<cc::SoftwareOutputDevice> scoped_ptr<cc::SoftwareOutputDevice>
GpuProcessTransportFactory::CreateSoftwareOutputDevice( GpuProcessTransportFactory::CreateSoftwareOutputDevice(
ui::Compositor* compositor) { ui::Compositor* compositor) {

View File

@ -1,5 +1,5 @@
diff --git public/renderer/content_renderer_client.cc public/renderer/content_renderer_client.cc 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
+++ public/renderer/content_renderer_client.cc +++ public/renderer/content_renderer_client.cc
@@ -98,7 +98,6 @@ bool ContentRendererClient::AllowPopup() { @@ -98,7 +98,6 @@ bool ContentRendererClient::AllowPopup() {
@ -19,10 +19,10 @@ index 3d0316f..ccd1f58 100644
bool ContentRendererClient::ShouldFork(blink::WebLocalFrame* frame, bool ContentRendererClient::ShouldFork(blink::WebLocalFrame* frame,
const GURL& url, const GURL& url,
diff --git public/renderer/content_renderer_client.h public/renderer/content_renderer_client.h 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
+++ 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. // Returns true if a popup window should be allowed.
virtual bool AllowPopup(); virtual bool AllowPopup();
@ -30,7 +30,7 @@ index 45686b5..18548a0 100644
// TODO(sgurun) This callback is deprecated and will be removed as soon // TODO(sgurun) This callback is deprecated and will be removed as soon
// as android webview completes implementation of a resource throttle based // as android webview completes implementation of a resource throttle based
// shouldoverrideurl implementation. See crbug.com/325351 // 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::WebNavigationType type,
blink::WebNavigationPolicy default_policy, blink::WebNavigationPolicy default_policy,
bool is_redirect); bool is_redirect);
@ -39,10 +39,10 @@ index 45686b5..18548a0 100644
// Returns true if we should fork a new process for the given navigation. // 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 // 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 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
+++ 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_ &&
!pending_navigation_params_->request_params.redirects.empty()); !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 // The handlenavigation API is deprecated and will be removed once
// crbug.com/325351 is resolved. // crbug.com/325351 is resolved.
if (info.urlRequest.url() != GURL(kSwappedOutURL) && if (info.urlRequest.url() != GURL(kSwappedOutURL) &&
@@ -4760,7 +4759,6 @@ WebNavigationPolicy RenderFrameImpl::decidePolicyForNavigation( @@ -4713,7 +4712,6 @@ WebNavigationPolicy RenderFrameImpl::decidePolicyForNavigation(
is_redirect)) { is_redirect)) {
return blink::WebNavigationPolicyIgnore; return blink::WebNavigationPolicyIgnore;
} }

View File

@ -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;

View File

@ -1,5 +1,5 @@
diff --git resource_ids resource_ids diff --git resource_ids resource_ids
index 2943776..6d4b898 100644 index c8dc083..7773a93b 100644
--- resource_ids --- resource_ids
+++ resource_ids +++ resource_ids
@@ -14,6 +14,12 @@ @@ -14,6 +14,12 @@

View File

@ -1,5 +1,5 @@
diff --git gyp/generator/ninja.py gyp/generator/ninja.py 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
+++ gyp/generator/ninja.py +++ gyp/generator/ninja.py
@@ -747,7 +747,16 @@ class NinjaWriter(object): @@ -747,7 +747,16 @@ class NinjaWriter(object):

View File

@ -1,8 +1,8 @@
diff --git hwnd_message_handler.cc hwnd_message_handler.cc 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
+++ 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; active_mouse_tracking_flags_ = 0;
} else if (event.type() == ui::ET_MOUSEWHEEL) { } else if (event.type() == ui::ET_MOUSEWHEEL) {
// Reroute the mouse wheel to the window under the pointer if applicable. // Reroute the mouse wheel to the window under the pointer if applicable.

View File

@ -1,8 +1,8 @@
diff --git input_method_win.cc input_method_win.cc 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
+++ 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 // 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 // even when the |attached_window_handle| becomes active but has not received
// WM_FOCUS yet. // WM_FOCUS yet.

View File

@ -1,5 +1,5 @@
diff --git message_loop.cc message_loop.cc diff --git message_loop.cc message_loop.cc
index 88f75e9..7abb471 100644 index 04aa9a8..ec302b6 100644
--- message_loop.cc --- message_loop.cc
+++ message_loop.cc +++ message_loop.cc
@@ -139,12 +139,6 @@ MessageLoop::~MessageLoop() { @@ -139,12 +139,6 @@ MessageLoop::~MessageLoop() {

View File

@ -1,5 +1,5 @@
diff --git mime_handler_view_guest.cc mime_handler_view_guest.cc 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
+++ mime_handler_view_guest.cc +++ mime_handler_view_guest.cc
@@ -134,6 +134,8 @@ void MimeHandlerViewGuest::CreateWebContents( @@ -134,6 +134,8 @@ void MimeHandlerViewGuest::CreateWebContents(

View File

@ -1,5 +1,5 @@
diff --git base/network_delegate.h base/network_delegate.h 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
+++ base/network_delegate.h +++ base/network_delegate.h
@@ -35,6 +35,7 @@ namespace net { @@ -35,6 +35,7 @@ namespace net {
@ -10,7 +10,7 @@ index 0737137..60cfcd717 100644
class HttpRequestHeaders; class HttpRequestHeaders;
class HttpResponseHeaders; class HttpResponseHeaders;
class ProxyInfo; 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& target_url,
const GURL& referrer_url) const; const GURL& referrer_url) const;
@ -25,7 +25,7 @@ index 0737137..60cfcd717 100644
// This is the interface for subclasses of NetworkDelegate to implement. These // This is the interface for subclasses of NetworkDelegate to implement. These
// member functions will be called by the respective public notification // member functions will be called by the respective public notification
diff --git filter/filter.h filter/filter.h diff --git filter/filter.h filter/filter.h
index e9df3db..768b7fc 100644 index 31d08d4..1de8e84 100644
--- filter/filter.h --- filter/filter.h
+++ filter/filter.h +++ filter/filter.h
@@ -59,6 +59,7 @@ @@ -59,6 +59,7 @@
@ -36,8 +36,8 @@ index e9df3db..768b7fc 100644
class GURL; class GURL;
namespace net { namespace net {
@@ -234,6 +235,7 @@ class NET_EXPORT_PRIVATE Filter { @@ -239,6 +240,7 @@ class NET_EXPORT_PRIVATE Filter {
std::string OrderedFilterList() const; FilterType type() const { return type_id_; }
protected: protected:
+ friend class ::CefNetworkDelegate; + friend class ::CefNetworkDelegate;
@ -45,10 +45,10 @@ index e9df3db..768b7fc 100644
friend class GZipUnitTest; friend class GZipUnitTest;
friend class SdchFilterChainingTest; friend class SdchFilterChainingTest;
diff --git url_request/url_request_job.cc url_request/url_request_job.cc 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
+++ 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()) if (request_->status().is_success())
filter_.reset(SetupFilter()); filter_.reset(SetupFilter());

View File

@ -1,8 +1,8 @@
diff --git url_request.h url_request.h diff --git url_request.h url_request.h
index 1a17470..bf51358 100644 index d3b0b7a..0adec6f 100644
--- url_request.h --- url_request.h
+++ 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. // or after the response headers are received.
void GetConnectionAttempts(ConnectionAttempts* out) const; void GetConnectionAttempts(ConnectionAttempts* out) const;

View File

@ -1,8 +1,8 @@
diff --git fpdfsdk/src/fpdfview.cpp fpdfsdk/src/fpdfview.cpp diff --git fpdfsdk/fpdfview.cpp fpdfsdk/fpdfview.cpp
index ba64709..02e1391 100644 index 4630ac1..9b5b36f 100644
--- fpdfsdk/src/fpdfview.cpp --- fpdfsdk/fpdfview.cpp
+++ fpdfsdk/src/fpdfview.cpp +++ fpdfsdk/fpdfview.cpp
@@ -14,6 +14,7 @@ @@ -16,6 +16,7 @@
#include "fpdfsdk/include/fsdk_mgr.h" #include "fpdfsdk/include/fsdk_mgr.h"
#include "fpdfsdk/include/fsdk_rendercontext.h" #include "fpdfsdk/include/fsdk_rendercontext.h"
#include "fpdfsdk/include/javascript/IJavaScript.h" #include "fpdfsdk/include/javascript/IJavaScript.h"
@ -10,7 +10,7 @@ index ba64709..02e1391 100644
#include "public/fpdf_ext.h" #include "public/fpdf_ext.h"
#include "public/fpdf_progressive.h" #include "public/fpdf_progressive.h"
#include "third_party/base/numerics/safe_conversions_impl.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 #endif // PDF_ENABLE_XFA
CPDF_ModuleMgr::Destroy(); CPDF_ModuleMgr::Destroy();
CFX_GEModule::Destroy(); CFX_GEModule::Destroy();

View File

@ -1,8 +1,8 @@
diff --git public/common/common_param_traits_macros.h public/common/common_param_traits_macros.h 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
+++ 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(main_frame_resizes_are_orientation_changes)
IPC_STRUCT_TRAITS_MEMBER(initialize_at_minimum_page_scale) IPC_STRUCT_TRAITS_MEMBER(initialize_at_minimum_page_scale)
IPC_STRUCT_TRAITS_MEMBER(smart_insert_delete_enabled) 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(navigate_on_drag_drop)
IPC_STRUCT_TRAITS_MEMBER(spatial_navigation_enabled) IPC_STRUCT_TRAITS_MEMBER(spatial_navigation_enabled)
diff --git public/common/web_preferences.cc public/common/web_preferences.cc 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
+++ 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), pinch_overlay_scrollbar_thickness(0),
use_solid_color_scrollbars(false), use_solid_color_scrollbars(false),
navigate_on_drag_drop(true), navigate_on_drag_drop(true),
+ base_background_color(0xFFFFFFFF), // Color::white + base_background_color(0xFFFFFFFF), // Color::white
v8_cache_options(V8_CACHE_OPTIONS_DEFAULT), v8_cache_options(V8_CACHE_OPTIONS_DEFAULT),
inert_visual_viewport(false),
cookie_enabled(true), cookie_enabled(true),
pepper_accelerated_video_decode_enabled(false),
diff --git public/common/web_preferences.h public/common/web_preferences.h 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
+++ public/common/web_preferences.h +++ public/common/web_preferences.h
@@ -174,6 +174,7 @@ struct CONTENT_EXPORT WebPreferences { @@ -174,6 +174,7 @@ struct CONTENT_EXPORT WebPreferences {
@ -32,18 +32,18 @@ index 7d6ca7d..ba38861 100644
bool navigate_on_drag_drop; bool navigate_on_drag_drop;
+ uint32_t base_background_color; + uint32_t base_background_color;
V8CacheOptions v8_cache_options; 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 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
+++ renderer/render_view_impl.cc +++ renderer/render_view_impl.cc
@@ -953,6 +953,8 @@ void RenderView::ApplyWebPreferences(const WebPreferences& prefs, @@ -1545,6 +1545,8 @@ void RenderViewImpl::ApplyWebPreferencesInternal(
settings->setCookieEnabled(prefs.cookie_enabled); blink::WebView* web_view,
settings->setNavigateOnDragDrop(prefs.navigate_on_drag_drop); CompositorDependencies* compositor_deps) {
ApplyWebPreferences(prefs, web_view);
+ web_view->setBaseBackgroundColor(prefs.base_background_color); + if (GetWebFrameWidget())
+ + GetWebFrameWidget()->setBaseBackgroundColor(prefs.base_background_color);
// By default, allow_universal_access_from_file_urls is set to false and thus #if defined(OS_MACOSX) && !defined(OS_IOS)
// we mitigate attacks from local HTML files by not granting file:// URLs DCHECK(compositor_deps);
// universal access. Only test shell will enable this. bool is_elastic_overscroll_enabled =

View File

@ -1,17 +1,18 @@
diff --git prefs_tab_helper.cc prefs_tab_helper.cc 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
+++ prefs_tab_helper.cc +++ prefs_tab_helper.cc
@@ -12,7 +12,7 @@ @@ -11,8 +11,8 @@
#include <string>
#include "base/command_line.h" #include "base/command_line.h"
+#include "base/lazy_instance.h"
#include "base/macros.h" #include "base/macros.h"
-#include "base/memory/singleton.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_number_conversions.h"
#include "base/strings/string_util.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)); GetInstance()->GetServiceForBrowserContext(profile, true));
} }
@ -26,7 +27,7 @@ index 36d6fe9..a875d1e 100644
PrefWatcherFactory() : BrowserContextKeyedServiceFactory( PrefWatcherFactory() : BrowserContextKeyedServiceFactory(
"PrefWatcher", "PrefWatcher",
@@ -457,6 +455,18 @@ class PrefWatcherFactory : public BrowserContextKeyedServiceFactory { @@ -449,6 +447,18 @@ class PrefWatcherFactory : public BrowserContextKeyedServiceFactory {
} }
}; };

View File

@ -1,8 +1,8 @@
diff --git printing/common/print_messages.cc printing/common/print_messages.cc 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
+++ 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<int>(); pages = std::vector<int>();
} }
@ -10,13 +10,13 @@ index c3469fc..9fc71ac 100644
PrintHostMsg_RequestPrintPreview_Params:: PrintHostMsg_RequestPrintPreview_Params::
PrintHostMsg_RequestPrintPreview_Params() PrintHostMsg_RequestPrintPreview_Params()
: is_modifiable(false), : is_modifiable(false),
@@ -117,4 +116,3 @@ PrintHostMsg_SetOptionsFromDocument_Params:: @@ -119,4 +118,3 @@ PrintHostMsg_SetOptionsFromDocument_Params::
PrintHostMsg_SetOptionsFromDocument_Params:: PrintHostMsg_SetOptionsFromDocument_Params::
~PrintHostMsg_SetOptionsFromDocument_Params() { ~PrintHostMsg_SetOptionsFromDocument_Params() {
} }
-#endif // defined(ENABLE_PRINT_PREVIEW) -#endif // defined(ENABLE_PRINT_PREVIEW)
diff --git printing/common/print_messages.h printing/common/print_messages.h 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
+++ printing/common/print_messages.h +++ printing/common/print_messages.h
@@ -70,7 +70,6 @@ struct PrintMsg_PrintPages_Params { @@ -70,7 +70,6 @@ struct PrintMsg_PrintPages_Params {
@ -35,7 +35,7 @@ index 6060a1c..d051297 100644
#endif // COMPONENTS_PRINTING_COMMON_PRINT_MESSAGES_H_ #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_MEMBER(to)
IPC_STRUCT_TRAITS_END() IPC_STRUCT_TRAITS_END()
@ -43,7 +43,7 @@ index 6060a1c..d051297 100644
IPC_STRUCT_TRAITS_BEGIN(PrintHostMsg_RequestPrintPreview_Params) IPC_STRUCT_TRAITS_BEGIN(PrintHostMsg_RequestPrintPreview_Params)
IPC_STRUCT_TRAITS_MEMBER(is_modifiable) IPC_STRUCT_TRAITS_MEMBER(is_modifiable)
IPC_STRUCT_TRAITS_MEMBER(webnode_only) 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. // Specifies page range to be printed.
IPC_STRUCT_TRAITS_MEMBER(page_ranges) IPC_STRUCT_TRAITS_MEMBER(page_ranges)
IPC_STRUCT_TRAITS_END() IPC_STRUCT_TRAITS_END()
@ -51,7 +51,7 @@ index 6060a1c..d051297 100644
IPC_STRUCT_TRAITS_BEGIN(printing::PageSizeMargins) IPC_STRUCT_TRAITS_BEGIN(printing::PageSizeMargins)
IPC_STRUCT_TRAITS_MEMBER(content_width) 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_MEMBER(pages)
IPC_STRUCT_TRAITS_END() IPC_STRUCT_TRAITS_END()
@ -59,7 +59,7 @@ index 6060a1c..d051297 100644
// Parameters to describe a rendered document. // Parameters to describe a rendered document.
IPC_STRUCT_BEGIN(PrintHostMsg_DidPreviewDocument_Params) IPC_STRUCT_BEGIN(PrintHostMsg_DidPreviewDocument_Params)
// A shared memory handle to metafile data. // 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. // Indicates whether the existing preview data needs to be cleared or not.
IPC_STRUCT_MEMBER(bool, clear_preview_data) IPC_STRUCT_MEMBER(bool, clear_preview_data)
IPC_STRUCT_END() IPC_STRUCT_END()
@ -67,7 +67,7 @@ index 6060a1c..d051297 100644
// Parameters to describe a rendered page. // Parameters to describe a rendered page.
IPC_STRUCT_BEGIN(PrintHostMsg_DidPrintPage_Params) 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. // Messages sent from the browser to the renderer.
@ -92,7 +92,7 @@ index 6060a1c..d051297 100644
#if defined(ENABLE_BASIC_PRINTING) #if defined(ENABLE_BASIC_PRINTING)
// Tells the render view to switch the CSS to print media type, renders every // 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, IPC_MESSAGE_ROUTED1(PrintMsg_SetScriptedPrintingBlocked,
bool /* blocked */) bool /* blocked */)
@ -106,7 +106,7 @@ index 6060a1c..d051297 100644
// Messages sent from the renderer to the browser. // 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. int /* fd in browser */) // Used only by Chrome OS.
#endif // defined(OS_ANDROID) #endif // defined(OS_ANDROID)
@ -114,7 +114,7 @@ index 6060a1c..d051297 100644
// Asks the browser to do print preview. // Asks the browser to do print preview.
IPC_MESSAGE_ROUTED1(PrintHostMsg_RequestPrintPreview, IPC_MESSAGE_ROUTED1(PrintHostMsg_RequestPrintPreview,
PrintHostMsg_RequestPrintPreview_Params /* params */) 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. // The memory handle in this message is already valid in the browser process.
IPC_MESSAGE_ROUTED1(PrintHostMsg_MetafileReadyForPrinting, IPC_MESSAGE_ROUTED1(PrintHostMsg_MetafileReadyForPrinting,
PrintHostMsg_DidPreviewDocument_Params /* params */) PrintHostMsg_DidPreviewDocument_Params /* params */)
@ -122,7 +122,7 @@ index 6060a1c..d051297 100644
// This is sent when there are invalid printer settings. // This is sent when there are invalid printer settings.
IPC_MESSAGE_ROUTED0(PrintHostMsg_ShowInvalidPrinterSettingsError) 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, IPC_MESSAGE_ROUTED1(PrintHostMsg_PrintingFailed,
int /* document cookie */) int /* document cookie */)
@ -130,16 +130,16 @@ index 6060a1c..d051297 100644
// Tell the browser print preview failed. // Tell the browser print preview failed.
IPC_MESSAGE_ROUTED1(PrintHostMsg_PrintPreviewFailed, IPC_MESSAGE_ROUTED1(PrintHostMsg_PrintPreviewFailed,
int /* document cookie */) 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. // Notify the browser to set print presets based on source PDF document.
IPC_MESSAGE_ROUTED1(PrintHostMsg_SetOptionsFromDocument, IPC_MESSAGE_ROUTED1(PrintHostMsg_SetOptionsFromDocument,
PrintHostMsg_SetOptionsFromDocument_Params /* params */) PrintHostMsg_SetOptionsFromDocument_Params /* params */)
-#endif // defined(ENABLE_PRINT_PREVIEW) -#endif // defined(ENABLE_PRINT_PREVIEW)
diff --git printing/renderer/print_web_view_helper.cc printing/renderer/print_web_view_helper.cc 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
+++ 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) #if defined(ENABLE_PRINT_PREVIEW)
bool g_is_preview_enabled = true; bool g_is_preview_enabled = true;
@ -149,7 +149,7 @@ index 6a8f1c3..f66469e 100644
const char kPageLoadScriptFormat[] = const char kPageLoadScriptFormat[] =
"document.open(); document.write(%s); document.close();"; "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()); std::string script = base::StringPrintf(script_format, json.c_str());
frame->executeScript(blink::WebString(base::UTF8ToUTF16(script))); frame->executeScript(blink::WebString(base::UTF8ToUTF16(script)));
} }
@ -159,7 +159,7 @@ index 6a8f1c3..f66469e 100644
int GetDPI(const PrintMsg_Print_Params* print_params) { int GetDPI(const PrintMsg_Print_Params* print_params) {
#if defined(OS_MACOSX) #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(); return plugin && plugin->supportsPaginatedPrint();
} }
@ -167,7 +167,7 @@ index 6a8f1c3..f66469e 100644
// Returns true if the current destination printer is PRINT_TO_PDF. // Returns true if the current destination printer is PRINT_TO_PDF.
bool IsPrintToPdfRequested(const base::DictionaryValue& job_settings) { bool IsPrintToPdfRequested(const base::DictionaryValue& job_settings) {
bool print_to_pdf = false; 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; return frame_has_custom_page_size_style;
} }
@ -175,7 +175,7 @@ index 6a8f1c3..f66469e 100644
// Disable scaling when either: // Disable scaling when either:
// - The PDF specifies disabling scaling. // - The PDF specifies disabling scaling.
@@ -376,7 +374,6 @@ MarginType GetMarginsForPdf(blink::WebLocalFrame* frame, @@ -375,7 +373,6 @@ MarginType GetMarginsForPdf(blink::WebLocalFrame* frame,
} }
#endif #endif
@ -183,7 +183,7 @@ index 6a8f1c3..f66469e 100644
bool FitToPageEnabled(const base::DictionaryValue& job_settings) { bool FitToPageEnabled(const base::DictionaryValue& job_settings) {
bool fit_to_paper_size = false; bool fit_to_paper_size = false;
if (!job_settings.GetBoolean(kSettingFitToPageEnabled, &fit_to_paper_size)) { 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; return blink::WebPrintScalingOptionFitToPrintableArea;
} }
@ -191,7 +191,7 @@ index 6a8f1c3..f66469e 100644
PrintMsg_Print_Params CalculatePrintParamsForCss( PrintMsg_Print_Params CalculatePrintParamsForCss(
blink::WebFrame* frame, blink::WebFrame* frame,
@@ -502,7 +498,6 @@ blink::WebView* FrameReference::view() { @@ -501,7 +497,6 @@ blink::WebView* FrameReference::view() {
return view_; return view_;
} }
@ -199,7 +199,7 @@ index 6a8f1c3..f66469e 100644
// static - Not anonymous so that platform implementations can use it. // static - Not anonymous so that platform implementations can use it.
void PrintWebViewHelper::PrintHeaderAndFooter( void PrintWebViewHelper::PrintHeaderAndFooter(
blink::WebCanvas* canvas, blink::WebCanvas* canvas,
@@ -558,7 +553,6 @@ void PrintWebViewHelper::PrintHeaderAndFooter( @@ -557,7 +552,6 @@ void PrintWebViewHelper::PrintHeaderAndFooter(
web_view->close(); web_view->close();
frame->close(); frame->close();
} }
@ -207,7 +207,7 @@ index 6a8f1c3..f66469e 100644
// static - Not anonymous so that platform implementations can use it. // static - Not anonymous so that platform implementations can use it.
float PrintWebViewHelper::RenderPageContent(blink::WebFrame* frame, 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), print_for_preview_(false),
delegate_(std::move(delegate)), delegate_(std::move(delegate)),
print_node_in_progress_(false), print_node_in_progress_(false),
@ -215,7 +215,7 @@ index 6a8f1c3..f66469e 100644
is_loading_(false), is_loading_(false),
is_scripted_preview_delayed_(false), is_scripted_preview_delayed_(false),
ipc_nesting_level_(0), 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; return;
if (g_is_preview_enabled) { if (g_is_preview_enabled) {
@ -226,7 +226,7 @@ index 6a8f1c3..f66469e 100644
} else { } else {
#if defined(ENABLE_BASIC_PRINTING) #if defined(ENABLE_BASIC_PRINTING)
Print(frame, blink::WebNode(), true); 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_PrintPages, OnPrintPages)
IPC_MESSAGE_HANDLER(PrintMsg_PrintForSystemDialog, OnPrintForSystemDialog) IPC_MESSAGE_HANDLER(PrintMsg_PrintForSystemDialog, OnPrintForSystemDialog)
#endif // defined(ENABLE_BASIC_PRINTING) #endif // defined(ENABLE_BASIC_PRINTING)
@ -241,7 +241,7 @@ index 6a8f1c3..f66469e 100644
IPC_MESSAGE_HANDLER(PrintMsg_SetScriptedPrintingBlocked, IPC_MESSAGE_HANDLER(PrintMsg_SetScriptedPrintingBlocked,
SetScriptedPrintBlocked) SetScriptedPrintBlocked)
IPC_MESSAGE_UNHANDLED(handled = false) IPC_MESSAGE_UNHANDLED(handled = false)
@@ -975,7 +964,6 @@ void PrintWebViewHelper::OnPrintForSystemDialog() { @@ -977,7 +966,6 @@ void PrintWebViewHelper::OnPrintForSystemDialog() {
} }
#endif // defined(ENABLE_BASIC_PRINTING) #endif // defined(ENABLE_BASIC_PRINTING)
@ -249,7 +249,7 @@ index 6a8f1c3..f66469e 100644
void PrintWebViewHelper::OnPrintForPrintPreview( void PrintWebViewHelper::OnPrintForPrintPreview(
const base::DictionaryValue& job_settings) { const base::DictionaryValue& job_settings) {
CHECK_LE(ipc_nesting_level_, 1); CHECK_LE(ipc_nesting_level_, 1);
@@ -1040,7 +1028,6 @@ void PrintWebViewHelper::OnPrintForPrintPreview( @@ -1042,7 +1030,6 @@ void PrintWebViewHelper::OnPrintForPrintPreview(
DidFinishPrinting(FAIL_PRINT); DidFinishPrinting(FAIL_PRINT);
} }
} }
@ -257,7 +257,7 @@ index 6a8f1c3..f66469e 100644
void PrintWebViewHelper::GetPageSizeAndContentAreaFromPageLayout( void PrintWebViewHelper::GetPageSizeAndContentAreaFromPageLayout(
const PageSizeMargins& page_layout_in_points, 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); ignore_css_margins_ = (margins_type != DEFAULT_MARGINS);
} }
@ -265,7 +265,7 @@ index 6a8f1c3..f66469e 100644
void PrintWebViewHelper::OnPrintPreview(const base::DictionaryValue& settings) { void PrintWebViewHelper::OnPrintPreview(const base::DictionaryValue& settings) {
if (ipc_nesting_level_ > 1) if (ipc_nesting_level_ > 1)
return; return;
@@ -1226,7 +1212,7 @@ bool PrintWebViewHelper::CreatePreviewDocument() { @@ -1228,7 +1214,7 @@ bool PrintWebViewHelper::CreatePreviewDocument() {
return true; return true;
} }
@ -274,7 +274,7 @@ index 6a8f1c3..f66469e 100644
bool PrintWebViewHelper::RenderPreviewPage( bool PrintWebViewHelper::RenderPreviewPage(
int page_number, int page_number,
const PrintMsg_Print_Params& print_params) { 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()); return PreviewPageRendered(page_number, draft_metafile.get());
} }
@ -283,7 +283,7 @@ index 6a8f1c3..f66469e 100644
bool PrintWebViewHelper::FinalizePrintReadyDocument() { bool PrintWebViewHelper::FinalizePrintReadyDocument() {
DCHECK(!is_print_ready_metafile_sent_); 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)); Send(new PrintHostMsg_MetafileReadyForPrinting(routing_id(), preview_params));
return true; return true;
} }
@ -291,7 +291,7 @@ index 6a8f1c3..f66469e 100644
void PrintWebViewHelper::OnPrintingDone(bool success) { void PrintWebViewHelper::OnPrintingDone(bool success) {
if (ipc_nesting_level_ > 1) 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; is_scripted_printing_blocked_ = blocked;
} }
@ -299,7 +299,7 @@ index 6a8f1c3..f66469e 100644
void PrintWebViewHelper::OnInitiatePrintPreview(bool selection_only) { void PrintWebViewHelper::OnInitiatePrintPreview(bool selection_only) {
if (ipc_nesting_level_ > 1) if (ipc_nesting_level_ > 1)
return; return;
@@ -1311,7 +1295,9 @@ void PrintWebViewHelper::OnInitiatePrintPreview(bool selection_only) { @@ -1313,7 +1297,9 @@ void PrintWebViewHelper::OnInitiatePrintPreview(bool selection_only) {
// that instead. // that instead.
auto plugin = delegate_->GetPdfElement(frame); auto plugin = delegate_->GetPdfElement(frame);
if (!plugin.isNull()) { if (!plugin.isNull()) {
@ -309,7 +309,7 @@ index 6a8f1c3..f66469e 100644
return; return;
} }
print_preview_context_.InitWithFrame(frame); 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_SELECTION
: PRINT_PREVIEW_USER_INITIATED_ENTIRE_FRAME); : PRINT_PREVIEW_USER_INITIATED_ENTIRE_FRAME);
} }
@ -317,7 +317,7 @@ index 6a8f1c3..f66469e 100644
bool PrintWebViewHelper::IsPrintingEnabled() { bool PrintWebViewHelper::IsPrintingEnabled() {
bool result = false; 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 // Make a copy of the node, in case RenderView::OnContextMenuClosed resets
// its |context_menu_node_|. // its |context_menu_node_|.
@ -330,7 +330,7 @@ index 6a8f1c3..f66469e 100644
} else { } else {
#if defined(ENABLE_BASIC_PRINTING) #if defined(ENABLE_BASIC_PRINTING)
blink::WebNode duplicate_node(node); blink::WebNode duplicate_node(node);
@@ -1415,7 +1398,6 @@ void PrintWebViewHelper::DidFinishPrinting(PrintingResult result) { @@ -1417,7 +1400,6 @@ void PrintWebViewHelper::DidFinishPrinting(PrintingResult result) {
} }
break; break;
@ -338,7 +338,7 @@ index 6a8f1c3..f66469e 100644
case FAIL_PREVIEW: case FAIL_PREVIEW:
int cookie = int cookie =
print_pages_params_ ? print_pages_params_->params.document_cookie : 0; 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_); print_preview_context_.Failed(notify_browser_of_print_failure_);
break; break;
@ -346,7 +346,7 @@ index 6a8f1c3..f66469e 100644
} }
prep_frame_view_.reset(); prep_frame_view_.reset();
print_pages_params_.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; return true;
} }
@ -354,7 +354,7 @@ index 6a8f1c3..f66469e 100644
bool PrintWebViewHelper::SetOptionsFromPdfDocument( bool PrintWebViewHelper::SetOptionsFromPdfDocument(
PrintHostMsg_SetOptionsFromDocument_Params* options) { PrintHostMsg_SetOptionsFromDocument_Params* options) {
blink::WebLocalFrame* source_frame = print_preview_context_.source_frame(); 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; return true;
} }
@ -362,46 +362,31 @@ index 6a8f1c3..f66469e 100644
#if defined(ENABLE_BASIC_PRINTING) #if defined(ENABLE_BASIC_PRINTING)
bool PrintWebViewHelper::GetPrintSettingsFromUser(blink::WebLocalFrame* frame, bool PrintWebViewHelper::GetPrintSettingsFromUser(blink::WebLocalFrame* frame,
@@ -1760,11 +1739,14 @@ void PrintWebViewHelper::PrintPageInternal( @@ -1778,7 +1757,6 @@ 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(
MetafileSkiaWrapper::SetMetafileOnCanvas(*canvas, metafile); MetafileSkiaWrapper::SetMetafileOnCanvas(*canvas, metafile);
-#if defined(ENABLE_PRINT_PREVIEW) -#if defined(ENABLE_PRINT_PREVIEW)
if (params.params.display_header_footer) { if (params.params.display_header_footer) {
// |page_number| is 0-based, so 1 is added. // TODO(thestig): Figure out why Linux needs this. The value may be
PrintHeaderAndFooter(canvas, params.page_number + 1, // |printingMinimumShrinkFactor|.
print_preview_context_.total_page_count(), *frame, @@ -1793,7 +1771,6 @@ void PrintWebViewHelper::PrintPageInternal(
scale_factor, page_layout_in_points, params.params); scale_factor / fudge_factor, page_layout_in_points,
params.params);
} }
-#endif // defined(ENABLE_PRINT_PREVIEW) -#endif // defined(ENABLE_PRINT_PREVIEW)
float webkit_scale_factor = float webkit_scale_factor =
RenderPageContent(frame, params.page_number, canvas_area, content_area, RenderPageContent(frame, params.page_number, canvas_area, content_area,
@@ -1836,7 +1816,6 @@ bool PrintWebViewHelper::CopyMetafileDataToSharedMem( @@ -1829,7 +1806,6 @@ bool PrintWebViewHelper::CopyMetafileDataToSharedMem(
#endif // defined(OS_WIN) return true;
} }
-#if defined(ENABLE_PRINT_PREVIEW) -#if defined(ENABLE_PRINT_PREVIEW)
void PrintWebViewHelper::ShowScriptedPrintPreview() { void PrintWebViewHelper::ShowScriptedPrintPreview() {
if (is_scripted_preview_delayed_) { if (is_scripted_preview_delayed_) {
is_scripted_preview_delayed_ = false; 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)); Send(new PrintHostMsg_DidPreviewPage(routing_id(), preview_page_params));
return true; return true;
} }
@ -410,7 +395,7 @@ index 6a8f1c3..f66469e 100644
PrintWebViewHelper::PrintPreviewContext::PrintPreviewContext() PrintWebViewHelper::PrintPreviewContext::PrintPreviewContext()
: total_page_count_(0), : total_page_count_(0),
diff --git printing/renderer/print_web_view_helper.h printing/renderer/print_web_view_helper.h 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
+++ printing/renderer/print_web_view_helper.h +++ printing/renderer/print_web_view_helper.h
@@ -137,9 +137,7 @@ class PrintWebViewHelper @@ -137,9 +137,7 @@ class PrintWebViewHelper
@ -507,10 +492,10 @@ index ca10384..7aacfbc 100644
bool is_loading_; bool is_loading_;
bool is_scripted_preview_delayed_; bool is_scripted_preview_delayed_;
diff --git printing/renderer/print_web_view_helper_mac.mm printing/renderer/print_web_view_helper_mac.mm 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
+++ 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)); Send(new PrintHostMsg_DidPrintPage(routing_id(), page_params));
} }
@ -518,7 +503,7 @@ index 08a1c10..4a80a2d 100644
bool PrintWebViewHelper::RenderPreviewPage( bool PrintWebViewHelper::RenderPreviewPage(
int page_number, int page_number,
const PrintMsg_Print_Params& print_params) { 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()); return PreviewPageRendered(page_number, draft_metafile.get());
} }
@ -526,7 +511,7 @@ index 08a1c10..4a80a2d 100644
void PrintWebViewHelper::RenderPage(const PrintMsg_Print_Params& params, void PrintWebViewHelper::RenderPage(const PrintMsg_Print_Params& params,
int page_number, 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); MetafileSkiaWrapper::SetMetafileOnCanvas(*canvas, metafile);
skia::SetIsPreviewMetafile(*canvas, is_preview); skia::SetIsPreviewMetafile(*canvas, is_preview);

View File

@ -1,5 +1,5 @@
diff --git web_contents.cc web_contents.cc diff --git web_contents.cc web_contents.cc
index 1b6d8a6..b606a30 100644 index d4b5fd0..b804902 100644
--- web_contents.cc --- web_contents.cc
+++ web_contents.cc +++ web_contents.cc
@@ -26,7 +26,9 @@ WebContents::CreateParams::CreateParams(BrowserContext* context, @@ -26,7 +26,9 @@ WebContents::CreateParams::CreateParams(BrowserContext* context,
@ -11,10 +11,10 @@ index 1b6d8a6..b606a30 100644
+ view(nullptr), + view(nullptr),
+ delegate_view(nullptr) {} + delegate_view(nullptr) {}
WebContents::CreateParams::~CreateParams() { WebContents::CreateParams::CreateParams(const CreateParams& other) = default;
}
diff --git web_contents.h web_contents.h diff --git web_contents.h web_contents.h
index 5260b91..4495078 100644 index 9dd14bf..7c7b7c9 100644
--- web_contents.h --- web_contents.h
+++ web_contents.h +++ web_contents.h
@@ -54,9 +54,11 @@ class PageState; @@ -54,9 +54,11 @@ class PageState;
@ -29,7 +29,7 @@ index 5260b91..4495078 100644
struct CustomContextMenuContext; struct CustomContextMenuContext;
struct DropData; struct DropData;
struct Manifest; 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 // RenderFrame, have already been created on the renderer side, and
// WebContents construction should take this into account. // WebContents construction should take this into account.
bool renderer_initiated_creation; bool renderer_initiated_creation;
@ -41,7 +41,7 @@ index 5260b91..4495078 100644
// Creates a new WebContents. // Creates a new WebContents.
diff --git web_contents_delegate.cc web_contents_delegate.cc 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
+++ web_contents_delegate.cc +++ web_contents_delegate.cc
@@ -144,7 +144,9 @@ bool WebContentsDelegate::ShouldCreateWebContents( @@ -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 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
+++ web_contents_delegate.h +++ web_contents_delegate.h
@@ -41,9 +41,11 @@ class DownloadItem; @@ -42,9 +42,11 @@ class JavaScriptDialogManager;
class JavaScriptDialogManager;
class PageState; class PageState;
class RenderFrameHost;
class RenderViewHost; class RenderViewHost;
+class RenderViewHostDelegateView; +class RenderViewHostDelegateView;
class SessionStorageNamespace; class SessionStorageNamespace;
@ -71,7 +71,7 @@ index b6015b0..75b53d4 100644
struct ColorSuggestion; struct ColorSuggestion;
struct ContextMenuParams; struct ContextMenuParams;
struct DropData; struct DropData;
@@ -309,7 +311,9 @@ class CONTENT_EXPORT WebContentsDelegate { @@ -311,7 +313,9 @@ class CONTENT_EXPORT WebContentsDelegate {
const std::string& frame_name, const std::string& frame_name,
const GURL& target_url, const GURL& target_url,
const std::string& partition_id, const std::string& partition_id,

View File

@ -1,8 +1,8 @@
diff --git render_widget_host_view_mac.mm render_widget_host_view_mac.mm 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
+++ 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 // Paint this view host with |background_color_| when there is no content
// ready to draw. // ready to draw.
background_layer_.reset([[CALayer alloc] init]); background_layer_.reset([[CALayer alloc] init]);

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