Compare commits

..

36 Commits
4692 ... 4758

Author SHA1 Message Date
Marshall Greenblatt
29d6e22fe4 Update to Chromium version 98.0.4758.109 2022-02-25 14:51:39 +00:00
Marshall Greenblatt
78c653a2ed Update context menu type enums to match Chromium (fixes issue #3257) 2022-02-18 16:47:20 -05:00
Marshall Greenblatt
9782362fea Support reconnect of the mojo frame channel (fixes issue #3260)
The mojo channel used for frame communication may disconnect for a variety of
reasons including frame navigation, frame destruction, or insertion into the
BackForwardCache (when the browser-side frame representation is destroyed and
closes the connection). When disconnect occurs we now evaluate the situation
and reconnect if appropriate.

Connections are now initiated solely from the renderer process and the
RenderFrame is passed as an argument to FrameAttached() instead of being
retrieved independently. Messages are queued while the frame is disconnected
and sent only after FrameAttachedAck() is received from the browser process.
The renderer process will be crashed intentionally with a "connection retry
failure" message if the reconnect fails 3 times in a row.
2022-02-15 15:56:03 -05:00
Marshall Greenblatt
0e8702df26 Update to Chromium version 98.0.4758.102 2022-02-15 16:55:12 +00:00
Marshall Greenblatt
57be9e2aba Update to Chromium version 98.0.4758.80 2022-02-09 20:17:27 -05:00
Marshall Greenblatt
856e56194e Fix includes path for Linux ARM cross-compile (see issue #2926) 2022-02-09 16:53:31 -05:00
Marshall Greenblatt
63805e69e3 Make cef_config.h discoverable from patched Chromium targets (see issue #2926)
Add the generated includes/ directory to CEF's "config" so that source files
included in patched Chromium targets (for example, blink_glue.cc) can find
cef_config.h which will be included via `include/internal/cef_types_linux.h`
on Linux.
2022-02-08 13:13:05 -05:00
Marshall Greenblatt
358ca263f4 Remove cef_config.h from cef_paths2.gypi (see issue #2926) 2022-02-05 00:50:07 +00:00
Marshall Greenblatt
42d1b7e0f9 Make cef_config.h generation a dependency of libcef_dll_wrapper (see issue #2926)
The libcef_dll_wrapper target may be built very early due to minimal
dependencies. Make sure that cef_config.h is generated first as it will be
included via `include/internal/cef_types_linux.h` on Linux.
2022-02-02 15:15:56 -05:00
Marshall Greenblatt
7fe84d02b3 alloy: Fix extension function registration for print preview dialog (fixes issue #3167) 2022-02-02 14:48:25 -05:00
Marshall Greenblatt
f1a0035c82 Generate cef_config.h as a build-time step (fixes issue #2926) 2022-02-02 12:31:20 -05:00
Marshall Greenblatt
d87e3f41f6 alloy: Move ExtensionsBrowserClient ownership to BrowserProcess (fixes issue #3247)
Fixes a shutdown crash due to `ExtensionsBrowserClient::Set(nullptr)` being
called too early. Some code that may occasionally be triggered via
`content::ContentMainShutdown()` is expecting the extensions objects to still
be valid.

This new ownership pattern matches the code in chrome/.
2022-01-28 16:41:25 -05:00
Marshall Greenblatt
eb2c682768 alloy: Fix shutdown assert if OneShotTimer is deleted on the wrong thread 2022-01-28 12:25:07 -05:00
Marshall Greenblatt
f07ce7b357 Fix notification for focused frame (fixes issue #3248) 2022-01-24 11:33:03 -05:00
Marshall Greenblatt
b2f0f54fdd chrome: Fix crash when clicking Reading List sidebar link (fixes issue #3128) 2022-01-14 13:54:39 -05:00
Marshall Greenblatt
4d42a6c31a cefclient: Disable alert on space bar press (see issue #3184)
This will be reverted after issue #3184 is resolved.
2022-01-14 12:17:43 -05:00
Nick Mueller
0e3b3bb110 Fix OSR resize issue when multiple monitors have different scale factors (fixes issue #3240) 2022-01-14 12:01:03 -05:00
Marshall Greenblatt
0cc7a7bdab chrome: Fix crashes when toggling full-screen mode (fixes issue #3182) 2022-01-13 12:40:12 -05:00
Marshall Greenblatt
a8dbe5cae2 Update to Chromium version 98.0.4758.55 2022-01-13 13:07:07 +00:00
Marshall Greenblatt
16dbbdc695 Update to Chromium version 98.0.4758.48 2022-01-12 16:45:07 +00:00
Marshall Greenblatt
657697d8dd Fix possible use after shutdown of BrowserContext (fixes issue #3193) 2022-01-10 17:20:37 -05:00
Marshall Greenblatt
7a5a4c683a Fix certificate errors with restarted/redirected requests (fixes issue #3200)
URLLoaderNetworkServiceObserver is used for routing certificate and
authentication callbacks from the NetworkService to the associated
StoragePartition instance. With request interception enabled this object was
previously only assigned for the initial request. This change adds assignment
for restarted/redirected requests as well.
2022-01-06 19:56:49 -05:00
Marshall Greenblatt
24e09fef3e alloy: Disable bfcache in M98 (see issue #3237)
This will be reverted if the bfcache issue is fixed before M98 becomes the
stable channel.
2022-01-06 14:18:14 -05:00
Marshall Greenblatt
419264812d Update copyright year in generated files 2022-01-06 13:40:21 -05:00
Marshall Greenblatt
5a865afa07 Update to Chromium version 98.0.4758.9 2021-12-18 20:30:37 -05:00
Marshall Greenblatt
2f5e1b621e Mac: Use system allocator instead of PartitionAlloc (fixes issue #3061)
This change disables PartitionAlloc and the related allocator shim. Using the
system allocator makes it easier to integrate with client applications which
may perform allocations before initializing CEF.
2021-12-18 15:57:49 -05:00
Marshall Greenblatt
dfc0131516 Update to Chromium version 98.0.4758.0 (#950365) 2021-12-18 15:57:34 -05:00
Marshall Greenblatt
b76badd958 Remove DISALLOW_ macro from include/ (see issue #3234)
Also perform related C++ cleanup:
- Use =default instead of {} for default implementations of
  constructors/destructors.
- Replace typedef with using.
2021-12-07 15:02:28 -05:00
Marshall Greenblatt
1eb55cbba8 Remove DISALLOW_ macro from libcef_dll/ (see issue #3234)
Also perform related C++ cleanup:
- Use =default instead of {} for default implementations of
  constructors/destructors.
- Replace typedef with using.
2021-12-07 15:02:28 -05:00
Marshall Greenblatt
9484d6528c Remove DISALLOW_ macro from libcef/ (see issue #3234)
Also perform related C++ cleanup:
- Use =default instead of {} for default implementations of
  constructors/destructors.
- Replace typedef with using.
2021-12-07 15:02:28 -05:00
Marshall Greenblatt
83ffc1f00d Add kPdfRenderer define for non-Windows platforms (see issue #3047)
This switch is currently only defined for Windows in
content/public/common/content_switches.h.
2021-12-02 12:37:02 -05:00
Marshall Greenblatt
f4d5395c4b Skip GetNewBrowserInfo call for PDF renderer processes (see issue #3047)
With PdfUnseasoned the PDF file will be loaded in a dedicated renderer process.
We identify this process by adding the kPdfRenderer command-line flag (similar
to how kExtensionProcess is used to identify an extension renderer process). We
then avoid calling GetNewBrowserInfo for the PDF renderer process because we
know the request will otherwise time out.
2021-11-29 15:46:39 -05:00
Nicolas Dusart
f6cf7f9ec7 Fix CefURLRequest crash with failing HEAD requests (fixes issue #3226) 2021-11-23 22:14:59 +00:00
Marshall Greenblatt
c75ebbccec alloy: Add support for the new non-PPAPI PDF viewer (see issue #3047)
Enable by passing `--enable-features=PdfUnseasoned` on the command line.
2021-11-23 16:38:16 -05:00
Marshall Greenblatt
d6d316e304 Fix discontinued/outdated External Projects links (fixes issue #3225) 2021-11-23 11:50:32 -05:00
Sarah
833612ba9a Prevent possible null dereference in ctocpp_ref_counted.h (fixes issue #3218) 2021-11-22 15:28:06 +00:00
336 changed files with 2381 additions and 1753 deletions

View File

@@ -96,6 +96,7 @@
import("//base/allocator/allocator.gni") import("//base/allocator/allocator.gni")
import("//build/config/features.gni") import("//build/config/features.gni")
import("//build/config/locales.gni") import("//build/config/locales.gni")
import("//build/config/ozone.gni")
import("//build/config/sanitizers/sanitizers.gni") import("//build/config/sanitizers/sanitizers.gni")
import("//build/config/ui.gni") import("//build/config/ui.gni")
import("//chrome/common/features.gni") import("//chrome/common/features.gni")
@@ -306,7 +307,7 @@ group("cef") {
":libcef_static_unittests", ":libcef_static_unittests",
] ]
if (!is_linux || use_x11) { if (!is_linux || ozone_platform_x11) {
deps += [ ":cefclient" ] deps += [ ":cefclient" ]
} }
} }
@@ -983,7 +984,7 @@ static_library("libcef_static") {
"libcef/browser/printing/print_dialog_linux.h", "libcef/browser/printing/print_dialog_linux.h",
] ]
if (use_x11) { if (ozone_platform_x11) {
sources += [ sources += [
"libcef/browser/native/window_x11.cc", "libcef/browser/native/window_x11.cc",
"libcef/browser/native/window_x11.h", "libcef/browser/native/window_x11.h",
@@ -995,7 +996,7 @@ static_library("libcef_static") {
"//third_party/fontconfig", "//third_party/fontconfig",
] ]
if (is_linux && !use_x11) { if (is_linux && !ozone_platform_x11) {
deps += [ deps += [
"//third_party/angle:libEGL", "//third_party/angle:libEGL",
] ]
@@ -1027,7 +1028,7 @@ static_library("libcef_static") {
deps += [ "//third_party/crashpad/crashpad/handler" ] deps += [ "//third_party/crashpad/crashpad/handler" ]
} }
if (use_x11) { if (ozone_platform_x11) {
deps += [ "//ui/events/devices/x11" ] deps += [ "//ui/events/devices/x11" ]
} }
@@ -1201,7 +1202,7 @@ static_library("libcef_static") {
"//ui/ozone:generate_test_support_constructor_list", "//ui/ozone:generate_test_support_constructor_list",
] ]
if (use_x11) { if (ozone_platform_x11) {
sources += [ sources += [
# Support for UI input events. # Support for UI input events.
# Part of //ui/base/x:test_support which is testingonly. # Part of //ui/base/x:test_support which is testingonly.
@@ -1296,6 +1297,8 @@ static_library("libcef_dll_wrapper") {
configs += [ ":libcef_dll_wrapper_config" ] configs += [ ":libcef_dll_wrapper_config" ]
public_configs = [ ":libcef_dll_wrapper_config" ] public_configs = [ ":libcef_dll_wrapper_config" ]
deps = [ ":cef_make_headers" ]
} }
@@ -1486,12 +1489,22 @@ action("make_api_hash_header") {
args = rebase_path(outputs + include_dir, root_build_dir) args = rebase_path(outputs + include_dir, root_build_dir)
} }
# Generate cef_config.h.
action("make_config_header") {
script = "tools/make_config_header.py"
outputs = [ "$root_out_dir/includes/include/cef_config.h" ]
args = rebase_path(outputs + [ "$root_out_dir/args.gn" ], root_build_dir)
}
# Generate pack files and associated CEF header files. # Generate pack files and associated CEF header files.
group("cef_make_headers") { group("cef_make_headers") {
deps = [ deps = [
":make_pack_header_resources", ":make_pack_header_resources",
":make_pack_header_strings", ":make_pack_header_strings",
":make_api_hash_header", ":make_api_hash_header",
":make_config_header",
] ]
} }
@@ -2249,7 +2262,7 @@ if (is_mac) {
sources += includes_linux + sources += includes_linux +
gypi_paths2.cefsimple_sources_linux gypi_paths2.cefsimple_sources_linux
if (use_x11) { if (ozone_platform_x11) {
libs = [ libs = [
"X11", "X11",
] ]
@@ -2309,7 +2322,7 @@ if (is_mac) {
sources += gypi_paths2.shared_sources_linux + sources += gypi_paths2.shared_sources_linux +
gypi_paths2.ceftests_sources_linux gypi_paths2.ceftests_sources_linux
if (use_x11) { if (ozone_platform_x11) {
libs = [ libs = [
"X11", "X11",
] ]

View File

@@ -7,6 +7,6 @@
# https://bitbucket.org/chromiumembedded/cef/wiki/BranchesAndBuilding # https://bitbucket.org/chromiumembedded/cef/wiki/BranchesAndBuilding
{ {
'chromium_checkout': 'refs/tags/97.0.4692.99', 'chromium_checkout': 'refs/tags/98.0.4758.109',
'depot_tools_checkout': 'f7b8f8f3cd' 'depot_tools_checkout': 'db41eed6b7'
} }

View File

@@ -45,15 +45,11 @@ The base CEF framework includes support for the C and C++ programming languages.
* .Net (CEF3) - https://github.com/cefsharp/CefSharp * .Net (CEF3) - https://github.com/cefsharp/CefSharp
* .Net (CEF1) - https://bitbucket.org/fddima/cefglue * .Net (CEF1) - https://bitbucket.org/fddima/cefglue
* .Net/Mono (CEF3) - https://bitbucket.org/xilium/xilium.cefglue * .Net/Mono (CEF3) - https://gitlab.com/xiliumhq/chromiumembedded/cefglue
* .Net (CEF3) - https://bitbucket.org/chromiumfx/chromiumfx * Delphi - https://github.com/hgourvest/dcef3
* Delphi (CEF1) - http://code.google.com/p/delphichromiumembedded/ * Delphi - https://github.com/salvadordf/CEF4Delphi
* Delphi (CEF3) - https://github.com/hgourvest/dcef3
* Delphi (CEF3) - https://github.com/salvadordf/CEF4Delphi
* Go - https://github.com/richardwilkes/cef
* Go - https://github.com/CzarekTomczak/cef2go * Go - https://github.com/CzarekTomczak/cef2go
* Java - https://bitbucket.org/chromiumembedded/java-cef * Java - https://bitbucket.org/chromiumembedded/java-cef
* Java - http://code.google.com/p/javacef/
* Python - http://code.google.com/p/cefpython/ * Python - http://code.google.com/p/cefpython/
If you're the maintainer of a project not listed above and would like your project listed here please either post to the [CEF Forum](http://www.magpcss.org/ceforum/) or contact Marshall directly. If you're the maintainer of a project not listed above and would like your project listed here please either post to the [CEF Forum](http://www.magpcss.org/ceforum/) or contact Marshall directly.

View File

@@ -38,7 +38,6 @@
'include/base/internal/cef_thread_checker_impl.h', 'include/base/internal/cef_thread_checker_impl.h',
'include/cef_api_hash.h', 'include/cef_api_hash.h',
'include/cef_base.h', 'include/cef_base.h',
'include/cef_config.h',
'include/cef_version.h', 'include/cef_version.h',
'include/internal/cef_export.h', 'include/internal/cef_export.h',
'include/internal/cef_ptr.h', 'include/internal/cef_ptr.h',

View File

@@ -45,7 +45,6 @@
#include <atomic> #include <atomic>
#include "include/base/cef_macros.h"
#include "include/base/cef_thread_checker.h" #include "include/base/cef_thread_checker.h"
namespace base { namespace base {
@@ -56,6 +55,10 @@ namespace base {
class AtomicFlag { class AtomicFlag {
public: public:
AtomicFlag(); AtomicFlag();
AtomicFlag(const AtomicFlag&) = delete;
AtomicFlag& operator=(const AtomicFlag&) = delete;
~AtomicFlag(); ~AtomicFlag();
// Set the flag. Must always be called from the same thread. // Set the flag. Must always be called from the same thread.
@@ -76,8 +79,6 @@ class AtomicFlag {
private: private:
std::atomic<uint_fast8_t> flag_{0}; std::atomic<uint_fast8_t> flag_{0};
base::ThreadChecker set_thread_checker_; base::ThreadChecker set_thread_checker_;
DISALLOW_COPY_AND_ASSIGN(AtomicFlag);
}; };
} // namespace base } // namespace base

View File

@@ -41,7 +41,6 @@
// updated to match. // updated to match.
#include "include/base/cef_logging.h" #include "include/base/cef_logging.h"
#include "include/base/cef_macros.h"
#include "include/base/cef_platform_thread.h" #include "include/base/cef_platform_thread.h"
#include "include/base/internal/cef_lock_impl.h" #include "include/base/internal/cef_lock_impl.h"
@@ -55,6 +54,10 @@ class Lock {
public: public:
#if !DCHECK_IS_ON() // Optimized wrapper implementation #if !DCHECK_IS_ON() // Optimized wrapper implementation
Lock() : lock_() {} Lock() : lock_() {}
Lock(const Lock&) = delete;
Lock& operator=(const Lock&) = delete;
~Lock() {} ~Lock() {}
void Acquire() { lock_.Lock(); } void Acquire() { lock_.Lock(); }
void Release() { lock_.Unlock(); } void Release() { lock_.Unlock(); }
@@ -111,8 +114,6 @@ class Lock {
// Platform specific underlying lock implementation. // Platform specific underlying lock implementation.
LockImpl lock_; LockImpl lock_;
DISALLOW_COPY_AND_ASSIGN(Lock);
}; };
// A helper class that acquires the given Lock while the AutoLock is in scope. // A helper class that acquires the given Lock while the AutoLock is in scope.
@@ -126,6 +127,9 @@ class AutoLock {
lock_.AssertAcquired(); lock_.AssertAcquired();
} }
AutoLock(const AutoLock&) = delete;
AutoLock& operator=(const AutoLock&) = delete;
~AutoLock() { ~AutoLock() {
lock_.AssertAcquired(); lock_.AssertAcquired();
lock_.Release(); lock_.Release();
@@ -133,7 +137,6 @@ class AutoLock {
private: private:
Lock& lock_; Lock& lock_;
DISALLOW_COPY_AND_ASSIGN(AutoLock);
}; };
// AutoUnlock is a helper that will Release() the |lock| argument in the // AutoUnlock is a helper that will Release() the |lock| argument in the
@@ -146,11 +149,13 @@ class AutoUnlock {
lock_.Release(); lock_.Release();
} }
AutoUnlock(const AutoUnlock&) = delete;
AutoUnlock& operator=(const AutoUnlock&) = delete;
~AutoUnlock() { lock_.Acquire(); } ~AutoUnlock() { lock_.Acquire(); }
private: private:
Lock& lock_; Lock& lock_;
DISALLOW_COPY_AND_ASSIGN(AutoUnlock);
}; };
} // namespace cef_internal } // namespace cef_internal
@@ -158,9 +163,9 @@ class AutoUnlock {
// Implement classes in the cef_internal namespace and then expose them to the // Implement classes in the cef_internal namespace and then expose them to the
// base namespace. This avoids conflicts with the base.lib implementation when // base namespace. This avoids conflicts with the base.lib implementation when
// linking sandbox support on Windows. // linking sandbox support on Windows.
using cef_internal::Lock;
using cef_internal::AutoLock; using cef_internal::AutoLock;
using cef_internal::AutoUnlock; using cef_internal::AutoUnlock;
using cef_internal::Lock;
} // namespace base } // namespace base

View File

@@ -164,7 +164,6 @@
#include <string> #include <string>
#include "include/base/cef_build.h" #include "include/base/cef_build.h"
#include "include/base/cef_macros.h"
#include "include/internal/cef_logging_internal.h" #include "include/internal/cef_logging_internal.h"
namespace cef { namespace cef {
@@ -583,6 +582,9 @@ class LogMessage {
LogSeverity severity, LogSeverity severity,
std::string* result); std::string* result);
LogMessage(const LogMessage&) = delete;
LogMessage& operator=(const LogMessage&) = delete;
~LogMessage(); ~LogMessage();
std::ostream& stream() { return stream_; } std::ostream& stream() { return stream_; }
@@ -614,8 +616,6 @@ class LogMessage {
SaveLastError last_error_; SaveLastError last_error_;
#endif #endif
DISALLOW_COPY_AND_ASSIGN(LogMessage);
}; };
// A non-macro interface to the log facility; (useful // A non-macro interface to the log facility; (useful
@@ -655,6 +655,9 @@ class Win32ErrorLogMessage {
LogSeverity severity, LogSeverity severity,
SystemErrorCode err); SystemErrorCode err);
Win32ErrorLogMessage(const Win32ErrorLogMessage&) = delete;
Win32ErrorLogMessage& operator=(const Win32ErrorLogMessage&) = delete;
// Appends the error message before destructing the encapsulated class. // Appends the error message before destructing the encapsulated class.
~Win32ErrorLogMessage(); ~Win32ErrorLogMessage();
@@ -663,8 +666,6 @@ class Win32ErrorLogMessage {
private: private:
SystemErrorCode err_; SystemErrorCode err_;
LogMessage log_message_; LogMessage log_message_;
DISALLOW_COPY_AND_ASSIGN(Win32ErrorLogMessage);
}; };
#elif defined(OS_POSIX) #elif defined(OS_POSIX)
// Appends a formatted system message of the errno type // Appends a formatted system message of the errno type
@@ -675,6 +676,9 @@ class ErrnoLogMessage {
LogSeverity severity, LogSeverity severity,
SystemErrorCode err); SystemErrorCode err);
ErrnoLogMessage(const ErrnoLogMessage&) = delete;
ErrnoLogMessage& operator=(const ErrnoLogMessage&) = delete;
// Appends the error message before destructing the encapsulated class. // Appends the error message before destructing the encapsulated class.
~ErrnoLogMessage(); ~ErrnoLogMessage();
@@ -683,8 +687,6 @@ class ErrnoLogMessage {
private: private:
SystemErrorCode err_; SystemErrorCode err_;
LogMessage log_message_; LogMessage log_message_;
DISALLOW_COPY_AND_ASSIGN(ErrnoLogMessage);
}; };
#endif // OS_WIN #endif // OS_WIN

View File

@@ -34,7 +34,7 @@
#if defined(USING_CHROMIUM_INCLUDES) #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/ignore_result.h"
#else // !USING_CHROMIUM_INCLUDES #else // !USING_CHROMIUM_INCLUDES
// The following is substantially similar to the Chromium implementation. // The following is substantially similar to the Chromium implementation.

View File

@@ -49,7 +49,6 @@
#include "include/base/cef_build.h" #include "include/base/cef_build.h"
#include "include/base/cef_compiler_specific.h" #include "include/base/cef_compiler_specific.h"
#include "include/base/cef_logging.h" #include "include/base/cef_logging.h"
#include "include/base/cef_macros.h"
#include "include/base/cef_scoped_refptr.h" #include "include/base/cef_scoped_refptr.h"
#include "include/base/cef_template_util.h" #include "include/base/cef_template_util.h"
#include "include/base/cef_thread_checker.h" #include "include/base/cef_thread_checker.h"
@@ -76,6 +75,9 @@ class RefCountedBase {
#endif #endif
} }
RefCountedBase(const RefCountedBase&) = delete;
RefCountedBase& operator=(const RefCountedBase&) = delete;
~RefCountedBase() { ~RefCountedBase() {
#if DCHECK_IS_ON() #if DCHECK_IS_ON()
DCHECK(in_dtor_) << "RefCounted object deleted without calling Release()"; DCHECK(in_dtor_) << "RefCounted object deleted without calling Release()";
@@ -168,8 +170,6 @@ class RefCountedBase {
mutable bool in_dtor_ = false; mutable bool in_dtor_ = false;
mutable ThreadChecker thread_checker_; mutable ThreadChecker thread_checker_;
#endif #endif
DISALLOW_COPY_AND_ASSIGN(RefCountedBase);
}; };
class RefCountedThreadSafeBase { class RefCountedThreadSafeBase {
@@ -186,6 +186,9 @@ class RefCountedThreadSafeBase {
#endif #endif
} }
RefCountedThreadSafeBase(const RefCountedThreadSafeBase&) = delete;
RefCountedThreadSafeBase& operator=(const RefCountedThreadSafeBase&) = delete;
#if DCHECK_IS_ON() #if DCHECK_IS_ON()
~RefCountedThreadSafeBase(); ~RefCountedThreadSafeBase();
#else #else
@@ -259,8 +262,6 @@ class RefCountedThreadSafeBase {
mutable bool needs_adopt_ref_ = false; mutable bool needs_adopt_ref_ = false;
mutable bool in_dtor_ = false; mutable bool in_dtor_ = false;
#endif #endif
DISALLOW_COPY_AND_ASSIGN(RefCountedThreadSafeBase);
}; };
// ScopedAllowCrossThreadRefCountAccess disables the check documented on // ScopedAllowCrossThreadRefCountAccess disables the check documented on
@@ -357,6 +358,9 @@ class RefCounted : public cef_subtle::RefCountedBase {
RefCounted() : cef_subtle::RefCountedBase(T::kRefCountPreference) {} RefCounted() : cef_subtle::RefCountedBase(T::kRefCountPreference) {}
RefCounted(const RefCounted&) = delete;
RefCounted& operator=(const RefCounted&) = delete;
void AddRef() const { cef_subtle::RefCountedBase::AddRef(); } void AddRef() const { cef_subtle::RefCountedBase::AddRef(); }
void Release() const { void Release() const {
@@ -379,8 +383,6 @@ class RefCounted : public cef_subtle::RefCountedBase {
static void DeleteInternal(const U* x) { static void DeleteInternal(const U* x) {
delete x; delete x;
} }
DISALLOW_COPY_AND_ASSIGN(RefCounted);
}; };
// Forward declaration. // Forward declaration.
@@ -424,6 +426,9 @@ class RefCountedThreadSafe : public cef_subtle::RefCountedThreadSafeBase {
explicit RefCountedThreadSafe() explicit RefCountedThreadSafe()
: cef_subtle::RefCountedThreadSafeBase(T::kRefCountPreference) {} : cef_subtle::RefCountedThreadSafeBase(T::kRefCountPreference) {}
RefCountedThreadSafe(const RefCountedThreadSafe&) = delete;
RefCountedThreadSafe& operator=(const RefCountedThreadSafe&) = delete;
void AddRef() const { AddRefImpl(T::kRefCountPreference); } void AddRef() const { AddRefImpl(T::kRefCountPreference); }
void Release() const { void Release() const {
@@ -450,8 +455,6 @@ class RefCountedThreadSafe : public cef_subtle::RefCountedThreadSafeBase {
void AddRefImpl(cef_subtle::StartRefCountFromOneTag) const { void AddRefImpl(cef_subtle::StartRefCountFromOneTag) const {
cef_subtle::RefCountedThreadSafeBase::AddRefWithCheck(); cef_subtle::RefCountedThreadSafeBase::AddRefWithCheck();
} }
DISALLOW_COPY_AND_ASSIGN(RefCountedThreadSafe);
}; };
// //

View File

@@ -48,7 +48,6 @@
#include "include/base/cef_compiler_specific.h" #include "include/base/cef_compiler_specific.h"
#include "include/base/cef_logging.h" #include "include/base/cef_logging.h"
#include "include/base/cef_macros.h"
template <class T> template <class T>
class scoped_refptr; class scoped_refptr;

View File

@@ -109,7 +109,6 @@
#include "include/base/cef_atomic_flag.h" #include "include/base/cef_atomic_flag.h"
#include "include/base/cef_logging.h" #include "include/base/cef_logging.h"
#include "include/base/cef_macros.h"
#include "include/base/cef_ref_counted.h" #include "include/base/cef_ref_counted.h"
#include "include/base/cef_thread_checker.h" #include "include/base/cef_thread_checker.h"
@@ -357,9 +356,14 @@ class WeakPtrFactoryBase {
template <class T> template <class T>
class WeakPtrFactory : public internal::WeakPtrFactoryBase { class WeakPtrFactory : public internal::WeakPtrFactoryBase {
public: public:
WeakPtrFactory() = delete;
explicit WeakPtrFactory(T* ptr) explicit WeakPtrFactory(T* ptr)
: WeakPtrFactoryBase(reinterpret_cast<uintptr_t>(ptr)) {} : WeakPtrFactoryBase(reinterpret_cast<uintptr_t>(ptr)) {}
WeakPtrFactory(const WeakPtrFactory&) = delete;
WeakPtrFactory& operator=(const WeakPtrFactory&) = delete;
~WeakPtrFactory() = default; ~WeakPtrFactory() = default;
WeakPtr<T> GetWeakPtr() const { WeakPtr<T> GetWeakPtr() const {
@@ -378,9 +382,6 @@ class WeakPtrFactory : public internal::WeakPtrFactoryBase {
DCHECK(ptr_); DCHECK(ptr_);
return weak_reference_owner_.HasRefs(); return weak_reference_owner_.HasRefs();
} }
private:
DISALLOW_IMPLICIT_CONSTRUCTORS(WeakPtrFactory);
}; };
// A class may extend from SupportsWeakPtr to let others take weak pointers to // A class may extend from SupportsWeakPtr to let others take weak pointers to
@@ -393,6 +394,9 @@ class SupportsWeakPtr : public internal::SupportsWeakPtrBase {
public: public:
SupportsWeakPtr() = default; SupportsWeakPtr() = default;
SupportsWeakPtr(const SupportsWeakPtr&) = delete;
SupportsWeakPtr& operator=(const SupportsWeakPtr&) = delete;
WeakPtr<T> AsWeakPtr() { WeakPtr<T> AsWeakPtr() {
return WeakPtr<T>(weak_reference_owner_.GetRef(), static_cast<T*>(this)); return WeakPtr<T>(weak_reference_owner_.GetRef(), static_cast<T*>(this));
} }
@@ -402,7 +406,6 @@ class SupportsWeakPtr : public internal::SupportsWeakPtrBase {
private: private:
internal::WeakReferenceOwner weak_reference_owner_; internal::WeakReferenceOwner weak_reference_owner_;
DISALLOW_COPY_AND_ASSIGN(SupportsWeakPtr);
}; };
// Helper function that uses type deduction to safely return a WeakPtr<Derived> // Helper function that uses type deduction to safely return a WeakPtr<Derived>

View File

@@ -40,8 +40,6 @@
#include <pthread.h> #include <pthread.h>
#endif #endif
#include "include/base/cef_macros.h"
namespace base { namespace base {
namespace cef_internal { namespace cef_internal {
@@ -57,6 +55,10 @@ class LockImpl {
#endif #endif
LockImpl(); LockImpl();
LockImpl(const LockImpl&) = delete;
LockImpl& operator=(const LockImpl&) = delete;
~LockImpl(); ~LockImpl();
// If the lock is not held, take it and return true. If the lock is already // If the lock is not held, take it and return true. If the lock is already
@@ -77,8 +79,6 @@ class LockImpl {
private: private:
NativeHandle native_handle_; NativeHandle native_handle_;
DISALLOW_COPY_AND_ASSIGN(LockImpl);
}; };
} // namespace cef_internal } // namespace cef_internal

View File

@@ -42,13 +42,13 @@
// way that may cause binary incompatibility with other builds. The universal // way that may cause binary incompatibility with other builds. The universal
// hash value will change if any platform is affected whereas the platform hash // hash value will change if any platform is affected whereas the platform hash
// values will change only if that particular platform is affected. // values will change only if that particular platform is affected.
#define CEF_API_HASH_UNIVERSAL "6f6a9c0f3b420cd3120cf4f5924cbc91f5095abd" #define CEF_API_HASH_UNIVERSAL "bce1c03dd10e25bb5b1c4130297486205e7a8e56"
#if defined(OS_WIN) #if defined(OS_WIN)
#define CEF_API_HASH_PLATFORM "5835e67ed251fec96837b475df44248a286e422f" #define CEF_API_HASH_PLATFORM "cb4f19f13d7a944d1cd0ea6fa3a5129d356cd9d5"
#elif defined(OS_MAC) #elif defined(OS_MAC)
#define CEF_API_HASH_PLATFORM "b8187d9f99b028d767dfd6a40490190c25a3d901" #define CEF_API_HASH_PLATFORM "6c37c43a7f7d206a54297068fcbe3ca4905a17cb"
#elif defined(OS_LINUX) #elif defined(OS_LINUX)
#define CEF_API_HASH_PLATFORM "d7199dfd396052e1517e55f18ea75d3d61336538" #define CEF_API_HASH_PLATFORM "3572e1eca7185fdcdcff550f7b1759f4647e3e04"
#endif #endif
#ifdef __cplusplus #ifdef __cplusplus

View File

@@ -90,7 +90,10 @@ class CefBaseScoped {
/// ///
class CefRefCount { class CefRefCount {
public: public:
CefRefCount() {} CefRefCount() = default;
CefRefCount(const CefRefCount&) = delete;
CefRefCount& operator=(const CefRefCount&) = delete;
/// ///
// Increment the reference count. // Increment the reference count.
@@ -114,7 +117,6 @@ class CefRefCount {
private: private:
mutable base::AtomicRefCount ref_count_{0}; mutable base::AtomicRefCount ref_count_{0};
DISALLOW_COPY_AND_ASSIGN(CefRefCount);
}; };
/// ///

View File

@@ -1028,7 +1028,8 @@ typedef enum {
} cef_postdataelement_type_t; } cef_postdataelement_type_t;
/// ///
// Resource type for a request. // Resource type for a request. These constants match their equivalents in
// Chromium's ResourceType and should not be renumbered.
/// ///
typedef enum { typedef enum {
/// ///
@@ -1616,8 +1617,7 @@ typedef enum {
MENU_ID_NO_SPELLING_SUGGESTIONS = 205, MENU_ID_NO_SPELLING_SUGGESTIONS = 205,
MENU_ID_ADD_TO_DICTIONARY = 206, MENU_ID_ADD_TO_DICTIONARY = 206,
// Custom menu items originating from the renderer process. For example, // Custom menu items originating from the renderer process.
// plugin placeholder menu items.
MENU_ID_CUSTOM_FIRST = 220, MENU_ID_CUSTOM_FIRST = 220,
MENU_ID_CUSTOM_LAST = 250, MENU_ID_CUSTOM_LAST = 250,
@@ -1819,7 +1819,8 @@ typedef enum {
} cef_context_menu_type_flags_t; } cef_context_menu_type_flags_t;
/// ///
// Supported context menu media types. // Supported context menu media types. These constants match their equivalents
// in Chromium's ContextMenuDataMediaType and should not be renumbered.
/// ///
typedef enum { typedef enum {
/// ///
@@ -1839,6 +1840,10 @@ typedef enum {
/// ///
CM_MEDIATYPE_AUDIO, CM_MEDIATYPE_AUDIO,
/// ///
// An canvas node is selected.
///
CM_MEDIATYPE_CANVAS,
///
// A file node is selected. // A file node is selected.
/// ///
CM_MEDIATYPE_FILE, CM_MEDIATYPE_FILE,
@@ -1849,24 +1854,31 @@ typedef enum {
} cef_context_menu_media_type_t; } cef_context_menu_media_type_t;
/// ///
// Supported context menu media state bit flags. // Supported context menu media state bit flags. These constants match their
// equivalents in Chromium's ContextMenuData::MediaFlags and should not be
// renumbered.
/// ///
typedef enum { typedef enum {
CM_MEDIAFLAG_NONE = 0, CM_MEDIAFLAG_NONE = 0,
CM_MEDIAFLAG_ERROR = 1 << 0, CM_MEDIAFLAG_IN_ERROR = 1 << 0,
CM_MEDIAFLAG_PAUSED = 1 << 1, CM_MEDIAFLAG_PAUSED = 1 << 1,
CM_MEDIAFLAG_MUTED = 1 << 2, CM_MEDIAFLAG_MUTED = 1 << 2,
CM_MEDIAFLAG_LOOP = 1 << 3, CM_MEDIAFLAG_LOOP = 1 << 3,
CM_MEDIAFLAG_CAN_SAVE = 1 << 4, CM_MEDIAFLAG_CAN_SAVE = 1 << 4,
CM_MEDIAFLAG_HAS_AUDIO = 1 << 5, CM_MEDIAFLAG_HAS_AUDIO = 1 << 5,
CM_MEDIAFLAG_HAS_VIDEO = 1 << 6, CM_MEDIAFLAG_CAN_TOGGLE_CONTROLS = 1 << 6,
CM_MEDIAFLAG_CONTROL_ROOT_ELEMENT = 1 << 7, CM_MEDIAFLAG_CONTROLS = 1 << 7,
CM_MEDIAFLAG_CAN_PRINT = 1 << 8, CM_MEDIAFLAG_CAN_PRINT = 1 << 8,
CM_MEDIAFLAG_CAN_ROTATE = 1 << 9, CM_MEDIAFLAG_CAN_ROTATE = 1 << 9,
CM_MEDIAFLAG_CAN_PICTURE_IN_PICTURE = 1 << 10,
CM_MEDIAFLAG_PICTURE_IN_PICTURE = 1 << 11,
CM_MEDIAFLAG_CAN_LOOP = 1 << 12,
} cef_context_menu_media_state_flags_t; } cef_context_menu_media_state_flags_t;
/// ///
// Supported context menu edit state bit flags. // Supported context menu edit state bit flags. These constants match their
// equivalents in Chromium's ContextMenuDataEditFlags and should not be
// renumbered.
/// ///
typedef enum { typedef enum {
CM_EDITFLAG_NONE = 0, CM_EDITFLAG_NONE = 0,
@@ -1878,6 +1890,7 @@ typedef enum {
CM_EDITFLAG_CAN_DELETE = 1 << 5, CM_EDITFLAG_CAN_DELETE = 1 << 5,
CM_EDITFLAG_CAN_SELECT_ALL = 1 << 6, CM_EDITFLAG_CAN_SELECT_ALL = 1 << 6,
CM_EDITFLAG_CAN_TRANSLATE = 1 << 7, CM_EDITFLAG_CAN_TRANSLATE = 1 << 7,
CM_EDITFLAG_CAN_EDIT_RICHLY = 1 << 8,
} cef_context_menu_edit_state_flags_t; } cef_context_menu_edit_state_flags_t;
/// ///

View File

@@ -38,7 +38,6 @@
#pragma once #pragma once
#include "include/base/cef_lock.h" #include "include/base/cef_lock.h"
#include "include/base/cef_macros.h"
#include "include/cef_base.h" #include "include/cef_base.h"
#include "include/cef_stream.h" #include "include/cef_stream.h"
@@ -57,6 +56,9 @@ class CefByteReadHandler : public CefReadHandler {
size_t size, size_t size,
CefRefPtr<CefBaseRefCounted> source); CefRefPtr<CefBaseRefCounted> source);
CefByteReadHandler(const CefByteReadHandler&) = delete;
CefByteReadHandler& operator=(const CefByteReadHandler&) = delete;
// CefReadHandler methods. // CefReadHandler methods.
virtual size_t Read(void* ptr, size_t size, size_t n) override; virtual size_t Read(void* ptr, size_t size, size_t n) override;
virtual int Seek(int64 offset, int whence) override; virtual int Seek(int64 offset, int whence) override;
@@ -73,7 +75,6 @@ class CefByteReadHandler : public CefReadHandler {
base::Lock lock_; base::Lock lock_;
IMPLEMENT_REFCOUNTING(CefByteReadHandler); IMPLEMENT_REFCOUNTING(CefByteReadHandler);
DISALLOW_COPY_AND_ASSIGN(CefByteReadHandler);
}; };
#endif // CEF_INCLUDE_WRAPPER_CEF_BYTE_READ_HANDLER_H_ #endif // CEF_INCLUDE_WRAPPER_CEF_BYTE_READ_HANDLER_H_

View File

@@ -38,7 +38,6 @@
#pragma once #pragma once
#include "include/base/cef_callback_forward.h" #include "include/base/cef_callback_forward.h"
#include "include/base/cef_macros.h"
#include "include/cef_task.h" #include "include/cef_task.h"
/// ///

View File

@@ -43,7 +43,6 @@
#include "include/base/cef_bind.h" #include "include/base/cef_bind.h"
#include "include/base/cef_logging.h" #include "include/base/cef_logging.h"
#include "include/base/cef_macros.h"
#include "include/cef_task.h" #include "include/cef_task.h"
#define CEF_REQUIRE_UI_THREAD() DCHECK(CefCurrentlyOn(TID_UI)); #define CEF_REQUIRE_UI_THREAD() DCHECK(CefCurrentlyOn(TID_UI));
@@ -140,6 +139,10 @@ class CefScopedArgArray {
} }
array_[argc] = NULL; array_[argc] = NULL;
} }
CefScopedArgArray(const CefScopedArgArray&) = delete;
CefScopedArgArray& operator=(const CefScopedArgArray&) = delete;
~CefScopedArgArray() { delete[] array_; } ~CefScopedArgArray() { delete[] array_; }
char** array() const { return array_; } char** array() const { return array_; }
@@ -150,8 +153,6 @@ class CefScopedArgArray {
// Keep values in a vector separate from |array_| because various users may // Keep values in a vector separate from |array_| because various users may
// modify |array_| and we still want to clean up memory properly. // modify |array_| and we still want to clean up memory properly.
std::vector<std::string> values_; std::vector<std::string> values_;
DISALLOW_COPY_AND_ASSIGN(CefScopedArgArray);
}; };
#endif // CEF_INCLUDE_WRAPPER_CEF_HELPERS_H_ #endif // CEF_INCLUDE_WRAPPER_CEF_HELPERS_H_

View File

@@ -36,8 +36,6 @@
#ifdef __cplusplus #ifdef __cplusplus
#include <string> #include <string>
#include "include/base/cef_macros.h"
extern "C" { extern "C" {
#endif // __cplusplus #endif // __cplusplus
@@ -99,6 +97,10 @@ int cef_unload_library();
class CefScopedLibraryLoader { class CefScopedLibraryLoader {
public: public:
CefScopedLibraryLoader(); CefScopedLibraryLoader();
CefScopedLibraryLoader(const CefScopedLibraryLoader&) = delete;
CefScopedLibraryLoader& operator=(const CefScopedLibraryLoader&) = delete;
~CefScopedLibraryLoader(); ~CefScopedLibraryLoader();
/// ///
@@ -119,7 +121,6 @@ class CefScopedLibraryLoader {
bool Load(bool helper); bool Load(bool helper);
bool loaded_; bool loaded_;
DISALLOW_COPY_AND_ASSIGN(CefScopedLibraryLoader);
}; };
#endif // defined(OS_MAC) #endif // defined(OS_MAC)

View File

@@ -245,7 +245,7 @@ class CefMessageRouterBrowserSide
/// ///
class Handler { class Handler {
public: public:
typedef CefMessageRouterBrowserSide::Callback Callback; using Callback = CefMessageRouterBrowserSide::Callback;
/// ///
// Executed when a new query is received. |query_id| uniquely identifies the // Executed when a new query is received. |query_id| uniquely identifies the

View File

@@ -41,7 +41,6 @@
#include <memory> #include <memory>
#include "include/base/cef_callback.h" #include "include/base/cef_callback.h"
#include "include/base/cef_macros.h"
#include "include/base/cef_ref_counted.h" #include "include/base/cef_ref_counted.h"
#include "include/base/cef_weak_ptr.h" #include "include/base/cef_weak_ptr.h"
#include "include/cef_request_handler.h" #include "include/cef_request_handler.h"
@@ -101,6 +100,9 @@ class CefResourceManager
/// ///
class Request : public base::RefCountedThreadSafe<Request> { class Request : public base::RefCountedThreadSafe<Request> {
public: public:
Request(const Request&) = delete;
Request& operator=(const Request&) = delete;
/// ///
// Returns the URL associated with this request. The returned value will be // Returns the URL associated with this request. The returned value will be
// fully qualified but will not contain query or fragment components. It // fully qualified but will not contain query or fragment components. It
@@ -176,11 +178,9 @@ class CefResourceManager
// Params that stay with this request object. Safe to access on any thread. // Params that stay with this request object. Safe to access on any thread.
RequestParams params_; RequestParams params_;
DISALLOW_COPY_AND_ASSIGN(Request);
}; };
typedef std::list<scoped_refptr<Request>> RequestList; using RequestList = std::list<scoped_refptr<Request>>;
/// ///
// Interface implemented by resource providers. A provider may be created on // Interface implemented by resource providers. A provider may be created on
@@ -210,6 +210,9 @@ class CefResourceManager
CefResourceManager(); CefResourceManager();
CefResourceManager(const CefResourceManager&) = delete;
CefResourceManager& operator=(const CefResourceManager&) = delete;
/// ///
// Add a provider that maps requests for |url| to |content|. |url| should be // Add a provider that maps requests for |url| to |content|. |url| should be
// fully qualified but not include a query or fragment component. If // fully qualified but not include a query or fragment component. If
@@ -316,7 +319,7 @@ class CefResourceManager
// Provider and associated information. // Provider and associated information.
struct ProviderEntry; struct ProviderEntry;
typedef std::list<ProviderEntry*> ProviderEntryList; using ProviderEntryList = std::list<ProviderEntry*>;
// Values associated with the pending request only. Ownership will be passed // Values associated with the pending request only. Ownership will be passed
// between requests and the resource manager as request handling proceeds. // between requests and the resource manager as request handling proceeds.
@@ -357,7 +360,7 @@ class CefResourceManager
ProviderEntryList providers_; ProviderEntryList providers_;
// Map of response ID to pending CefResourceHandler object. // Map of response ID to pending CefResourceHandler object.
typedef std::map<uint64, CefRefPtr<CefResourceHandler>> PendingHandlersMap; using PendingHandlersMap = std::map<uint64, CefRefPtr<CefResourceHandler>>;
PendingHandlersMap pending_handlers_; PendingHandlersMap pending_handlers_;
UrlFilter url_filter_; UrlFilter url_filter_;
@@ -365,8 +368,6 @@ class CefResourceManager
// Must be the last member. Created and accessed on the IO thread. // Must be the last member. Created and accessed on the IO thread.
std::unique_ptr<base::WeakPtrFactory<CefResourceManager>> weak_ptr_factory_; std::unique_ptr<base::WeakPtrFactory<CefResourceManager>> weak_ptr_factory_;
DISALLOW_COPY_AND_ASSIGN(CefResourceManager);
}; };
#endif // CEF_INCLUDE_WRAPPER_CEF_RESOURCE_MANAGER_H_ #endif // CEF_INCLUDE_WRAPPER_CEF_RESOURCE_MANAGER_H_

View File

@@ -39,7 +39,6 @@
#pragma once #pragma once
#include "include/base/cef_build.h" #include "include/base/cef_build.h"
#include "include/base/cef_macros.h"
#include "include/cef_base.h" #include "include/cef_base.h"
/// ///
@@ -60,6 +59,9 @@ class CefScopedTempDir {
/// ///
CefScopedTempDir(); CefScopedTempDir();
CefScopedTempDir(const CefScopedTempDir&) = delete;
CefScopedTempDir& operator=(const CefScopedTempDir&) = delete;
/// ///
// Recursively delete path. // Recursively delete path.
/// ///
@@ -111,8 +113,6 @@ class CefScopedTempDir {
private: private:
CefString path_; CefString path_;
DISALLOW_COPY_AND_ASSIGN(CefScopedTempDir);
}; };
#endif // CEF_INCLUDE_SCOPED_TEMP_DIR_H_ #endif // CEF_INCLUDE_SCOPED_TEMP_DIR_H_

View File

@@ -37,7 +37,6 @@
#define CEF_INCLUDE_WRAPPER_CEF_STREAM_RESOURCE_HANDLER_H_ #define CEF_INCLUDE_WRAPPER_CEF_STREAM_RESOURCE_HANDLER_H_
#pragma once #pragma once
#include "include/base/cef_macros.h"
#include "include/cef_resource_handler.h" #include "include/cef_resource_handler.h"
#include "include/cef_response.h" #include "include/cef_response.h"
#include "include/cef_stream.h" #include "include/cef_stream.h"
@@ -61,6 +60,9 @@ class CefStreamResourceHandler : public CefResourceHandler {
CefResponse::HeaderMap header_map, CefResponse::HeaderMap header_map,
CefRefPtr<CefStreamReader> stream); CefRefPtr<CefStreamReader> stream);
CefStreamResourceHandler(const CefStreamResourceHandler&) = delete;
CefStreamResourceHandler& operator=(const CefStreamResourceHandler&) = delete;
// CefResourceHandler methods. // CefResourceHandler methods.
bool Open(CefRefPtr<CefRequest> request, bool Open(CefRefPtr<CefRequest> request,
bool& handle_request, bool& handle_request,
@@ -82,7 +84,6 @@ class CefStreamResourceHandler : public CefResourceHandler {
const CefRefPtr<CefStreamReader> stream_; const CefRefPtr<CefStreamReader> stream_;
IMPLEMENT_REFCOUNTING(CefStreamResourceHandler); IMPLEMENT_REFCOUNTING(CefStreamResourceHandler);
DISALLOW_COPY_AND_ASSIGN(CefStreamResourceHandler);
}; };
#endif // CEF_INCLUDE_WRAPPER_CEF_STREAM_RESOURCE_HANDLER_H_ #endif // CEF_INCLUDE_WRAPPER_CEF_STREAM_RESOURCE_HANDLER_H_

View File

@@ -41,7 +41,6 @@
#include <vector> #include <vector>
#include "include/base/cef_lock.h" #include "include/base/cef_lock.h"
#include "include/base/cef_macros.h"
#include "include/base/cef_ref_counted.h" #include "include/base/cef_ref_counted.h"
#include "include/cef_base.h" #include "include/cef_base.h"
#include "include/cef_xml_reader.h" #include "include/cef_xml_reader.h"
@@ -73,8 +72,8 @@ class CefStreamReader;
/// ///
class CefXmlObject : public base::RefCountedThreadSafe<CefXmlObject> { class CefXmlObject : public base::RefCountedThreadSafe<CefXmlObject> {
public: public:
typedef std::vector<CefRefPtr<CefXmlObject>> ObjectVector; using ObjectVector = std::vector<CefRefPtr<CefXmlObject>>;
typedef std::map<CefString, CefString> AttributeMap; using AttributeMap = std::map<CefString, CefString>;
/// ///
// Create a new object with the specified name. An object name must always be // Create a new object with the specified name. An object name must always be
@@ -82,6 +81,9 @@ class CefXmlObject : public base::RefCountedThreadSafe<CefXmlObject> {
/// ///
explicit CefXmlObject(const CefString& name); explicit CefXmlObject(const CefString& name);
CefXmlObject(const CefXmlObject&) = delete;
CefXmlObject& operator=(const CefXmlObject&) = delete;
/// ///
// Load the contents of the specified XML stream into this object. The // Load the contents of the specified XML stream into this object. The
// existing children and attributes, if any, will first be cleared. // existing children and attributes, if any, will first be cleared.
@@ -190,8 +192,6 @@ class CefXmlObject : public base::RefCountedThreadSafe<CefXmlObject> {
ObjectVector children_; ObjectVector children_;
base::Lock lock_; base::Lock lock_;
DISALLOW_COPY_AND_ASSIGN(CefXmlObject);
}; };
#endif // CEF_INCLUDE_WRAPPER_CEF_XML_OBJECT_H_ #endif // CEF_INCLUDE_WRAPPER_CEF_XML_OBJECT_H_

View File

@@ -40,7 +40,6 @@
#include <map> #include <map>
#include "include/base/cef_lock.h" #include "include/base/cef_lock.h"
#include "include/base/cef_macros.h"
#include "include/base/cef_ref_counted.h" #include "include/base/cef_ref_counted.h"
#include "include/cef_base.h" #include "include/cef_base.h"
@@ -80,13 +79,16 @@ class CefZipArchive : public base::RefCountedThreadSafe<CefZipArchive> {
virtual CefRefPtr<CefStreamReader> GetStreamReader() const = 0; virtual CefRefPtr<CefStreamReader> GetStreamReader() const = 0;
}; };
typedef std::map<CefString, CefRefPtr<File>> FileMap; using FileMap = std::map<CefString, CefRefPtr<File>>;
/// ///
// Create a new object. // Create a new object.
/// ///
CefZipArchive(); CefZipArchive();
CefZipArchive(const CefZipArchive&) = delete;
CefZipArchive& operator=(const CefZipArchive&) = delete;
/// ///
// Load the contents of the specified zip archive stream into this object. // Load the contents of the specified zip archive stream into this object.
// If the zip archive requires a password then provide it via |password|. // If the zip archive requires a password then provide it via |password|.
@@ -136,8 +138,6 @@ class CefZipArchive : public base::RefCountedThreadSafe<CefZipArchive> {
FileMap contents_; FileMap contents_;
mutable base::Lock lock_; mutable base::Lock lock_;
DISALLOW_COPY_AND_ASSIGN(CefZipArchive);
}; };
#endif // CEF_INCLUDE_WRAPPER_CEF_ZIP_ARCHIVE_H_ #endif // CEF_INCLUDE_WRAPPER_CEF_ZIP_ARCHIVE_H_

View File

@@ -55,6 +55,9 @@ class CefVisitedLinkListener : public visitedlink::VisitedLinkWriter::Listener {
public: public:
CefVisitedLinkListener() { DCHECK(listener_map_.empty()); } CefVisitedLinkListener() { DCHECK(listener_map_.empty()); }
CefVisitedLinkListener(const CefVisitedLinkListener&) = delete;
CefVisitedLinkListener& operator=(const CefVisitedLinkListener&) = delete;
void CreateListenerForContext(content::BrowserContext* context) { void CreateListenerForContext(content::BrowserContext* context) {
CEF_REQUIRE_UIT(); CEF_REQUIRE_UIT();
auto listener = auto listener =
@@ -94,12 +97,10 @@ class CefVisitedLinkListener : public visitedlink::VisitedLinkWriter::Listener {
private: private:
// Map of AlloyBrowserContext to the associated VisitedLinkEventListener. // Map of AlloyBrowserContext to the associated VisitedLinkEventListener.
typedef std::map<const content::BrowserContext*, using ListenerMap =
std::unique_ptr<visitedlink::VisitedLinkEventListener>> std::map<const content::BrowserContext*,
ListenerMap; std::unique_ptr<visitedlink::VisitedLinkEventListener>>;
ListenerMap listener_map_; ListenerMap listener_map_;
DISALLOW_COPY_AND_ASSIGN(CefVisitedLinkListener);
}; };
AlloyBrowserContext::AlloyBrowserContext( AlloyBrowserContext::AlloyBrowserContext(

View File

@@ -39,6 +39,9 @@ class AlloyBrowserContext : public ChromeProfileAlloy,
public: public:
explicit AlloyBrowserContext(const CefRequestContextSettings& settings); explicit AlloyBrowserContext(const CefRequestContextSettings& settings);
AlloyBrowserContext(const AlloyBrowserContext&) = delete;
AlloyBrowserContext& operator=(const AlloyBrowserContext&) = delete;
// CefBrowserContext overrides. // CefBrowserContext overrides.
content::BrowserContext* AsBrowserContext() override { return this; } content::BrowserContext* AsBrowserContext() override { return this; }
Profile* AsProfile() override { return this; } Profile* AsProfile() override { return this; }
@@ -142,8 +145,6 @@ class AlloyBrowserContext : public ChromeProfileAlloy,
std::unique_ptr<content::ResourceContext> resource_context_; std::unique_ptr<content::ResourceContext> resource_context_;
scoped_refptr<MediaDeviceIDSalt> media_device_id_salt_; scoped_refptr<MediaDeviceIDSalt> media_device_id_salt_;
DISALLOW_COPY_AND_ASSIGN(AlloyBrowserContext);
}; };
#endif // CEF_LIBCEF_BROWSER_ALLOY_ALLOY_BROWSER_CONTEXT_H_ #endif // CEF_LIBCEF_BROWSER_ALLOY_ALLOY_BROWSER_CONTEXT_H_

View File

@@ -99,6 +99,9 @@ class CefWidgetHostInterceptor
render_widget_host_->AddObserver(this); render_widget_host_->AddObserver(this);
} }
CefWidgetHostInterceptor(const CefWidgetHostInterceptor&) = delete;
CefWidgetHostInterceptor& operator=(const CefWidgetHostInterceptor&) = delete;
blink::mojom::WidgetHost* GetForwardingInterface() override { return impl_; } blink::mojom::WidgetHost* GetForwardingInterface() override { return impl_; }
// WidgetHostInterceptorForTesting method: // WidgetHostInterceptorForTesting method:
@@ -122,8 +125,6 @@ class CefWidgetHostInterceptor
AlloyBrowserHostImpl* const browser_; AlloyBrowserHostImpl* const browser_;
content::RenderWidgetHostImpl* const render_widget_host_; content::RenderWidgetHostImpl* const render_widget_host_;
blink::mojom::WidgetHost* const impl_; blink::mojom::WidgetHost* const impl_;
DISALLOW_COPY_AND_ASSIGN(CefWidgetHostInterceptor);
}; };
static constexpr base::TimeDelta kRecentlyAudibleTimeout = base::Seconds(2); static constexpr base::TimeDelta kRecentlyAudibleTimeout = base::Seconds(2);
@@ -1125,8 +1126,8 @@ void AlloyBrowserHostImpl::AddNewContents(
} }
void AlloyBrowserHostImpl::LoadingStateChanged(content::WebContents* source, void AlloyBrowserHostImpl::LoadingStateChanged(content::WebContents* source,
bool to_different_document) { bool should_show_loading_ui) {
contents_delegate_->LoadingStateChanged(source, to_different_document); contents_delegate_->LoadingStateChanged(source, should_show_loading_ui);
} }
void AlloyBrowserHostImpl::CloseContents(content::WebContents* source) { void AlloyBrowserHostImpl::CloseContents(content::WebContents* source) {

View File

@@ -212,7 +212,7 @@ class AlloyBrowserHostImpl : public CefBrowserHostBase,
bool user_gesture, bool user_gesture,
bool* was_blocked) override; bool* was_blocked) override;
void LoadingStateChanged(content::WebContents* source, void LoadingStateChanged(content::WebContents* source,
bool to_different_document) override; bool should_show_loading_ui) override;
void CloseContents(content::WebContents* source) override; void CloseContents(content::WebContents* source) override;
void UpdateTargetURL(content::WebContents* source, const GURL& url) override; void UpdateTargetURL(content::WebContents* source, const GURL& url) override;
bool DidAddMessageToConsole(content::WebContents* source, bool DidAddMessageToConsole(content::WebContents* source,

View File

@@ -39,9 +39,12 @@
#include "third_party/widevine/cdm/buildflags.h" #include "third_party/widevine/cdm/buildflags.h"
#include "ui/base/resource/resource_bundle.h" #include "ui/base/resource/resource_bundle.h"
#if defined(USE_AURA) && defined(USE_X11) #if defined(OS_LINUX)
#include "ui/ozone/buildflags.h"
#if defined(USE_AURA) && BUILDFLAG(OZONE_PLATFORM_X11)
#include "ui/events/devices/x11/touch_factory_x11.h" #include "ui/events/devices/x11/touch_factory_x11.h"
#endif #endif
#endif
#if defined(USE_AURA) #if defined(USE_AURA)
#include "ui/aura/env.h" #include "ui/aura/env.h"
@@ -82,8 +85,8 @@
#endif #endif
AlloyBrowserMainParts::AlloyBrowserMainParts( AlloyBrowserMainParts::AlloyBrowserMainParts(
const content::MainFunctionParams& parameters) content::MainFunctionParams parameters)
: BrowserMainParts(), devtools_delegate_(nullptr) {} : BrowserMainParts(), parameters_(std::move(parameters)) {}
AlloyBrowserMainParts::~AlloyBrowserMainParts() { AlloyBrowserMainParts::~AlloyBrowserMainParts() {
constrained_window::SetConstrainedWindowViewsClient(nullptr); constrained_window::SetConstrainedWindowViewsClient(nullptr);
@@ -118,9 +121,11 @@ void AlloyBrowserMainParts::ToolkitInitialized() {
} }
void AlloyBrowserMainParts::PreCreateMainMessageLoop() { void AlloyBrowserMainParts::PreCreateMainMessageLoop() {
#if defined(USE_AURA) && defined(USE_X11) #if defined(OS_LINUX)
#if defined(USE_AURA) && BUILDFLAG(OZONE_PLATFORM_X11)
ui::TouchFactory::SetTouchDeviceListFromCommandLine(); ui::TouchFactory::SetTouchDeviceListFromCommandLine();
#endif #endif
#endif
#if defined(OS_WIN) #if defined(OS_WIN)
// Initialize the OSCrypt. // Initialize the OSCrypt.

View File

@@ -9,15 +9,11 @@
#include "libcef/browser/request_context_impl.h" #include "libcef/browser/request_context_impl.h"
#include "base/command_line.h" #include "base/command_line.h"
#include "base/macros.h"
#include "base/strings/string_piece.h" #include "base/strings/string_piece.h"
#include "build/build_config.h" #include "build/build_config.h"
#include "components/prefs/pref_service.h" #include "components/prefs/pref_service.h"
#include "content/public/browser/browser_main_parts.h" #include "content/public/browser/browser_main_parts.h"
#include "content/public/common/main_function_params.h"
namespace content {
struct MainFunctionParams;
}
#if defined(USE_AURA) #if defined(USE_AURA)
namespace display { namespace display {
@@ -41,7 +37,11 @@ class CefDevToolsDelegate;
class AlloyBrowserMainParts : public content::BrowserMainParts { class AlloyBrowserMainParts : public content::BrowserMainParts {
public: public:
explicit AlloyBrowserMainParts(const content::MainFunctionParams& parameters); explicit AlloyBrowserMainParts(content::MainFunctionParams parameters);
AlloyBrowserMainParts(const AlloyBrowserMainParts&) = delete;
AlloyBrowserMainParts& operator=(const AlloyBrowserMainParts&) = delete;
~AlloyBrowserMainParts() override; ~AlloyBrowserMainParts() override;
int PreEarlyInitialization() override; int PreEarlyInitialization() override;
@@ -74,8 +74,10 @@ class AlloyBrowserMainParts : public content::BrowserMainParts {
void PlatformInitialize(); void PlatformInitialize();
#endif // defined(OS_WIN) #endif // defined(OS_WIN)
content::MainFunctionParams parameters_;
CefRefPtr<CefRequestContextImpl> global_request_context_; CefRefPtr<CefRequestContextImpl> global_request_context_;
CefDevToolsDelegate* devtools_delegate_; // Deletes itself. CefDevToolsDelegate* devtools_delegate_ = nullptr; // Deletes itself.
// Blocking task runners exposed via CefTaskRunner. For consistency with // Blocking task runners exposed via CefTaskRunner. For consistency with
// previous named thread behavior always execute all pending tasks before // previous named thread behavior always execute all pending tasks before
@@ -96,8 +98,6 @@ class AlloyBrowserMainParts : public content::BrowserMainParts {
std::unique_ptr<views::LayoutProvider> layout_provider_; std::unique_ptr<views::LayoutProvider> layout_provider_;
#endif #endif
#endif // defined(TOOLKIT_VIEWS) #endif // defined(TOOLKIT_VIEWS)
DISALLOW_COPY_AND_ASSIGN(AlloyBrowserMainParts);
}; };
#endif // CEF_LIBCEF_BROWSER_ALLOY_ALLOY_BROWSER_MAIN_H_ #endif // CEF_LIBCEF_BROWSER_ALLOY_ALLOY_BROWSER_MAIN_H_

View File

@@ -46,6 +46,7 @@
#include "base/base_switches.h" #include "base/base_switches.h"
#include "base/command_line.h" #include "base/command_line.h"
#include "base/files/file_path.h" #include "base/files/file_path.h"
#include "base/ignore_result.h"
#include "base/json/json_reader.h" #include "base/json/json_reader.h"
#include "base/path_service.h" #include "base/path_service.h"
#include "base/stl_util.h" #include "base/stl_util.h"
@@ -176,6 +177,9 @@ class CefQuotaCallbackImpl : public CefCallback {
explicit CefQuotaCallbackImpl(CallbackType callback) explicit CefQuotaCallbackImpl(CallbackType callback)
: callback_(std::move(callback)) {} : callback_(std::move(callback)) {}
CefQuotaCallbackImpl(const CefQuotaCallbackImpl&) = delete;
CefQuotaCallbackImpl& operator=(const CefQuotaCallbackImpl&) = delete;
~CefQuotaCallbackImpl() { ~CefQuotaCallbackImpl() {
if (!callback_.is_null()) { if (!callback_.is_null()) {
// The callback is still pending. Cancel it now. // The callback is still pending. Cancel it now.
@@ -217,17 +221,21 @@ class CefQuotaCallbackImpl : public CefCallback {
CallbackType callback_; CallbackType callback_;
IMPLEMENT_REFCOUNTING(CefQuotaCallbackImpl); IMPLEMENT_REFCOUNTING(CefQuotaCallbackImpl);
DISALLOW_COPY_AND_ASSIGN(CefQuotaCallbackImpl);
}; };
class CefAllowCertificateErrorCallbackImpl : public CefCallback { class CefAllowCertificateErrorCallbackImpl : public CefCallback {
public: public:
typedef base::OnceCallback<void(content::CertificateRequestResultType)> using CallbackType =
CallbackType; base::OnceCallback<void(content::CertificateRequestResultType)>;
explicit CefAllowCertificateErrorCallbackImpl(CallbackType callback) explicit CefAllowCertificateErrorCallbackImpl(CallbackType callback)
: callback_(std::move(callback)) {} : callback_(std::move(callback)) {}
CefAllowCertificateErrorCallbackImpl(
const CefAllowCertificateErrorCallbackImpl&) = delete;
CefAllowCertificateErrorCallbackImpl& operator=(
const CefAllowCertificateErrorCallbackImpl&) = delete;
~CefAllowCertificateErrorCallbackImpl() { ~CefAllowCertificateErrorCallbackImpl() {
if (!callback_.is_null()) { if (!callback_.is_null()) {
// The callback is still pending. Cancel it now. // The callback is still pending. Cancel it now.
@@ -272,7 +280,6 @@ class CefAllowCertificateErrorCallbackImpl : public CefCallback {
CallbackType callback_; CallbackType callback_;
IMPLEMENT_REFCOUNTING(CefAllowCertificateErrorCallbackImpl); IMPLEMENT_REFCOUNTING(CefAllowCertificateErrorCallbackImpl);
DISALLOW_COPY_AND_ASSIGN(CefAllowCertificateErrorCallbackImpl);
}; };
class CefSelectClientCertificateCallbackImpl class CefSelectClientCertificateCallbackImpl
@@ -282,6 +289,11 @@ class CefSelectClientCertificateCallbackImpl
std::unique_ptr<content::ClientCertificateDelegate> delegate) std::unique_ptr<content::ClientCertificateDelegate> delegate)
: delegate_(std::move(delegate)) {} : delegate_(std::move(delegate)) {}
CefSelectClientCertificateCallbackImpl(
const CefSelectClientCertificateCallbackImpl&) = delete;
CefSelectClientCertificateCallbackImpl& operator=(
const CefSelectClientCertificateCallbackImpl&) = delete;
~CefSelectClientCertificateCallbackImpl() { ~CefSelectClientCertificateCallbackImpl() {
// If Select has not been called, call it with NULL to continue without any // If Select has not been called, call it with NULL to continue without any
// client certificate. // client certificate.
@@ -342,12 +354,15 @@ class CefSelectClientCertificateCallbackImpl
std::unique_ptr<content::ClientCertificateDelegate> delegate_; std::unique_ptr<content::ClientCertificateDelegate> delegate_;
IMPLEMENT_REFCOUNTING(CefSelectClientCertificateCallbackImpl); IMPLEMENT_REFCOUNTING(CefSelectClientCertificateCallbackImpl);
DISALLOW_COPY_AND_ASSIGN(CefSelectClientCertificateCallbackImpl);
}; };
class CefQuotaPermissionContext : public content::QuotaPermissionContext { class CefQuotaPermissionContext : public content::QuotaPermissionContext {
public: public:
CefQuotaPermissionContext() {} CefQuotaPermissionContext() = default;
CefQuotaPermissionContext(const CefQuotaPermissionContext&) = delete;
CefQuotaPermissionContext& operator=(const CefQuotaPermissionContext&) =
delete;
// The callback will be dispatched on the IO thread. // The callback will be dispatched on the IO thread.
void RequestQuotaPermission(const content::StorageQuotaParams& params, void RequestQuotaPermission(const content::StorageQuotaParams& params,
@@ -389,9 +404,7 @@ class CefQuotaPermissionContext : public content::QuotaPermissionContext {
} }
private: private:
~CefQuotaPermissionContext() override {} ~CefQuotaPermissionContext() override = default;
DISALLOW_COPY_AND_ASSIGN(CefQuotaPermissionContext);
}; };
#if defined(OS_POSIX) && !defined(OS_MAC) #if defined(OS_POSIX) && !defined(OS_MAC)
@@ -495,8 +508,8 @@ AlloyContentBrowserClient::~AlloyContentBrowserClient() = default;
std::unique_ptr<content::BrowserMainParts> std::unique_ptr<content::BrowserMainParts>
AlloyContentBrowserClient::CreateBrowserMainParts( AlloyContentBrowserClient::CreateBrowserMainParts(
const content::MainFunctionParams& parameters) { content::MainFunctionParams parameters) {
browser_main_parts_ = new AlloyBrowserMainParts(parameters); browser_main_parts_ = new AlloyBrowserMainParts(std::move(parameters));
return base::WrapUnique(browser_main_parts_); return base::WrapUnique(browser_main_parts_);
} }
@@ -1510,6 +1523,18 @@ bool AlloyContentBrowserClient::ShouldAllowPluginCreation(
return true; return true;
} }
void AlloyContentBrowserClient::OnWebContentsCreated(
content::WebContents* web_contents) {
// Attach universal WebContentsObservers. These are quite rare, and in most
// cases CefBrowserPlatformDelegateAlloy::BrowserCreated and/or
// CefExtensionsAPIClient::AttachWebContentsHelpers should be used instead.
if (extensions::ExtensionsEnabled()) {
extensions::CefExtensionWebContentsObserver::CreateForWebContents(
web_contents);
}
}
bool AlloyContentBrowserClient::IsFindInPageDisabledForOrigin( bool AlloyContentBrowserClient::IsFindInPageDisabledForOrigin(
const url::Origin& origin) { const url::Origin& origin) {
// For PDF viewing with the PPAPI-free PDF Viewer, find-in-page should only // For PDF viewing with the PPAPI-free PDF Viewer, find-in-page should only

View File

@@ -12,7 +12,6 @@
#include "include/cef_request_context_handler.h" #include "include/cef_request_context_handler.h"
#include "libcef/browser/request_context_impl.h" #include "libcef/browser/request_context_impl.h"
#include "base/macros.h"
#include "base/memory/ref_counted.h" #include "base/memory/ref_counted.h"
#include "build/build_config.h" #include "build/build_config.h"
#include "content/public/browser/content_browser_client.h" #include "content/public/browser/content_browser_client.h"
@@ -36,7 +35,7 @@ class AlloyContentBrowserClient : public content::ContentBrowserClient {
// ContentBrowserClient implementation. // ContentBrowserClient implementation.
std::unique_ptr<content::BrowserMainParts> CreateBrowserMainParts( std::unique_ptr<content::BrowserMainParts> CreateBrowserMainParts(
const content::MainFunctionParams& parameters) override; content::MainFunctionParams parameters) override;
void RenderProcessWillLaunch(content::RenderProcessHost* host) override; void RenderProcessWillLaunch(content::RenderProcessHost* host) override;
bool ShouldUseProcessPerSite(content::BrowserContext* browser_context, bool ShouldUseProcessPerSite(content::BrowserContext* browser_context,
const GURL& site_url) override; const GURL& site_url) override;
@@ -237,6 +236,7 @@ class AlloyContentBrowserClient : public content::ContentBrowserClient {
bool ShouldAllowPluginCreation( bool ShouldAllowPluginCreation(
const url::Origin& embedder_origin, const url::Origin& embedder_origin,
const content::PepperPluginInfo& plugin_info) override; const content::PepperPluginInfo& plugin_info) override;
void OnWebContentsCreated(content::WebContents* web_contents) override;
bool IsFindInPageDisabledForOrigin(const url::Origin& origin) override; bool IsFindInPageDisabledForOrigin(const url::Origin& origin) override;
CefRefPtr<CefRequestContextImpl> request_context() const; CefRefPtr<CefRequestContextImpl> request_context() const;

View File

@@ -179,9 +179,6 @@ void CefBrowserPlatformDelegateAlloy::BrowserCreated(
printing::CefPrintViewManager::CreateForWebContents(web_contents_); printing::CefPrintViewManager::CreateForWebContents(web_contents_);
if (extensions::ExtensionsEnabled()) { if (extensions::ExtensionsEnabled()) {
extensions::CefExtensionWebContentsObserver::CreateForWebContents(
web_contents_);
// Used by the tabs extension API. // Used by the tabs extension API.
zoom::ZoomController::CreateForWebContents(web_contents_); zoom::ZoomController::CreateForWebContents(web_contents_);
} }

View File

@@ -16,6 +16,11 @@
// Implementation of Alloy-based browser functionality. // Implementation of Alloy-based browser functionality.
class CefBrowserPlatformDelegateAlloy : public CefBrowserPlatformDelegate { class CefBrowserPlatformDelegateAlloy : public CefBrowserPlatformDelegate {
public: public:
CefBrowserPlatformDelegateAlloy(const CefBrowserPlatformDelegateAlloy&) =
delete;
CefBrowserPlatformDelegateAlloy& operator=(
const CefBrowserPlatformDelegateAlloy&) = delete;
content::WebContents* CreateWebContents(CefBrowserCreateParams& create_params, content::WebContents* CreateWebContents(CefBrowserCreateParams& create_params,
bool& own_web_contents) override; bool& own_web_contents) override;
void WebContentsCreated(content::WebContents* web_contents, void WebContentsCreated(content::WebContents* web_contents,
@@ -108,8 +113,6 @@ class CefBrowserPlatformDelegateAlloy : public CefBrowserPlatformDelegate {
bool primary_ = true; bool primary_ = true;
base::WeakPtrFactory<CefBrowserPlatformDelegateAlloy> weak_ptr_factory_; base::WeakPtrFactory<CefBrowserPlatformDelegateAlloy> weak_ptr_factory_;
DISALLOW_COPY_AND_ASSIGN(CefBrowserPlatformDelegateAlloy);
}; };
#endif // CEF_LIBCEF_BROWSER_ALLOY_BROWSER_PLATFORM_DELEGATE_ALLOY_H_ #endif // CEF_LIBCEF_BROWSER_ALLOY_BROWSER_PLATFORM_DELEGATE_ALLOY_H_

View File

@@ -160,11 +160,6 @@ ChromeBrowserProcessAlloy::network_quality_tracker() {
return nullptr; return nullptr;
} }
WatchDogThread* ChromeBrowserProcessAlloy::watchdog_thread() {
NOTREACHED();
return nullptr;
}
ProfileManager* ChromeBrowserProcessAlloy::profile_manager() { ProfileManager* ChromeBrowserProcessAlloy::profile_manager() {
DCHECK(context_initialized_); DCHECK(context_initialized_);
return profile_manager_.get(); return profile_manager_.get();
@@ -365,7 +360,7 @@ ChromeBrowserProcessAlloy::component_updater() {
component_updater::MakeChromeComponentUpdaterConfigurator( component_updater::MakeChromeComponentUpdaterConfigurator(
base::CommandLine::ForCurrentProcess(), base::CommandLine::ForCurrentProcess(),
g_browser_process->local_state()), g_browser_process->local_state()),
std::move(scheduler)); std::move(scheduler), /*brand=*/std::string());
return component_updater_.get(); return component_updater_.get();
} }

View File

@@ -28,15 +28,21 @@ class ChromeProfileManagerAlloy;
class BackgroundModeManager { class BackgroundModeManager {
public: public:
BackgroundModeManager(); BackgroundModeManager();
virtual ~BackgroundModeManager();
private: BackgroundModeManager(const BackgroundModeManager&) = delete;
DISALLOW_COPY_AND_ASSIGN(BackgroundModeManager); BackgroundModeManager& operator=(const BackgroundModeManager&) = delete;
virtual ~BackgroundModeManager();
}; };
class ChromeBrowserProcessAlloy : public BrowserProcess { class ChromeBrowserProcessAlloy : public BrowserProcess {
public: public:
ChromeBrowserProcessAlloy(); ChromeBrowserProcessAlloy();
ChromeBrowserProcessAlloy(const ChromeBrowserProcessAlloy&) = delete;
ChromeBrowserProcessAlloy& operator=(const ChromeBrowserProcessAlloy&) =
delete;
~ChromeBrowserProcessAlloy() override; ~ChromeBrowserProcessAlloy() override;
void Initialize(); void Initialize();
@@ -51,7 +57,6 @@ class ChromeBrowserProcessAlloy : public BrowserProcess {
metrics::MetricsService* metrics_service() override; metrics::MetricsService* metrics_service() override;
SystemNetworkContextManager* system_network_context_manager() override; SystemNetworkContextManager* system_network_context_manager() override;
network::NetworkQualityTracker* network_quality_tracker() override; network::NetworkQualityTracker* network_quality_tracker() override;
WatchDogThread* watchdog_thread() override;
ProfileManager* profile_manager() override; ProfileManager* profile_manager() override;
PrefService* local_state() override; PrefService* local_state() override;
scoped_refptr<network::SharedURLLoaderFactory> shared_url_loader_factory() scoped_refptr<network::SharedURLLoaderFactory> shared_url_loader_factory()
@@ -131,8 +136,6 @@ class ChromeBrowserProcessAlloy : public BrowserProcess {
std::unique_ptr<base::FieldTrialList> field_trial_list_; std::unique_ptr<base::FieldTrialList> field_trial_list_;
std::unique_ptr<component_updater::ComponentUpdateService> component_updater_; std::unique_ptr<component_updater::ComponentUpdateService> component_updater_;
DISALLOW_COPY_AND_ASSIGN(ChromeBrowserProcessAlloy);
}; };
#endif // CEF_LIBCEF_BROWSER_ALLOY_CHROME_BROWSER_PROCESS_ALLOY_H_ #endif // CEF_LIBCEF_BROWSER_ALLOY_CHROME_BROWSER_PROCESS_ALLOY_H_

View File

@@ -108,10 +108,6 @@ const Profile* ChromeProfileAlloy::GetOriginalProfile() const {
return this; return this;
} }
bool ChromeProfileAlloy::IsSupervised() const {
return false;
}
bool ChromeProfileAlloy::IsChild() const { bool ChromeProfileAlloy::IsChild() const {
return false; return false;
} }

View File

@@ -16,6 +16,10 @@
class ChromeProfileAlloy : public Profile { class ChromeProfileAlloy : public Profile {
public: public:
ChromeProfileAlloy(); ChromeProfileAlloy();
ChromeProfileAlloy(const ChromeProfileAlloy&) = delete;
ChromeProfileAlloy& operator=(const ChromeProfileAlloy&) = delete;
~ChromeProfileAlloy() override; ~ChromeProfileAlloy() override;
protected: protected:
@@ -35,7 +39,6 @@ class ChromeProfileAlloy : public Profile {
bool HasAnyOffTheRecordProfile() override; bool HasAnyOffTheRecordProfile() override;
Profile* GetOriginalProfile() override; Profile* GetOriginalProfile() override;
const Profile* GetOriginalProfile() const override; const Profile* GetOriginalProfile() const override;
bool IsSupervised() const override;
bool IsChild() const override; bool IsChild() const override;
ExtensionSpecialStoragePolicy* GetExtensionSpecialStoragePolicy() override; ExtensionSpecialStoragePolicy* GetExtensionSpecialStoragePolicy() override;
bool IsSameOrParent(Profile* profile) override; bool IsSameOrParent(Profile* profile) override;
@@ -51,8 +54,6 @@ class ChromeProfileAlloy : public Profile {
private: private:
std::unique_ptr<variations::VariationsClient> variations_client_; std::unique_ptr<variations::VariationsClient> variations_client_;
DISALLOW_COPY_AND_ASSIGN(ChromeProfileAlloy);
}; };
#endif // CEF_LIBCEF_BROWSER_ALLOY_CHROME_PROFILE_ALLOY_H_ #endif // CEF_LIBCEF_BROWSER_ALLOY_CHROME_PROFILE_ALLOY_H_

View File

@@ -14,13 +14,15 @@
class ChromeProfileManagerAlloy : public ProfileManager { class ChromeProfileManagerAlloy : public ProfileManager {
public: public:
ChromeProfileManagerAlloy(); ChromeProfileManagerAlloy();
ChromeProfileManagerAlloy(const ChromeProfileManagerAlloy&) = delete;
ChromeProfileManagerAlloy& operator=(const ChromeProfileManagerAlloy&) =
delete;
~ChromeProfileManagerAlloy() override; ~ChromeProfileManagerAlloy() override;
Profile* GetProfile(const base::FilePath& profile_dir) override; Profile* GetProfile(const base::FilePath& profile_dir) override;
bool IsValidProfile(const void* profile) override; bool IsValidProfile(const void* profile) override;
private:
DISALLOW_COPY_AND_ASSIGN(ChromeProfileManagerAlloy);
}; };
#endif // CEF_LIBCEF_BROWSER_ALLOY_CHROME_PROFILE_MANAGER_ALLOY_H_ #endif // CEF_LIBCEF_BROWSER_ALLOY_CHROME_PROFILE_MANAGER_ALLOY_H_

View File

@@ -35,6 +35,10 @@ class StreamCreatedCallbackAdapter final
DCHECK(callback_); DCHECK(callback_);
} }
StreamCreatedCallbackAdapter(const StreamCreatedCallbackAdapter&) = delete;
StreamCreatedCallbackAdapter& operator=(const StreamCreatedCallbackAdapter&) =
delete;
~StreamCreatedCallbackAdapter() override {} ~StreamCreatedCallbackAdapter() override {}
// blink::mojom::RendererAudioInputStreamFactoryClient implementation. // blink::mojom::RendererAudioInputStreamFactoryClient implementation.
@@ -52,8 +56,6 @@ class StreamCreatedCallbackAdapter final
private: private:
const CefAudioLoopbackStreamCreator::StreamCreatedCallback callback_; const CefAudioLoopbackStreamCreator::StreamCreatedCallback callback_;
DISALLOW_COPY_AND_ASSIGN(StreamCreatedCallbackAdapter);
}; };
void CreateLoopbackStreamHelper( void CreateLoopbackStreamHelper(

View File

@@ -6,7 +6,6 @@
#define CEF_LIBCEF_BROWSER_AUDIO_LOOPBACK_STREAM_CREATOR_H_ #define CEF_LIBCEF_BROWSER_AUDIO_LOOPBACK_STREAM_CREATOR_H_
#include "base/callback.h" #include "base/callback.h"
#include "base/macros.h"
#include "content/browser/media/forwarding_audio_stream_factory.h" #include "content/browser/media/forwarding_audio_stream_factory.h"
#include "content/common/content_export.h" #include "content/common/content_export.h"
#include "media/mojo/mojom/audio_data_pipe.mojom.h" #include "media/mojo/mojom/audio_data_pipe.mojom.h"
@@ -25,6 +24,11 @@ class AudioParameters;
class CefAudioLoopbackStreamCreator final { class CefAudioLoopbackStreamCreator final {
public: public:
CefAudioLoopbackStreamCreator(); CefAudioLoopbackStreamCreator();
CefAudioLoopbackStreamCreator(const CefAudioLoopbackStreamCreator&) = delete;
CefAudioLoopbackStreamCreator& operator=(
const CefAudioLoopbackStreamCreator&) = delete;
~CefAudioLoopbackStreamCreator(); ~CefAudioLoopbackStreamCreator();
// The callback that is called when the requested stream is created. // The callback that is called when the requested stream is created.
@@ -44,8 +48,6 @@ class CefAudioLoopbackStreamCreator final {
private: private:
content::ForwardingAudioStreamFactory factory_; content::ForwardingAudioStreamFactory factory_;
DISALLOW_COPY_AND_ASSIGN(CefAudioLoopbackStreamCreator);
}; };
#endif // CEF_LIBCEF_BROWSER_AUDIO_LOOPBACK_STREAM_CREATOR_H_ #endif // CEF_LIBCEF_BROWSER_AUDIO_LOOPBACK_STREAM_CREATOR_H_

View File

@@ -91,7 +91,7 @@ content::WebContents* CefBrowserContentsDelegate::OpenURLFromTab(
void CefBrowserContentsDelegate::LoadingStateChanged( void CefBrowserContentsDelegate::LoadingStateChanged(
content::WebContents* source, content::WebContents* source,
bool to_different_document) { bool should_show_loading_ui) {
const int current_index = const int current_index =
source->GetController().GetLastCommittedEntryIndex(); source->GetController().GetLastCommittedEntryIndex();
const int max_index = source->GetController().GetEntryCount() - 1; const int max_index = source->GetController().GetEntryCount() - 1;

View File

@@ -72,6 +72,10 @@ class CefBrowserContentsDelegate : public content::WebContentsDelegate,
explicit CefBrowserContentsDelegate( explicit CefBrowserContentsDelegate(
scoped_refptr<CefBrowserInfo> browser_info); scoped_refptr<CefBrowserInfo> browser_info);
CefBrowserContentsDelegate(const CefBrowserContentsDelegate&) = delete;
CefBrowserContentsDelegate& operator=(const CefBrowserContentsDelegate&) =
delete;
void ObserveWebContents(content::WebContents* new_contents); void ObserveWebContents(content::WebContents* new_contents);
// Manage observer objects. The observer must either outlive this object or // Manage observer objects. The observer must either outlive this object or
@@ -84,7 +88,7 @@ class CefBrowserContentsDelegate : public content::WebContentsDelegate,
content::WebContents* source, content::WebContents* source,
const content::OpenURLParams& params) override; const content::OpenURLParams& params) override;
void LoadingStateChanged(content::WebContents* source, void LoadingStateChanged(content::WebContents* source,
bool to_different_document) override; bool should_show_loading_ui) override;
void UpdateTargetURL(content::WebContents* source, const GURL& url) override; void UpdateTargetURL(content::WebContents* source, const GURL& url) override;
bool DidAddMessageToConsole(content::WebContents* source, bool DidAddMessageToConsole(content::WebContents* source,
blink::mojom::ConsoleMessageLevel log_level, blink::mojom::ConsoleMessageLevel log_level,
@@ -195,8 +199,6 @@ class CefBrowserContentsDelegate : public content::WebContentsDelegate,
// True if the focus is currently on an editable field on the page. // True if the focus is currently on an editable field on the page.
bool focus_on_editable_field_ = false; bool focus_on_editable_field_ = false;
DISALLOW_COPY_AND_ASSIGN(CefBrowserContentsDelegate);
}; };
#endif // CEF_LIBCEF_BROWSER_BROWSER_CONTENTS_DELEGATE_H_ #endif // CEF_LIBCEF_BROWSER_BROWSER_CONTENTS_DELEGATE_H_

View File

@@ -34,9 +34,13 @@ namespace {
// Manages the global list of Impl instances. // Manages the global list of Impl instances.
class ImplManager { class ImplManager {
public: public:
typedef std::vector<CefBrowserContext*> Vector; using Vector = std::vector<CefBrowserContext*>;
ImplManager() {} ImplManager() {}
ImplManager(const ImplManager&) = delete;
ImplManager& operator=(const ImplManager&) = delete;
~ImplManager() { ~ImplManager() {
DCHECK(all_.empty()); DCHECK(all_.empty());
DCHECK(map_.empty()); DCHECK(map_.empty());
@@ -122,12 +126,10 @@ class ImplManager {
return all_.end(); return all_.end();
} }
typedef std::map<base::FilePath, CefBrowserContext*> PathMap; using PathMap = std::map<base::FilePath, CefBrowserContext*>;
PathMap map_; PathMap map_;
Vector all_; Vector all_;
DISALLOW_COPY_AND_ASSIGN(ImplManager);
}; };
#if DCHECK_IS_ON() #if DCHECK_IS_ON()

View File

@@ -91,6 +91,9 @@ class Profile;
// the UI thread unless otherwise indicated. // the UI thread unless otherwise indicated.
class CefBrowserContext { class CefBrowserContext {
public: public:
CefBrowserContext(const CefBrowserContext&) = delete;
CefBrowserContext& operator=(const CefBrowserContext&) = delete;
// Returns the existing instance, if any, associated with the specified // Returns the existing instance, if any, associated with the specified
// |cache_path|. // |cache_path|.
static CefBrowserContext* FromCachePath(const base::FilePath& cache_path); static CefBrowserContext* FromCachePath(const base::FilePath& cache_path);
@@ -226,7 +229,7 @@ class CefBrowserContext {
CefRequestContextHandlerMap handler_map_; CefRequestContextHandlerMap handler_map_;
// Set of global IDs associated with this context. // Set of global IDs associated with this context.
typedef std::set<content::GlobalRenderFrameHostId> RenderIdSet; using RenderIdSet = std::set<content::GlobalRenderFrameHostId>;
RenderIdSet render_id_set_; RenderIdSet render_id_set_;
#if DCHECK_IS_ON() #if DCHECK_IS_ON()
@@ -235,8 +238,6 @@ class CefBrowserContext {
Getter getter_; Getter getter_;
base::WeakPtrFactory<CefBrowserContext> weak_ptr_factory_; base::WeakPtrFactory<CefBrowserContext> weak_ptr_factory_;
DISALLOW_COPY_AND_ASSIGN(CefBrowserContext);
}; };
#endif // CEF_LIBCEF_BROWSER_BROWSER_CONTEXT_IMPL_H_ #endif // CEF_LIBCEF_BROWSER_BROWSER_CONTEXT_IMPL_H_

View File

@@ -35,18 +35,20 @@ void CefBrowserFrame::RegisterBrowserInterfaceBindersForFrame(
void CefBrowserFrame::SendMessage(const std::string& name, void CefBrowserFrame::SendMessage(const std::string& name,
base::Value arguments) { base::Value arguments) {
// Always associate with the newly created RFH, which may be speculative when // Always send to the newly created RFH, which may be speculative when
// navigating cross-origin. // navigating cross-origin.
if (auto host = GetFrameHost(/*prefer_speculative=*/true)) { if (auto host = GetFrameHost(/*prefer_speculative=*/true)) {
host->SendMessage(name, std::move(arguments)); host->SendMessage(name, std::move(arguments));
} }
} }
void CefBrowserFrame::FrameAttached() { void CefBrowserFrame::FrameAttached(
mojo::PendingRemote<cef::mojom::RenderFrame> render_frame,
bool reattached) {
// Always send to the newly created RFH, which may be speculative when // Always send to the newly created RFH, which may be speculative when
// navigating cross-origin. // navigating cross-origin.
if (auto host = GetFrameHost(/*prefer_speculative=*/true)) { if (auto host = GetFrameHost(/*prefer_speculative=*/true)) {
host->FrameAttached(); host->FrameAttached(std::move(render_frame), reattached);
} }
} }

View File

@@ -22,6 +22,10 @@ class CefBrowserFrame
public: public:
CefBrowserFrame(content::RenderFrameHost* render_frame_host, CefBrowserFrame(content::RenderFrameHost* render_frame_host,
mojo::PendingReceiver<cef::mojom::BrowserFrame> receiver); mojo::PendingReceiver<cef::mojom::BrowserFrame> receiver);
CefBrowserFrame(const CefBrowserFrame&) = delete;
CefBrowserFrame& operator=(const CefBrowserFrame&) = delete;
~CefBrowserFrame() override; ~CefBrowserFrame() override;
// Called from the ContentBrowserClient method of the same name. // Called from the ContentBrowserClient method of the same name.
@@ -32,7 +36,8 @@ class CefBrowserFrame
private: private:
// cef::mojom::BrowserFrame methods: // cef::mojom::BrowserFrame methods:
void SendMessage(const std::string& name, base::Value arguments) override; void SendMessage(const std::string& name, base::Value arguments) override;
void FrameAttached() override; void FrameAttached(mojo::PendingRemote<cef::mojom::RenderFrame> render_frame,
bool reattached) override;
void DidFinishFrameLoad(const GURL& validated_url, void DidFinishFrameLoad(const GURL& validated_url,
int32_t http_status_code) override; int32_t http_status_code) override;
void UpdateDraggableRegions( void UpdateDraggableRegions(
@@ -44,8 +49,6 @@ class CefBrowserFrame
CefRefPtr<CefFrameHostImpl> GetFrameHost( CefRefPtr<CefFrameHostImpl> GetFrameHost(
bool prefer_speculative = false) const; bool prefer_speculative = false) const;
DISALLOW_COPY_AND_ASSIGN(CefBrowserFrame);
}; };
#endif // CEF_LIBCEF_BROWSER_BROWSER_FRAME_H_ #endif // CEF_LIBCEF_BROWSER_BROWSER_FRAME_H_

View File

@@ -13,6 +13,7 @@
#include "libcef/common/frame_util.h" #include "libcef/common/frame_util.h"
#include "libcef/common/net/url_util.h" #include "libcef/common/net/url_util.h"
#include "base/ignore_result.h"
#include "base/logging.h" #include "base/logging.h"
#include "chrome/browser/spellchecker/spellcheck_factory.h" #include "chrome/browser/spellchecker/spellcheck_factory.h"
#include "chrome/browser/spellchecker/spellcheck_service.h" #include "chrome/browser/spellchecker/spellcheck_service.h"

View File

@@ -134,6 +134,9 @@ class CefBrowserHostBase : public CefBrowserHost,
scoped_refptr<CefBrowserInfo> browser_info, scoped_refptr<CefBrowserInfo> browser_info,
CefRefPtr<CefRequestContextImpl> request_context); CefRefPtr<CefRequestContextImpl> request_context);
CefBrowserHostBase(const CefBrowserHostBase&) = delete;
CefBrowserHostBase& operator=(const CefBrowserHostBase&) = delete;
// Called on the UI thread after the associated WebContents is created. // Called on the UI thread after the associated WebContents is created.
virtual void InitializeBrowser(); virtual void InitializeBrowser();
@@ -310,7 +313,6 @@ class CefBrowserHostBase : public CefBrowserHost,
private: private:
IMPLEMENT_REFCOUNTING(CefBrowserHostBase); IMPLEMENT_REFCOUNTING(CefBrowserHostBase);
DISALLOW_COPY_AND_ASSIGN(CefBrowserHostBase);
}; };
#endif // CEF_LIBCEF_BROWSER_BROWSER_HOST_BASE_H_ #endif // CEF_LIBCEF_BROWSER_BROWSER_HOST_BASE_H_

View File

@@ -168,10 +168,13 @@ void CefBrowserInfo::FrameHostStateChanged(
content::RenderFrameHost::LifecycleState::kInBackForwardCache) && content::RenderFrameHost::LifecycleState::kInBackForwardCache) &&
new_state == content::RenderFrameHost::LifecycleState::kActive) { new_state == content::RenderFrameHost::LifecycleState::kActive) {
if (auto frame = GetFrameForHost(host)) { if (auto frame = GetFrameForHost(host)) {
// Should only occur for the main frame.
CHECK(frame->IsMain());
// Update the associated RFH, which may have changed. // Update the associated RFH, which may have changed.
frame->MaybeReAttach(this, host); frame->MaybeReAttach(this, host);
if (frame->IsMain()) { {
// Update the main frame object. // Update the main frame object.
NotificationStateLock lock_scope(this); NotificationStateLock lock_scope(this);
SetMainFrame(browser_, frame); SetMainFrame(browser_, frame);

View File

@@ -39,6 +39,9 @@ class CefBrowserInfo : public base::RefCountedThreadSafe<CefBrowserInfo> {
bool is_windowless, bool is_windowless,
CefRefPtr<CefDictionaryValue> extra_info); CefRefPtr<CefDictionaryValue> extra_info);
CefBrowserInfo(const CefBrowserInfo&) = delete;
CefBrowserInfo& operator=(const CefBrowserInfo&) = delete;
int browser_id() const { return browser_id_; } int browser_id() const { return browser_id_; }
bool is_popup() const { return is_popup_; } bool is_popup() const { return is_popup_; }
bool is_windowless() const { return is_windowless_; } bool is_windowless() const { return is_windowless_; }
@@ -119,7 +122,7 @@ class CefBrowserInfo : public base::RefCountedThreadSafe<CefBrowserInfo> {
// Returns all non-speculative frame objects that currently exist. Guest views // Returns all non-speculative frame objects that currently exist. Guest views
// will be excluded because they don't have a frame object. Safe to call from // will be excluded because they don't have a frame object. Safe to call from
// any thread. // any thread.
typedef std::set<CefRefPtr<CefFrameHostImpl>> FrameHostList; using FrameHostList = std::set<CefRefPtr<CefFrameHostImpl>>;
FrameHostList GetAllFrames() const; FrameHostList GetAllFrames() const;
class NavigationLock final : public base::RefCounted<NavigationLock> { class NavigationLock final : public base::RefCounted<NavigationLock> {
@@ -251,8 +254,6 @@ class CefBrowserInfo : public base::RefCountedThreadSafe<CefBrowserInfo> {
// Only accessed on the UI thread. // Only accessed on the UI thread.
std::vector<CefDraggableRegion> draggable_regions_; std::vector<CefDraggableRegion> draggable_regions_;
DISALLOW_COPY_AND_ASSIGN(CefBrowserInfo);
}; };
#endif // CEF_LIBCEF_BROWSER_BROWSER_INFO_H_ #endif // CEF_LIBCEF_BROWSER_BROWSER_INFO_H_

View File

@@ -44,6 +44,10 @@ class CefBrowserPlatformDelegate;
class CefBrowserInfoManager : public content::RenderProcessHostObserver { class CefBrowserInfoManager : public content::RenderProcessHostObserver {
public: public:
CefBrowserInfoManager(); CefBrowserInfoManager();
CefBrowserInfoManager(const CefBrowserInfoManager&) = delete;
CefBrowserInfoManager& operator=(const CefBrowserInfoManager&) = delete;
~CefBrowserInfoManager() override; ~CefBrowserInfoManager() override;
// Returns this singleton instance of this class. // Returns this singleton instance of this class.
@@ -232,8 +236,6 @@ class CefBrowserInfoManager : public content::RenderProcessHostObserver {
PendingPopupList pending_popup_list_; PendingPopupList pending_popup_list_;
int next_timeout_id_ = 0; int next_timeout_id_ = 0;
DISALLOW_COPY_AND_ASSIGN(CefBrowserInfoManager);
}; };
#endif // CEF_LIBCEF_BROWSER_BROWSER_INFO_H_ #endif // CEF_LIBCEF_BROWSER_BROWSER_INFO_H_

View File

@@ -20,6 +20,10 @@ class RenderProcessHost;
class CefBrowserManager : public cef::mojom::BrowserManager { class CefBrowserManager : public cef::mojom::BrowserManager {
public: public:
explicit CefBrowserManager(int render_process_id); explicit CefBrowserManager(int render_process_id);
CefBrowserManager(const CefBrowserManager&) = delete;
CefBrowserManager& operator=(const CefBrowserManager&) = delete;
~CefBrowserManager() override; ~CefBrowserManager() override;
// Called from the ContentBrowserClient method of the same name. // Called from the ContentBrowserClient method of the same name.
@@ -47,8 +51,6 @@ class CefBrowserManager : public cef::mojom::BrowserManager {
// The process ID of the renderer. // The process ID of the renderer.
const int render_process_id_; const int render_process_id_;
DISALLOW_COPY_AND_ASSIGN(CefBrowserManager);
}; };
#endif // CEF_LIBCEF_BROWSER_BROWSER_MANAGER_H_ #endif // CEF_LIBCEF_BROWSER_BROWSER_MANAGER_H_

View File

@@ -74,6 +74,10 @@ class CefMenuRunner;
// indicated. // indicated.
class CefBrowserPlatformDelegate { class CefBrowserPlatformDelegate {
public: public:
CefBrowserPlatformDelegate(const CefBrowserPlatformDelegate&) = delete;
CefBrowserPlatformDelegate& operator=(const CefBrowserPlatformDelegate&) =
delete;
// Create a new CefBrowserPlatformDelegate instance. May be called on multiple // Create a new CefBrowserPlatformDelegate instance. May be called on multiple
// threads. // threads.
static std::unique_ptr<CefBrowserPlatformDelegate> Create( static std::unique_ptr<CefBrowserPlatformDelegate> Create(
@@ -368,8 +372,6 @@ class CefBrowserPlatformDelegate {
// Not owned by this object. // Not owned by this object.
content::WebContents* web_contents_ = nullptr; content::WebContents* web_contents_ = nullptr;
CefBrowserHostBase* browser_ = nullptr; CefBrowserHostBase* browser_ = nullptr;
DISALLOW_COPY_AND_ASSIGN(CefBrowserPlatformDelegate);
}; };
#endif // CEF_LIBCEF_BROWSER_BROWSER_PLATFORM_DELEGATE_H_ #endif // CEF_LIBCEF_BROWSER_BROWSER_PLATFORM_DELEGATE_H_

View File

@@ -20,6 +20,9 @@ class ChromeBrowserContext : public CefBrowserContext, public ProfileObserver {
public: public:
explicit ChromeBrowserContext(const CefRequestContextSettings& settings); explicit ChromeBrowserContext(const CefRequestContextSettings& settings);
ChromeBrowserContext(const ChromeBrowserContext&) = delete;
ChromeBrowserContext& operator=(const ChromeBrowserContext&) = delete;
void InitializeAsync(base::OnceClosure initialized_cb); void InitializeAsync(base::OnceClosure initialized_cb);
// CefBrowserContext overrides. // CefBrowserContext overrides.
@@ -47,8 +50,6 @@ class ChromeBrowserContext : public CefBrowserContext, public ProfileObserver {
std::vector<base::OnceClosure> init_callbacks_; std::vector<base::OnceClosure> init_callbacks_;
base::WeakPtrFactory<ChromeBrowserContext> weak_ptr_factory_; base::WeakPtrFactory<ChromeBrowserContext> weak_ptr_factory_;
DISALLOW_COPY_AND_ASSIGN(ChromeBrowserContext);
}; };
#endif // CEF_LIBCEF_BROWSER_CHROME_CHROME_BROWSER_CONTEXT_H_ #endif // CEF_LIBCEF_BROWSER_CHROME_CHROME_BROWSER_CONTEXT_H_

View File

@@ -152,9 +152,9 @@ content::WebContents* ChromeBrowserDelegate::OpenURLFromTab(
} }
void ChromeBrowserDelegate::LoadingStateChanged(content::WebContents* source, void ChromeBrowserDelegate::LoadingStateChanged(content::WebContents* source,
bool to_different_document) { bool should_show_loading_ui) {
if (auto delegate = GetDelegateForWebContents(source)) { if (auto delegate = GetDelegateForWebContents(source)) {
delegate->LoadingStateChanged(source, to_different_document); delegate->LoadingStateChanged(source, should_show_loading_ui);
} }
} }

View File

@@ -41,6 +41,10 @@ class ChromeBrowserDelegate : public cef::BrowserDelegate {
public: public:
ChromeBrowserDelegate(Browser* browser, ChromeBrowserDelegate(Browser* browser,
const CefBrowserCreateParams& create_params); const CefBrowserCreateParams& create_params);
ChromeBrowserDelegate(const ChromeBrowserDelegate&) = delete;
ChromeBrowserDelegate& operator=(const ChromeBrowserDelegate&) = delete;
~ChromeBrowserDelegate() override; ~ChromeBrowserDelegate() override;
// cef::BrowserDelegate methods: // cef::BrowserDelegate methods:
@@ -66,7 +70,7 @@ class ChromeBrowserDelegate : public cef::BrowserDelegate {
content::WebContents* source, content::WebContents* source,
const content::OpenURLParams& params) override; const content::OpenURLParams& params) override;
void LoadingStateChanged(content::WebContents* source, void LoadingStateChanged(content::WebContents* source,
bool to_different_document) override; bool should_show_loading_ui) override;
void UpdateTargetURL(content::WebContents* source, const GURL& url) override; void UpdateTargetURL(content::WebContents* source, const GURL& url) override;
bool DidAddMessageToConsole(content::WebContents* source, bool DidAddMessageToConsole(content::WebContents* source,
blink::mojom::ConsoleMessageLevel log_level, blink::mojom::ConsoleMessageLevel log_level,
@@ -105,8 +109,6 @@ class ChromeBrowserDelegate : public cef::BrowserDelegate {
// Used when creating a new browser host. // Used when creating a new browser host.
const CefBrowserCreateParams create_params_; const CefBrowserCreateParams create_params_;
DISALLOW_COPY_AND_ASSIGN(ChromeBrowserDelegate);
}; };
#endif // CEF_LIBCEF_BROWSER_CHROME_CHROME_BROWSER_DELEGATE_H_ #endif // CEF_LIBCEF_BROWSER_CHROME_CHROME_BROWSER_DELEGATE_H_

View File

@@ -9,7 +9,6 @@
#include "libcef/browser/request_context_impl.h" #include "libcef/browser/request_context_impl.h"
#include "base/macros.h"
#include "base/task/single_thread_task_runner.h" #include "base/task/single_thread_task_runner.h"
#include "chrome/browser/chrome_browser_main_extra_parts.h" #include "chrome/browser/chrome_browser_main_extra_parts.h"
@@ -17,6 +16,12 @@
class ChromeBrowserMainExtraPartsCef : public ChromeBrowserMainExtraParts { class ChromeBrowserMainExtraPartsCef : public ChromeBrowserMainExtraParts {
public: public:
ChromeBrowserMainExtraPartsCef(); ChromeBrowserMainExtraPartsCef();
ChromeBrowserMainExtraPartsCef(const ChromeBrowserMainExtraPartsCef&) =
delete;
ChromeBrowserMainExtraPartsCef& operator=(
const ChromeBrowserMainExtraPartsCef&) = delete;
~ChromeBrowserMainExtraPartsCef() override; ~ChromeBrowserMainExtraPartsCef() override;
CefRefPtr<CefRequestContextImpl> request_context() const { CefRefPtr<CefRequestContextImpl> request_context() const {
@@ -47,8 +52,6 @@ class ChromeBrowserMainExtraPartsCef : public ChromeBrowserMainExtraParts {
scoped_refptr<base::SingleThreadTaskRunner> background_task_runner_; scoped_refptr<base::SingleThreadTaskRunner> background_task_runner_;
scoped_refptr<base::SingleThreadTaskRunner> user_visible_task_runner_; scoped_refptr<base::SingleThreadTaskRunner> user_visible_task_runner_;
scoped_refptr<base::SingleThreadTaskRunner> user_blocking_task_runner_; scoped_refptr<base::SingleThreadTaskRunner> user_blocking_task_runner_;
DISALLOW_COPY_AND_ASSIGN(ChromeBrowserMainExtraPartsCef);
}; };
#endif // CEF_LIBCEF_BROWSER_CHROME_CHROME_BROWSER_MAIN_EXTRA_PARTS_CEF_H_ #endif // CEF_LIBCEF_BROWSER_CHROME_CHROME_BROWSER_MAIN_EXTRA_PARTS_CEF_H_

View File

@@ -24,6 +24,7 @@
#include "libcef/common/command_line_impl.h" #include "libcef/common/command_line_impl.h"
#include "base/command_line.h" #include "base/command_line.h"
#include "base/ignore_result.h"
#include "base/path_service.h" #include "base/path_service.h"
#include "chrome/browser/chrome_browser_main.h" #include "chrome/browser/chrome_browser_main.h"
#include "chrome/browser/net/system_network_context_manager.h" #include "chrome/browser/net/system_network_context_manager.h"
@@ -68,9 +69,9 @@ ChromeContentBrowserClientCef::~ChromeContentBrowserClientCef() = default;
std::unique_ptr<content::BrowserMainParts> std::unique_ptr<content::BrowserMainParts>
ChromeContentBrowserClientCef::CreateBrowserMainParts( ChromeContentBrowserClientCef::CreateBrowserMainParts(
const content::MainFunctionParams& parameters) { content::MainFunctionParams parameters) {
auto main_parts = auto main_parts =
ChromeContentBrowserClient::CreateBrowserMainParts(parameters); ChromeContentBrowserClient::CreateBrowserMainParts(std::move(parameters));
browser_main_parts_ = new ChromeBrowserMainExtraPartsCef; browser_main_parts_ = new ChromeBrowserMainExtraPartsCef;
static_cast<ChromeBrowserMainParts*>(main_parts.get()) static_cast<ChromeBrowserMainParts*>(main_parts.get())
->AddParts( ->AddParts(

View File

@@ -10,7 +10,6 @@
#include "libcef/browser/request_context_impl.h" #include "libcef/browser/request_context_impl.h"
#include "base/macros.h"
#include "chrome/browser/chrome_content_browser_client.h" #include "chrome/browser/chrome_content_browser_client.h"
class ChromeBrowserMainExtraPartsCef; class ChromeBrowserMainExtraPartsCef;
@@ -19,11 +18,16 @@ class ChromeBrowserMainExtraPartsCef;
class ChromeContentBrowserClientCef : public ChromeContentBrowserClient { class ChromeContentBrowserClientCef : public ChromeContentBrowserClient {
public: public:
ChromeContentBrowserClientCef(); ChromeContentBrowserClientCef();
ChromeContentBrowserClientCef(const ChromeContentBrowserClientCef&) = delete;
ChromeContentBrowserClientCef& operator=(
const ChromeContentBrowserClientCef&) = delete;
~ChromeContentBrowserClientCef() override; ~ChromeContentBrowserClientCef() override;
// ChromeContentBrowserClient overrides. // ChromeContentBrowserClient overrides.
std::unique_ptr<content::BrowserMainParts> CreateBrowserMainParts( std::unique_ptr<content::BrowserMainParts> CreateBrowserMainParts(
const content::MainFunctionParams& parameters) override; content::MainFunctionParams parameters) override;
void AppendExtraCommandLineSwitches(base::CommandLine* command_line, void AppendExtraCommandLineSwitches(base::CommandLine* command_line,
int child_process_id) override; int child_process_id) override;
void RenderProcessWillLaunch(content::RenderProcessHost* host) override; void RenderProcessWillLaunch(content::RenderProcessHost* host) override;
@@ -114,8 +118,6 @@ class ChromeContentBrowserClientCef : public ChromeContentBrowserClient {
private: private:
ChromeBrowserMainExtraPartsCef* browser_main_parts_ = nullptr; ChromeBrowserMainExtraPartsCef* browser_main_parts_ = nullptr;
DISALLOW_COPY_AND_ASSIGN(ChromeContentBrowserClientCef);
}; };
#endif // CEF_LIBCEF_BROWSER_CHROME_CHROME_CONTENT_BROWSER_CLIENT_CEF_ #endif // CEF_LIBCEF_BROWSER_CHROME_CHROME_CONTENT_BROWSER_CLIENT_CEF_

View File

@@ -23,6 +23,9 @@ class CefContextMenuObserver : public RenderViewContextMenuObserver,
CefRefPtr<CefContextMenuHandler> handler) CefRefPtr<CefContextMenuHandler> handler)
: context_menu_(context_menu), browser_(browser), handler_(handler) {} : context_menu_(context_menu), browser_(browser), handler_(handler) {}
CefContextMenuObserver(const CefContextMenuObserver&) = delete;
CefContextMenuObserver& operator=(const CefContextMenuObserver&) = delete;
// RenderViewContextMenuObserver methods: // RenderViewContextMenuObserver methods:
void InitMenu(const content::ContextMenuParams& params) override { void InitMenu(const content::ContextMenuParams& params) override {
@@ -177,8 +180,6 @@ class CefContextMenuObserver : public RenderViewContextMenuObserver,
// Map of command_id to ItemInfo. // Map of command_id to ItemInfo.
using ItemInfoMap = std::map<int, ItemInfo>; using ItemInfoMap = std::map<int, ItemInfo>;
ItemInfoMap iteminfomap_; ItemInfoMap iteminfomap_;
DISALLOW_COPY_AND_ASSIGN(CefContextMenuObserver);
}; };
std::unique_ptr<RenderViewContextMenuObserver> MenuCreatedCallback( std::unique_ptr<RenderViewContextMenuObserver> MenuCreatedCallback(

View File

@@ -17,6 +17,9 @@ class PopupWindowDelegate : public CefWindowDelegate {
explicit PopupWindowDelegate(CefRefPtr<CefBrowserView> browser_view) explicit PopupWindowDelegate(CefRefPtr<CefBrowserView> browser_view)
: browser_view_(browser_view) {} : browser_view_(browser_view) {}
PopupWindowDelegate(const PopupWindowDelegate&) = delete;
PopupWindowDelegate& operator=(const PopupWindowDelegate&) = delete;
void OnWindowCreated(CefRefPtr<CefWindow> window) override { void OnWindowCreated(CefRefPtr<CefWindow> window) override {
window->AddChildView(browser_view_); window->AddChildView(browser_view_);
window->Show(); window->Show();
@@ -38,7 +41,6 @@ class PopupWindowDelegate : public CefWindowDelegate {
CefRefPtr<CefBrowserView> browser_view_; CefRefPtr<CefBrowserView> browser_view_;
IMPLEMENT_REFCOUNTING(PopupWindowDelegate); IMPLEMENT_REFCOUNTING(PopupWindowDelegate);
DISALLOW_COPY_AND_ASSIGN(PopupWindowDelegate);
}; };
} // namespace } // namespace

View File

@@ -32,6 +32,9 @@ class ChromeBrowserView
ChromeBrowserView(CefBrowserViewDelegate* cef_delegate, ChromeBrowserView(CefBrowserViewDelegate* cef_delegate,
Delegate* browser_view_delegate); Delegate* browser_view_delegate);
ChromeBrowserView(const ChromeBrowserView&) = delete;
ChromeBrowserView& operator=(const ChromeBrowserView&) = delete;
// Called by ChromeBrowserHostImpl. // Called by ChromeBrowserHostImpl.
void InitBrowser(std::unique_ptr<Browser> browser, void InitBrowser(std::unique_ptr<Browser> browser,
CefRefPtr<CefBrowserView> browser_view); CefRefPtr<CefBrowserView> browser_view);
@@ -59,8 +62,6 @@ class ChromeBrowserView
bool destroyed_ = false; bool destroyed_ = false;
CefRefPtr<CefToolbarViewImpl> cef_toolbar_; CefRefPtr<CefToolbarViewImpl> cef_toolbar_;
DISALLOW_COPY_AND_ASSIGN(ChromeBrowserView);
}; };
#endif // CEF_LIBCEF_BROWSER_CHROME_VIEWS_CHROME_BROWSER_VIEW_H_ #endif // CEF_LIBCEF_BROWSER_CHROME_VIEWS_CHROME_BROWSER_VIEW_H_

View File

@@ -17,7 +17,10 @@ class BrowserView;
class CefToolbarViewImpl class CefToolbarViewImpl
: public CefViewImpl<CefToolbarViewView, CefView, CefViewDelegate> { : public CefViewImpl<CefToolbarViewView, CefView, CefViewDelegate> {
public: public:
typedef CefViewImpl<CefToolbarViewView, CefView, CefViewDelegate> ParentClass; using ParentClass = CefViewImpl<CefToolbarViewView, CefView, CefViewDelegate>;
CefToolbarViewImpl(const CefToolbarViewImpl&) = delete;
CefToolbarViewImpl& operator=(const CefToolbarViewImpl&) = delete;
// Create a new CefToolbarViewImpl instance. |delegate| may be nullptr. // Create a new CefToolbarViewImpl instance. |delegate| may be nullptr.
static CefRefPtr<CefToolbarViewImpl> Create( static CefRefPtr<CefToolbarViewImpl> Create(
@@ -49,7 +52,6 @@ class CefToolbarViewImpl
absl::optional<ToolbarView::DisplayMode> const display_mode_; absl::optional<ToolbarView::DisplayMode> const display_mode_;
IMPLEMENT_REFCOUNTING_DELETE_ON_UIT(CefToolbarViewImpl); IMPLEMENT_REFCOUNTING_DELETE_ON_UIT(CefToolbarViewImpl);
DISALLOW_COPY_AND_ASSIGN(CefToolbarViewImpl);
}; };
#endif // CEF_LIBCEF_BROWSER_VIEWS_SCROLL_VIEW_IMPL_H_ #endif // CEF_LIBCEF_BROWSER_VIEWS_SCROLL_VIEW_IMPL_H_

View File

@@ -12,7 +12,7 @@
class CefToolbarViewView : public CefViewView<ToolbarView, CefViewDelegate> { class CefToolbarViewView : public CefViewView<ToolbarView, CefViewDelegate> {
public: public:
typedef CefViewView<ToolbarView, CefViewDelegate> ParentClass; using ParentClass = CefViewView<ToolbarView, CefViewDelegate>;
// |cef_delegate| may be nullptr. // |cef_delegate| may be nullptr.
explicit CefToolbarViewView(CefViewDelegate* cef_delegate, explicit CefToolbarViewView(CefViewDelegate* cef_delegate,
@@ -20,8 +20,8 @@ class CefToolbarViewView : public CefViewView<ToolbarView, CefViewDelegate> {
BrowserView* browser_view, BrowserView* browser_view,
absl::optional<DisplayMode> display_mode); absl::optional<DisplayMode> display_mode);
private: CefToolbarViewView(const CefToolbarViewView&) = delete;
DISALLOW_COPY_AND_ASSIGN(CefToolbarViewView); CefToolbarViewView& operator=(const CefToolbarViewView&) = delete;
}; };
#endif // CEF_LIBCEF_BROWSER_CHROME_VIEWS_TOOLBAR_VIEW_VIEW_H_ #endif // CEF_LIBCEF_BROWSER_CHROME_VIEWS_TOOLBAR_VIEW_VIEW_H_

View File

@@ -17,6 +17,9 @@ class CefContextMenuParamsImpl
public: public:
explicit CefContextMenuParamsImpl(content::ContextMenuParams* value); explicit CefContextMenuParamsImpl(content::ContextMenuParams* value);
CefContextMenuParamsImpl(const CefContextMenuParamsImpl&) = delete;
CefContextMenuParamsImpl& operator=(const CefContextMenuParamsImpl&) = delete;
// CefContextMenuParams methods. // CefContextMenuParams methods.
int GetXCoord() override; int GetXCoord() override;
int GetYCoord() override; int GetYCoord() override;
@@ -38,8 +41,6 @@ class CefContextMenuParamsImpl
bool IsSpellCheckEnabled() override; bool IsSpellCheckEnabled() override;
EditStateFlags GetEditStateFlags() override; EditStateFlags GetEditStateFlags() override;
bool IsCustomMenu() override; bool IsCustomMenu() override;
DISALLOW_COPY_AND_ASSIGN(CefContextMenuParamsImpl);
}; };
#endif // CEF_LIBCEF_BROWSER_CONTEXT_MENU_PARAMS_IMPL_H_ #endif // CEF_LIBCEF_BROWSER_CONTEXT_MENU_PARAMS_IMPL_H_

View File

@@ -41,6 +41,10 @@ class CefDevToolsController : public content::DevToolsAgentHostClient {
// |inspected_contents| will outlive this object. // |inspected_contents| will outlive this object.
explicit CefDevToolsController(content::WebContents* inspected_contents); explicit CefDevToolsController(content::WebContents* inspected_contents);
CefDevToolsController(const CefDevToolsController&) = delete;
CefDevToolsController& operator=(const CefDevToolsController&) = delete;
~CefDevToolsController() override; ~CefDevToolsController() override;
// See CefBrowserHost methods of the same name for documentation. // See CefBrowserHost methods of the same name for documentation.
@@ -72,8 +76,6 @@ class CefDevToolsController : public content::DevToolsAgentHostClient {
base::ObserverList<Observer> observers_; base::ObserverList<Observer> observers_;
base::WeakPtrFactory<CefDevToolsController> weak_ptr_factory_; base::WeakPtrFactory<CefDevToolsController> weak_ptr_factory_;
DISALLOW_COPY_AND_ASSIGN(CefDevToolsController);
}; };
#endif // CEF_LIBCEF_BROWSER_DEVTOOLS_DEVTOOLS_CONTROLLER_H_ #endif // CEF_LIBCEF_BROWSER_DEVTOOLS_DEVTOOLS_CONTROLLER_H_

View File

@@ -6,7 +6,6 @@
#define CEF_LIBCEF_BROWSER_DEVTOOLS_DEVTOOLS_FILE_MANAGER_H_ #define CEF_LIBCEF_BROWSER_DEVTOOLS_DEVTOOLS_FILE_MANAGER_H_
#include "base/callback_forward.h" #include "base/callback_forward.h"
#include "base/macros.h"
#include "base/memory/weak_ptr.h" #include "base/memory/weak_ptr.h"
#include <map> #include <map>
@@ -29,6 +28,9 @@ class CefDevToolsFileManager {
CefDevToolsFileManager(AlloyBrowserHostImpl* browser_impl, CefDevToolsFileManager(AlloyBrowserHostImpl* browser_impl,
PrefService* prefs); PrefService* prefs);
CefDevToolsFileManager(const CefDevToolsFileManager&) = delete;
CefDevToolsFileManager& operator=(const CefDevToolsFileManager&) = delete;
void SaveToFile(const std::string& url, void SaveToFile(const std::string& url,
const std::string& content, const std::string& content,
bool save_as); bool save_as);
@@ -36,8 +38,8 @@ class CefDevToolsFileManager {
private: private:
// SaveToFile implementation: // SaveToFile implementation:
typedef base::OnceCallback<void(const std::string&)> SaveCallback; using SaveCallback = base::OnceCallback<void(const std::string&)>;
typedef base::OnceCallback<void()> CancelCallback; using CancelCallback = base::OnceCallback<void()>;
void Save(const std::string& url, void Save(const std::string& url,
const std::string& content, const std::string& content,
bool save_as, bool save_as,
@@ -57,7 +59,7 @@ class CefDevToolsFileManager {
void CanceledFileSaveAs(const std::string& url); void CanceledFileSaveAs(const std::string& url);
// AppendToFile implementation: // AppendToFile implementation:
typedef base::OnceCallback<void(void)> AppendCallback; using AppendCallback = base::OnceCallback<void(void)>;
void Append(const std::string& url, void Append(const std::string& url,
const std::string& content, const std::string& content,
AppendCallback callback); AppendCallback callback);
@@ -72,12 +74,10 @@ class CefDevToolsFileManager {
AlloyBrowserHostImpl* browser_impl_; AlloyBrowserHostImpl* browser_impl_;
PrefService* prefs_; PrefService* prefs_;
typedef std::map<std::string, base::FilePath> PathsMap; using PathsMap = std::map<std::string, base::FilePath>;
PathsMap saved_files_; PathsMap saved_files_;
scoped_refptr<base::SequencedTaskRunner> file_task_runner_; scoped_refptr<base::SequencedTaskRunner> file_task_runner_;
base::WeakPtrFactory<CefDevToolsFileManager> weak_factory_; base::WeakPtrFactory<CefDevToolsFileManager> weak_factory_;
DISALLOW_COPY_AND_ASSIGN(CefDevToolsFileManager);
}; };
#endif // CEF_LIBCEF_BROWSER_DEVTOOLS_DEVTOOLS_FILE_MANAGER_H_ #endif // CEF_LIBCEF_BROWSER_DEVTOOLS_DEVTOOLS_FILE_MANAGER_H_

View File

@@ -22,7 +22,6 @@
#include "base/json/json_reader.h" #include "base/json/json_reader.h"
#include "base/json/json_writer.h" #include "base/json/json_writer.h"
#include "base/json/string_escape.h" #include "base/json/string_escape.h"
#include "base/macros.h"
#include "base/memory/ptr_util.h" #include "base/memory/ptr_util.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"
@@ -188,6 +187,9 @@ class CefDevToolsFrontend::NetworkResourceLoader
loader_->DownloadAsStream(url_loader_factory, this); loader_->DownloadAsStream(url_loader_factory, this);
} }
NetworkResourceLoader(const NetworkResourceLoader&) = delete;
NetworkResourceLoader& operator=(const NetworkResourceLoader&) = delete;
private: private:
void OnResponseStarted(const GURL& final_url, void OnResponseStarted(const GURL& final_url,
const network::mojom::URLResponseHead& response_head) { const network::mojom::URLResponseHead& response_head) {
@@ -230,8 +232,6 @@ class CefDevToolsFrontend::NetworkResourceLoader
std::unique_ptr<network::SimpleURLLoader> loader_; std::unique_ptr<network::SimpleURLLoader> loader_;
int request_id_; int request_id_;
scoped_refptr<net::HttpResponseHeaders> response_headers_; scoped_refptr<net::HttpResponseHeaders> response_headers_;
DISALLOW_COPY_AND_ASSIGN(NetworkResourceLoader);
}; };
// static // static

View File

@@ -12,7 +12,6 @@
#include "base/compiler_specific.h" #include "base/compiler_specific.h"
#include "base/files/file_path.h" #include "base/files/file_path.h"
#include "base/macros.h"
#include "base/memory/ref_counted.h" #include "base/memory/ref_counted.h"
#include "base/memory/weak_ptr.h" #include "base/memory/weak_ptr.h"
#include "base/values.h" #include "base/values.h"
@@ -41,6 +40,9 @@ enum class ProtocolMessageType {
class CefDevToolsFrontend : public content::WebContentsObserver, class CefDevToolsFrontend : public content::WebContentsObserver,
public content::DevToolsAgentHostClient { public content::DevToolsAgentHostClient {
public: public:
CefDevToolsFrontend(const CefDevToolsFrontend&) = delete;
CefDevToolsFrontend& operator=(const CefDevToolsFrontend&) = delete;
static CefDevToolsFrontend* Show( static CefDevToolsFrontend* Show(
AlloyBrowserHostImpl* inspected_browser, AlloyBrowserHostImpl* inspected_browser,
const CefWindowInfo& windowInfo, const CefWindowInfo& windowInfo,
@@ -109,8 +111,6 @@ class CefDevToolsFrontend : public content::WebContentsObserver,
const base::FilePath protocol_log_file_; const base::FilePath protocol_log_file_;
base::WeakPtrFactory<CefDevToolsFrontend> weak_factory_; base::WeakPtrFactory<CefDevToolsFrontend> weak_factory_;
DISALLOW_COPY_AND_ASSIGN(CefDevToolsFrontend);
}; };
#endif // CEF_LIBCEF_BROWSER_DEVTOOLS_DEVTOOLS_FRONTEND_H_ #endif // CEF_LIBCEF_BROWSER_DEVTOOLS_DEVTOOLS_FRONTEND_H_

View File

@@ -22,6 +22,10 @@ class CefDevToolsRegistrationImpl : public CefRegistration,
DCHECK(observer_); DCHECK(observer_);
} }
CefDevToolsRegistrationImpl(const CefDevToolsRegistrationImpl&) = delete;
CefDevToolsRegistrationImpl& operator=(const CefDevToolsRegistrationImpl&) =
delete;
~CefDevToolsRegistrationImpl() override { ~CefDevToolsRegistrationImpl() override {
CEF_REQUIRE_UIT(); CEF_REQUIRE_UIT();
@@ -88,7 +92,6 @@ class CefDevToolsRegistrationImpl : public CefRegistration,
base::WeakPtr<CefDevToolsController> controller_; base::WeakPtr<CefDevToolsController> controller_;
IMPLEMENT_REFCOUNTING_DELETE_ON_UIT(CefDevToolsRegistrationImpl); IMPLEMENT_REFCOUNTING_DELETE_ON_UIT(CefDevToolsRegistrationImpl);
DISALLOW_COPY_AND_ASSIGN(CefDevToolsRegistrationImpl);
}; };
} // namespace } // namespace

View File

@@ -24,6 +24,10 @@ class CefDevToolsManager {
public: public:
// |inspected_browser| will outlive this object. // |inspected_browser| will outlive this object.
explicit CefDevToolsManager(CefBrowserHostBase* inspected_browser); explicit CefDevToolsManager(CefBrowserHostBase* inspected_browser);
CefDevToolsManager(const CefDevToolsManager&) = delete;
CefDevToolsManager& operator=(const CefDevToolsManager&) = delete;
~CefDevToolsManager(); ~CefDevToolsManager();
// See CefBrowserHost methods of the same name for documentation. // See CefBrowserHost methods of the same name for documentation.
@@ -62,8 +66,6 @@ class CefDevToolsManager {
std::unique_ptr<CefDevToolsController> devtools_controller_; std::unique_ptr<CefDevToolsController> devtools_controller_;
base::WeakPtrFactory<CefDevToolsManager> weak_ptr_factory_; base::WeakPtrFactory<CefDevToolsManager> weak_ptr_factory_;
DISALLOW_COPY_AND_ASSIGN(CefDevToolsManager);
}; };
#endif // CEF_LIBCEF_BROWSER_DEVTOOLS_DEVTOOLS_MANAGER_H_ #endif // CEF_LIBCEF_BROWSER_DEVTOOLS_DEVTOOLS_MANAGER_H_

View File

@@ -12,7 +12,6 @@
#include "base/bind.h" #include "base/bind.h"
#include "base/command_line.h" #include "base/command_line.h"
#include "base/files/file_path.h" #include "base/files/file_path.h"
#include "base/macros.h"
#include "base/memory/ptr_util.h" #include "base/memory/ptr_util.h"
#include "base/strings/string_number_conversions.h" #include "base/strings/string_number_conversions.h"
#include "base/strings/stringprintf.h" #include "base/strings/stringprintf.h"
@@ -44,6 +43,9 @@ class TCPServerSocketFactory : public content::DevToolsSocketFactory {
TCPServerSocketFactory(const std::string& address, uint16_t port) TCPServerSocketFactory(const std::string& address, uint16_t port)
: address_(address), port_(port) {} : address_(address), port_(port) {}
TCPServerSocketFactory(const TCPServerSocketFactory&) = delete;
TCPServerSocketFactory& operator=(const TCPServerSocketFactory&) = delete;
private: private:
// content::DevToolsSocketFactory. // content::DevToolsSocketFactory.
std::unique_ptr<net::ServerSocket> CreateForHttpServer() override { std::unique_ptr<net::ServerSocket> CreateForHttpServer() override {
@@ -61,8 +63,6 @@ class TCPServerSocketFactory : public content::DevToolsSocketFactory {
std::string address_; std::string address_;
uint16_t port_; uint16_t port_;
DISALLOW_COPY_AND_ASSIGN(TCPServerSocketFactory);
}; };
std::unique_ptr<content::DevToolsSocketFactory> CreateSocketFactory() { std::unique_ptr<content::DevToolsSocketFactory> CreateSocketFactory() {

View File

@@ -6,7 +6,6 @@
#define CEF_LIBCEF_BROWSER_DEVTOOLS_DEVTOOLS_MANAGER_DELEGATE_H_ #define CEF_LIBCEF_BROWSER_DEVTOOLS_DEVTOOLS_MANAGER_DELEGATE_H_
#include "base/compiler_specific.h" #include "base/compiler_specific.h"
#include "base/macros.h"
#include "content/public/browser/devtools_manager_delegate.h" #include "content/public/browser/devtools_manager_delegate.h"
namespace content { namespace content {
@@ -19,6 +18,11 @@ class CefDevToolsManagerDelegate : public content::DevToolsManagerDelegate {
static void StopHttpHandler(); static void StopHttpHandler();
CefDevToolsManagerDelegate(); CefDevToolsManagerDelegate();
CefDevToolsManagerDelegate(const CefDevToolsManagerDelegate&) = delete;
CefDevToolsManagerDelegate& operator=(const CefDevToolsManagerDelegate&) =
delete;
~CefDevToolsManagerDelegate() override; ~CefDevToolsManagerDelegate() override;
// DevToolsManagerDelegate implementation. // DevToolsManagerDelegate implementation.
@@ -26,9 +30,6 @@ class CefDevToolsManagerDelegate : public content::DevToolsManagerDelegate {
const GURL& url) override; const GURL& url) override;
std::string GetDiscoveryPageHTML() override; std::string GetDiscoveryPageHTML() override;
bool HasBundledFrontendResources() override; bool HasBundledFrontendResources() override;
private:
DISALLOW_COPY_AND_ASSIGN(CefDevToolsManagerDelegate);
}; };
#endif // CEF_LIBCEF_BROWSER_DEVTOOLS_DEVTOOLS_MANAGER_DELEGATE_H_ #endif // CEF_LIBCEF_BROWSER_DEVTOOLS_DEVTOOLS_MANAGER_DELEGATE_H_

View File

@@ -19,6 +19,9 @@ class CefDownloadItemImpl
public: public:
explicit CefDownloadItemImpl(download::DownloadItem* value); explicit CefDownloadItemImpl(download::DownloadItem* value);
CefDownloadItemImpl(const CefDownloadItemImpl&) = delete;
CefDownloadItemImpl& operator=(const CefDownloadItemImpl&) = delete;
// CefDownloadItem methods. // CefDownloadItem methods.
bool IsValid() override; bool IsValid() override;
bool IsInProgress() override; bool IsInProgress() override;
@@ -37,9 +40,6 @@ class CefDownloadItemImpl
CefString GetSuggestedFileName() override; CefString GetSuggestedFileName() override;
CefString GetContentDisposition() override; CefString GetContentDisposition() override;
CefString GetMimeType() override; CefString GetMimeType() override;
private:
DISALLOW_COPY_AND_ASSIGN(CefDownloadItemImpl);
}; };
#endif // CEF_LIBCEF_BROWSER_DOWNLOAD_ITEM_IMPL_H_ #endif // CEF_LIBCEF_BROWSER_DOWNLOAD_ITEM_IMPL_H_

View File

@@ -12,6 +12,7 @@
#include "base/bind.h" #include "base/bind.h"
#include "base/files/file_util.h" #include "base/files/file_util.h"
#include "base/ignore_result.h"
#include "base/logging.h" #include "base/logging.h"
#include "base/path_service.h" #include "base/path_service.h"
#include "base/strings/string_util.h" #include "base/strings/string_util.h"
@@ -50,6 +51,10 @@ class CefBeforeDownloadCallbackImpl : public CefBeforeDownloadCallback {
suggested_name_(suggested_name), suggested_name_(suggested_name),
callback_(std::move(callback)) {} callback_(std::move(callback)) {}
CefBeforeDownloadCallbackImpl(const CefBeforeDownloadCallbackImpl&) = delete;
CefBeforeDownloadCallbackImpl& operator=(
const CefBeforeDownloadCallbackImpl&) = delete;
void Continue(const CefString& download_path, bool show_dialog) override { void Continue(const CefString& download_path, bool show_dialog) override {
if (CEF_CURRENTLY_ON_UIT()) { if (CEF_CURRENTLY_ON_UIT()) {
if (download_id_ <= 0) if (download_id_ <= 0)
@@ -182,7 +187,6 @@ class CefBeforeDownloadCallbackImpl : public CefBeforeDownloadCallback {
content::DownloadTargetCallback callback_; content::DownloadTargetCallback callback_;
IMPLEMENT_REFCOUNTING(CefBeforeDownloadCallbackImpl); IMPLEMENT_REFCOUNTING(CefBeforeDownloadCallbackImpl);
DISALLOW_COPY_AND_ASSIGN(CefBeforeDownloadCallbackImpl);
}; };
// CefDownloadItemCallback implementation. // CefDownloadItemCallback implementation.
@@ -193,6 +197,10 @@ class CefDownloadItemCallbackImpl : public CefDownloadItemCallback {
uint32 download_id) uint32 download_id)
: manager_(manager), download_id_(download_id) {} : manager_(manager), download_id_(download_id) {}
CefDownloadItemCallbackImpl(const CefDownloadItemCallbackImpl&) = delete;
CefDownloadItemCallbackImpl& operator=(const CefDownloadItemCallbackImpl&) =
delete;
void Cancel() override { void Cancel() override {
CEF_POST_TASK(CEF_UIT, CEF_POST_TASK(CEF_UIT,
base::BindOnce(&CefDownloadItemCallbackImpl::DoCancel, this)); base::BindOnce(&CefDownloadItemCallbackImpl::DoCancel, this));
@@ -248,7 +256,6 @@ class CefDownloadItemCallbackImpl : public CefDownloadItemCallback {
uint32 download_id_; uint32 download_id_;
IMPLEMENT_REFCOUNTING(CefDownloadItemCallbackImpl); IMPLEMENT_REFCOUNTING(CefDownloadItemCallbackImpl);
DISALLOW_COPY_AND_ASSIGN(CefDownloadItemCallbackImpl);
}; };
} // namespace } // namespace

View File

@@ -24,6 +24,11 @@ class CefDownloadManagerDelegate : public download::DownloadItem::Observer,
public CefBrowserHostBase::Observer { public CefBrowserHostBase::Observer {
public: public:
explicit CefDownloadManagerDelegate(content::DownloadManager* manager); explicit CefDownloadManagerDelegate(content::DownloadManager* manager);
CefDownloadManagerDelegate(const CefDownloadManagerDelegate&) = delete;
CefDownloadManagerDelegate& operator=(const CefDownloadManagerDelegate&) =
delete;
~CefDownloadManagerDelegate() override; ~CefDownloadManagerDelegate() override;
private: private:
@@ -55,11 +60,9 @@ class CefDownloadManagerDelegate : public download::DownloadItem::Observer,
// Map of DownloadItem to originating AlloyBrowserHostImpl. Maintaining this // Map of DownloadItem to originating AlloyBrowserHostImpl. Maintaining this
// map is necessary because DownloadItem::GetWebContents() may return NULL if // map is necessary because DownloadItem::GetWebContents() may return NULL if
// the browser navigates while the download is in progress. // the browser navigates while the download is in progress.
typedef std::map<download::DownloadItem*, AlloyBrowserHostImpl*> using ItemBrowserMap =
ItemBrowserMap; std::map<download::DownloadItem*, AlloyBrowserHostImpl*>;
ItemBrowserMap item_browser_map_; ItemBrowserMap item_browser_map_;
DISALLOW_COPY_AND_ASSIGN(CefDownloadManagerDelegate);
}; };
#endif // CEF_LIBCEF_BROWSER_DOWNLOAD_MANAGER_DELEGATE_H_ #endif // CEF_LIBCEF_BROWSER_DOWNLOAD_MANAGER_DELEGATE_H_

View File

@@ -23,6 +23,9 @@ class CefExtensionImpl : public CefExtension {
CefRequestContext* loader_context, CefRequestContext* loader_context,
CefRefPtr<CefExtensionHandler> handler); CefRefPtr<CefExtensionHandler> handler);
CefExtensionImpl(const CefExtensionImpl&) = delete;
CefExtensionImpl& operator=(const CefExtensionImpl&) = delete;
// CefExtension methods. // CefExtension methods.
CefString GetIdentifier() override; CefString GetIdentifier() override;
CefString GetPath() override; CefString GetPath() override;
@@ -52,7 +55,6 @@ class CefExtensionImpl : public CefExtension {
bool unloaded_ = false; bool unloaded_ = false;
IMPLEMENT_REFCOUNTING(CefExtensionImpl); IMPLEMENT_REFCOUNTING(CefExtensionImpl);
DISALLOW_COPY_AND_ASSIGN(CefExtensionImpl);
}; };
#endif // CEF_LIBCEF_BROWSER_EXTENSION_IMPL_H_ #endif // CEF_LIBCEF_BROWSER_EXTENSION_IMPL_H_

View File

@@ -9,7 +9,6 @@
#include <memory> #include <memory>
#include "base/compiler_specific.h" #include "base/compiler_specific.h"
#include "base/macros.h"
#include "base/memory/ref_counted.h" #include "base/memory/ref_counted.h"
#include "extensions/browser/api/storage/settings_storage_quota_enforcer.h" #include "extensions/browser/api/storage/settings_storage_quota_enforcer.h"
#include "extensions/browser/api/storage/value_store_cache.h" #include "extensions/browser/api/storage/value_store_cache.h"
@@ -28,6 +27,10 @@ class SyncValueStoreCache : public ValueStoreCache {
public: public:
explicit SyncValueStoreCache( explicit SyncValueStoreCache(
scoped_refptr<value_store::ValueStoreFactory> factory); scoped_refptr<value_store::ValueStoreFactory> factory);
SyncValueStoreCache(const SyncValueStoreCache&) = delete;
SyncValueStoreCache& operator=(const SyncValueStoreCache&) = delete;
~SyncValueStoreCache() override; ~SyncValueStoreCache() override;
// ValueStoreCache implementation: // ValueStoreCache implementation:
@@ -50,8 +53,6 @@ class SyncValueStoreCache : public ValueStoreCache {
// The collection of ValueStores for local storage. // The collection of ValueStores for local storage.
StorageMap storage_map_; StorageMap storage_map_;
DISALLOW_COPY_AND_ASSIGN(SyncValueStoreCache);
}; };
} // namespace cef } // namespace cef

View File

@@ -8,7 +8,6 @@
#include <map> #include <map>
#include "base/files/file_path.h" #include "base/files/file_path.h"
#include "base/macros.h"
#include "extensions/browser/component_extension_resource_manager.h" #include "extensions/browser/component_extension_resource_manager.h"
namespace webui { namespace webui {
@@ -21,6 +20,12 @@ class CefComponentExtensionResourceManager
: public ComponentExtensionResourceManager { : public ComponentExtensionResourceManager {
public: public:
CefComponentExtensionResourceManager(); CefComponentExtensionResourceManager();
CefComponentExtensionResourceManager(
const CefComponentExtensionResourceManager&) = delete;
CefComponentExtensionResourceManager& operator=(
const CefComponentExtensionResourceManager&) = delete;
~CefComponentExtensionResourceManager() override; ~CefComponentExtensionResourceManager() override;
// Overridden from ComponentExtensionResourceManager: // Overridden from ComponentExtensionResourceManager:
@@ -42,8 +47,6 @@ class CefComponentExtensionResourceManager
using TemplateReplacementMap = using TemplateReplacementMap =
std::map<std::string, ui::TemplateReplacements>; std::map<std::string, ui::TemplateReplacements>;
TemplateReplacementMap template_replacements_; TemplateReplacementMap template_replacements_;
DISALLOW_COPY_AND_ASSIGN(CefComponentExtensionResourceManager);
}; };
} // namespace extensions } // namespace extensions

View File

@@ -8,7 +8,6 @@
#include <memory> #include <memory>
#include "base/callback_forward.h" #include "base/callback_forward.h"
#include "base/macros.h"
#include "extensions/browser/extension_host.h" #include "extensions/browser/extension_host.h"
class AlloyBrowserHostImpl; class AlloyBrowserHostImpl;
@@ -30,6 +29,11 @@ class CefExtensionBackgroundHost : public ExtensionHost {
content::WebContents* host_contents, content::WebContents* host_contents,
const GURL& url, const GURL& url,
mojom::ViewType host_type); mojom::ViewType host_type);
CefExtensionBackgroundHost(const CefExtensionBackgroundHost&) = delete;
CefExtensionBackgroundHost& operator=(const CefExtensionBackgroundHost&) =
delete;
~CefExtensionBackgroundHost() override; ~CefExtensionBackgroundHost() override;
// content::WebContentsDelegate methods: // content::WebContentsDelegate methods:
@@ -39,8 +43,6 @@ class CefExtensionBackgroundHost : public ExtensionHost {
private: private:
// Callback that will be executed on host deletion. // Callback that will be executed on host deletion.
base::OnceClosure deleted_callback_; base::OnceClosure deleted_callback_;
DISALLOW_COPY_AND_ASSIGN(CefExtensionBackgroundHost);
}; };
} // namespace extensions } // namespace extensions

View File

@@ -38,6 +38,11 @@ class CefGetExtensionLoadFileCallbackImpl
CefExtensionFunctionDetails::LoadFileCallback callback) CefExtensionFunctionDetails::LoadFileCallback callback)
: file_(file), callback_(std::move(callback)) {} : file_(file), callback_(std::move(callback)) {}
CefGetExtensionLoadFileCallbackImpl(
const CefGetExtensionLoadFileCallbackImpl&) = delete;
CefGetExtensionLoadFileCallbackImpl& operator=(
const CefGetExtensionLoadFileCallbackImpl&) = delete;
~CefGetExtensionLoadFileCallbackImpl() { ~CefGetExtensionLoadFileCallbackImpl() {
if (!callback_.is_null()) { if (!callback_.is_null()) {
// The callback is still pending. Cancel it now. // The callback is still pending. Cancel it now.
@@ -127,7 +132,6 @@ class CefGetExtensionLoadFileCallbackImpl
CefExtensionFunctionDetails::LoadFileCallback callback_; CefExtensionFunctionDetails::LoadFileCallback callback_;
IMPLEMENT_REFCOUNTING(CefGetExtensionLoadFileCallbackImpl); IMPLEMENT_REFCOUNTING(CefGetExtensionLoadFileCallbackImpl);
DISALLOW_COPY_AND_ASSIGN(CefGetExtensionLoadFileCallbackImpl);
}; };
} // namespace } // namespace

View File

@@ -10,7 +10,6 @@
#include "include/cef_extension.h" #include "include/cef_extension.h"
#include "base/callback_forward.h" #include "base/callback_forward.h"
#include "base/macros.h"
#include "chrome/common/extensions/api/tabs.h" #include "chrome/common/extensions/api/tabs.h"
#include "ui/gfx/native_widget_types.h" #include "ui/gfx/native_widget_types.h"
@@ -30,6 +29,11 @@ class CefExtensionFunctionDetails {
// Constructs a new ChromeExtensionFunctionDetails instance for |function|. // Constructs a new ChromeExtensionFunctionDetails instance for |function|.
// This instance does not own |function| and must outlive it. // This instance does not own |function| and must outlive it.
explicit CefExtensionFunctionDetails(ExtensionFunction* function); explicit CefExtensionFunctionDetails(ExtensionFunction* function);
CefExtensionFunctionDetails(const CefExtensionFunctionDetails&) = delete;
CefExtensionFunctionDetails& operator=(const CefExtensionFunctionDetails&) =
delete;
~CefExtensionFunctionDetails(); ~CefExtensionFunctionDetails();
Profile* GetProfile() const; Profile* GetProfile() const;
@@ -140,8 +144,6 @@ class CefExtensionFunctionDetails {
// Verifies correct usage of GetBrowserForTabId* methods. // Verifies correct usage of GetBrowserForTabId* methods.
mutable bool get_browser_called_first_time_ = false; mutable bool get_browser_called_first_time_ = false;
DISALLOW_COPY_AND_ASSIGN(CefExtensionFunctionDetails);
}; };
} // namespace extensions } // namespace extensions

View File

@@ -5,7 +5,6 @@
#ifndef LIBCEF_BROWSER_EXTENSIONS_EXTENSION_HOST_DELEGATE_H_ #ifndef LIBCEF_BROWSER_EXTENSIONS_EXTENSION_HOST_DELEGATE_H_
#define LIBCEF_BROWSER_EXTENSIONS_EXTENSION_HOST_DELEGATE_H_ #define LIBCEF_BROWSER_EXTENSIONS_EXTENSION_HOST_DELEGATE_H_
#include "base/macros.h"
#include "extensions/browser/extension_host_delegate.h" #include "extensions/browser/extension_host_delegate.h"
class AlloyBrowserHostImpl; class AlloyBrowserHostImpl;
@@ -15,6 +14,10 @@ namespace extensions {
class CefExtensionHostDelegate : public ExtensionHostDelegate { class CefExtensionHostDelegate : public ExtensionHostDelegate {
public: public:
explicit CefExtensionHostDelegate(AlloyBrowserHostImpl* browser); explicit CefExtensionHostDelegate(AlloyBrowserHostImpl* browser);
CefExtensionHostDelegate(const CefExtensionHostDelegate&) = delete;
CefExtensionHostDelegate& operator=(const CefExtensionHostDelegate&) = delete;
~CefExtensionHostDelegate() override; ~CefExtensionHostDelegate() override;
// ExtensionHostDelegate implementation. // ExtensionHostDelegate implementation.
@@ -39,9 +42,6 @@ class CefExtensionHostDelegate : public ExtensionHostDelegate {
const viz::SurfaceId& surface_id, const viz::SurfaceId& surface_id,
const gfx::Size& natural_size) override; const gfx::Size& natural_size) override;
void ExitPictureInPicture() override; void ExitPictureInPicture() override;
private:
DISALLOW_COPY_AND_ASSIGN(CefExtensionHostDelegate);
}; };
} // namespace extensions } // namespace extensions

View File

@@ -35,6 +35,10 @@ class RendererStartupHelper;
class CefExtensionSystem : public ExtensionSystem { class CefExtensionSystem : public ExtensionSystem {
public: public:
explicit CefExtensionSystem(content::BrowserContext* browser_context); explicit CefExtensionSystem(content::BrowserContext* browser_context);
CefExtensionSystem(const CefExtensionSystem&) = delete;
CefExtensionSystem& operator=(const CefExtensionSystem&) = delete;
~CefExtensionSystem() override; ~CefExtensionSystem() override;
// Initializes the extension system. // Initializes the extension system.
@@ -192,8 +196,6 @@ class CefExtensionSystem : public ExtensionSystem {
// Must be the last member. // Must be the last member.
base::WeakPtrFactory<CefExtensionSystem> weak_ptr_factory_; base::WeakPtrFactory<CefExtensionSystem> weak_ptr_factory_;
DISALLOW_COPY_AND_ASSIGN(CefExtensionSystem);
}; };
} // namespace extensions } // namespace extensions

View File

@@ -13,6 +13,10 @@ namespace extensions {
// Factory that provides CefExtensionSystem. // Factory that provides CefExtensionSystem.
class CefExtensionSystemFactory : public ExtensionSystemProvider { class CefExtensionSystemFactory : public ExtensionSystemProvider {
public: public:
CefExtensionSystemFactory(const CefExtensionSystemFactory&) = delete;
CefExtensionSystemFactory& operator=(const CefExtensionSystemFactory&) =
delete;
// ExtensionSystemProvider implementation: // ExtensionSystemProvider implementation:
ExtensionSystem* GetForBrowserContext( ExtensionSystem* GetForBrowserContext(
content::BrowserContext* context) override; content::BrowserContext* context) override;
@@ -31,8 +35,6 @@ class CefExtensionSystemFactory : public ExtensionSystemProvider {
content::BrowserContext* GetBrowserContextToUse( content::BrowserContext* GetBrowserContextToUse(
content::BrowserContext* context) const override; content::BrowserContext* context) const override;
bool ServiceIsCreatedWithBrowserContext() const override; bool ServiceIsCreatedWithBrowserContext() const override;
DISALLOW_COPY_AND_ASSIGN(CefExtensionSystemFactory);
}; };
} // namespace extensions } // namespace extensions

View File

@@ -7,9 +7,7 @@
#include "libcef/browser/browser_platform_delegate.h" #include "libcef/browser/browser_platform_delegate.h"
#include "libcef/browser/extensions/extension_host_delegate.h" #include "libcef/browser/extensions/extension_host_delegate.h"
#include "content/public/browser/notification_source.h"
#include "content/public/browser/web_contents.h" #include "content/public/browser/web_contents.h"
#include "extensions/browser/notification_types.h"
#include "extensions/browser/process_util.h" #include "extensions/browser/process_util.h"
#include "third_party/blink/public/common/input/web_gesture_event.h" #include "third_party/blink/public/common/input/web_gesture_event.h"
@@ -47,9 +45,8 @@ void CefExtensionViewHost::LoadInitialURL() {
browser_context()) == browser_context()) ==
process_util::PersistentBackgroundPageState::kNotReady) { process_util::PersistentBackgroundPageState::kNotReady) {
// Make sure the background page loads before any others. // Make sure the background page loads before any others.
registrar_.Add(this, host_registry_observation_.Observe(
extensions::NOTIFICATION_EXTENSION_BACKGROUND_PAGE_READY, ExtensionHostRegistry::Get(browser_context()));
content::Source<Extension>(extension()));
return; return;
} }
@@ -80,14 +77,22 @@ WebContents* CefExtensionViewHost::GetVisibleWebContents() const {
return nullptr; return nullptr;
} }
void CefExtensionViewHost::Observe( void CefExtensionViewHost::OnExtensionHostDocumentElementAvailable(
int type, content::BrowserContext* host_browser_context,
const content::NotificationSource& source, ExtensionHost* extension_host) {
const content::NotificationDetails& details) { DCHECK(extension_host->extension());
DCHECK_EQ(type, extensions::NOTIFICATION_EXTENSION_BACKGROUND_PAGE_READY); if (host_browser_context != browser_context() ||
extension_host->extension() != extension() ||
extension_host->extension_host_type() !=
mojom::ViewType::kExtensionBackgroundPage) {
return;
}
DCHECK_EQ(process_util::PersistentBackgroundPageState::kReady, DCHECK_EQ(process_util::PersistentBackgroundPageState::kReady,
process_util::GetPersistentBackgroundPageState(*extension(), process_util::GetPersistentBackgroundPageState(*extension(),
browser_context())); browser_context()));
// We only needed to wait for the background page to load, so stop observing.
host_registry_observation_.Reset();
LoadInitialURL(); LoadInitialURL();
} }

View File

@@ -7,10 +7,9 @@
#include <memory> #include <memory>
#include "base/macros.h" #include "base/scoped_observation.h"
#include "content/public/browser/notification_observer.h"
#include "content/public/browser/notification_registrar.h"
#include "extensions/browser/extension_host.h" #include "extensions/browser/extension_host.h"
#include "extensions/browser/extension_host_registry.h"
class AlloyBrowserHostImpl; class AlloyBrowserHostImpl;
@@ -25,13 +24,17 @@ namespace extensions {
// page. Object lifespan is managed by AlloyBrowserHostImpl. Based on // page. Object lifespan is managed by AlloyBrowserHostImpl. Based on
// chrome/browser/extensions/extension_view_host.h. // chrome/browser/extensions/extension_view_host.h.
class CefExtensionViewHost : public ExtensionHost, class CefExtensionViewHost : public ExtensionHost,
public content::NotificationObserver { public ExtensionHostRegistry::Observer {
public: public:
CefExtensionViewHost(AlloyBrowserHostImpl* browser, CefExtensionViewHost(AlloyBrowserHostImpl* browser,
const Extension* extension, const Extension* extension,
content::WebContents* host_contents, content::WebContents* host_contents,
const GURL& url, const GURL& url,
mojom::ViewType host_type); mojom::ViewType host_type);
CefExtensionViewHost(const CefExtensionViewHost&) = delete;
CefExtensionViewHost& operator=(const CefExtensionViewHost&) = delete;
~CefExtensionViewHost() override; ~CefExtensionViewHost() override;
// ExtensionHost methods: // ExtensionHost methods:
@@ -48,15 +51,15 @@ class CefExtensionViewHost : public ExtensionHost,
// extensions::ExtensionFunctionDispatcher::Delegate methods: // extensions::ExtensionFunctionDispatcher::Delegate methods:
content::WebContents* GetVisibleWebContents() const override; content::WebContents* GetVisibleWebContents() const override;
// content::NotificationObserver methods: // ExtensionHostRegistry::Observer methods:
void Observe(int type, void OnExtensionHostDocumentElementAvailable(
const content::NotificationSource& source, content::BrowserContext* browser_context,
const content::NotificationDetails& details) override; ExtensionHost* extension_host) override;
private: private:
content::NotificationRegistrar registrar_; base::ScopedObservation<ExtensionHostRegistry,
ExtensionHostRegistry::Observer>
DISALLOW_COPY_AND_ASSIGN(CefExtensionViewHost); host_registry_observation_{this};
}; };
} // namespace extensions } // namespace extensions

View File

@@ -19,6 +19,11 @@ class CefExtensionWebContentsObserver
: public ExtensionWebContentsObserver, : public ExtensionWebContentsObserver,
public content::WebContentsUserData<CefExtensionWebContentsObserver> { public content::WebContentsUserData<CefExtensionWebContentsObserver> {
public: public:
CefExtensionWebContentsObserver(const CefExtensionWebContentsObserver&) =
delete;
CefExtensionWebContentsObserver& operator=(
const CefExtensionWebContentsObserver&) = delete;
~CefExtensionWebContentsObserver() override; ~CefExtensionWebContentsObserver() override;
// Creates and initializes an instance of this class for the given // Creates and initializes an instance of this class for the given
@@ -38,7 +43,6 @@ class CefExtensionWebContentsObserver
std::unique_ptr<ScriptExecutor> script_executor_; std::unique_ptr<ScriptExecutor> script_executor_;
WEB_CONTENTS_USER_DATA_KEY_DECL(); WEB_CONTENTS_USER_DATA_KEY_DECL();
DISALLOW_COPY_AND_ASSIGN(CefExtensionWebContentsObserver);
}; };
} // namespace extensions } // namespace extensions

View File

@@ -52,8 +52,6 @@ void CefExtensionsAPIClient::AttachWebContentsHelpers(
PrefsTabHelper::CreateForWebContents(web_contents); PrefsTabHelper::CreateForWebContents(web_contents);
printing::CefPrintViewManager::CreateForWebContents(web_contents); printing::CefPrintViewManager::CreateForWebContents(web_contents);
CefExtensionWebContentsObserver::CreateForWebContents(web_contents);
// Used by the PDF extension. // Used by the PDF extension.
pdf::PDFWebContentsHelper::CreateForWebContentsWithClient( pdf::PDFWebContentsHelper::CreateForWebContentsWithClient(
web_contents, std::unique_ptr<pdf::PDFWebContentsHelperClient>( web_contents, std::unique_ptr<pdf::PDFWebContentsHelperClient>(

View File

@@ -5,7 +5,6 @@
#ifndef CEF_LIBCEF_BROWSER_EXTENSIONS_EXTENSIONS_BROWSER_API_PROVIDER_H_ #ifndef CEF_LIBCEF_BROWSER_EXTENSIONS_EXTENSIONS_BROWSER_API_PROVIDER_H_
#define CEF_LIBCEF_BROWSER_EXTENSIONS_EXTENSIONS_BROWSER_API_PROVIDER_H_ #define CEF_LIBCEF_BROWSER_EXTENSIONS_EXTENSIONS_BROWSER_API_PROVIDER_H_
#include "base/macros.h"
#include "extensions/browser/extensions_browser_api_provider.h" #include "extensions/browser/extensions_browser_api_provider.h"
namespace extensions { namespace extensions {
@@ -13,12 +12,15 @@ namespace extensions {
class CefExtensionsBrowserAPIProvider : public ExtensionsBrowserAPIProvider { class CefExtensionsBrowserAPIProvider : public ExtensionsBrowserAPIProvider {
public: public:
CefExtensionsBrowserAPIProvider(); CefExtensionsBrowserAPIProvider();
CefExtensionsBrowserAPIProvider(const CefExtensionsBrowserAPIProvider&) =
delete;
CefExtensionsBrowserAPIProvider& operator=(
const CefExtensionsBrowserAPIProvider&) = delete;
~CefExtensionsBrowserAPIProvider() override; ~CefExtensionsBrowserAPIProvider() override;
void RegisterExtensionFunctions(ExtensionFunctionRegistry* registry) override; void RegisterExtensionFunctions(ExtensionFunctionRegistry* registry) override;
private:
DISALLOW_COPY_AND_ASSIGN(CefExtensionsBrowserAPIProvider);
}; };
} // namespace extensions } // namespace extensions

View File

@@ -18,6 +18,11 @@ class ExtensionsAPIClient;
class CefExtensionsBrowserClient : public ExtensionsBrowserClient { class CefExtensionsBrowserClient : public ExtensionsBrowserClient {
public: public:
CefExtensionsBrowserClient(); CefExtensionsBrowserClient();
CefExtensionsBrowserClient(const CefExtensionsBrowserClient&) = delete;
CefExtensionsBrowserClient& operator=(const CefExtensionsBrowserClient&) =
delete;
~CefExtensionsBrowserClient() override; ~CefExtensionsBrowserClient() override;
// Returns the singleton CefExtensionsBrowserClient instance. // Returns the singleton CefExtensionsBrowserClient instance.
@@ -111,8 +116,6 @@ class CefExtensionsBrowserClient : public ExtensionsBrowserClient {
std::unique_ptr<ComponentExtensionResourceManager> resource_manager_; std::unique_ptr<ComponentExtensionResourceManager> resource_manager_;
std::unique_ptr<KioskDelegate> kiosk_delegate_; std::unique_ptr<KioskDelegate> kiosk_delegate_;
DISALLOW_COPY_AND_ASSIGN(CefExtensionsBrowserClient);
}; };
} // namespace extensions } // namespace extensions

View File

@@ -18,6 +18,12 @@ namespace extensions {
class CefMimeHandlerViewGuestDelegate : public MimeHandlerViewGuestDelegate { class CefMimeHandlerViewGuestDelegate : public MimeHandlerViewGuestDelegate {
public: public:
explicit CefMimeHandlerViewGuestDelegate(MimeHandlerViewGuest* guest); explicit CefMimeHandlerViewGuestDelegate(MimeHandlerViewGuest* guest);
CefMimeHandlerViewGuestDelegate(const CefMimeHandlerViewGuestDelegate&) =
delete;
CefMimeHandlerViewGuestDelegate& operator=(
const CefMimeHandlerViewGuestDelegate&) = delete;
~CefMimeHandlerViewGuestDelegate() override; ~CefMimeHandlerViewGuestDelegate() override;
// MimeHandlerViewGuestDelegate methods. // MimeHandlerViewGuestDelegate methods.
@@ -31,8 +37,6 @@ class CefMimeHandlerViewGuestDelegate : public MimeHandlerViewGuestDelegate {
private: private:
MimeHandlerViewGuest* guest_; // Owns us. MimeHandlerViewGuest* guest_; // Owns us.
content::WebContents* owner_web_contents_; content::WebContents* owner_web_contents_;
DISALLOW_COPY_AND_ASSIGN(CefMimeHandlerViewGuestDelegate);
}; };
} // namespace extensions } // namespace extensions

View File

@@ -5,7 +5,6 @@
#ifndef CEF_LIBCEF_BROWSER_EXTENSIONS_PDF_WEB_CONTENTS_HELPER_CLIENT_H_ #ifndef CEF_LIBCEF_BROWSER_EXTENSIONS_PDF_WEB_CONTENTS_HELPER_CLIENT_H_
#define CEF_LIBCEF_BROWSER_EXTENSIONS_PDF_WEB_CONTENTS_HELPER_CLIENT_H_ #define CEF_LIBCEF_BROWSER_EXTENSIONS_PDF_WEB_CONTENTS_HELPER_CLIENT_H_
#include "base/macros.h"
#include "components/pdf/browser/pdf_web_contents_helper_client.h" #include "components/pdf/browser/pdf_web_contents_helper_client.h"
namespace extensions { namespace extensions {
@@ -13,6 +12,11 @@ namespace extensions {
class CefPDFWebContentsHelperClient : public pdf::PDFWebContentsHelperClient { class CefPDFWebContentsHelperClient : public pdf::PDFWebContentsHelperClient {
public: public:
CefPDFWebContentsHelperClient(); CefPDFWebContentsHelperClient();
CefPDFWebContentsHelperClient(const CefPDFWebContentsHelperClient&) = delete;
CefPDFWebContentsHelperClient& operator=(
const CefPDFWebContentsHelperClient&) = delete;
~CefPDFWebContentsHelperClient() override; ~CefPDFWebContentsHelperClient() override;
private: private:
@@ -22,8 +26,6 @@ class CefPDFWebContentsHelperClient : public pdf::PDFWebContentsHelperClient {
void OnPDFHasUnsupportedFeature(content::WebContents* contents) override; void OnPDFHasUnsupportedFeature(content::WebContents* contents) override;
void OnSaveURL(content::WebContents* contents) override; void OnSaveURL(content::WebContents* contents) override;
void SetPluginCanSave(content::WebContents* contents, bool can_save) override; void SetPluginCanSave(content::WebContents* contents, bool can_save) override;
DISALLOW_COPY_AND_ASSIGN(CefPDFWebContentsHelperClient);
}; };
} // namespace extensions } // namespace extensions

View File

@@ -12,7 +12,6 @@
#include <vector> #include <vector>
#include "base/compiler_specific.h" #include "base/compiler_specific.h"
#include "base/macros.h"
#include "components/value_store/value_store.h" #include "components/value_store/value_store.h"
namespace value_store { namespace value_store {

View File

@@ -99,6 +99,9 @@ class UploadFolderHelper
CefFileDialogRunner::RunFileChooserCallback callback) CefFileDialogRunner::RunFileChooserCallback callback)
: callback_(std::move(callback)) {} : callback_(std::move(callback)) {}
UploadFolderHelper(const UploadFolderHelper&) = delete;
UploadFolderHelper& operator=(const UploadFolderHelper&) = delete;
~UploadFolderHelper() override { ~UploadFolderHelper() override {
if (!callback_.is_null()) { if (!callback_.is_null()) {
if (CEF_CURRENTLY_ON_UIT()) { if (CEF_CURRENTLY_ON_UIT()) {
@@ -133,8 +136,6 @@ class UploadFolderHelper
CefFileDialogRunner::RunFileChooserCallback callback_; CefFileDialogRunner::RunFileChooserCallback callback_;
std::vector<base::FilePath> select_files_; std::vector<base::FilePath> select_files_;
DISALLOW_COPY_AND_ASSIGN(UploadFolderHelper);
}; };
} // namespace } // namespace

View File

@@ -30,6 +30,10 @@ class CefFileDialogManager {
// |runner| may be NULL if the platform doesn't implement dialogs. // |runner| may be NULL if the platform doesn't implement dialogs.
CefFileDialogManager(AlloyBrowserHostImpl* browser, CefFileDialogManager(AlloyBrowserHostImpl* browser,
std::unique_ptr<CefFileDialogRunner> runner); std::unique_ptr<CefFileDialogRunner> runner);
CefFileDialogManager(const CefFileDialogManager&) = delete;
CefFileDialogManager& operator=(const CefFileDialogManager&) = delete;
~CefFileDialogManager(); ~CefFileDialogManager();
// Delete the runner to free any platform constructs. // Delete the runner to free any platform constructs.
@@ -99,8 +103,6 @@ class CefFileDialogManager {
// Must be the last member. // Must be the last member.
base::WeakPtrFactory<CefFileDialogManager> weak_ptr_factory_; base::WeakPtrFactory<CefFileDialogManager> weak_ptr_factory_;
DISALLOW_COPY_AND_ASSIGN(CefFileDialogManager);
}; };
#endif // CEF_LIBCEF_BROWSER_JAVASCRIPT_DIALOG_MANAGER_H_ #endif // CEF_LIBCEF_BROWSER_JAVASCRIPT_DIALOG_MANAGER_H_

View File

@@ -17,6 +17,9 @@ class AlloyBrowserHostImpl;
class CefFileDialogRunner { class CefFileDialogRunner {
public: public:
CefFileDialogRunner(const CefFileDialogRunner&) = delete;
CefFileDialogRunner& operator=(const CefFileDialogRunner&) = delete;
// Extend blink::mojom::FileChooserParams with some options unique to CEF. // Extend blink::mojom::FileChooserParams with some options unique to CEF.
struct FileChooserParams : public blink::mojom::FileChooserParams { struct FileChooserParams : public blink::mojom::FileChooserParams {
// 0-based index of the selected value in |accept_types|. // 0-based index of the selected value in |accept_types|.
@@ -30,8 +33,8 @@ class CefFileDialogRunner {
}; };
// The argument vector will be empty if the dialog was canceled. // The argument vector will be empty if the dialog was canceled.
typedef base::OnceCallback<void(int, const std::vector<base::FilePath>&)> using RunFileChooserCallback =
RunFileChooserCallback; base::OnceCallback<void(int, const std::vector<base::FilePath>&)>;
// Display the file chooser dialog. Execute |callback| on completion. // Display the file chooser dialog. Execute |callback| on completion.
virtual void Run(AlloyBrowserHostImpl* browser, virtual void Run(AlloyBrowserHostImpl* browser,
@@ -42,11 +45,8 @@ class CefFileDialogRunner {
// Allow deletion via std::unique_ptr only. // Allow deletion via std::unique_ptr only.
friend std::default_delete<CefFileDialogRunner>; friend std::default_delete<CefFileDialogRunner>;
CefFileDialogRunner() {} CefFileDialogRunner() = default;
virtual ~CefFileDialogRunner() {} virtual ~CefFileDialogRunner() = default;
private:
DISALLOW_COPY_AND_ASSIGN(CefFileDialogRunner);
}; };
#endif // CEF_LIBCEF_BROWSER_FILE_DIALOG_RUNNER_H_ #endif // CEF_LIBCEF_BROWSER_FILE_DIALOG_RUNNER_H_

View File

@@ -449,13 +449,12 @@ bool CefFrameHostImpl::Detach() {
} }
// In case we never attached, clean up. // In case we never attached, clean up.
while (!queued_actions_.empty()) { while (!queued_renderer_actions_.empty()) {
queued_actions_.pop(); queued_renderer_actions_.pop();
} }
render_frame_.reset(); render_frame_.reset();
render_frame_host_ = nullptr; render_frame_host_ = nullptr;
is_attached_ = false;
return first_detach; return first_detach;
} }
@@ -464,14 +463,14 @@ void CefFrameHostImpl::MaybeReAttach(
scoped_refptr<CefBrowserInfo> browser_info, scoped_refptr<CefBrowserInfo> browser_info,
content::RenderFrameHost* render_frame_host) { content::RenderFrameHost* render_frame_host) {
CEF_REQUIRE_UIT(); CEF_REQUIRE_UIT();
if (is_attached_ && render_frame_host_ == render_frame_host) { if (render_frame_.is_bound() && render_frame_host_ == render_frame_host) {
// Nothing to do here. // Nothing to do here.
return; return;
} }
// We expect that Detach() was called previously. // We expect that Detach() was called previously.
CHECK(!is_temporary()); CHECK(!is_temporary());
CHECK(!is_attached_); CHECK(!render_frame_.is_bound());
CHECK(!render_frame_host_); CHECK(!render_frame_host_);
// The RFH may change but the GlobalId should remain the same. // The RFH may change but the GlobalId should remain the same.
@@ -486,8 +485,7 @@ void CefFrameHostImpl::MaybeReAttach(
render_frame_host_ = render_frame_host; render_frame_host_ = render_frame_host;
RefreshAttributes(); RefreshAttributes();
// Restore the RenderFrame connection. // We expect a reconnect to be triggered via FrameAttached().
FrameAttachedInternal(/*reattached=*/true);
} }
// kMainFrameId must be -1 to align with renderer expectations. // kMainFrameId must be -1 to align with renderer expectations.
@@ -517,20 +515,6 @@ CefRefPtr<CefBrowserHostBase> CefFrameHostImpl::GetBrowserHostBase() const {
return nullptr; return nullptr;
} }
const mojo::Remote<cef::mojom::RenderFrame>&
CefFrameHostImpl::GetRenderFrame() {
CEF_REQUIRE_UIT();
DCHECK(is_attached_);
if (!render_frame_.is_bound() && render_frame_host_ &&
render_frame_host_->GetRemoteInterfaces()) {
// Connects to a CefFrameImpl that already exists in the renderer process.
render_frame_host_->GetRemoteInterfaces()->GetInterface(
render_frame_.BindNewPipeAndPassReceiver());
}
return render_frame_;
}
void CefFrameHostImpl::SendToRenderFrame(const std::string& function_name, void CefFrameHostImpl::SendToRenderFrame(const std::string& function_name,
RenderFrameAction action) { RenderFrameAction action) {
if (!CEF_CURRENTLY_ON_UIT()) { if (!CEF_CURRENTLY_ON_UIT()) {
@@ -553,18 +537,22 @@ void CefFrameHostImpl::SendToRenderFrame(const std::string& function_name,
return; return;
} }
if (!is_attached_) { if (!render_frame_.is_bound()) {
// Queue actions until we're notified by the renderer that it's ready to // Queue actions until we're notified by the renderer that it's ready to
// handle them. // handle them.
queued_actions_.push(std::make_pair(function_name, std::move(action))); queued_renderer_actions_.push(
std::make_pair(function_name, std::move(action)));
return; return;
} }
auto& render_frame = GetRenderFrame(); std::move(action).Run(render_frame_);
if (!render_frame) }
return;
std::move(action).Run(render_frame); void CefFrameHostImpl::OnRenderFrameDisconnect() {
CEF_REQUIRE_UIT();
// Reconnect, if any, will be triggered via FrameAttached().
render_frame_.reset();
} }
void CefFrameHostImpl::SendMessage(const std::string& name, void CefFrameHostImpl::SendMessage(const std::string& name,
@@ -581,12 +569,11 @@ void CefFrameHostImpl::SendMessage(const std::string& name,
} }
} }
void CefFrameHostImpl::FrameAttached() { void CefFrameHostImpl::FrameAttached(
FrameAttachedInternal(/*reattached=*/false); mojo::PendingRemote<cef::mojom::RenderFrame> render_frame_remote,
} bool reattached) {
void CefFrameHostImpl::FrameAttachedInternal(bool reattached) {
CEF_REQUIRE_UIT(); CEF_REQUIRE_UIT();
CHECK(render_frame_remote);
auto browser_info = GetBrowserInfo(); auto browser_info = GetBrowserInfo();
if (!browser_info) { if (!browser_info) {
@@ -594,16 +581,22 @@ void CefFrameHostImpl::FrameAttachedInternal(bool reattached) {
return; return;
} }
DCHECK(!is_attached_); if (reattached) {
if (!is_attached_) { LOG(INFO) << (is_main_frame_ ? "main" : "sub") << "frame "
is_attached_ = true; << frame_util::GetFrameDebugString(frame_id_)
<< " has reconnected";
auto& render_frame = GetRenderFrame();
while (!queued_actions_.empty()) {
if (render_frame) {
std::move(queued_actions_.front().second).Run(render_frame);
} }
queued_actions_.pop();
render_frame_.Bind(std::move(render_frame_remote));
render_frame_.set_disconnect_handler(
base::BindOnce(&CefFrameHostImpl::OnRenderFrameDisconnect, this));
// Notify the renderer process that it can start sending messages.
render_frame_->FrameAttachedAck();
while (!queued_renderer_actions_.empty()) {
std::move(queued_renderer_actions_.front().second).Run(render_frame_);
queued_renderer_actions_.pop();
} }
browser_info->MaybeExecuteFrameNotification(base::BindOnce( browser_info->MaybeExecuteFrameNotification(base::BindOnce(
@@ -614,7 +607,6 @@ void CefFrameHostImpl::FrameAttachedInternal(bool reattached) {
} }
}, },
CefRefPtr<CefFrameHostImpl>(this), reattached)); CefRefPtr<CefFrameHostImpl>(this), reattached));
}
} }
void CefFrameHostImpl::DidFinishFrameLoad(const GURL& validated_url, void CefFrameHostImpl::DidFinishFrameLoad(const GURL& validated_url,

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