diff --git a/BUILD.gn b/BUILD.gn index e749a4cd0..351b20505 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -125,7 +125,6 @@ if (is_mac) { import("//build/config/mac/rules.gni") import("//build/util/version.gni") import("//media/cdm/library_cdm/cdm_paths.gni") - import("//build/config/mac/base_rules.gni") # Template to compile .xib and .storyboard files. # diff --git a/CHROMIUM_BUILD_COMPATIBILITY.txt b/CHROMIUM_BUILD_COMPATIBILITY.txt index afa56e819..55daf5b57 100644 --- a/CHROMIUM_BUILD_COMPATIBILITY.txt +++ b/CHROMIUM_BUILD_COMPATIBILITY.txt @@ -7,5 +7,5 @@ # https://bitbucket.org/chromiumembedded/cef/wiki/BranchesAndBuilding { - 'chromium_checkout': 'refs/tags/90.0.4430.0' + 'chromium_checkout': 'refs/tags/91.0.4472.0' } diff --git a/cef_paths2.gypi b/cef_paths2.gypi index df99ace52..0ad653c01 100644 --- a/cef_paths2.gypi +++ b/cef_paths2.gypi @@ -22,7 +22,6 @@ 'include/base/cef_platform_thread.h', 'include/base/cef_ref_counted.h', 'include/base/cef_scoped_ptr.h', - 'include/base/cef_string16.h', 'include/base/cef_template_util.h', 'include/base/cef_thread_checker.h', 'include/base/cef_trace_event.h', @@ -128,7 +127,6 @@ 'libcef_dll/base/cef_lock_impl.cc', 'libcef_dll/base/cef_logging.cc', 'libcef_dll/base/cef_ref_counted.cc', - 'libcef_dll/base/cef_string16.cc', 'libcef_dll/base/cef_thread_checker_impl.cc', 'libcef_dll/base/cef_weak_ptr.cc', ], diff --git a/include/base/cef_basictypes.h b/include/base/cef_basictypes.h index fb81b8e55..4f39e83c6 100644 --- a/include/base/cef_basictypes.h +++ b/include/base/cef_basictypes.h @@ -75,7 +75,6 @@ typedef unsigned short uint16; #endif // UTF-16 character type. -// This should be kept synchronized with base/strings/string16.h #ifndef char16 #if defined(WCHAR_T_IS_UTF16) typedef wchar_t char16; diff --git a/include/base/cef_string16.h b/include/base/cef_string16.h deleted file mode 100644 index 6afcb79bd..000000000 --- a/include/base/cef_string16.h +++ /dev/null @@ -1,223 +0,0 @@ -// Copyright (c) 2014 Marshall A. Greenblatt. Portions copyright (c) 2013 -// Google Inc. All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the name Chromium Embedded -// Framework nor the names of its contributors may be used to endorse -// or promote products derived from this software without specific prior -// written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#ifndef CEF_INCLUDE_BASE_CEF_STRING16_H_ -#define CEF_INCLUDE_BASE_CEF_STRING16_H_ -#pragma once - -#if defined(BASE_STRINGS_STRING16_H_) -// Do nothing if the Chromium header has already been included. -// This can happen in cases where Chromium code is used directly by the -// client application. When using Chromium code directly always include -// the Chromium header first to avoid type conflicts. -#elif defined(USING_CHROMIUM_INCLUDES) -// When building CEF include the Chromium header directly. -#include "base/strings/string16.h" -#else // !USING_CHROMIUM_INCLUDES -// The following is substantially similar to the Chromium implementation. -// If the Chromium implementation diverges the below implementation should be -// updated to match. -// WHAT: -// A version of std::basic_string that provides 2-byte characters even when -// wchar_t is not implemented as a 2-byte type. You can access this class as -// string16. We also define char16, which string16 is based upon. -// -// WHY: -// On Windows, wchar_t is 2 bytes, and it can conveniently handle UTF-16/UCS-2 -// data. Plenty of existing code operates on strings encoded as UTF-16. -// -// On many other platforms, sizeof(wchar_t) is 4 bytes by default. We can make -// it 2 bytes by using the GCC flag -fshort-wchar. But then std::wstring fails -// at run time, because it calls some functions (like wcslen) that come from -// the system's native C library -- which was built with a 4-byte wchar_t! -// It's wasteful to use 4-byte wchar_t strings to carry UTF-16 data, and it's -// entirely improper on those systems where the encoding of wchar_t is defined -// as UTF-32. -// -// Here, we define string16, which is similar to std::wstring but replaces all -// libc functions with custom, 2-byte-char compatible routines. It is capable -// of carrying UTF-16-encoded data. - -#include -#include - -#include "include/base/cef_basictypes.h" - -#if defined(WCHAR_T_IS_UTF16) - -namespace base { - -typedef wchar_t char16; -typedef std::wstring string16; -typedef std::char_traits string16_char_traits; - -} // namespace base - -#elif defined(WCHAR_T_IS_UTF32) - -#include // For uint16_t - -#include "include/base/cef_macros.h" - -namespace cef { -namespace base { - -typedef uint16_t char16; - -// char16 versions of the functions required by string16_char_traits; these -// are based on the wide character functions of similar names ("w" or "wcs" -// instead of "c16"). -int c16memcmp(const char16* s1, const char16* s2, size_t n); -size_t c16len(const char16* s); -const char16* c16memchr(const char16* s, char16 c, size_t n); -char16* c16memmove(char16* s1, const char16* s2, size_t n); -char16* c16memcpy(char16* s1, const char16* s2, size_t n); -char16* c16memset(char16* s, char16 c, size_t n); - -struct string16_char_traits { - typedef char16 char_type; - typedef int int_type; - - // int_type needs to be able to hold each possible value of char_type, and in - // addition, the distinct value of eof(). - COMPILE_ASSERT(sizeof(int_type) > sizeof(char_type), unexpected_type_width); - - typedef std::streamoff off_type; - typedef mbstate_t state_type; - typedef std::fpos pos_type; - - static void assign(char_type& c1, const char_type& c2) { c1 = c2; } - - static bool eq(const char_type& c1, const char_type& c2) { return c1 == c2; } - static bool lt(const char_type& c1, const char_type& c2) { return c1 < c2; } - - static int compare(const char_type* s1, const char_type* s2, size_t n) { - return c16memcmp(s1, s2, n); - } - - static size_t length(const char_type* s) { return c16len(s); } - - static const char_type* find(const char_type* s, - size_t n, - const char_type& a) { - return c16memchr(s, a, n); - } - - static char_type* move(char_type* s1, const char_type* s2, int_type n) { - return c16memmove(s1, s2, n); - } - - static char_type* copy(char_type* s1, const char_type* s2, size_t n) { - return c16memcpy(s1, s2, n); - } - - static char_type* assign(char_type* s, size_t n, char_type a) { - return c16memset(s, a, n); - } - - static int_type not_eof(const int_type& c) { - return eq_int_type(c, eof()) ? 0 : c; - } - - static char_type to_char_type(const int_type& c) { return char_type(c); } - - static int_type to_int_type(const char_type& c) { return int_type(c); } - - static bool eq_int_type(const int_type& c1, const int_type& c2) { - return c1 == c2; - } - - static int_type eof() { return static_cast(EOF); } -}; - -typedef std::basic_string string16; - -} // namespace base -} // namespace cef - -namespace base { - -typedef cef::base::char16 char16; -typedef cef::base::string16 string16; - -extern std::ostream& operator<<(std::ostream& out, const string16& str); - -// This is required by googletest to print a readable output on test failures. -extern void PrintTo(const string16& str, std::ostream* out); - -} // namespace base - -// The string class will be explicitly instantiated only once, in string16.cc. -// -// std::basic_string<> in GNU libstdc++ contains a static data member, -// _S_empty_rep_storage, to represent empty strings. When an operation such -// as assignment or destruction is performed on a string, causing its existing -// data member to be invalidated, it must not be freed if this static data -// member is being used. Otherwise, it counts as an attempt to free static -// (and not allocated) data, which is a memory error. -// -// Generally, due to C++ template magic, _S_empty_rep_storage will be marked -// as a coalesced symbol, meaning that the linker will combine multiple -// instances into a single one when generating output. -// -// If a string class is used by multiple shared libraries, a problem occurs. -// Each library will get its own copy of _S_empty_rep_storage. When strings -// are passed across a library boundary for alteration or destruction, memory -// errors will result. GNU libstdc++ contains a configuration option, -// --enable-fully-dynamic-string (_GLIBCXX_FULLY_DYNAMIC_STRING), which -// disables the static data member optimization, but it's a good optimization -// and non-STL code is generally at the mercy of the system's STL -// configuration. Fully-dynamic strings are not the default for GNU libstdc++ -// libstdc++ itself or for the libstdc++ installations on the systems we care -// about, such as Mac OS X and relevant flavors of Linux. -// -// See also http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24196 . -// -// To avoid problems, string classes need to be explicitly instantiated only -// once, in exactly one library. All other string users see it via an "extern" -// declaration. This is precisely how GNU libstdc++ handles -// std::basic_string (string) and std::basic_string (wstring). -// -// This also works around a Mac OS X linker bug in ld64-85.2.1 (Xcode 3.1.2), -// in which the linker does not fully coalesce symbols when dead code -// stripping is enabled. This bug causes the memory errors described above -// to occur even when a std::basic_string<> does not cross shared library -// boundaries, such as in statically-linked executables. -// -// TODO(mark): File this bug with Apple and update this note with a bug number. - -extern template class std::basic_string; - -#endif // WCHAR_T_IS_UTF32 - -#endif // !USING_CHROMIUM_INCLUDES - -#endif // CEF_INCLUDE_BASE_CEF_STRING16_H_ diff --git a/include/internal/cef_string_wrappers.h b/include/internal/cef_string_wrappers.h index 48bebaba9..6645b8588 100644 --- a/include/internal/cef_string_wrappers.h +++ b/include/internal/cef_string_wrappers.h @@ -34,7 +34,6 @@ #include #include -#include "include/base/cef_string16.h" #include "include/internal/cef_string_types.h" #if defined(USING_CHROMIUM_INCLUDES) @@ -91,32 +90,34 @@ struct CefStringTraitsWide { : false; } #if defined(WCHAR_T_IS_UTF32) - static inline base::string16 to_string16(const struct_type* s) { + static inline std::u16string to_string16(const struct_type* s) { cef_string_utf16_t cstr; memset(&cstr, 0, sizeof(cstr)); cef_string_wide_to_utf16(s->str, s->length, &cstr); - base::string16 str; + std::u16string str; if (cstr.length > 0) { - str = base::string16( - reinterpret_cast(cstr.str), cstr.length); + str = std::u16string( + reinterpret_cast(cstr.str), cstr.length); } cef_string_utf16_clear(&cstr); return str; } - static inline bool from_string16(const base::string16& str, struct_type* s) { + static inline bool from_string16(const std::u16string& str, struct_type* s) { return cef_string_utf16_to_wide( reinterpret_cast(str.c_str()), str.length(), s) ? true : false; } #else // WCHAR_T_IS_UTF32 - static inline base::string16 to_string16(const struct_type* s) { - return base::string16( - reinterpret_cast(s->str), s->length); + static inline std::u16string to_string16(const struct_type* s) { + return std::u16string( + reinterpret_cast(s->str), s->length); } - static inline bool from_string16(const base::string16& str, struct_type* s) { - return cef_string_wide_set(str.c_str(), str.length(), s, true) ? true - : false; + static inline bool from_string16(const std::u16string& str, struct_type* s) { + return cef_string_wide_set(reinterpret_cast(str.c_str()), + str.length(), s, true) + ? true + : false; } #endif // WCHAR_T_IS_UTF32 }; @@ -169,19 +170,19 @@ struct CefStringTraitsUTF8 { static inline bool from_wstring(const std::wstring& str, struct_type* s) { return cef_string_wide_to_utf8(str.c_str(), str.length(), s) ? true : false; } - static inline base::string16 to_string16(const struct_type* s) { + static inline std::u16string to_string16(const struct_type* s) { cef_string_utf16_t cstr; memset(&cstr, 0, sizeof(cstr)); cef_string_utf8_to_utf16(s->str, s->length, &cstr); - base::string16 str; + std::u16string str; if (cstr.length > 0) { - str = base::string16( - reinterpret_cast(cstr.str), cstr.length); + str = std::u16string( + reinterpret_cast(cstr.str), cstr.length); } cef_string_utf16_clear(&cstr); return str; } - static inline bool from_string16(const base::string16& str, struct_type* s) { + static inline bool from_string16(const std::u16string& str, struct_type* s) { return cef_string_utf16_to_utf8( reinterpret_cast(str.c_str()), str.length(), s) ? true @@ -256,11 +257,11 @@ struct CefStringTraitsUTF16 { : false; } #endif // WCHAR_T_IS_UTF32 - static inline base::string16 to_string16(const struct_type* s) { - return base::string16( - reinterpret_cast(s->str), s->length); + static inline std::u16string to_string16(const struct_type* s) { + return std::u16string( + reinterpret_cast(s->str), s->length); } - static inline bool from_string16(const base::string16& str, struct_type* s) { + static inline bool from_string16(const std::u16string& str, struct_type* s) { return cef_string_utf16_set(reinterpret_cast(str.c_str()), str.length(), s, true) ? true @@ -341,19 +342,25 @@ class CefStringBase { FromWString(std::wstring(src)); } -#if defined(WCHAR_T_IS_UTF32) /// // Create a new string from an existing string16. Data will be always // copied. Translation will occur if necessary based on the underlying string // type. /// - CefStringBase(const base::string16& src) : string_(NULL), owner_(false) { + CefStringBase(const std::u16string& src) : string_(NULL), owner_(false) { FromString16(src); } - CefStringBase(const char16* src) : string_(NULL), owner_(false) { + CefStringBase(const std::u16string::value_type* src) + : string_(NULL), owner_(false) { if (src) - FromString16(base::string16( - reinterpret_cast(src))); + FromString16(std::u16string(src)); + } +#if defined(WCHAR_T_IS_UTF32) + CefStringBase(const char16* src) : string_(NULL), owner_(false) { + if (src) { + FromString16(std::u16string( + reinterpret_cast(src))); + } } #endif // WCHAR_T_IS_UTF32 @@ -620,9 +627,9 @@ class CefStringBase { // Return this string's data as a string16. Translation will occur if // necessary based on the underlying string type. /// - base::string16 ToString16() const { + std::u16string ToString16() const { if (empty()) - return base::string16(); + return std::u16string(); return traits::to_string16(string_); } @@ -631,7 +638,7 @@ class CefStringBase { // copied. Translation will occur if necessary based on the underlying string // type. /// - bool FromString16(const base::string16& str) { + bool FromString16(const std::u16string& str) { if (str.empty()) { clear(); return true; @@ -683,15 +690,19 @@ class CefStringBase { FromWString(std::wstring(str)); return *this; } -#if defined(WCHAR_T_IS_UTF32) - operator base::string16() const { return ToString16(); } - CefStringBase& operator=(const base::string16& str) { + operator std::u16string() const { return ToString16(); } + CefStringBase& operator=(const std::u16string& str) { FromString16(str); return *this; } + CefStringBase& operator=(const std::u16string::value_type* str) { + FromString16(std::u16string(str)); + return *this; + } +#if defined(WCHAR_T_IS_UTF32) CefStringBase& operator=(const char16* str) { - FromString16(base::string16( - reinterpret_cast(str))); + FromString16(std::u16string( + reinterpret_cast(str))); return *this; } #endif // WCHAR_T_IS_UTF32 diff --git a/libcef/browser/alloy/alloy_browser_context.cc b/libcef/browser/alloy/alloy_browser_context.cc index 6877382c5..96516f4d5 100644 --- a/libcef/browser/alloy/alloy_browser_context.cc +++ b/libcef/browser/alloy/alloy_browser_context.cc @@ -309,16 +309,6 @@ AlloyBrowserContext::GetClientHintsControllerDelegate() { return nullptr; } -void AlloyBrowserContext::SetCorsOriginAccessListForOrigin( - TargetBrowserContexts target_mode, - const url::Origin& source_origin, - std::vector allow_patterns, - std::vector block_patterns, - base::OnceClosure closure) { - // This method is called for Extension support. - base::ThreadTaskRunnerHandle::Get()->PostTask(FROM_HERE, std::move(closure)); -} - ChromeZoomLevelPrefs* AlloyBrowserContext::GetZoomLevelPrefs() { return static_cast( GetStoragePartition(this, nullptr)->GetZoomLevelDelegate()); diff --git a/libcef/browser/alloy/alloy_browser_context.h b/libcef/browser/alloy/alloy_browser_context.h index db4154ce4..72c458196 100644 --- a/libcef/browser/alloy/alloy_browser_context.h +++ b/libcef/browser/alloy/alloy_browser_context.h @@ -60,12 +60,6 @@ class AlloyBrowserContext : public ChromeProfileAlloy, content::ResourceContext* GetResourceContext() override; content::ClientHintsControllerDelegate* GetClientHintsControllerDelegate() override; - void SetCorsOriginAccessListForOrigin( - TargetBrowserContexts target_mode, - const url::Origin& source_origin, - std::vector allow_patterns, - std::vector block_patterns, - base::OnceClosure closure) override; base::FilePath GetPath() override; base::FilePath GetPath() const override; std::unique_ptr CreateZoomLevelDelegate( diff --git a/libcef/browser/alloy/alloy_browser_host_impl.cc b/libcef/browser/alloy/alloy_browser_host_impl.cc index 1f9eda540..ec9b8e6bc 100644 --- a/libcef/browser/alloy/alloy_browser_host_impl.cc +++ b/libcef/browser/alloy/alloy_browser_host_impl.cc @@ -1191,9 +1191,9 @@ void AlloyBrowserHostImpl::UpdateTargetURL(content::WebContents* source, bool AlloyBrowserHostImpl::DidAddMessageToConsole( content::WebContents* source, blink::mojom::ConsoleMessageLevel level, - const base::string16& message, + const std::u16string& message, int32_t line_no, - const base::string16& source_id) { + const std::u16string& source_id) { return contents_delegate_->DidAddMessageToConsole(source, level, message, line_no, source_id); } diff --git a/libcef/browser/alloy/alloy_browser_host_impl.h b/libcef/browser/alloy/alloy_browser_host_impl.h index c14710683..faee30792 100644 --- a/libcef/browser/alloy/alloy_browser_host_impl.h +++ b/libcef/browser/alloy/alloy_browser_host_impl.h @@ -22,12 +22,11 @@ #include "libcef/browser/menu_manager.h" #include "libcef/browser/request_context_impl.h" -#include "base/strings/string16.h" #include "base/synchronization/lock.h" #include "content/public/browser/web_contents.h" #include "content/public/browser/web_contents_delegate.h" #include "content/public/browser/web_contents_observer.h" -#include "extensions/common/view_type.h" +#include "extensions/common/mojom/view_type.mojom-forward.h" class CefAudioCapturer; class CefBrowserInfo; @@ -222,9 +221,9 @@ class AlloyBrowserHostImpl : public CefBrowserHostBase, void UpdateTargetURL(content::WebContents* source, const GURL& url) override; bool DidAddMessageToConsole(content::WebContents* source, blink::mojom::ConsoleMessageLevel log_level, - const base::string16& message, + const std::u16string& message, int32_t line_no, - const base::string16& source_id) override; + const std::u16string& source_id) override; void BeforeUnloadFired(content::WebContents* source, bool proceed, bool* proceed_to_fire_unload) override; diff --git a/libcef/browser/alloy/alloy_browser_main.cc b/libcef/browser/alloy/alloy_browser_main.cc index f732ae35a..ffcde4281 100644 --- a/libcef/browser/alloy/alloy_browser_main.cc +++ b/libcef/browser/alloy/alloy_browser_main.cc @@ -25,6 +25,7 @@ #include "base/bind.h" #include "base/strings/string_number_conversions.h" #include "base/task/post_task.h" +#include "base/task/thread_pool.h" #include "chrome/browser/browser_process.h" #include "chrome/browser/media/router/chrome_media_router_factory.h" #include "chrome/browser/net/system_network_context_manager.h" @@ -152,7 +153,7 @@ int AlloyBrowserMainParts::PreCreateThreads() { return 0; } -void AlloyBrowserMainParts::PreMainMessageLoopRun() { +int AlloyBrowserMainParts::PreMainMessageLoopRun() { #if defined(USE_AURA) display::Screen::SetScreenInstance(views::CreateDesktopScreen()); #endif @@ -173,14 +174,14 @@ void AlloyBrowserMainParts::PreMainMessageLoopRun() { // ChromeBrowserMainExtraPartsProfiles for details. cef::EnsureBrowserContextKeyedServiceFactoriesBuilt(); - background_task_runner_ = base::CreateSingleThreadTaskRunner( - {base::ThreadPool(), base::TaskPriority::BEST_EFFORT, + background_task_runner_ = base::ThreadPool::CreateSingleThreadTaskRunner( + {base::TaskPriority::BEST_EFFORT, base::TaskShutdownBehavior::BLOCK_SHUTDOWN, base::MayBlock()}); - user_visible_task_runner_ = base::CreateSingleThreadTaskRunner( - {base::ThreadPool(), base::TaskPriority::USER_VISIBLE, + user_visible_task_runner_ = base::ThreadPool::CreateSingleThreadTaskRunner( + {base::TaskPriority::USER_VISIBLE, base::TaskShutdownBehavior::BLOCK_SHUTDOWN, base::MayBlock()}); - user_blocking_task_runner_ = base::CreateSingleThreadTaskRunner( - {base::ThreadPool(), base::TaskPriority::USER_BLOCKING, + user_blocking_task_runner_ = base::ThreadPool::CreateSingleThreadTaskRunner( + {base::TaskPriority::USER_BLOCKING, base::TaskShutdownBehavior::BLOCK_SHUTDOWN, base::MayBlock()}); CefRequestContextSettings settings; @@ -204,6 +205,8 @@ void AlloyBrowserMainParts::PreMainMessageLoopRun() { PluginFinder::GetInstance()->Init(); scheme::RegisterWebUIControllerFactory(); + + return content::RESULT_CODE_NORMAL_EXIT; } void AlloyBrowserMainParts::PostMainMessageLoopRun() { diff --git a/libcef/browser/alloy/alloy_browser_main.h b/libcef/browser/alloy/alloy_browser_main.h index 08b235e59..609b60c2f 100644 --- a/libcef/browser/alloy/alloy_browser_main.h +++ b/libcef/browser/alloy/alloy_browser_main.h @@ -50,7 +50,7 @@ class AlloyBrowserMainParts : public content::BrowserMainParts { void PreMainMessageLoopStart() override; void PostMainMessageLoopStart() override; int PreCreateThreads() override; - void PreMainMessageLoopRun() override; + int PreMainMessageLoopRun() override; void PostMainMessageLoopRun() override; void PostDestroyThreads() override; diff --git a/libcef/browser/alloy/alloy_content_browser_client.cc b/libcef/browser/alloy/alloy_content_browser_client.cc index 9c2ba04c4..932c74692 100644 --- a/libcef/browser/alloy/alloy_content_browser_client.cc +++ b/libcef/browser/alloy/alloy_content_browser_client.cc @@ -988,9 +988,9 @@ void AlloyContentBrowserClient::DidCreatePpapiPlugin( new ChromeBrowserPepperHostFactory(browser_host))); } -content::DevToolsManagerDelegate* -AlloyContentBrowserClient::GetDevToolsManagerDelegate() { - return new CefDevToolsManagerDelegate(); +std::unique_ptr +AlloyContentBrowserClient::CreateDevToolsManagerDelegate() { + return std::make_unique(); } std::vector> @@ -1244,6 +1244,7 @@ bool AlloyContentBrowserClient::HandleExternalProtocol( const GURL& url, content::WebContents::OnceGetter web_contents_getter, int child_id, + int frame_tree_node_id, content::NavigationUIData* navigation_data, bool is_main_frame, ui::PageTransition page_transition, diff --git a/libcef/browser/alloy/alloy_content_browser_client.h b/libcef/browser/alloy/alloy_content_browser_client.h index 82a738341..194401b53 100644 --- a/libcef/browser/alloy/alloy_content_browser_client.h +++ b/libcef/browser/alloy/alloy_content_browser_client.h @@ -109,7 +109,8 @@ class AlloyContentBrowserClient : public content::ContentBrowserClient { void BrowserURLHandlerCreated(content::BrowserURLHandler* handler) override; std::string GetDefaultDownloadName() override; void DidCreatePpapiPlugin(content::BrowserPpapiHost* browser_host) override; - content::DevToolsManagerDelegate* GetDevToolsManagerDelegate() override; + std::unique_ptr + CreateDevToolsManagerDelegate() override; std::vector> CreateThrottlesForNavigation( content::NavigationHandle* navigation_handle) override; @@ -179,6 +180,7 @@ class AlloyContentBrowserClient : public content::ContentBrowserClient { const GURL& url, content::WebContents::OnceGetter web_contents_getter, int child_id, + int frame_tree_node_id, content::NavigationUIData* navigation_data, bool is_main_frame, ui::PageTransition page_transition, diff --git a/libcef/browser/alloy/browser_platform_delegate_alloy.cc b/libcef/browser/alloy/browser_platform_delegate_alloy.cc index e9b7968bd..18aad738c 100644 --- a/libcef/browser/alloy/browser_platform_delegate_alloy.cc +++ b/libcef/browser/alloy/browser_platform_delegate_alloy.cc @@ -68,10 +68,11 @@ content::WebContents* CefBrowserPlatformDelegateAlloy::CreateWebContents( extensions::GetExtensionForUrl(browser_context, gurl); } if (create_params.extension) { - if (create_params.extension_host_type == extensions::VIEW_TYPE_INVALID) { + if (create_params.extension_host_type == + extensions::mojom::ViewType::kInvalid) { // Default to dialog behavior. create_params.extension_host_type = - extensions::VIEW_TYPE_EXTENSION_DIALOG; + extensions::mojom::ViewType::kExtensionDialog; } // Extension resources will fail to load if we don't use a SiteInstance @@ -191,7 +192,7 @@ void CefBrowserPlatformDelegateAlloy::BrowserCreated( void CefBrowserPlatformDelegateAlloy::CreateExtensionHost( const extensions::Extension* extension, const GURL& url, - extensions::ViewType host_type) { + extensions::mojom::ViewType host_type) { REQUIRE_ALLOY_RUNTIME(); DCHECK(primary_); @@ -202,14 +203,15 @@ void CefBrowserPlatformDelegateAlloy::CreateExtensionHost( auto alloy_browser = static_cast(browser_); - if (host_type == extensions::VIEW_TYPE_EXTENSION_DIALOG || - host_type == extensions::VIEW_TYPE_EXTENSION_POPUP) { + if (host_type == extensions::mojom::ViewType::kExtensionDialog || + host_type == extensions::mojom::ViewType::kExtensionPopup) { // Create an extension host that we own. extension_host_ = new extensions::CefExtensionViewHost( alloy_browser, extension, web_contents_, url, host_type); // Trigger load of the extension URL. extension_host_->CreateRendererSoon(); - } else if (host_type == extensions::VIEW_TYPE_EXTENSION_BACKGROUND_PAGE) { + } else if (host_type == + extensions::mojom::ViewType::kExtensionBackgroundPage) { is_background_host_ = true; alloy_browser->is_background_host_ = true; // Create an extension host that will be owned by ProcessManager. @@ -451,7 +453,7 @@ void CefBrowserPlatformDelegateAlloy::DestroyExtensionHost() { if (!extension_host_) return; if (extension_host_->extension_host_type() == - extensions::VIEW_TYPE_EXTENSION_BACKGROUND_PAGE) { + extensions::mojom::ViewType::kExtensionBackgroundPage) { DCHECK(is_background_host_); // Close notification for background pages arrives via CloseContents. // The extension host will be deleted by diff --git a/libcef/browser/alloy/browser_platform_delegate_alloy.h b/libcef/browser/alloy/browser_platform_delegate_alloy.h index fde6106c9..dcd8879cc 100644 --- a/libcef/browser/alloy/browser_platform_delegate_alloy.h +++ b/libcef/browser/alloy/browser_platform_delegate_alloy.h @@ -33,7 +33,7 @@ class CefBrowserPlatformDelegateAlloy : public CefBrowserPlatformDelegate { void BrowserCreated(CefBrowserHostBase* browser) override; void CreateExtensionHost(const extensions::Extension* extension, const GURL& url, - extensions::ViewType host_type) override; + extensions::mojom::ViewType host_type) override; extensions::ExtensionHost* GetExtensionHost() const override; void BrowserDestroyed(CefBrowserHostBase* browser) override; void SendCaptureLostEvent() override; diff --git a/libcef/browser/alloy/chrome_profile_alloy.cc b/libcef/browser/alloy/chrome_profile_alloy.cc index 21ecf55fb..be54b205c 100644 --- a/libcef/browser/alloy/chrome_profile_alloy.cc +++ b/libcef/browser/alloy/chrome_profile_alloy.cc @@ -71,7 +71,8 @@ std::string ChromeProfileAlloy::GetProfileUserName() const { } Profile* ChromeProfileAlloy::GetOffTheRecordProfile( - const Profile::OTRProfileID& otr_profile_id) { + const Profile::OTRProfileID& otr_profile_id, + bool create_if_needed) { NOTREACHED(); return nullptr; } diff --git a/libcef/browser/alloy/chrome_profile_alloy.h b/libcef/browser/alloy/chrome_profile_alloy.h index d6b9b937e..20083610b 100644 --- a/libcef/browser/alloy/chrome_profile_alloy.h +++ b/libcef/browser/alloy/chrome_profile_alloy.h @@ -26,8 +26,8 @@ class ChromeProfileAlloy : public Profile { variations::VariationsClient* GetVariationsClient() override; scoped_refptr GetIOTaskRunner() override; std::string GetProfileUserName() const override; - Profile* GetOffTheRecordProfile( - const Profile::OTRProfileID& otr_profile_id) override; + Profile* GetOffTheRecordProfile(const Profile::OTRProfileID& otr_profile_id, + bool create_if_needed) override; std::vector GetAllOffTheRecordProfiles() override; void DestroyOffTheRecordProfile(Profile* otr_profile) override; bool HasOffTheRecordProfile( diff --git a/libcef/browser/browser_contents_delegate.cc b/libcef/browser/browser_contents_delegate.cc index ca9b252c9..f6f26956c 100644 --- a/libcef/browser/browser_contents_delegate.cc +++ b/libcef/browser/browser_contents_delegate.cc @@ -16,6 +16,7 @@ #include "content/public/browser/notification_source.h" #include "content/public/browser/notification_types.h" #include "content/public/browser/render_view_host.h" +#include "third_party/blink/public/mojom/favicon/favicon_url.mojom.h" using content::KeyboardEventProcessingResult; @@ -127,9 +128,9 @@ void CefBrowserContentsDelegate::UpdateTargetURL(content::WebContents* source, bool CefBrowserContentsDelegate::DidAddMessageToConsole( content::WebContents* source, blink::mojom::ConsoleMessageLevel log_level, - const base::string16& message, + const std::u16string& message, int32_t line_no, - const base::string16& source_id) { + const std::u16string& source_id) { if (auto c = client()) { if (auto handler = c->GetDisplayHandler()) { // Use LOGSEVERITY_DEBUG for unrecognized |level| values. @@ -328,7 +329,8 @@ void CefBrowserContentsDelegate::OnFrameFocused( OnStateChanged(State::kFocusedFrame); } -void CefBrowserContentsDelegate::DocumentAvailableInMainFrame() { +void CefBrowserContentsDelegate::DocumentAvailableInMainFrame( + content::RenderFrameHost* render_frame_host) { has_document_ = true; OnStateChanged(State::kDocument); @@ -592,7 +594,7 @@ void CefBrowserContentsDelegate::OnLoadError(CefRefPtr frame, } } -void CefBrowserContentsDelegate::OnTitleChange(const base::string16& title) { +void CefBrowserContentsDelegate::OnTitleChange(const std::u16string& title) { if (auto c = client()) { if (auto handler = c->GetDisplayHandler()) { handler->OnTitleChange(browser(), title); diff --git a/libcef/browser/browser_contents_delegate.h b/libcef/browser/browser_contents_delegate.h index c4fc0aad8..9977552a8 100644 --- a/libcef/browser/browser_contents_delegate.h +++ b/libcef/browser/browser_contents_delegate.h @@ -87,9 +87,9 @@ class CefBrowserContentsDelegate : public content::WebContentsDelegate, void UpdateTargetURL(content::WebContents* source, const GURL& url) override; bool DidAddMessageToConsole(content::WebContents* source, blink::mojom::ConsoleMessageLevel log_level, - const base::string16& message, + const std::u16string& message, int32_t line_no, - const base::string16& source_id) override; + const std::u16string& source_id) override; void DidNavigateMainFramePostCommit( content::WebContents* web_contents) override; void EnterFullscreenModeForTab( @@ -112,7 +112,8 @@ class CefBrowserContentsDelegate : public content::WebContentsDelegate, void RenderViewReady() override; void RenderProcessGone(base::TerminationStatus status) override; void OnFrameFocused(content::RenderFrameHost* render_frame_host) override; - void DocumentAvailableInMainFrame() override; + void DocumentAvailableInMainFrame( + content::RenderFrameHost* render_frame_host) override; void LoadProgressChanged(double progress) override; void DidStopLoading() override; void DidFinishNavigation( @@ -163,7 +164,7 @@ class CefBrowserContentsDelegate : public content::WebContentsDelegate, void OnLoadStart(CefRefPtr frame, ui::PageTransition transition_type); void OnLoadError(CefRefPtr frame, const GURL& url, int error_code); - void OnTitleChange(const base::string16& title); + void OnTitleChange(const std::u16string& title); void OnFullscreenModeChange(bool fullscreen); void OnStateChanged(State state_changed); diff --git a/libcef/browser/browser_host_base.h b/libcef/browser/browser_host_base.h index 3b8530a78..48331e81e 100644 --- a/libcef/browser/browser_host_base.h +++ b/libcef/browser/browser_host_base.h @@ -18,7 +18,7 @@ #include "base/observer_list.h" #include "base/synchronization/lock.h" -#include "extensions/common/view_type.h" +#include "extensions/common/mojom/view_type.mojom.h" namespace extensions { class Extension; @@ -86,7 +86,8 @@ struct CefBrowserCreateParams { // ProcessManager::CreateBackgroundHost. Currently used with the alloy // runtime only. const extensions::Extension* extension = nullptr; - extensions::ViewType extension_host_type = extensions::VIEW_TYPE_INVALID; + extensions::mojom::ViewType extension_host_type = + extensions::mojom::ViewType::kInvalid; }; // Base class for CefBrowserHost implementations. Includes functionality that is diff --git a/libcef/browser/browser_platform_delegate.cc b/libcef/browser/browser_platform_delegate.cc index 9f6292633..31f3a811a 100644 --- a/libcef/browser/browser_platform_delegate.cc +++ b/libcef/browser/browser_platform_delegate.cc @@ -76,7 +76,7 @@ void CefBrowserPlatformDelegate::BrowserCreated(CefBrowserHostBase* browser) { void CefBrowserPlatformDelegate::CreateExtensionHost( const extensions::Extension* extension, const GURL& url, - extensions::ViewType host_type) { + extensions::mojom::ViewType host_type) { NOTREACHED(); } diff --git a/libcef/browser/browser_platform_delegate.h b/libcef/browser/browser_platform_delegate.h index fe76c77e1..501a778f6 100644 --- a/libcef/browser/browser_platform_delegate.h +++ b/libcef/browser/browser_platform_delegate.h @@ -15,7 +15,7 @@ #include "include/views/cef_browser_view.h" #include "base/callback_forward.h" -#include "extensions/common/view_type.h" +#include "extensions/common/mojom/view_type.mojom-forward.h" #include "third_party/blink/public/common/page/drag_operation.h" #include "third_party/blink/public/mojom/page/drag.mojom-forward.h" #include "third_party/skia/include/core/SkColor.h" @@ -134,7 +134,7 @@ class CefBrowserPlatformDelegate { // Called from AlloyBrowserHostImpl::Create. virtual void CreateExtensionHost(const extensions::Extension* extension, const GURL& url, - extensions::ViewType host_type); + extensions::mojom::ViewType host_type); // Returns the current extension host. virtual extensions::ExtensionHost* GetExtensionHost() const; diff --git a/libcef/browser/browser_platform_delegate_create.cc b/libcef/browser/browser_platform_delegate_create.cc index f28582495..e8da240f0 100644 --- a/libcef/browser/browser_platform_delegate_create.cc +++ b/libcef/browser/browser_platform_delegate_create.cc @@ -115,7 +115,7 @@ std::unique_ptr CefBrowserPlatformDelegate::Create( } return std::move(native_delegate); } else if (create_params.extension_host_type == - extensions::VIEW_TYPE_EXTENSION_BACKGROUND_PAGE) { + extensions::mojom::ViewType::kExtensionBackgroundPage) { // Creating a background extension host without a window. std::unique_ptr native_delegate = CreateNativeDelegate(CefWindowInfo(), background_color); diff --git a/libcef/browser/chrome/chrome_browser_context.cc b/libcef/browser/chrome/chrome_browser_context.cc index ed65ec034..05cc052fb 100644 --- a/libcef/browser/chrome/chrome_browser_context.cc +++ b/libcef/browser/chrome/chrome_browser_context.cc @@ -57,10 +57,8 @@ void ChromeBrowserContext::InitializeAsync(base::OnceClosure initialized_cb) { // Create or load a specific disk-based profile. May continue // synchronously or asynchronously. profile_manager->CreateProfileAsync( - cache_path_, - base::Bind(&ChromeBrowserContext::ProfileCreated, - weak_ptr_factory_.GetWeakPtr()), - /*name=*/base::string16(), /*icon_url=*/std::string()); + cache_path_, base::Bind(&ChromeBrowserContext::ProfileCreated, + weak_ptr_factory_.GetWeakPtr())); return; } else { // All profile directories must be relative to |user_data_dir|. diff --git a/libcef/browser/chrome/chrome_browser_delegate.cc b/libcef/browser/chrome/chrome_browser_delegate.cc index ff5d1d2da..0cbbc65f1 100644 --- a/libcef/browser/chrome/chrome_browser_delegate.cc +++ b/libcef/browser/chrome/chrome_browser_delegate.cc @@ -156,9 +156,9 @@ void ChromeBrowserDelegate::UpdateTargetURL(content::WebContents* source, bool ChromeBrowserDelegate::DidAddMessageToConsole( content::WebContents* source, blink::mojom::ConsoleMessageLevel log_level, - const base::string16& message, + const std::u16string& message, int32_t line_no, - const base::string16& source_id) { + const std::u16string& source_id) { if (auto delegate = GetDelegateForWebContents(source)) { return delegate->DidAddMessageToConsole(source, log_level, message, line_no, source_id); diff --git a/libcef/browser/chrome/chrome_browser_delegate.h b/libcef/browser/chrome/chrome_browser_delegate.h index 2d6285e3f..b7de41664 100644 --- a/libcef/browser/chrome/chrome_browser_delegate.h +++ b/libcef/browser/chrome/chrome_browser_delegate.h @@ -70,9 +70,9 @@ class ChromeBrowserDelegate : public cef::BrowserDelegate { void UpdateTargetURL(content::WebContents* source, const GURL& url) override; bool DidAddMessageToConsole(content::WebContents* source, blink::mojom::ConsoleMessageLevel log_level, - const base::string16& message, + const std::u16string& message, int32_t line_no, - const base::string16& source_id) override; + const std::u16string& source_id) override; void DidNavigateMainFramePostCommit( content::WebContents* web_contents) override; void EnterFullscreenModeForTab( diff --git a/libcef/browser/chrome/chrome_browser_main_extra_parts_cef.cc b/libcef/browser/chrome/chrome_browser_main_extra_parts_cef.cc index 411279bce..e97f220b6 100644 --- a/libcef/browser/chrome/chrome_browser_main_extra_parts_cef.cc +++ b/libcef/browser/chrome/chrome_browser_main_extra_parts_cef.cc @@ -9,6 +9,7 @@ #include "libcef/browser/net/chrome_scheme_handler.h" #include "base/task/post_task.h" +#include "base/task/thread_pool.h" ChromeBrowserMainExtraPartsCef::ChromeBrowserMainExtraPartsCef() = default; @@ -24,14 +25,14 @@ void ChromeBrowserMainExtraPartsCef::PostProfileInit() { } void ChromeBrowserMainExtraPartsCef::PreMainMessageLoopRun() { - background_task_runner_ = base::CreateSingleThreadTaskRunner( - {base::ThreadPool(), base::TaskPriority::BEST_EFFORT, + background_task_runner_ = base::ThreadPool::CreateSingleThreadTaskRunner( + {base::TaskPriority::BEST_EFFORT, base::TaskShutdownBehavior::BLOCK_SHUTDOWN, base::MayBlock()}); - user_visible_task_runner_ = base::CreateSingleThreadTaskRunner( - {base::ThreadPool(), base::TaskPriority::USER_VISIBLE, + user_visible_task_runner_ = base::ThreadPool::CreateSingleThreadTaskRunner( + {base::TaskPriority::USER_VISIBLE, base::TaskShutdownBehavior::BLOCK_SHUTDOWN, base::MayBlock()}); - user_blocking_task_runner_ = base::CreateSingleThreadTaskRunner( - {base::ThreadPool(), base::TaskPriority::USER_BLOCKING, + user_blocking_task_runner_ = base::ThreadPool::CreateSingleThreadTaskRunner( + {base::TaskPriority::USER_BLOCKING, base::TaskShutdownBehavior::BLOCK_SHUTDOWN, base::MayBlock()}); scheme::RegisterWebUIControllerFactory(); diff --git a/libcef/browser/chrome/chrome_content_browser_client_cef.cc b/libcef/browser/chrome/chrome_content_browser_client_cef.cc index d7d657f99..debe29b48 100644 --- a/libcef/browser/chrome/chrome_content_browser_client_cef.cc +++ b/libcef/browser/chrome/chrome_content_browser_client_cef.cc @@ -40,13 +40,15 @@ namespace { void HandleExternalProtocolHelper( ChromeContentBrowserClientCef* self, content::WebContents::OnceGetter web_contents_getter, + int frame_tree_node_id, content::NavigationUIData* navigation_data, const network::ResourceRequest& resource_request) { // Match the logic of the original call in // NavigationURLLoaderImpl::PrepareForNonInterceptedRequest. self->HandleExternalProtocol( resource_request.url, std::move(web_contents_getter), - content::ChildProcessHost::kInvalidUniqueID, navigation_data, + content::ChildProcessHost::kInvalidUniqueID, frame_tree_node_id, + navigation_data, resource_request.resource_type == static_cast(blink::mojom::ResourceType::kMainFrame), static_cast(resource_request.transition_type), @@ -227,6 +229,7 @@ bool ChromeContentBrowserClientCef::HandleExternalProtocol( const GURL& url, content::WebContents::OnceGetter web_contents_getter, int child_id, + int frame_tree_node_id, content::NavigationUIData* navigation_data, bool is_main_frame, ui::PageTransition page_transition, @@ -244,9 +247,9 @@ bool ChromeContentBrowserClientCef::HandleExternalProtocol( // HandleExternalProtocolHelper. Forward to the chrome layer for default // handling. return ChromeContentBrowserClient::HandleExternalProtocol( - url, std::move(web_contents_getter), child_id, navigation_data, - is_main_frame, page_transition, has_user_gesture, initiating_origin, - nullptr); + url, std::move(web_contents_getter), child_id, frame_tree_node_id, + navigation_data, is_main_frame, page_transition, has_user_gesture, + initiating_origin, nullptr); } bool ChromeContentBrowserClientCef::HandleExternalProtocol( @@ -262,7 +265,8 @@ bool ChromeContentBrowserClientCef::HandleExternalProtocol( auto request_handler = net_service::CreateInterceptedRequestHandler( web_contents_getter, frame_tree_node_id, resource_request, base::Bind(HandleExternalProtocolHelper, base::Unretained(this), - web_contents_getter, navigation_data, resource_request)); + web_contents_getter, frame_tree_node_id, navigation_data, + resource_request)); net_service::ProxyURLLoaderFactory::CreateProxy( web_contents_getter, std::move(receiver), std::move(request_handler)); diff --git a/libcef/browser/chrome/chrome_content_browser_client_cef.h b/libcef/browser/chrome/chrome_content_browser_client_cef.h index 2c2e28ee2..ebe2f6ce4 100644 --- a/libcef/browser/chrome/chrome_content_browser_client_cef.h +++ b/libcef/browser/chrome/chrome_content_browser_client_cef.h @@ -60,6 +60,7 @@ class ChromeContentBrowserClientCef : public ChromeContentBrowserClient { const GURL& url, content::WebContents::OnceGetter web_contents_getter, int child_id, + int frame_tree_node_id, content::NavigationUIData* navigation_data, bool is_main_frame, ui::PageTransition page_transition, diff --git a/libcef/browser/context_menu_params_impl.cc b/libcef/browser/context_menu_params_impl.cc index 23e9f076b..c8d817852 100644 --- a/libcef/browser/context_menu_params_impl.cc +++ b/libcef/browser/context_menu_params_impl.cc @@ -119,7 +119,7 @@ bool CefContextMenuParamsImpl::GetDictionarySuggestions( if (const_value().dictionary_suggestions.empty()) return false; - std::vector::const_iterator it = + std::vector::const_iterator it = const_value().dictionary_suggestions.begin(); for (; it != const_value().dictionary_suggestions.end(); ++it) suggestions.push_back(*it); diff --git a/libcef/browser/devtools/devtools_controller.cc b/libcef/browser/devtools/devtools_controller.cc index 9b3496edf..abb930111 100644 --- a/libcef/browser/devtools/devtools_controller.cc +++ b/libcef/browser/devtools/devtools_controller.cc @@ -91,7 +91,7 @@ void CefDevToolsController::RemoveObserver(Observer* observer) { void CefDevToolsController::DispatchProtocolMessage( content::DevToolsAgentHost* agent_host, base::span message) { - if (!observers_.might_have_observers()) + if (observers_.empty()) return; base::StringPiece str_message(reinterpret_cast(message.data()), diff --git a/libcef/browser/devtools/devtools_file_manager.cc b/libcef/browser/devtools/devtools_file_manager.cc index 2082c3337..adea22abb 100644 --- a/libcef/browser/devtools/devtools_file_manager.cc +++ b/libcef/browser/devtools/devtools_file_manager.cc @@ -15,6 +15,7 @@ #include "base/path_service.h" #include "base/strings/utf_string_conversions.h" #include "base/task/post_task.h" +#include "base/task/thread_pool.h" #include "base/threading/sequenced_task_runner_handle.h" #include "base/util/values/values_util.h" #include "base/values.h" @@ -44,8 +45,8 @@ CefDevToolsFileManager::CefDevToolsFileManager( PrefService* prefs) : browser_impl_(browser_impl), prefs_(prefs), - file_task_runner_(base::CreateSequencedTaskRunner( - {base::ThreadPool(), base::MayBlock()})), + file_task_runner_( + base::ThreadPool::CreateSequencedTaskRunner({base::MayBlock()})), weak_factory_(this) {} void CefDevToolsFileManager::SaveToFile(const std::string& url, diff --git a/libcef/browser/devtools/devtools_frontend.cc b/libcef/browser/devtools/devtools_frontend.cc index f495a33f4..0d4e6605c 100644 --- a/libcef/browser/devtools/devtools_frontend.cc +++ b/libcef/browser/devtools/devtools_frontend.cc @@ -338,7 +338,8 @@ void CefDevToolsFrontend::ReadyToCommitNavigation( content::DevToolsFrontendHost::SetupExtensionsAPI(frame, script); } -void CefDevToolsFrontend::DocumentAvailableInMainFrame() { +void CefDevToolsFrontend::DocumentAvailableInMainFrame( + content::RenderFrameHost* render_frame_host) { // Don't call AttachClient multiple times for the same DevToolsAgentHost. // Otherwise it will call AgentHostClosed which closes the DevTools window. // This may happen in cases where the DevTools content fails to load. @@ -390,8 +391,7 @@ void CefDevToolsFrontend::HandleMessageFromDevToolsFrontend( this, base::as_bytes(base::make_span(protocol_message))); } else if (method == "loadCompleted") { web_contents()->GetMainFrame()->ExecuteJavaScriptForTests( - base::ASCIIToUTF16("DevToolsAPI.setUseSoftMenu(true);"), - base::NullCallback()); + u"DevToolsAPI.setUseSoftMenu(true);", base::NullCallback()); } else if (method == "loadNetworkResource" && params->GetSize() == 3) { // TODO(pfeldman): handle some of the embedder messages in content. std::string url; @@ -461,7 +461,7 @@ void CefDevToolsFrontend::HandleMessageFromDevToolsFrontend( SendMessageAck(request_id, &response); return; } else { - auto* partition = content::BrowserContext::GetStoragePartitionForSite( + auto* partition = content::BrowserContext::GetStoragePartitionForUrl( web_contents()->GetBrowserContext(), gurl); url_loader_factory = partition->GetURLLoaderFactoryForBrowserProcess(); } @@ -493,8 +493,7 @@ void CefDevToolsFrontend::HandleMessageFromDevToolsFrontend( update.Get()->RemoveWithoutPathExpansion(name, nullptr); } else if (method == "requestFileSystems") { web_contents()->GetMainFrame()->ExecuteJavaScriptForTests( - base::ASCIIToUTF16("DevToolsAPI.fileSystemsLoaded([]);"), - base::NullCallback()); + u"DevToolsAPI.fileSystemsLoaded([]);", base::NullCallback()); } else if (method == "reattach") { if (!agent_host_) return; @@ -550,7 +549,7 @@ void CefDevToolsFrontend::DispatchProtocolMessage( std::string param; base::EscapeJSONString(str_message, true, ¶m); std::string code = "DevToolsAPI.dispatchMessage(" + param + ");"; - base::string16 javascript = base::UTF8ToUTF16(code); + std::u16string javascript = base::UTF8ToUTF16(code); web_contents()->GetMainFrame()->ExecuteJavaScriptForTests( javascript, base::NullCallback()); return; @@ -564,7 +563,7 @@ void CefDevToolsFrontend::DispatchProtocolMessage( ¶m); std::string code = "DevToolsAPI.dispatchMessageChunk(" + param + "," + std::to_string(pos ? 0 : total_size) + ");"; - base::string16 javascript = base::UTF8ToUTF16(code); + std::u16string javascript = base::UTF8ToUTF16(code); web_contents()->GetMainFrame()->ExecuteJavaScriptForTests( javascript, base::NullCallback()); } diff --git a/libcef/browser/devtools/devtools_frontend.h b/libcef/browser/devtools/devtools_frontend.h index 51dffd2ee..1214cc56b 100644 --- a/libcef/browser/devtools/devtools_frontend.h +++ b/libcef/browser/devtools/devtools_frontend.h @@ -76,7 +76,8 @@ class CefDevToolsFrontend : public content::WebContentsObserver, // WebContentsObserver overrides void ReadyToCommitNavigation( content::NavigationHandle* navigation_handle) override; - void DocumentAvailableInMainFrame() override; + void DocumentAvailableInMainFrame( + content::RenderFrameHost* render_frame_host) override; void WebContentsDestroyed() override; void SendMessageAck(int request_id, const base::Value* arg1); diff --git a/libcef/browser/extensions/api/storage/sync_value_store_cache.cc b/libcef/browser/extensions/api/storage/sync_value_store_cache.cc index 86685f34b..d866d5641 100644 --- a/libcef/browser/extensions/api/storage/sync_value_store_cache.cc +++ b/libcef/browser/extensions/api/storage/sync_value_store_cache.cc @@ -56,7 +56,7 @@ void SyncValueStoreCache::RunWithValueStoreForExtension( // A neat way to implement unlimited storage; if the extension has the // unlimited storage permission, force through all calls to Set(). if (extension->permissions_data()->HasAPIPermission( - APIPermission::kUnlimitedStorage)) { + mojom::APIPermissionID::kUnlimitedStorage)) { WeakUnlimitedSettingsStorage unlimited_storage(storage); std::move(callback).Run(&unlimited_storage); } else { diff --git a/libcef/browser/extensions/api/tabs/tabs_api.cc b/libcef/browser/extensions/api/tabs/tabs_api.cc index a9b3c6003..f5c779ee9 100644 --- a/libcef/browser/extensions/api/tabs/tabs_api.cc +++ b/libcef/browser/extensions/api/tabs/tabs_api.cc @@ -128,7 +128,8 @@ ExecuteCodeFunction::InitResult ExecuteCodeInTabFunction::Init() { execute_tab_id_ = browser->GetIdentifier(); details_ = std::move(details); - set_host_id(HostID(HostID::EXTENSIONS, extension()->id())); + set_host_id( + mojom::HostID(mojom::HostID::HostType::kExtensions, extension()->id())); return set_init_result(SUCCESS); } @@ -182,7 +183,7 @@ bool ExecuteCodeInTabFunction::CanExecuteScriptOnPage(std::string* error) { execute_tab_id_, error)) { if (is_about_url && extension()->permissions_data()->active_permissions().HasAPIPermission( - APIPermission::kTab)) { + mojom::APIPermissionID::kTab)) { *error = ErrorUtils::FormatErrorMessage( manifest_errors::kCannotAccessAboutUrl, rfh->GetLastCommittedURL().spec(), diff --git a/libcef/browser/extensions/component_extension_resource_manager.cc b/libcef/browser/extensions/component_extension_resource_manager.cc index d912efa8b..78e79d088 100644 --- a/libcef/browser/extensions/component_extension_resource_manager.cc +++ b/libcef/browser/extensions/component_extension_resource_manager.cc @@ -23,7 +23,7 @@ CefComponentExtensionResourceManager::CefComponentExtensionResourceManager() { base::Value dict(base::Value::Type::DICTIONARY); pdf_extension_util::AddStrings( pdf_extension_util::PdfViewerContext::kPdfViewer, &dict); - pdf_extension_util::AddAdditionalData(&dict); + pdf_extension_util::AddAdditionalData(/*enable_annotations=*/true, &dict); ui::TemplateReplacements pdf_viewer_replacements; ui::TemplateReplacementsFromDictionaryValue( diff --git a/libcef/browser/extensions/extension_background_host.cc b/libcef/browser/extensions/extension_background_host.cc index ed3f79d15..eefd1c163 100644 --- a/libcef/browser/extensions/extension_background_host.cc +++ b/libcef/browser/extensions/extension_background_host.cc @@ -17,7 +17,7 @@ CefExtensionBackgroundHost::CefExtensionBackgroundHost( const Extension* extension, content::WebContents* host_contents, const GURL& url, - ViewType host_type) + mojom::ViewType host_type) : ExtensionHost(new CefExtensionHostDelegate(browser), extension, host_contents->GetBrowserContext(), @@ -28,7 +28,7 @@ CefExtensionBackgroundHost::CefExtensionBackgroundHost( DCHECK(!deleted_callback_.is_null()); // Only used for background pages. - DCHECK(host_type == VIEW_TYPE_EXTENSION_BACKGROUND_PAGE); + DCHECK(host_type == mojom::ViewType::kExtensionBackgroundPage); } CefExtensionBackgroundHost::~CefExtensionBackgroundHost() { diff --git a/libcef/browser/extensions/extension_background_host.h b/libcef/browser/extensions/extension_background_host.h index 8b62a3744..e010f84e8 100644 --- a/libcef/browser/extensions/extension_background_host.h +++ b/libcef/browser/extensions/extension_background_host.h @@ -29,7 +29,7 @@ class CefExtensionBackgroundHost : public ExtensionHost { const Extension* extension, content::WebContents* host_contents, const GURL& url, - ViewType host_type); + mojom::ViewType host_type); ~CefExtensionBackgroundHost() override; // content::WebContentsDelegate methods: diff --git a/libcef/browser/extensions/extension_function_details.cc b/libcef/browser/extensions/extension_function_details.cc index da19b2d40..79d0aafb2 100644 --- a/libcef/browser/extensions/extension_function_details.cc +++ b/libcef/browser/extensions/extension_function_details.cc @@ -12,6 +12,7 @@ #include "base/strings/utf_string_conversions.h" #include "base/task/post_task.h" +#include "base/task/thread_pool.h" #include "chrome/browser/extensions/api/tabs/tabs_constants.h" #include "chrome/browser/extensions/extension_tab_util.h" #include "chrome/browser/profiles/profile.h" @@ -81,10 +82,9 @@ class CefGetExtensionLoadFileCallbackImpl return; } - base::PostTaskAndReplyWithResult( + base::ThreadPool::PostTaskAndReplyWithResult( FROM_HERE, - {base::ThreadPool(), base::MayBlock(), - base::TaskShutdownBehavior::SKIP_ON_SHUTDOWN}, + {base::MayBlock(), base::TaskShutdownBehavior::SKIP_ON_SHUTDOWN}, base::BindOnce(LoadFileFromStream, file, stream), std::move(callback)); } diff --git a/libcef/browser/extensions/extension_system.cc b/libcef/browser/extensions/extension_system.cc index c5b803695..22da03fea 100644 --- a/libcef/browser/extensions/extension_system.cc +++ b/libcef/browser/extensions/extension_system.cc @@ -547,7 +547,8 @@ scoped_refptr CefExtensionSystem::CreateExtension( // Tests should continue to use the Manifest::COMMAND_LINE value here // Some Chrome APIs will cause undesired effects if this is incorrect // e.g.: alarms API has 1 minute minimum applied to Packed Extensions - info.internal ? Manifest::COMPONENT : Manifest::COMMAND_LINE, + info.internal ? mojom::ManifestLocation::kComponent + : mojom::ManifestLocation::kCommandLine, *info.manifest, flags, utf8_error); } diff --git a/libcef/browser/extensions/extension_view_host.cc b/libcef/browser/extensions/extension_view_host.cc index 3eb8ee839..3b1c08d5d 100644 --- a/libcef/browser/extensions/extension_view_host.cc +++ b/libcef/browser/extensions/extension_view_host.cc @@ -25,7 +25,7 @@ CefExtensionViewHost::CefExtensionViewHost(AlloyBrowserHostImpl* browser, const Extension* extension, content::WebContents* host_contents, const GURL& url, - ViewType host_type) + mojom::ViewType host_type) : ExtensionHost(new CefExtensionHostDelegate(browser), extension, host_contents->GetBrowserContext(), @@ -33,8 +33,8 @@ CefExtensionViewHost::CefExtensionViewHost(AlloyBrowserHostImpl* browser, url, host_type) { // Only used for dialogs and popups. - DCHECK(host_type == VIEW_TYPE_EXTENSION_DIALOG || - host_type == VIEW_TYPE_EXTENSION_POPUP); + DCHECK(host_type == mojom::ViewType::kExtensionDialog || + host_type == mojom::ViewType::kExtensionPopup); } CefExtensionViewHost::~CefExtensionViewHost() {} @@ -76,7 +76,7 @@ bool CefExtensionViewHost::PreHandleGestureEvent( } WebContents* CefExtensionViewHost::GetVisibleWebContents() const { - if (extension_host_type() == VIEW_TYPE_EXTENSION_POPUP) + if (extension_host_type() == mojom::ViewType::kExtensionPopup) return host_contents(); return nullptr; } diff --git a/libcef/browser/extensions/extension_view_host.h b/libcef/browser/extensions/extension_view_host.h index 9e8b2eb5f..4c360fb70 100644 --- a/libcef/browser/extensions/extension_view_host.h +++ b/libcef/browser/extensions/extension_view_host.h @@ -31,7 +31,7 @@ class CefExtensionViewHost : public ExtensionHost, const Extension* extension, content::WebContents* host_contents, const GURL& url, - ViewType host_type); + mojom::ViewType host_type); ~CefExtensionViewHost() override; // ExtensionHost methods: diff --git a/libcef/browser/extensions/extensions_browser_client.cc b/libcef/browser/extensions/extensions_browser_client.cc index 5ce037ba8..af8dbbdbe 100644 --- a/libcef/browser/extensions/extensions_browser_client.cc +++ b/libcef/browser/extensions/extensions_browser_client.cc @@ -264,8 +264,7 @@ bool CefExtensionsBrowserClient::CreateBackgroundExtensionHost( // This triggers creation of the background host. create_params.extension = extension; - create_params.extension_host_type = - extensions::VIEW_TYPE_EXTENSION_BACKGROUND_PAGE; + create_params.extension_host_type = mojom::ViewType::kExtensionBackgroundPage; // Browser creation may fail under certain rare circumstances. Fail the // background host creation in that case. diff --git a/libcef/browser/extensions/value_store/cef_value_store.cc b/libcef/browser/extensions/value_store/cef_value_store.cc index 350c0a8f7..730b0722f 100644 --- a/libcef/browser/extensions/value_store/cef_value_store.cc +++ b/libcef/browser/extensions/value_store/cef_value_store.cc @@ -92,17 +92,17 @@ ValueStore::WriteResult CefValueStore::Set( if (!status_.ok()) return WriteResult(CreateStatusCopy(status_)); - std::unique_ptr changes(new ValueStoreChangeList()); + ValueStoreChangeList changes; for (base::DictionaryValue::Iterator it(settings); !it.IsAtEnd(); it.Advance()) { - base::Value* old_value = nullptr; + base::Value* old_value = NULL; if (!storage_.GetWithoutPathExpansion(it.key(), &old_value) || !old_value->Equals(&it.value())) { - changes->push_back(ValueStoreChange( - it.key(), - old_value ? base::Optional(old_value->Clone()) - : base::nullopt, - it.value().Clone())); + changes.emplace_back(it.key(), + old_value + ? base::Optional(old_value->Clone()) + : base::nullopt, + it.value().Clone()); storage_.SetWithoutPathExpansion(it.key(), it.value().CreateDeepCopy()); } } @@ -119,13 +119,11 @@ ValueStore::WriteResult CefValueStore::Remove( if (!status_.ok()) return WriteResult(CreateStatusCopy(status_)); - std::unique_ptr changes(new ValueStoreChangeList()); - for (std::vector::const_iterator it = keys.begin(); - it != keys.end(); ++it) { + ValueStoreChangeList changes; + for (auto it = keys.cbegin(); it != keys.cend(); ++it) { std::unique_ptr old_value; if (storage_.RemoveWithoutPathExpansion(*it, &old_value)) { - changes->push_back( - ValueStoreChange(*it, std::move(*old_value), base::nullopt)); + changes.emplace_back(*it, std::move(*old_value), base::nullopt); } } return WriteResult(std::move(changes), CreateStatusCopy(status_)); diff --git a/libcef/browser/file_dialog_manager.cc b/libcef/browser/file_dialog_manager.cc index 12d476228..4d139eb51 100644 --- a/libcef/browser/file_dialog_manager.cc +++ b/libcef/browser/file_dialog_manager.cc @@ -274,7 +274,7 @@ void CefFileDialogManager::RunFileChooserInternal( if (params.hidereadonly) mode |= FILE_DIALOG_HIDEREADONLY_FLAG; - std::vector::const_iterator it; + std::vector::const_iterator it; std::vector accept_filters; it = params.accept_types.begin(); @@ -357,7 +357,7 @@ void CefFileDialogManager::OnRunFileChooserDelegateCallback( // Convert FilePath list to SelectedFileInfo list. for (size_t i = 0; i < file_paths.size(); ++i) { auto info = blink::mojom::FileChooserFileInfo::NewNativeFile( - blink::mojom::NativeFileInfo::New(file_paths[i], base::string16())); + blink::mojom::NativeFileInfo::New(file_paths[i], std::u16string())); selected_files.push_back(std::move(info)); } } diff --git a/libcef/browser/javascript_dialog_manager.cc b/libcef/browser/javascript_dialog_manager.cc index 521c293ff..bc967e32a 100644 --- a/libcef/browser/javascript_dialog_manager.cc +++ b/libcef/browser/javascript_dialog_manager.cc @@ -52,7 +52,7 @@ class CefJSDialogCallbackImpl : public CefJSDialogCallback { private: static void CancelNow(CallbackType callback) { CEF_REQUIRE_UIT(); - std::move(callback).Run(false, base::string16()); + std::move(callback).Run(false, std::u16string()); } CallbackType callback_; @@ -82,8 +82,8 @@ void CefJavaScriptDialogManager::RunJavaScriptDialog( content::WebContents* web_contents, content::RenderFrameHost* render_frame_host, content::JavaScriptDialogType message_type, - const base::string16& message_text, - const base::string16& default_prompt_text, + const std::u16string& message_text, + const std::u16string& default_prompt_text, DialogClosedCallback callback, bool* did_suppress_message) { const GURL& origin_url = render_frame_host->GetLastCommittedURL(); @@ -128,7 +128,7 @@ void CefJavaScriptDialogManager::RunJavaScriptDialog( dialog_running_ = true; - const base::string16& display_url = + const std::u16string& display_url = url_formatter::FormatUrlForSecurityDisplay(origin_url); DCHECK(!callback.is_null()); @@ -147,12 +147,11 @@ void CefJavaScriptDialogManager::RunBeforeUnloadDialog( AlloyBrowserHostImpl::DESTRUCTION_STATE_ACCEPTED) { // Currently destroying the browser. Accept the unload without showing // the prompt. - std::move(callback).Run(true, base::string16()); + std::move(callback).Run(true, std::u16string()); return; } - const base::string16& message_text = - base::ASCIIToUTF16("Is it OK to leave/reload this page?"); + const std::u16string& message_text = u"Is it OK to leave/reload this page?"; CefRefPtr client = browser_->GetClient(); if (client.get()) { @@ -179,7 +178,7 @@ void CefJavaScriptDialogManager::RunBeforeUnloadDialog( LOG(WARNING) << "No javascript dialog runner available for this platform"; // Suppress the dialog if there is no platform runner or if the dialog is // currently running. - std::move(callback).Run(true, base::string16()); + std::move(callback).Run(true, std::u16string()); return; } @@ -188,9 +187,9 @@ void CefJavaScriptDialogManager::RunBeforeUnloadDialog( DCHECK(!callback.is_null()); runner_->Run( browser_, content::JAVASCRIPT_DIALOG_TYPE_CONFIRM, - base::string16(), // display_url + std::u16string(), // display_url message_text, - base::string16(), // default_prompt_text + std::u16string(), // default_prompt_text base::BindOnce(&CefJavaScriptDialogManager::DialogClosed, weak_ptr_factory_.GetWeakPtr(), std::move(callback))); } @@ -216,7 +215,7 @@ void CefJavaScriptDialogManager::CancelDialogs( void CefJavaScriptDialogManager::DialogClosed( DialogClosedCallback callback, bool success, - const base::string16& user_input) { + const std::u16string& user_input) { CefRefPtr client = browser_->GetClient(); if (client.get()) { CefRefPtr handler = client->GetJSDialogHandler(); diff --git a/libcef/browser/javascript_dialog_manager.h b/libcef/browser/javascript_dialog_manager.h index 6c8db31ff..a9a3deef8 100644 --- a/libcef/browser/javascript_dialog_manager.h +++ b/libcef/browser/javascript_dialog_manager.h @@ -31,8 +31,8 @@ class CefJavaScriptDialogManager : public content::JavaScriptDialogManager { void RunJavaScriptDialog(content::WebContents* web_contents, content::RenderFrameHost* render_frame_host, content::JavaScriptDialogType message_type, - const base::string16& message_text, - const base::string16& default_prompt_text, + const std::u16string& message_text, + const std::u16string& default_prompt_text, DialogClosedCallback callback, bool* did_suppress_message) override; void RunBeforeUnloadDialog(content::WebContents* web_contents, @@ -46,7 +46,7 @@ class CefJavaScriptDialogManager : public content::JavaScriptDialogManager { // Method executed by the callback passed to CefJavaScriptDialogRunner::Run. void DialogClosed(DialogClosedCallback callback, bool success, - const base::string16& user_input); + const std::u16string& user_input); // AlloyBrowserHostImpl pointer is guaranteed to outlive this object. AlloyBrowserHostImpl* browser_; diff --git a/libcef/browser/javascript_dialog_runner.h b/libcef/browser/javascript_dialog_runner.h index af2aa5072..ff601a962 100644 --- a/libcef/browser/javascript_dialog_runner.h +++ b/libcef/browser/javascript_dialog_runner.h @@ -8,7 +8,6 @@ #pragma once #include "base/callback.h" -#include "base/strings/string16.h" #include "content/public/common/javascript_dialog_type.h" class AlloyBrowserHostImpl; @@ -16,15 +15,15 @@ class AlloyBrowserHostImpl; class CefJavaScriptDialogRunner { public: typedef base::OnceCallback + const std::u16string& /* user_input */)> DialogClosedCallback; // Run the dialog. Execute |callback| on completion. virtual void Run(AlloyBrowserHostImpl* browser, content::JavaScriptDialogType message_type, - const base::string16& display_url, - const base::string16& message_text, - const base::string16& default_prompt_text, + const std::u16string& display_url, + const std::u16string& message_text, + const std::u16string& default_prompt_text, DialogClosedCallback callback) = 0; // Cancel a dialog mid-flight. diff --git a/libcef/browser/main_runner.cc b/libcef/browser/main_runner.cc index 875111ea3..5741def94 100644 --- a/libcef/browser/main_runner.cc +++ b/libcef/browser/main_runner.cc @@ -99,7 +99,7 @@ int RunAsCrashpadHandler(const base::CommandLine& command_line) { storage.reserve(argv.size()); for (size_t i = 0; i < argv.size(); ++i) { #if defined(OS_WIN) - storage.push_back(base::UTF16ToUTF8(argv[i])); + storage.push_back(base::WideToUTF8(argv[i])); #else storage.push_back(argv[i]); #endif diff --git a/libcef/browser/menu_manager.cc b/libcef/browser/menu_manager.cc index d3e72daf9..d1ccfa6f3 100644 --- a/libcef/browser/menu_manager.cc +++ b/libcef/browser/menu_manager.cc @@ -19,11 +19,12 @@ #include "content/public/browser/render_frame_host.h" #include "content/public/browser/render_process_host.h" #include "content/public/browser/render_widget_host_view.h" +#include "third_party/blink/public/mojom/context_menu/context_menu.mojom.h" namespace { CefString GetLabel(int message_id) { - base::string16 label = + std::u16string label = CefAppManager::Get()->GetContentClient()->GetLocalizedString(message_id); DCHECK(!label.empty()); return label; @@ -267,7 +268,7 @@ void CefMenuManager::MenuClosed(CefRefPtr source) { } bool CefMenuManager::FormatLabel(CefRefPtr source, - base::string16& label) { + std::u16string& label) { if (!runner_) return false; return runner_->FormatLabel(label); diff --git a/libcef/browser/menu_manager.h b/libcef/browser/menu_manager.h index 83fafe263..931b0038e 100644 --- a/libcef/browser/menu_manager.h +++ b/libcef/browser/menu_manager.h @@ -47,7 +47,7 @@ class CefMenuManager : public CefMenuModelImpl::Delegate, void MenuWillShow(CefRefPtr source) override; void MenuClosed(CefRefPtr source) override; bool FormatLabel(CefRefPtr source, - base::string16& label) override; + std::u16string& label) override; void ExecuteCommandCallback(int command_id, cef_event_flags_t event_flags); diff --git a/libcef/browser/menu_model_impl.cc b/libcef/browser/menu_model_impl.cc index 9192c0b83..a4359af1f 100644 --- a/libcef/browser/menu_model_impl.cc +++ b/libcef/browser/menu_model_impl.cc @@ -64,7 +64,7 @@ class CefSimpleMenuModel : public ui::MenuModel { return impl_->GetCommandIdAt(index); } - base::string16 GetLabelAt(int index) const override { + std::u16string GetLabelAt(int index) const override { return impl_->GetFormattedLabelAt(index); } @@ -886,8 +886,8 @@ void CefMenuModelImpl::MenuWillClose() { FROM_HERE, base::Bind(&CefMenuModelImpl::OnMenuClosed, this)); } -base::string16 CefMenuModelImpl::GetFormattedLabelAt(int index) { - base::string16 label = GetLabelAt(index).ToString16(); +std::u16string CefMenuModelImpl::GetFormattedLabelAt(int index) { + std::u16string label = GetLabelAt(index).ToString16(); if (delegate_) delegate_->FormatLabel(this, label); if (menu_model_delegate_) { diff --git a/libcef/browser/menu_model_impl.h b/libcef/browser/menu_model_impl.h index ebe197916..e7254c4d3 100644 --- a/libcef/browser/menu_model_impl.h +++ b/libcef/browser/menu_model_impl.h @@ -47,7 +47,7 @@ class CefMenuModelImpl : public CefMenuModel { // Allows the delegate to modify a menu item label before it's displayed. virtual bool FormatLabel(CefRefPtr source, - base::string16& label) = 0; + std::u16string& label) = 0; protected: virtual ~Delegate() {} @@ -166,7 +166,7 @@ class CefMenuModelImpl : public CefMenuModel { SkColor* override_color) const; void MenuWillShow(); void MenuWillClose(); - base::string16 GetFormattedLabelAt(int index); + std::u16string GetFormattedLabelAt(int index); const gfx::FontList* GetLabelFontListAt(int index) const; // Verify that only a single reference exists to all CefMenuModelImpl objects. diff --git a/libcef/browser/menu_runner.h b/libcef/browser/menu_runner.h index edd058057..b8bf22f0b 100644 --- a/libcef/browser/menu_runner.h +++ b/libcef/browser/menu_runner.h @@ -6,9 +6,9 @@ #define CEF_LIBCEF_BROWSER_MENU_RUNNER_H_ #include +#include #include "base/macros.h" -#include "base/strings/string16.h" namespace content { struct ContextMenuParams; @@ -24,7 +24,7 @@ class CefMenuRunner { CefMenuModelImpl* model, const content::ContextMenuParams& params) = 0; virtual void CancelContextMenu() {} - virtual bool FormatLabel(base::string16& label) { return false; } + virtual bool FormatLabel(std::u16string& label) { return false; } protected: // Allow deletion via scoped_ptr only. diff --git a/libcef/browser/native/browser_platform_delegate_native_linux.cc b/libcef/browser/native/browser_platform_delegate_native_linux.cc index 6ce1d848b..c7ba57b96 100644 --- a/libcef/browser/native/browser_platform_delegate_native_linux.cc +++ b/libcef/browser/native/browser_platform_delegate_native_linux.cc @@ -295,7 +295,7 @@ ui::KeyEvent CefBrowserPlatformDelegateNativeLinux::TranslateUiKeyEvent( ui::KeycodeConverter::NativeKeycodeToDomCode(key_event.native_key_code); int keysym = ui::XKeysymForWindowsKeyCode( key_code, !!(key_event.modifiers & EVENTFLAG_SHIFT_DOWN)); - base::char16 character = ui::GetUnicodeCharacterFromXKeySym(keysym); + char16_t character = ui::GetUnicodeCharacterFromXKeySym(keysym); base::TimeTicks time_stamp = GetEventTimeStamp(); if (key_event.type == KEYEVENT_CHAR) { diff --git a/libcef/browser/native/browser_platform_delegate_native_win.cc b/libcef/browser/native/browser_platform_delegate_native_win.cc index 7d62c9930..86d311414 100644 --- a/libcef/browser/native/browser_platform_delegate_native_win.cc +++ b/libcef/browser/native/browser_platform_delegate_native_win.cc @@ -69,7 +69,7 @@ const int kMaxAddressLengthChars = 2048; bool HasExternalHandler(const std::string& scheme) { base::win::RegKey key; const std::wstring registry_path = - base::ASCIIToUTF16(scheme + "\\shell\\open\\command"); + base::ASCIIToWide(scheme + "\\shell\\open\\command"); key.Open(HKEY_CLASSES_ROOT, registry_path.c_str(), KEY_READ); if (key.Valid()) { DWORD size = 0; diff --git a/libcef/browser/native/cursor_util_linux.cc b/libcef/browser/native/cursor_util_linux.cc index c8f777620..f5d256845 100644 --- a/libcef/browser/native/cursor_util_linux.cc +++ b/libcef/browser/native/cursor_util_linux.cc @@ -15,7 +15,7 @@ namespace cursor_util { cef_cursor_handle_t GetPlatformCursor(ui::mojom::CursorType type) { auto cursor = ui::CursorFactory::GetInstance()->GetDefaultCursor(type); if (cursor) { - return ToCursorHandle(*cursor); + return ToCursorHandle(cursor); } return 0; } diff --git a/libcef/browser/native/cursor_util_win.cc b/libcef/browser/native/cursor_util_win.cc index 112b5f6c6..842a54671 100644 --- a/libcef/browser/native/cursor_util_win.cc +++ b/libcef/browser/native/cursor_util_win.cc @@ -47,12 +47,16 @@ LPCWSTR ToCursorID(ui::mojom::CursorType type) { return IDC_SIZENESW; case ui::mojom::CursorType::kWestResize: return IDC_SIZEWE; + case ui::mojom::CursorType::kNorthSouthNoResize: case ui::mojom::CursorType::kNorthSouthResize: return IDC_SIZENS; + case ui::mojom::CursorType::kEastWestNoResize: case ui::mojom::CursorType::kEastWestResize: return IDC_SIZEWE; + case ui::mojom::CursorType::kNorthEastSouthWestNoResize: case ui::mojom::CursorType::kNorthEastSouthWestResize: return IDC_SIZENESW; + case ui::mojom::CursorType::kNorthWestSouthEastNoResize: case ui::mojom::CursorType::kNorthWestSouthEastResize: return IDC_SIZENWSE; case ui::mojom::CursorType::kColumnResize: diff --git a/libcef/browser/native/file_dialog_runner_mac.mm b/libcef/browser/native/file_dialog_runner_mac.mm index f6cbf78f7..193ca806b 100644 --- a/libcef/browser/native/file_dialog_runner_mac.mm +++ b/libcef/browser/native/file_dialog_runner_mac.mm @@ -25,7 +25,7 @@ namespace { -base::string16 GetDescriptionFromMimeType(const std::string& mime_type) { +std::u16string GetDescriptionFromMimeType(const std::string& mime_type) { // Check for wild card mime types and return an appropriate description. static const struct { const char* mime_type; @@ -42,31 +42,31 @@ base::string16 GetDescriptionFromMimeType(const std::string& mime_type) { return l10n_util::GetStringUTF16(kWildCardMimeTypes[i].string_id); } - return base::string16(); + return std::u16string(); } void AddFilters(NSPopUpButton* button, - const std::vector& accept_filters, + const std::vector& accept_filters, bool include_all_files, - std::vector>* all_extensions) { + std::vector>* all_extensions) { for (size_t i = 0; i < accept_filters.size(); ++i) { - const base::string16& filter = accept_filters[i]; + const std::u16string& filter = accept_filters[i]; if (filter.empty()) continue; - std::vector extensions; - base::string16 description; + std::vector extensions; + std::u16string description; size_t sep_index = filter.find('|'); if (sep_index != std::string::npos) { // Treat as a filter of the form "Filter Name|.ext1;.ext2;.ext3". description = filter.substr(0, sep_index); - const std::vector& ext = base::SplitString( - filter.substr(sep_index + 1), base::ASCIIToUTF16(";"), - base::TRIM_WHITESPACE, base::SPLIT_WANT_NONEMPTY); + const std::vector& ext = + base::SplitString(filter.substr(sep_index + 1), u";", + base::TRIM_WHITESPACE, base::SPLIT_WANT_NONEMPTY); for (size_t x = 0; x < ext.size(); ++x) { - const base::string16& file_ext = ext[x]; + const std::u16string& file_ext = ext[x]; if (!file_ext.empty() && file_ext[0] == '.') extensions.push_back(file_ext); } @@ -80,7 +80,7 @@ void AddFilters(NSPopUpButton* button, net::GetExtensionsForMimeType(ascii, &ext); if (!ext.empty()) { for (size_t x = 0; x < ext.size(); ++x) - extensions.push_back(base::ASCIIToUTF16("." + ext[x])); + extensions.push_back(u"." + base::ASCIIToUTF16(ext[x])); description = GetDescriptionFromMimeType(ascii); } } @@ -92,22 +92,21 @@ void AddFilters(NSPopUpButton* button, // will keep growing. const size_t kMaxExtensions = 10; - base::string16 ext_str; + std::u16string ext_str; for (size_t x = 0; x < std::min(kMaxExtensions, extensions.size()); ++x) { - const base::string16& pattern = base::ASCIIToUTF16("*") + extensions[x]; + const std::u16string& pattern = u"*" + extensions[x]; if (x != 0) - ext_str += base::ASCIIToUTF16(";"); + ext_str += u";"; ext_str += pattern; } if (extensions.size() > kMaxExtensions) - ext_str += base::ASCIIToUTF16(";..."); + ext_str += u";..."; if (description.empty()) { description = ext_str; } else { - description += - base::ASCIIToUTF16(" (") + ext_str + base::ASCIIToUTF16(")"); + description += u" (" + ext_str + u")"; } [button addItemWithTitle:base::SysUTF16ToNSString(description)]; @@ -119,7 +118,7 @@ void AddFilters(NSPopUpButton* button, // is implied). if (include_all_files && !all_extensions->empty()) { [button addItemWithTitle:base::SysUTF8ToNSString("All Files (*)")]; - all_extensions->push_back(std::vector()); + all_extensions->push_back(std::vector()); } } @@ -129,11 +128,11 @@ void AddFilters(NSPopUpButton* button, @interface CefFilterDelegate : NSObject { @private NSSavePanel* panel_; - std::vector> extensions_; + std::vector> extensions_; int selected_index_; } - (id)initWithPanel:(NSSavePanel*)panel - andAcceptFilters:(const std::vector&)accept_filters + andAcceptFilters:(const std::vector&)accept_filters andFilterIndex:(int)index; - (void)setFilter:(int)index; - (int)filter; @@ -144,7 +143,7 @@ void AddFilters(NSPopUpButton* button, @implementation CefFilterDelegate - (id)initWithPanel:(NSSavePanel*)panel - andAcceptFilters:(const std::vector&)accept_filters + andAcceptFilters:(const std::vector&)accept_filters andFilterIndex:(int)index { if (self = [super init]) { DCHECK(panel); @@ -204,7 +203,7 @@ void AddFilters(NSPopUpButton* button, // Set the extension on the currently selected file name. - (void)setFileExtension { - const std::vector& filter = extensions_[selected_index_]; + const std::vector& filter = extensions_[selected_index_]; if (filter.empty()) { // All extensions are allowed so don't change anything. return; @@ -214,7 +213,7 @@ void AddFilters(NSPopUpButton* button, // If the file name currently includes an extension from |filter| then don't // change anything. - base::string16 extension = base::UTF8ToUTF16(path.Extension()); + std::u16string extension = base::UTF8ToUTF16(path.Extension()); if (!extension.empty()) { for (size_t i = 0; i < filter.size(); ++i) { if (filter[i] == extension) @@ -259,7 +258,7 @@ void CefFileDialogRunnerMac::RunOpenFileDialog( int filter_index) { NSOpenPanel* openPanel = [NSOpenPanel openPanel]; - base::string16 title; + std::u16string title; if (!params.title.empty()) { title = params.title; } else { @@ -347,7 +346,7 @@ void CefFileDialogRunnerMac::RunSaveFileDialog( int filter_index) { NSSavePanel* savePanel = [NSSavePanel savePanel]; - base::string16 title; + std::u16string title; if (!params.title.empty()) title = params.title; else diff --git a/libcef/browser/native/file_dialog_runner_win.cc b/libcef/browser/native/file_dialog_runner_win.cc index eec07f332..14d1bbb58 100644 --- a/libcef/browser/native/file_dialog_runner_win.cc +++ b/libcef/browser/native/file_dialog_runner_win.cc @@ -69,8 +69,8 @@ std::wstring FormatFilterForExtensions( bool include_all_files) { const std::wstring all_ext = L"*.*"; const std::wstring all_desc = - l10n_util::GetStringUTF16(IDS_APP_SAVEAS_ALL_FILES) + L" (" + all_ext + - L")"; + base::UTF16ToWide(l10n_util::GetStringUTF16(IDS_APP_SAVEAS_ALL_FILES)) + + L" (" + all_ext + L")"; DCHECK(file_ext.size() >= ext_desc.size()); @@ -97,7 +97,8 @@ std::wstring FormatFilterForExtensions( ext += L";" + std::wstring(*it); } std::wstring desc = - l10n_util::GetStringUTF16(IDS_CUSTOM_FILES) + L" (" + ext + L")"; + base::UTF16ToWide(l10n_util::GetStringUTF16(IDS_CUSTOM_FILES)) + + L" (" + ext + L")"; result.append(desc.c_str(), desc.size() + 1); // Append NULL too. result.append(ext.c_str(), ext.size() + 1); @@ -167,34 +168,36 @@ std::wstring GetDescriptionFromMimeType(const std::string& mime_type) { }; for (size_t i = 0; i < base::size(kWildCardMimeTypes); ++i) { - if (mime_type == std::string(kWildCardMimeTypes[i].mime_type) + "/*") - return l10n_util::GetStringUTF16(kWildCardMimeTypes[i].string_id); + if (mime_type == std::string(kWildCardMimeTypes[i].mime_type) + "/*") { + return base::UTF16ToWide( + l10n_util::GetStringUTF16(kWildCardMimeTypes[i].string_id)); + } } return std::wstring(); } std::wstring GetFilterString( - const std::vector& accept_filters) { + const std::vector& accept_filters) { std::vector extensions; std::vector descriptions; for (size_t i = 0; i < accept_filters.size(); ++i) { - const base::string16& filter = accept_filters[i]; + const std::wstring& filter = base::UTF16ToWide(accept_filters[i]); if (filter.empty()) continue; - size_t sep_index = filter.find('|'); - if (sep_index != base::string16::npos) { + size_t sep_index = filter.find(L'|'); + if (sep_index != std::wstring::npos) { // Treat as a filter of the form "Filter Name|.ext1;.ext2;.ext3". - const base::string16& desc = filter.substr(0, sep_index); - const std::vector& ext = base::SplitString( - filter.substr(sep_index + 1), base::ASCIIToUTF16(";"), + const std::wstring& desc = filter.substr(0, sep_index); + const std::vector& ext = base::SplitString( + base::WideToUTF16(filter.substr(sep_index + 1)), u";", base::TRIM_WHITESPACE, base::SPLIT_WANT_NONEMPTY); std::wstring ext_str; for (size_t x = 0; x < ext.size(); ++x) { - const base::string16& file_ext = ext[x]; - if (!file_ext.empty() && file_ext[0] == '.') { + const std::wstring& file_ext = base::UTF16ToWide(ext[x]); + if (!file_ext.empty() && file_ext[0] == L'.') { if (!ext_str.empty()) ext_str += L";"; ext_str += L"*" + file_ext; @@ -210,7 +213,7 @@ std::wstring GetFilterString( descriptions.push_back(std::wstring()); } else { // Otherwise convert mime type to one or more extensions. - const std::string& ascii = base::UTF16ToASCII(filter); + const std::string& ascii = base::WideToASCII(filter); std::vector ext; std::wstring ext_str; net::GetExtensionsForMimeType(ascii, &ext); @@ -264,10 +267,12 @@ bool RunOpenFileDialog(const CefFileDialogRunner::FileChooserParams& params, ofn.lpstrInitialDir = directory.c_str(); std::wstring title; - if (!params.title.empty()) - title = params.title; - else - title = l10n_util::GetStringUTF16(IDS_OPEN_FILE_DIALOG_TITLE); + if (!params.title.empty()) { + title = base::UTF16ToWide(params.title); + } else { + title = base::UTF16ToWide( + l10n_util::GetStringUTF16(IDS_OPEN_FILE_DIALOG_TITLE)); + } if (!title.empty()) ofn.lpstrTitle = title.c_str(); @@ -326,10 +331,12 @@ bool RunOpenMultiFileDialog( ofn.lpstrInitialDir = directory.c_str(); std::wstring title; - if (!params.title.empty()) - title = params.title; - else - title = l10n_util::GetStringUTF16(IDS_OPEN_FILES_DIALOG_TITLE); + if (!params.title.empty()) { + title = base::UTF16ToWide(params.title); + } else { + title = base::UTF16ToWide( + l10n_util::GetStringUTF16(IDS_OPEN_FILES_DIALOG_TITLE)); + } if (!title.empty()) ofn.lpstrTitle = title.c_str(); @@ -404,10 +411,12 @@ bool RunOpenFolderDialog(const CefFileDialogRunner::FileChooserParams& params, browse_info.ulFlags = BIF_USENEWUI | BIF_RETURNONLYFSDIRS; std::wstring title; - if (!params.title.empty()) - title = params.title; - else - title = l10n_util::GetStringUTF16(IDS_SELECT_FOLDER_DIALOG_TITLE); + if (!params.title.empty()) { + title = base::UTF16ToWide(params.title); + } else { + title = base::UTF16ToWide( + l10n_util::GetStringUTF16(IDS_SELECT_FOLDER_DIALOG_TITLE)); + } if (!title.empty()) browse_info.lpszTitle = title.c_str(); @@ -479,10 +488,12 @@ bool RunSaveFileDialog(const CefFileDialogRunner::FileChooserParams& params, ofn.lpstrInitialDir = directory.c_str(); std::wstring title; - if (!params.title.empty()) - title = params.title; - else - title = l10n_util::GetStringUTF16(IDS_SAVE_AS_DIALOG_TITLE); + if (!params.title.empty()) { + title = base::UTF16ToWide(params.title); + } else { + title = + base::UTF16ToWide(l10n_util::GetStringUTF16(IDS_SAVE_AS_DIALOG_TITLE)); + } if (!title.empty()) ofn.lpstrTitle = title.c_str(); diff --git a/libcef/browser/native/javascript_dialog_runner_mac.h b/libcef/browser/native/javascript_dialog_runner_mac.h index 8f93ef497..193f2d694 100644 --- a/libcef/browser/native/javascript_dialog_runner_mac.h +++ b/libcef/browser/native/javascript_dialog_runner_mac.h @@ -26,14 +26,14 @@ class CefJavaScriptDialogRunnerMac : public CefJavaScriptDialogRunner { // CefJavaScriptDialogRunner methods: void Run(AlloyBrowserHostImpl* browser, content::JavaScriptDialogType message_type, - const base::string16& display_url, - const base::string16& message_text, - const base::string16& default_prompt_text, + const std::u16string& display_url, + const std::u16string& message_text, + const std::u16string& default_prompt_text, DialogClosedCallback callback) override; void Cancel() override; // Callback from CefJavaScriptDialogHelper when the dialog is closed. - void DialogClosed(bool success, const base::string16& user_input); + void DialogClosed(bool success, const std::u16string& user_input); private: DialogClosedCallback callback_; diff --git a/libcef/browser/native/javascript_dialog_runner_mac.mm b/libcef/browser/native/javascript_dialog_runner_mac.mm index bf1948bed..4d6572d83 100644 --- a/libcef/browser/native/javascript_dialog_runner_mac.mm +++ b/libcef/browser/native/javascript_dialog_runner_mac.mm @@ -65,7 +65,7 @@ return; bool success = returnCode == NSAlertFirstButtonReturn; - base::string16 input; + std::u16string input; if (textField_) input = base::SysNSStringToUTF16([textField_ stringValue]); @@ -89,9 +89,9 @@ CefJavaScriptDialogRunnerMac::~CefJavaScriptDialogRunnerMac() { void CefJavaScriptDialogRunnerMac::Run( AlloyBrowserHostImpl* browser, content::JavaScriptDialogType message_type, - const base::string16& display_url, - const base::string16& message_text, - const base::string16& default_prompt_text, + const std::u16string& display_url, + const std::u16string& message_text, + const std::u16string& default_prompt_text, DialogClosedCallback callback) { DCHECK(!helper_.get()); callback_ = std::move(callback); @@ -114,20 +114,20 @@ void CefJavaScriptDialogRunnerMac::Run( [alert setDelegate:helper_]; [alert setInformativeText:base::SysUTF16ToNSString(message_text)]; - base::string16 label; + std::u16string label; switch (message_type) { case content::JAVASCRIPT_DIALOG_TYPE_ALERT: - label = base::ASCIIToUTF16("JavaScript Alert"); + label = u"JavaScript Alert"; break; case content::JAVASCRIPT_DIALOG_TYPE_PROMPT: - label = base::ASCIIToUTF16("JavaScript Prompt"); + label = u"JavaScript Prompt"; break; case content::JAVASCRIPT_DIALOG_TYPE_CONFIRM: - label = base::ASCIIToUTF16("JavaScript Confirm"); + label = u"JavaScript Confirm"; break; } if (!display_url.empty()) - label += base::ASCIIToUTF16(" - ") + display_url; + label += u" - " + display_url; [alert setMessageText:base::SysUTF16ToNSString(label)]; @@ -165,7 +165,7 @@ void CefJavaScriptDialogRunnerMac::Cancel() { void CefJavaScriptDialogRunnerMac::DialogClosed( bool success, - const base::string16& user_input) { + const std::u16string& user_input) { helper_.reset(nil); std::move(callback_).Run(success, user_input); } diff --git a/libcef/browser/native/javascript_dialog_runner_win.cc b/libcef/browser/native/javascript_dialog_runner_win.cc index 49a6af8d9..94af08562 100644 --- a/libcef/browser/native/javascript_dialog_runner_win.cc +++ b/libcef/browser/native/javascript_dialog_runner_win.cc @@ -39,7 +39,7 @@ INT_PTR CALLBACK CefJavaScriptDialogRunnerWin::DialogProc(HWND dialog, reinterpret_cast( GetWindowLongPtr(dialog, DWLP_USER)); if (owner) { - owner->CloseDialog(false, base::string16()); + owner->CloseDialog(false, std::wstring()); // No need for the system to call DestroyWindow() because it will be // called by the Cancel() method. @@ -51,7 +51,7 @@ INT_PTR CALLBACK CefJavaScriptDialogRunnerWin::DialogProc(HWND dialog, CefJavaScriptDialogRunnerWin* owner = reinterpret_cast( GetWindowLongPtr(dialog, DWLP_USER)); - base::string16 user_input; + std::wstring user_input; bool finish = false; bool result = false; switch (LOWORD(wparam)) { @@ -62,8 +62,9 @@ INT_PTR CALLBACK CefJavaScriptDialogRunnerWin::DialogProc(HWND dialog, size_t length = GetWindowTextLength(GetDlgItem(dialog, IDC_PROMPTEDIT)) + 1; if (length > 1) { - GetDlgItemText(dialog, IDC_PROMPTEDIT, - base::WriteInto(&user_input, length), length); + user_input.reserve(length); + user_input.resize(length - 1); + GetDlgItemText(dialog, IDC_PROMPTEDIT, &user_input[0], length); } } break; @@ -93,15 +94,15 @@ CefJavaScriptDialogRunnerWin::~CefJavaScriptDialogRunnerWin() { void CefJavaScriptDialogRunnerWin::Run( AlloyBrowserHostImpl* browser, content::JavaScriptDialogType message_type, - const base::string16& display_url, - const base::string16& message_text, - const base::string16& default_prompt_text, + const std::u16string& display_url, + const std::u16string& message_text, + const std::u16string& default_prompt_text, DialogClosedCallback callback) { DCHECK(!dialog_win_); message_type_ = message_type; - message_text_ = message_text; - default_prompt_text_ = default_prompt_text; + message_text_ = base::UTF16ToWide(message_text); + default_prompt_text_ = base::UTF16ToWide(default_prompt_text); callback_ = std::move(callback); InstallMessageHook(); @@ -135,11 +136,11 @@ void CefJavaScriptDialogRunnerWin::Run( if (!display_url.empty()) { // Add the display URL to the window title. - TCHAR text[64]; - GetWindowText(dialog_win_, text, sizeof(text) / sizeof(TCHAR)); + wchar_t text[64]; + GetWindowText(dialog_win_, text, sizeof(text) / sizeof(wchar_t)); - base::string16 new_window_text = - text + base::ASCIIToUTF16(" - ") + display_url; + std::wstring new_window_text = + std::wstring(text) + L" - " + base::UTF16ToWide(display_url); SetWindowText(dialog_win_, new_window_text.c_str()); } @@ -170,14 +171,13 @@ void CefJavaScriptDialogRunnerWin::Cancel() { } } -void CefJavaScriptDialogRunnerWin::CloseDialog( - bool success, - const base::string16& user_input) { +void CefJavaScriptDialogRunnerWin::CloseDialog(bool success, + const std::wstring& user_input) { // Run the callback first so that RenderProcessHostImpl::IsBlocked is // cleared. Otherwise, RenderWidgetHostImpl::IsIgnoringInputEvents will // return true and RenderWidgetHostViewAura::OnWindowFocused will fail to // re-assign browser focus. - std::move(callback_).Run(success, user_input); + std::move(callback_).Run(success, base::WideToUTF16(user_input)); Cancel(); } diff --git a/libcef/browser/native/javascript_dialog_runner_win.h b/libcef/browser/native/javascript_dialog_runner_win.h index 94cae6ab7..ae2d86548 100644 --- a/libcef/browser/native/javascript_dialog_runner_win.h +++ b/libcef/browser/native/javascript_dialog_runner_win.h @@ -19,21 +19,21 @@ class CefJavaScriptDialogRunnerWin : public CefJavaScriptDialogRunner { // CefJavaScriptDialogRunner methods: void Run(AlloyBrowserHostImpl* browser, content::JavaScriptDialogType message_type, - const base::string16& display_url, - const base::string16& message_text, - const base::string16& default_prompt_text, + const std::u16string& display_url, + const std::u16string& message_text, + const std::u16string& default_prompt_text, DialogClosedCallback callback) override; void Cancel() override; private: - void CloseDialog(bool success, const base::string16& user_input); + void CloseDialog(bool success, const std::wstring& user_input); HWND dialog_win_; HWND parent_win_; content::JavaScriptDialogType message_type_; - base::string16 message_text_; - base::string16 default_prompt_text_; + std::wstring message_text_; + std::wstring default_prompt_text_; DialogClosedCallback callback_; bool hook_installed_; diff --git a/libcef/browser/native/menu_runner_linux.cc b/libcef/browser/native/menu_runner_linux.cc index 137d85f7e..220d06c30 100644 --- a/libcef/browser/native/menu_runner_linux.cc +++ b/libcef/browser/native/menu_runner_linux.cc @@ -37,8 +37,8 @@ void CefMenuRunnerLinux::CancelContextMenu() { menu_->Cancel(); } -bool CefMenuRunnerLinux::FormatLabel(base::string16& label) { +bool CefMenuRunnerLinux::FormatLabel(std::u16string& label) { // Remove the accelerator indicator (&) from label strings. - const base::string16::value_type replace[] = {L'&', 0}; - return base::ReplaceChars(label, replace, base::string16(), &label); + const std::u16string::value_type replace[] = {u'&', 0}; + return base::ReplaceChars(label, replace, std::u16string(), &label); } diff --git a/libcef/browser/native/menu_runner_linux.h b/libcef/browser/native/menu_runner_linux.h index 7ea70aa60..503461370 100644 --- a/libcef/browser/native/menu_runner_linux.h +++ b/libcef/browser/native/menu_runner_linux.h @@ -19,7 +19,7 @@ class CefMenuRunnerLinux : public CefMenuRunner { CefMenuModelImpl* model, const content::ContextMenuParams& params) override; void CancelContextMenu() override; - bool FormatLabel(base::string16& label) override; + bool FormatLabel(std::u16string& label) override; private: std::unique_ptr menu_; diff --git a/libcef/browser/native/native_menu_win.cc b/libcef/browser/native/native_menu_win.cc index 43a23f778..27dae2da5 100644 --- a/libcef/browser/native/native_menu_win.cc +++ b/libcef/browser/native/native_menu_win.cc @@ -93,7 +93,7 @@ HFONT CreateNativeFont(const gfx::Font& font) { italic, underline, FALSE, DEFAULT_CHARSET, OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY, DEFAULT_PITCH | FF_DONTCARE, - base::UTF8ToUTF16(font.GetFontName()).c_str()); + base::UTF8ToWide(font.GetFontName()).c_str()); } } // namespace @@ -102,7 +102,7 @@ struct CefNativeMenuWin::ItemData { // The Windows API requires that whoever creates the menus must own the // strings used for labels, and keep them around for the lifetime of the // created menu. So be it. - base::string16 label; + std::wstring label; // Someone needs to own submenus, it may as well be us. std::unique_ptr submenu; @@ -204,14 +204,14 @@ class CefNativeMenuWin::MenuHostWindow { if (data) { gfx::FontList font_list; measure_item_struct->itemWidth = - gfx::GetStringWidth(data->label, font_list) + kIconWidth + - kItemLeftMargin + kItemLabelSpacing - + gfx::GetStringWidth(base::WideToUTF16(data->label), font_list) + + kIconWidth + kItemLeftMargin + kItemLabelSpacing - GetSystemMetrics(SM_CXMENUCHECK); if (data->submenu.get()) measure_item_struct->itemWidth += kArrowWidth; // If the label contains an accelerator, make room for tab. - if (data->label.find(L'\t') != base::string16::npos) - measure_item_struct->itemWidth += gfx::GetStringWidth(L" ", font_list); + if (data->label.find(L'\t') != std::wstring::npos) + measure_item_struct->itemWidth += gfx::GetStringWidth(u" ", font_list); measure_item_struct->itemHeight = font_list.GetHeight() + kItemBottomMargin + kItemTopMargin; } else { @@ -267,10 +267,10 @@ class CefNativeMenuWin::MenuHostWindow { // left and the accelerator on the right. // TODO(jungshik): This will break in RTL UI. Currently, he/ar use the // window system UI font and will not hit here. - base::string16 label = data->label; - base::string16 accel; - base::string16::size_type tab_pos = label.find(L'\t'); - if (tab_pos != base::string16::npos) { + std::wstring label = data->label; + std::wstring accel; + std::wstring::size_type tab_pos = label.find(L'\t'); + if (tab_pos != std::wstring::npos) { accel = label.substr(tab_pos); label = label.substr(0, tab_pos); } @@ -527,7 +527,7 @@ void CefNativeMenuWin::UpdateStates() { if (model_->IsItemDynamicAt(model_index)) { // TODO(atwilson): Update the icon as well (http://crbug.com/66508). SetMenuItemLabel(menu_index, model_index, - model_->GetLabelAt(model_index)); + base::UTF16ToWide(model_->GetLabelAt(model_index))); } Menu2* submenu = (*it)->submenu.get(); if (submenu) @@ -643,7 +643,7 @@ void CefNativeMenuWin::AddMenuItemAt(int menu_index, int model_index) { mii.fType = MFT_OWNERDRAW; std::unique_ptr item_data = std::make_unique(); - item_data->label = base::string16(); + item_data->label = std::wstring(); ui::MenuModel::ItemType type = model_->GetTypeAt(model_index); if (type == ui::MenuModel::TYPE_SUBMENU) { item_data->submenu.reset(new Menu2(model_->GetSubmenuModelAt(model_index))); @@ -659,8 +659,8 @@ void CefNativeMenuWin::AddMenuItemAt(int menu_index, int model_index) { item_data->model_index = model_index; mii.dwItemData = reinterpret_cast(item_data.get()); items_.insert(items_.begin() + model_index, std::move(item_data)); - UpdateMenuItemInfoForString(&mii, model_index, - model_->GetLabelAt(model_index)); + UpdateMenuItemInfoForString( + &mii, model_index, base::UTF16ToWide(model_->GetLabelAt(model_index))); InsertMenuItem(menu_, menu_index, TRUE, &mii); } @@ -697,7 +697,7 @@ void CefNativeMenuWin::SetMenuItemState(int menu_index, void CefNativeMenuWin::SetMenuItemLabel(int menu_index, int model_index, - const base::string16& label) { + const std::wstring& label) { if (IsSeparatorItemAt(menu_index)) return; @@ -707,11 +707,10 @@ void CefNativeMenuWin::SetMenuItemLabel(int menu_index, SetMenuItemInfo(menu_, menu_index, MF_BYPOSITION, &mii); } -void CefNativeMenuWin::UpdateMenuItemInfoForString( - MENUITEMINFO* mii, - int model_index, - const base::string16& label) { - base::string16 formatted = label; +void CefNativeMenuWin::UpdateMenuItemInfoForString(MENUITEMINFO* mii, + int model_index, + const std::wstring& label) { + std::wstring formatted = label; ui::MenuModel::ItemType type = model_->GetTypeAt(model_index); // Strip out any tabs, otherwise they get interpreted as accelerators and can // lead to weird behavior. @@ -721,7 +720,7 @@ void CefNativeMenuWin::UpdateMenuItemInfoForString( ui::Accelerator accelerator(ui::VKEY_UNKNOWN, ui::EF_NONE); if (model_->GetAcceleratorAt(model_index, &accelerator)) { formatted += L"\t"; - formatted += accelerator.GetShortcutText(); + formatted += base::UTF16ToWide(accelerator.GetShortcutText()); } } diff --git a/libcef/browser/native/native_menu_win.h b/libcef/browser/native/native_menu_win.h index 414722e8b..cb0467486 100644 --- a/libcef/browser/native/native_menu_win.h +++ b/libcef/browser/native/native_menu_win.h @@ -14,7 +14,6 @@ #include "base/macros.h" #include "base/memory/weak_ptr.h" #include "base/observer_list.h" -#include "base/strings/string16.h" namespace ui { class MenuModel; @@ -73,7 +72,7 @@ class CefNativeMenuWin : public MenuWrapper { // Sets the label of the item at the specified index. void SetMenuItemLabel(int menu_index, int model_index, - const base::string16& label); + const std::wstring& label); // Updates the local data structure with the correctly formatted version of // |label| at the specified model_index, and adds string data to |mii| if @@ -81,7 +80,7 @@ class CefNativeMenuWin : public MenuWrapper { // of the peculiarities of the Windows menu API. void UpdateMenuItemInfoForString(MENUITEMINFO* mii, int model_index, - const base::string16& label); + const std::wstring& label); // Returns the alignment flags to be passed to TrackPopupMenuEx, based on the // supplied alignment and the UI text direction. diff --git a/libcef/browser/net/internal_scheme_handler.cc b/libcef/browser/net/internal_scheme_handler.cc index d476d850d..0606532c6 100644 --- a/libcef/browser/net/internal_scheme_handler.cc +++ b/libcef/browser/net/internal_scheme_handler.cc @@ -23,7 +23,7 @@ namespace { base::FilePath FilePathFromASCII(const std::string& str) { #if defined(OS_WIN) - return base::FilePath(base::ASCIIToUTF16(str)); + return base::FilePath(base::ASCIIToWide(str)); #else return base::FilePath(str); #endif diff --git a/libcef/browser/net_service/browser_urlrequest_impl.cc b/libcef/browser/net_service/browser_urlrequest_impl.cc index ca69087fb..0c82fa41b 100644 --- a/libcef/browser/net_service/browser_urlrequest_impl.cc +++ b/libcef/browser/net_service/browser_urlrequest_impl.cc @@ -206,13 +206,12 @@ class CefBrowserURLRequest::Context auto browser_context = cef_browser_context->AsBrowserContext(); CHECK(browser_context); - int render_frame_id = MSG_ROUTING_NONE; scoped_refptr loader_factory_getter; // Used to route authentication and certificate callbacks through the // associated StoragePartition instance. - mojo::PendingRemote - auth_cert_observer; + mojo::PendingRemote + url_loader_network_observer; if (frame) { // The request will be associated with this frame/browser if it's valid, @@ -220,23 +219,16 @@ class CefBrowserURLRequest::Context content::RenderFrameHost* rfh = static_cast(frame.get())->GetRenderFrameHost(); if (rfh) { - // In cases where authentication is required this value will be passed - // as the |routing_id| parameter to - // NetworkServiceClient::OnAuthRequired. Despite the naming the - // GetWebContents method in network_service_client.cc expects it to be a - // FrameTreeNodeId. The |process_id| parameter will always be - // network::mojom::kBrowserProcessId (value 0) for these requests. - render_frame_id = rfh->GetFrameTreeNodeId(); - loader_factory_getter = net_service::URLLoaderFactoryGetter::Create(rfh, browser_context); - auth_cert_observer = static_cast(rfh) - ->CreateAuthAndCertObserver(); + url_loader_network_observer = + static_cast(rfh) + ->CreateURLLoaderNetworkObserver(); } } else { loader_factory_getter = net_service::URLLoaderFactoryGetter::Create(nullptr, browser_context); - auth_cert_observer = + url_loader_network_observer = static_cast( content::BrowserContext::GetDefaultStoragePartition( browser_context)) @@ -247,16 +239,15 @@ class CefBrowserURLRequest::Context FROM_HERE, base::BindOnce( &CefBrowserURLRequest::Context::ContinueOnOriginatingThread, self, - render_frame_id, MakeRequestID(), loader_factory_getter, - std::move(auth_cert_observer))); + MakeRequestID(), loader_factory_getter, + std::move(url_loader_network_observer))); } void ContinueOnOriginatingThread( - int render_frame_id, int32_t request_id, scoped_refptr loader_factory_getter, - mojo::PendingRemote - auth_cert_observer) { + mojo::PendingRemote + url_loader_network_observer) { DCHECK(CalledOnValidThread()); // The request may have been canceled. @@ -282,8 +273,6 @@ class CefBrowserURLRequest::Context static_cast(request_.get()) ->Get(resource_request.get(), false); - resource_request->render_frame_id = render_frame_id; - // Behave the same as a subresource load. resource_request->resource_type = static_cast(blink::mojom::ResourceType::kSubResource); @@ -298,11 +287,11 @@ class CefBrowserURLRequest::Context net::SiteForCookies::FromOrigin(*resource_request->request_initiator); } - if (auth_cert_observer) { + if (url_loader_network_observer) { resource_request->trusted_params = network::ResourceRequest::TrustedParams(); - resource_request->trusted_params->auth_cert_observer = - std::move(auth_cert_observer); + resource_request->trusted_params->url_loader_network_observer = + std::move(url_loader_network_observer); } // SimpleURLLoader is picky about the body contents. Try to populate them diff --git a/libcef/browser/net_service/cookie_helper.cc b/libcef/browser/net_service/cookie_helper.cc index f6ab0b8cd..6b2adf40c 100644 --- a/libcef/browser/net_service/cookie_helper.cc +++ b/libcef/browser/net_service/cookie_helper.cc @@ -46,7 +46,7 @@ net::CookieOptions GetCookieOptions(const network::ResourceRequest& request) { options.set_include_httponly(); options.set_same_site_cookie_context( net::cookie_util::ComputeSameSiteContextForRequest( - request.method, request.url, request.site_for_cookies, + request.method, {request.url}, request.site_for_cookies, request.request_initiator, is_main_frame_navigation, should_treat_as_first_party)); diff --git a/libcef/browser/net_service/proxy_url_loader_factory.cc b/libcef/browser/net_service/proxy_url_loader_factory.cc index 0475ad7de..16d762689 100644 --- a/libcef/browser/net_service/proxy_url_loader_factory.cc +++ b/libcef/browser/net_service/proxy_url_loader_factory.cc @@ -180,7 +180,7 @@ class InterceptedRequest : public network::mojom::URLLoader, public: InterceptedRequest( ProxyURLLoaderFactory* factory, - RequestId id, + int32_t id, uint32_t options, const network::ResourceRequest& request, const net::MutableNetworkTrafficAnnotationTag& traffic_annotation, @@ -207,6 +207,7 @@ class InterceptedRequest : public network::mojom::URLLoader, OnHeadersReceivedCallback callback) override; // mojom::URLLoaderClient methods: + void OnReceiveEarlyHints(network::mojom::EarlyHintsPtr early_hints) override; void OnReceiveResponse(network::mojom::URLResponseHeadPtr head) override; void OnReceiveRedirect(const net::RedirectInfo& redirect_info, network::mojom::URLResponseHeadPtr head) override; @@ -230,7 +231,7 @@ class InterceptedRequest : public network::mojom::URLLoader, void PauseReadingBodyFromNet() override; void ResumeReadingBodyFromNet() override; - const RequestId id() const { return id_; } + int32_t id() const { return id_; } private: // Helpers for determining the request handler. @@ -289,7 +290,7 @@ class InterceptedRequest : public network::mojom::URLLoader, void OnUploadProgressACK(); ProxyURLLoaderFactory* const factory_; - const RequestId id_; + const int32_t id_; const uint32_t options_; bool input_stream_previously_failed_ = false; bool request_was_redirected_ = false; @@ -346,19 +347,18 @@ class InterceptDelegate : public StreamReaderURLLoader::Delegate { base::WeakPtr request) : response_(std::move(response)), request_(request) {} - bool OpenInputStream(const RequestId& request_id, + bool OpenInputStream(int32_t request_id, const network::ResourceRequest& request, OpenCallback callback) override { return response_->OpenInputStream(request_id, request, std::move(callback)); } - void OnInputStreamOpenFailed(const RequestId& request_id, - bool* restarted) override { + void OnInputStreamOpenFailed(int32_t request_id, bool* restarted) override { request_->InputStreamFailed(false /* restart_needed */); *restarted = false; } - void GetResponseHeaders(const RequestId& request_id, + void GetResponseHeaders(int32_t request_id, int* status_code, std::string* reason_phrase, std::string* mime_type, @@ -377,7 +377,7 @@ class InterceptDelegate : public StreamReaderURLLoader::Delegate { InterceptedRequest::InterceptedRequest( ProxyURLLoaderFactory* factory, - RequestId id, + int32_t id, uint32_t options, const network::ResourceRequest& request, const net::MutableNetworkTrafficAnnotationTag& traffic_annotation, @@ -533,6 +533,11 @@ void InterceptedRequest::OnHeadersReceived( // URLLoaderClient methods. +void InterceptedRequest::OnReceiveEarlyHints( + network::mojom::EarlyHintsPtr early_hints) { + target_client_->OnReceiveEarlyHints(std::move(early_hints)); +} + void InterceptedRequest::OnReceiveResponse( network::mojom::URLResponseHeadPtr head) { current_response_ = std::move(head); @@ -776,8 +781,7 @@ void InterceptedRequest::ContinueAfterIntercept() { // might, so we need to set the option on the loader. uint32_t options = options_ | network::mojom::kURLLoadOptionUseHeaderClient; target_factory_->CreateLoaderAndStart( - target_loader_.BindNewPipeAndPassReceiver(), id_.routing_id(), - id_.request_id(), options, request_, + target_loader_.BindNewPipeAndPassReceiver(), id_, options, request_, proxied_client_receiver_.BindNewPipeAndPassRemote(), traffic_annotation_); } @@ -1141,7 +1145,7 @@ InterceptedRequestHandler::InterceptedRequestHandler() {} InterceptedRequestHandler::~InterceptedRequestHandler() {} void InterceptedRequestHandler::OnBeforeRequest( - const RequestId& id, + int32_t request_id, network::ResourceRequest* request, bool request_was_redirected, OnBeforeRequestResultCallback callback, @@ -1150,14 +1154,14 @@ void InterceptedRequestHandler::OnBeforeRequest( } void InterceptedRequestHandler::ShouldInterceptRequest( - const RequestId& id, + int32_t request_id, network::ResourceRequest* request, ShouldInterceptRequestResultCallback callback) { std::move(callback).Run(nullptr); } void InterceptedRequestHandler::OnRequestResponse( - const RequestId& id, + int32_t request_id, network::ResourceRequest* request, net::HttpResponseHeaders* headers, base::Optional redirect_info, @@ -1169,7 +1173,7 @@ void InterceptedRequestHandler::OnRequestResponse( mojo::ScopedDataPipeConsumerHandle InterceptedRequestHandler::OnFilterResponseBody( - const RequestId& id, + int32_t request_id, const network::ResourceRequest& request, mojo::ScopedDataPipeConsumerHandle body) { return body; @@ -1287,7 +1291,6 @@ void ProxyURLLoaderFactory::CreateProxy( void ProxyURLLoaderFactory::CreateLoaderAndStart( mojo::PendingReceiver receiver, - int32_t routing_id, int32_t request_id, uint32_t options, const network::ResourceRequest& request, @@ -1303,9 +1306,9 @@ void ProxyURLLoaderFactory::CreateLoaderAndStart( if (pass_through) { // This is the so-called pass-through, no-op option. if (target_factory_) { - target_factory_->CreateLoaderAndStart( - std::move(receiver), routing_id, request_id, options, request, - std::move(client), traffic_annotation); + target_factory_->CreateLoaderAndStart(std::move(receiver), request_id, + options, request, std::move(client), + traffic_annotation); } return; } @@ -1317,9 +1320,8 @@ void ProxyURLLoaderFactory::CreateLoaderAndStart( } InterceptedRequest* req = new InterceptedRequest( - this, RequestId(request_id, routing_id), options, request, - traffic_annotation, std::move(receiver), std::move(client), - std::move(target_factory_clone)); + this, request_id, options, request, traffic_annotation, + std::move(receiver), std::move(client), std::move(target_factory_clone)); requests_.insert(std::make_pair(request_id, base::WrapUnique(req))); req->Restart(); } @@ -1362,7 +1364,7 @@ void ProxyURLLoaderFactory::OnProxyBindingError() { } void ProxyURLLoaderFactory::RemoveRequest(InterceptedRequest* request) { - auto it = requests_.find(request->id().request_id()); + auto it = requests_.find(request->id()); DCHECK(it != requests_.end()); requests_.erase(it); diff --git a/libcef/browser/net_service/proxy_url_loader_factory.h b/libcef/browser/net_service/proxy_url_loader_factory.h index dc384000b..16bde5018 100644 --- a/libcef/browser/net_service/proxy_url_loader_factory.h +++ b/libcef/browser/net_service/proxy_url_loader_factory.h @@ -46,7 +46,7 @@ class InterceptedRequestHandler { base::OnceCallback; using CancelRequestCallback = base::OnceCallback; - virtual void OnBeforeRequest(const RequestId& id, + virtual void OnBeforeRequest(int32_t request_id, network::ResourceRequest* request, bool request_was_redirected, OnBeforeRequestResultCallback callback, @@ -57,7 +57,7 @@ class InterceptedRequestHandler { using ShouldInterceptRequestResultCallback = base::OnceCallback)>; virtual void ShouldInterceptRequest( - const RequestId& id, + int32_t request_id, network::ResourceRequest* request, ShouldInterceptRequestResultCallback callback); @@ -68,7 +68,7 @@ class InterceptedRequestHandler { // values will be merged first, and then any |removed_headers| values will be // removed. This comparison is case sensitive. virtual void ProcessRequestHeaders( - const RequestId& id, + int32_t request_id, const network::ResourceRequest& request, const GURL& redirect_url, net::HttpRequestHeaders* modified_headers, @@ -79,7 +79,7 @@ class InterceptedRequestHandler { // method is called in response to a redirect. Even though |head| is const the // |head.headers| value is non-const and any changes will be passed to the // client. - virtual void ProcessResponseHeaders(const RequestId& id, + virtual void ProcessResponseHeaders(int32_t request_id, const network::ResourceRequest& request, const GURL& redirect_url, net::HttpResponseHeaders* headers) {} @@ -101,7 +101,7 @@ class InterceptedRequestHandler { scoped_refptr /* override_headers */, const GURL& /* redirect_url */)>; virtual void OnRequestResponse( - const RequestId& id, + int32_t request_id, network::ResourceRequest* request, net::HttpResponseHeaders* headers, base::Optional redirect_info, @@ -109,18 +109,18 @@ class InterceptedRequestHandler { // Called to optionally filter the response body. virtual mojo::ScopedDataPipeConsumerHandle OnFilterResponseBody( - const RequestId& id, + int32_t request_id, const network::ResourceRequest& request, mojo::ScopedDataPipeConsumerHandle body); // Called on completion notification from the loader (successful or not). virtual void OnRequestComplete( - const RequestId& id, + int32_t request_id, const network::ResourceRequest& request, const network::URLLoaderCompletionStatus& status) {} // Called on error. - virtual void OnRequestError(const RequestId& id, + virtual void OnRequestError(int32_t request_id, const network::ResourceRequest& request, int error_code, bool safebrowsing_hit) {} @@ -156,7 +156,6 @@ class ProxyURLLoaderFactory // mojom::URLLoaderFactory methods: void CreateLoaderAndStart( mojo::PendingReceiver receiver, - int32_t routing_id, int32_t request_id, uint32_t options, const network::ResourceRequest& request, diff --git a/libcef/browser/net_service/resource_handler_wrapper.cc b/libcef/browser/net_service/resource_handler_wrapper.cc index 2f27bd112..44aabe5fe 100644 --- a/libcef/browser/net_service/resource_handler_wrapper.cc +++ b/libcef/browser/net_service/resource_handler_wrapper.cc @@ -372,7 +372,7 @@ void CallProcessRequestOnIOThread( class ResourceResponseWrapper : public ResourceResponse { public: - ResourceResponseWrapper(const RequestId request_id, + ResourceResponseWrapper(const int32_t request_id, CefRefPtr handler) : request_id_(request_id), handler_provider_(new HandlerProvider(handler)) {} @@ -383,7 +383,7 @@ class ResourceResponseWrapper : public ResourceResponse { } // ResourceResponse methods: - bool OpenInputStream(const RequestId& request_id, + bool OpenInputStream(int32_t request_id, const network::ResourceRequest& request, OpenCallback callback) override { DCHECK_EQ(request_id, request_id_); @@ -396,7 +396,7 @@ class ResourceResponseWrapper : public ResourceResponse { // May be recreated on redirect. request_ = new CefRequestImpl(); - request_->Set(&request, request_id.hash()); + request_->Set(&request, request_id); request_->SetReadOnly(true); CefRefPtr callbackWrapper = new OpenCallbackWrapper( @@ -426,7 +426,7 @@ class ResourceResponseWrapper : public ResourceResponse { return true; } - void GetResponseHeaders(const RequestId& request_id, + void GetResponseHeaders(int32_t request_id, int* status_code, std::string* reason_phrase, std::string* mime_type, @@ -487,7 +487,7 @@ class ResourceResponseWrapper : public ResourceResponse { } private: - const RequestId request_id_; + const int32_t request_id_; CefRefPtr request_; scoped_refptr handler_provider_; @@ -498,7 +498,7 @@ class ResourceResponseWrapper : public ResourceResponse { } // namespace std::unique_ptr CreateResourceResponse( - const RequestId& request_id, + int32_t request_id, CefRefPtr handler) { return std::make_unique(request_id, handler); } diff --git a/libcef/browser/net_service/resource_handler_wrapper.h b/libcef/browser/net_service/resource_handler_wrapper.h index ce7da9bd6..b47c95b08 100644 --- a/libcef/browser/net_service/resource_handler_wrapper.h +++ b/libcef/browser/net_service/resource_handler_wrapper.h @@ -10,14 +10,13 @@ namespace net_service { -class RequestId; class ResourceResponse; // Create a ResourceResponse that delegates to |handler|. // The resulting object should be passed to // InterceptedRequestHandler::ShouldInterceptRequestResultCallback. std::unique_ptr CreateResourceResponse( - const RequestId& request_id, + int32_t request_id, CefRefPtr handler); } // namespace net_service diff --git a/libcef/browser/net_service/resource_request_handler_wrapper.cc b/libcef/browser/net_service/resource_request_handler_wrapper.cc index 64eb4896c..c47119553 100644 --- a/libcef/browser/net_service/resource_request_handler_wrapper.cc +++ b/libcef/browser/net_service/resource_request_handler_wrapper.cc @@ -131,12 +131,12 @@ class InterceptedRequestHandlerWrapper : public InterceptedRequestHandler { }; struct PendingRequest { - PendingRequest(const RequestId& id, + PendingRequest(int32_t request_id, network::ResourceRequest* request, bool request_was_redirected, OnBeforeRequestResultCallback callback, CancelRequestCallback cancel_callback) - : id_(id), + : id_(request_id), request_(request), request_was_redirected_(request_was_redirected), callback_(std::move(callback)), @@ -153,7 +153,7 @@ class InterceptedRequestHandlerWrapper : public InterceptedRequestHandler { std::move(callback_), std::move(cancel_callback_)); } - const RequestId id_; + const int32_t id_; network::ResourceRequest* const request_; const bool request_was_redirected_; OnBeforeRequestResultCallback callback_; @@ -251,7 +251,6 @@ class InterceptedRequestHandlerWrapper : public InterceptedRequestHandler { CefRefPtr browser, CefRefPtr frame, int render_process_id, - int render_frame_id, int frame_tree_node_id, bool is_navigation, bool is_download, @@ -280,7 +279,6 @@ class InterceptedRequestHandlerWrapper : public InterceptedRequestHandler { } render_process_id_ = render_process_id; - render_frame_id_ = render_frame_id; frame_tree_node_id_ = frame_tree_node_id; is_navigation_ = is_navigation; is_download_ = is_download; @@ -317,7 +315,6 @@ class InterceptedRequestHandlerWrapper : public InterceptedRequestHandler { scoped_refptr iothread_state_; CefBrowserContext::CookieableSchemes cookieable_schemes_; int render_process_id_ = 0; - int render_frame_id_ = -1; int frame_tree_node_id_ = -1; bool is_navigation_ = true; bool is_download_ = false; @@ -413,7 +410,7 @@ class InterceptedRequestHandlerWrapper : public InterceptedRequestHandler { } // InterceptedRequestHandler methods: - void OnBeforeRequest(const RequestId& id, + void OnBeforeRequest(int32_t request_id, network::ResourceRequest* request, bool request_was_redirected, OnBeforeRequestResultCallback callback, @@ -429,13 +426,13 @@ class InterceptedRequestHandlerWrapper : public InterceptedRequestHandler { if (!init_state_) { // Queue requests until we're initialized. pending_requests_.push_back(std::make_unique( - id, request, request_was_redirected, std::move(callback), + request_id, request, request_was_redirected, std::move(callback), std::move(cancel_callback))); return; } // State may already exist for restarted requests. - RequestState* state = GetOrCreateState(id); + RequestState* state = GetOrCreateState(request_id); // Add standard headers, if currently unspecified. request->headers.SetHeaderIfMissing( @@ -451,12 +448,12 @@ class InterceptedRequestHandlerWrapper : public InterceptedRequestHandler { CefRefPtr requestPtr; CefRefPtr handler = - GetHandler(id, request, &intercept_only, requestPtr); + GetHandler(request_id, request, &intercept_only, requestPtr); CefRefPtr scheme_factory = init_state_->iothread_state_->GetSchemeHandlerFactory(request->url); if (scheme_factory && !requestPtr) { - requestPtr = MakeRequest(request, id.hash(), true); + requestPtr = MakeRequest(request, request_id, true); } // True if there's a possibility that the client might handle the request. @@ -483,10 +480,10 @@ class InterceptedRequestHandlerWrapper : public InterceptedRequestHandler { return; } - MaybeLoadCookies(id, state, request, std::move(exec_callback)); + MaybeLoadCookies(request_id, state, request, std::move(exec_callback)); } - void MaybeLoadCookies(const RequestId& id, + void MaybeLoadCookies(int32_t request_id, RequestState* state, network::ResourceRequest* request, base::OnceClosure callback) { @@ -505,12 +502,13 @@ class InterceptedRequestHandlerWrapper : public InterceptedRequestHandler { state->cookie_filter_ ? base::BindRepeating( &InterceptedRequestHandlerWrapper::AllowCookieLoad, - weak_ptr_factory_.GetWeakPtr(), id) + weak_ptr_factory_.GetWeakPtr(), request_id) : base::BindRepeating( &InterceptedRequestHandlerWrapper::AllowCookieAlways); auto done_cookie_callback = base::BindOnce( &InterceptedRequestHandlerWrapper::ContinueWithLoadedCookies, - weak_ptr_factory_.GetWeakPtr(), id, request, std::move(callback)); + weak_ptr_factory_.GetWeakPtr(), request_id, request, + std::move(callback)); cookie_helper::LoadCookies(init_state_->browser_context_, *request, allow_cookie_callback, std::move(done_cookie_callback)); @@ -521,12 +519,12 @@ class InterceptedRequestHandlerWrapper : public InterceptedRequestHandler { *allow = true; } - void AllowCookieLoad(const RequestId& id, + void AllowCookieLoad(int32_t request_id, const net::CanonicalCookie& cookie, bool* allow) { CEF_REQUIRE_IOT(); - RequestState* state = GetState(id); + RequestState* state = GetState(request_id); if (!state) { // The request may have been canceled while the async callback was // pending. @@ -543,14 +541,14 @@ class InterceptedRequestHandlerWrapper : public InterceptedRequestHandler { } } - void ContinueWithLoadedCookies(const RequestId& id, + void ContinueWithLoadedCookies(int32_t request_id, network::ResourceRequest* request, base::OnceClosure callback, int total_count, net::CookieList allowed_cookies) { CEF_REQUIRE_IOT(); - RequestState* state = GetState(id); + RequestState* state = GetState(request_id); if (!state) { // The request may have been canceled while the async callback was // pending. @@ -579,12 +577,12 @@ class InterceptedRequestHandlerWrapper : public InterceptedRequestHandler { } void ShouldInterceptRequest( - const RequestId& id, + int32_t request_id, network::ResourceRequest* request, ShouldInterceptRequestResultCallback callback) override { CEF_REQUIRE_IOT(); - RequestState* state = GetState(id); + RequestState* state = GetState(request_id); if (!state) { // The request may have been canceled during destruction. return; @@ -603,8 +601,8 @@ class InterceptedRequestHandlerWrapper : public InterceptedRequestHandler { CefRefPtr callbackPtr = new RequestCallbackWrapper(base::BindOnce( &InterceptedRequestHandlerWrapper::ContinueShouldInterceptRequest, - weak_ptr_factory_.GetWeakPtr(), id, base::Unretained(request), - std::move(callback))); + weak_ptr_factory_.GetWeakPtr(), request_id, + base::Unretained(request), std::move(callback))); cef_return_value_t retval = state->handler_->OnBeforeResourceLoad( init_state_->browser_, init_state_->frame_, @@ -615,18 +613,19 @@ class InterceptedRequestHandlerWrapper : public InterceptedRequestHandler { } } else { // The scheme factory may choose to handle it. - ContinueShouldInterceptRequest(id, request, std::move(callback), true); + ContinueShouldInterceptRequest(request_id, request, std::move(callback), + true); } } void ContinueShouldInterceptRequest( - const RequestId& id, + int32_t request_id, network::ResourceRequest* request, ShouldInterceptRequestResultCallback callback, bool allow) { CEF_REQUIRE_IOT(); - RequestState* state = GetState(id); + RequestState* state = GetState(request_id); if (!state) { // The request may have been canceled while the async callback was // pending. @@ -685,7 +684,7 @@ class InterceptedRequestHandlerWrapper : public InterceptedRequestHandler { std::unique_ptr resource_response; if (resource_handler) { - resource_response = CreateResourceResponse(id, resource_handler); + resource_response = CreateResourceResponse(request_id, resource_handler); DCHECK(resource_response); state->was_custom_handled_ = true; } else { @@ -699,13 +698,13 @@ class InterceptedRequestHandlerWrapper : public InterceptedRequestHandler { std::move(callback).Run(std::move(resource_response)); } - void ProcessResponseHeaders(const RequestId& id, + void ProcessResponseHeaders(int32_t request_id, const network::ResourceRequest& request, const GURL& redirect_url, net::HttpResponseHeaders* headers) override { CEF_REQUIRE_IOT(); - RequestState* state = GetState(id); + RequestState* state = GetState(request_id); if (!state) { // The request may have been canceled during destruction. return; @@ -725,14 +724,14 @@ class InterceptedRequestHandlerWrapper : public InterceptedRequestHandler { state->pending_response_->SetReadOnly(true); } - void OnRequestResponse(const RequestId& id, + void OnRequestResponse(int32_t request_id, network::ResourceRequest* request, net::HttpResponseHeaders* headers, base::Optional redirect_info, OnRequestResponseResultCallback callback) override { CEF_REQUIRE_IOT(); - RequestState* state = GetState(id); + RequestState* state = GetState(request_id); if (!state) { // The request may have been canceled during destruction. return; @@ -746,7 +745,7 @@ class InterceptedRequestHandlerWrapper : public InterceptedRequestHandler { if (!state->handler_) { // Cookies may come from a scheme handler. MaybeSaveCookies( - id, state, request, headers, + request_id, state, request, headers, base::BindOnce( std::move(callback), ResponseMode::CONTINUE, nullptr, redirect_info.has_value() ? redirect_info->new_url : GURL())); @@ -757,14 +756,14 @@ class InterceptedRequestHandlerWrapper : public InterceptedRequestHandler { DCHECK(state->pending_response_); if (redirect_info.has_value()) { - HandleRedirect(id, state, request, headers, *redirect_info, + HandleRedirect(request_id, state, request, headers, *redirect_info, std::move(callback)); } else { - HandleResponse(id, state, request, headers, std::move(callback)); + HandleResponse(request_id, state, request, headers, std::move(callback)); } } - void HandleRedirect(const RequestId& id, + void HandleRedirect(int32_t request_id, RequestState* state, network::ResourceRequest* request, net::HttpResponseHeaders* headers, @@ -797,10 +796,11 @@ class InterceptedRequestHandlerWrapper : public InterceptedRequestHandler { auto exec_callback = base::BindOnce( std::move(callback), ResponseMode::CONTINUE, nullptr, new_url); - MaybeSaveCookies(id, state, request, headers, std::move(exec_callback)); + MaybeSaveCookies(request_id, state, request, headers, + std::move(exec_callback)); } - void HandleResponse(const RequestId& id, + void HandleResponse(int32_t request_id, RequestState* state, network::ResourceRequest* request, net::HttpResponseHeaders* headers, @@ -846,10 +846,11 @@ class InterceptedRequestHandlerWrapper : public InterceptedRequestHandler { return; } - MaybeSaveCookies(id, state, request, headers, std::move(exec_callback)); + MaybeSaveCookies(request_id, state, request, headers, + std::move(exec_callback)); } - void MaybeSaveCookies(const RequestId& id, + void MaybeSaveCookies(int32_t request_id, RequestState* state, network::ResourceRequest* request, net::HttpResponseHeaders* headers, @@ -875,23 +876,23 @@ class InterceptedRequestHandlerWrapper : public InterceptedRequestHandler { state->cookie_filter_ ? base::BindRepeating( &InterceptedRequestHandlerWrapper::AllowCookieSave, - weak_ptr_factory_.GetWeakPtr(), id) + weak_ptr_factory_.GetWeakPtr(), request_id) : base::BindRepeating( &InterceptedRequestHandlerWrapper::AllowCookieAlways); auto done_cookie_callback = base::BindOnce( &InterceptedRequestHandlerWrapper::ContinueWithSavedCookies, - weak_ptr_factory_.GetWeakPtr(), id, std::move(callback)); + weak_ptr_factory_.GetWeakPtr(), request_id, std::move(callback)); cookie_helper::SaveCookies(init_state_->browser_context_, *request, headers, allow_cookie_callback, std::move(done_cookie_callback)); } - void AllowCookieSave(const RequestId& id, + void AllowCookieSave(int32_t request_id, const net::CanonicalCookie& cookie, bool* allow) { CEF_REQUIRE_IOT(); - RequestState* state = GetState(id); + RequestState* state = GetState(request_id); if (!state) { // The request may have been canceled while the async callback was // pending. @@ -909,7 +910,7 @@ class InterceptedRequestHandlerWrapper : public InterceptedRequestHandler { } } - void ContinueWithSavedCookies(const RequestId& id, + void ContinueWithSavedCookies(int32_t request_id, base::OnceClosure callback, int total_count, net::CookieList allowed_cookies) { @@ -918,12 +919,12 @@ class InterceptedRequestHandlerWrapper : public InterceptedRequestHandler { } mojo::ScopedDataPipeConsumerHandle OnFilterResponseBody( - const RequestId& id, + int32_t request_id, const network::ResourceRequest& request, mojo::ScopedDataPipeConsumerHandle body) override { CEF_REQUIRE_IOT(); - RequestState* state = GetState(id); + RequestState* state = GetState(request_id); if (!state) { // The request may have been canceled during destruction. return body; @@ -937,17 +938,17 @@ class InterceptedRequestHandlerWrapper : public InterceptedRequestHandler { return CreateResponseFilterHandler( filter, std::move(body), base::BindOnce(&InterceptedRequestHandlerWrapper::OnFilterError, - weak_ptr_factory_.GetWeakPtr(), id)); + weak_ptr_factory_.GetWeakPtr(), request_id)); } } return body; } - void OnFilterError(const RequestId& id) { + void OnFilterError(int32_t request_id) { CEF_REQUIRE_IOT(); - RequestState* state = GetState(id); + RequestState* state = GetState(request_id); if (!state) { // The request may have been canceled while the async callback was // pending. @@ -960,12 +961,12 @@ class InterceptedRequestHandlerWrapper : public InterceptedRequestHandler { } void OnRequestComplete( - const RequestId& id, + int32_t request_id, const network::ResourceRequest& request, const network::URLLoaderCompletionStatus& status) override { CEF_REQUIRE_IOT(); - RequestState* state = GetState(id); + RequestState* state = GetState(request_id); if (!state) { // The request may have been aborted during initialization or canceled // during destruction. This method will always be called before a request @@ -974,7 +975,7 @@ class InterceptedRequestHandlerWrapper : public InterceptedRequestHandler { if (!pending_requests_.empty()) { PendingRequests::iterator it = pending_requests_.begin(); for (; it != pending_requests_.end(); ++it) { - if ((*it)->id_ == id) { + if ((*it)->id_ == request_id) { pending_requests_.erase(it); break; } @@ -1011,7 +1012,7 @@ class InterceptedRequestHandlerWrapper : public InterceptedRequestHandler { } } - RemoveState(id); + RemoveState(request_id); } private: @@ -1045,14 +1046,12 @@ class InterceptedRequestHandlerWrapper : public InterceptedRequestHandler { // Returns the handler, if any, that should be used for this request. CefRefPtr GetHandler( - const RequestId& id, + int32_t request_id, network::ResourceRequest* request, bool* intercept_only, CefRefPtr& requestPtr) const { CefRefPtr handler; - const int64 request_id = id.hash(); - if (init_state_->browser_) { // Maybe the browser's client wants to handle it? CefRefPtr client = @@ -1075,8 +1074,8 @@ class InterceptedRequestHandlerWrapper : public InterceptedRequestHandler { // Maybe the request context wants to handle it? CefRefPtr context_handler = init_state_->iothread_state_->GetHandler( - init_state_->render_process_id_, request->render_frame_id, - init_state_->frame_tree_node_id_, false); + init_state_->render_process_id_, MSG_ROUTING_NONE, + init_state_->frame_tree_node_id_, /*require_frame_match=*/false); if (context_handler) { if (!requestPtr) requestPtr = MakeRequest(request, request_id, true); @@ -1091,24 +1090,24 @@ class InterceptedRequestHandlerWrapper : public InterceptedRequestHandler { return handler; } - RequestState* GetOrCreateState(const RequestId& id) { - RequestState* state = GetState(id); + RequestState* GetOrCreateState(int32_t request_id) { + RequestState* state = GetState(request_id); if (!state) { state = new RequestState(); - request_map_.insert(std::make_pair(id, base::WrapUnique(state))); + request_map_.insert(std::make_pair(request_id, base::WrapUnique(state))); } return state; } - RequestState* GetState(const RequestId& id) const { - RequestMap::const_iterator it = request_map_.find(id); + RequestState* GetState(int32_t request_id) const { + RequestMap::const_iterator it = request_map_.find(request_id); if (it != request_map_.end()) return it->second.get(); return nullptr; } - void RemoveState(const RequestId& id) { - RequestMap::iterator it = request_map_.find(id); + void RemoveState(int32_t request_id) { + RequestMap::iterator it = request_map_.find(request_id); DCHECK(it != request_map_.end()); if (it != request_map_.end()) request_map_.erase(it); @@ -1186,7 +1185,7 @@ class InterceptedRequestHandlerWrapper : public InterceptedRequestHandler { bool shutting_down_ = false; - using RequestMap = std::map>; + using RequestMap = std::map>; RequestMap request_map_; using PendingRequests = std::vector>; @@ -1220,27 +1219,21 @@ void InitOnUIThread( content::RenderFrameHost* frame = nullptr; - if (request.render_frame_id >= 0) { - // TODO(network): Are these main frame checks equivalent? - if (request.is_main_frame || - static_cast(request.resource_type) == - blink::mojom::ResourceType::kMainFrame) { + if (request.is_main_frame || + static_cast(request.resource_type) == + blink::mojom::ResourceType::kMainFrame) { + frame = web_contents->GetMainFrame(); + DCHECK(frame); + } else { + if (frame_tree_node_id >= 0) { + // May return null for frames in inner WebContents. + frame = web_contents->FindFrameByFrameTreeNodeId(frame_tree_node_id, + render_process_id); + } + if (!frame) { + // Use the main frame for the CefBrowserHost. frame = web_contents->GetMainFrame(); DCHECK(frame); - } else { - // May return null for newly created iframes. - frame = content::RenderFrameHost::FromID(render_process_id, - request.render_frame_id); - if (!frame && frame_tree_node_id >= 0) { - // May return null for frames in inner WebContents. - frame = web_contents->FindFrameByFrameTreeNodeId(frame_tree_node_id, - render_process_id); - } - if (!frame) { - // Use the main frame for the CefBrowserHost. - frame = web_contents->GetMainFrame(); - DCHECK(frame); - } } } @@ -1270,9 +1263,9 @@ void InitOnUIThread( auto init_state = std::make_unique(); init_state->Initialize(browser_context, browserPtr, framePtr, - render_process_id, request.render_frame_id, - frame_tree_node_id, is_navigation, is_download, - request_initiator, unhandled_request_callback); + render_process_id, frame_tree_node_id, is_navigation, + is_download, request_initiator, + unhandled_request_callback); init_helper->MaybeSetInitialized(std::move(init_state)); } @@ -1289,12 +1282,10 @@ std::unique_ptr CreateInterceptedRequestHandler( CEF_REQUIRE_UIT(); CefRefPtr browserPtr; CefRefPtr framePtr; - int render_frame_id = -1; int frame_tree_node_id = -1; // |frame| may be null for service worker requests. if (frame) { - render_frame_id = frame->GetRoutingID(); frame_tree_node_id = frame->GetFrameTreeNodeId(); // May return nullptr for requests originating from guest views. @@ -1308,9 +1299,8 @@ std::unique_ptr CreateInterceptedRequestHandler( auto init_state = std::make_unique(); init_state->Initialize(browser_context, browserPtr, framePtr, - render_process_id, render_frame_id, frame_tree_node_id, - is_navigation, is_download, request_initiator, - base::Closure()); + render_process_id, frame_tree_node_id, is_navigation, + is_download, request_initiator, base::Closure()); auto wrapper = std::make_unique(); wrapper->init_helper()->MaybeSetInitialized(std::move(init_state)); diff --git a/libcef/browser/net_service/stream_reader_url_loader.cc b/libcef/browser/net_service/stream_reader_url_loader.cc index 56de5ec99..d7690baed 100644 --- a/libcef/browser/net_service/stream_reader_url_loader.cc +++ b/libcef/browser/net_service/stream_reader_url_loader.cc @@ -14,6 +14,7 @@ #include "base/strings/string_util.h" #include "base/strings/stringprintf.h" #include "base/task/post_task.h" +#include "base/task/thread_pool.h" #include "base/threading/thread.h" #include "base/threading/thread_task_runner_handle.h" #include "content/public/browser/browser_thread.h" @@ -37,7 +38,7 @@ class OpenInputStreamWrapper static base::OnceClosure Open( std::unique_ptr delegate, scoped_refptr work_thread_task_runner, - const RequestId& request_id, + int32_t request_id, const network::ResourceRequest& request, OnInputStreamOpenedCallback callback) WARN_UNUSED_RESULT { scoped_refptr wrapper = new OpenInputStreamWrapper( @@ -62,8 +63,7 @@ class OpenInputStreamWrapper callback_(std::move(callback)) {} virtual ~OpenInputStreamWrapper() {} - void Start(const RequestId& request_id, - const network::ResourceRequest& request) { + void Start(int32_t request_id, const network::ResourceRequest& request) { work_thread_task_runner_->PostTask( FROM_HERE, base::BindOnce(&OpenInputStreamWrapper::OpenOnWorkThread, @@ -95,7 +95,7 @@ class OpenInputStreamWrapper OnCallback(nullptr); } - void OpenOnWorkThread(const RequestId& request_id, + void OpenOnWorkThread(int32_t request_id, const network::ResourceRequest& request) { DCHECK(work_thread_task_runner_->RunsTasksInCurrentSequence()); if (is_canceled_) @@ -455,30 +455,12 @@ void InputStreamReader::RunReadCallbackOnJobThread( std::move(read_callback).Run(bytes_read); } -//============================== -// RequestId -//============================== - -std::string RequestId::ToString() const { - return base::StringPrintf("RequestId(%u, %u)", request_id_, routing_id_); -} - -std::string RequestId::ToString(base::StringPiece debug_label) const { - return base::StringPrintf("RequestId[%s](%u, %u)", - debug_label.as_string().c_str(), request_id_, - routing_id_); -} - -std::ostream& operator<<(std::ostream& out, const RequestId& request_id) { - return out << request_id.ToString(); -} - //============================== // StreamReaderURLLoader //============================= StreamReaderURLLoader::StreamReaderURLLoader( - const RequestId& request_id, + int32_t request_id, const network::ResourceRequest& request, mojo::PendingRemote client, mojo::PendingRemote header_client, @@ -502,7 +484,7 @@ StreamReaderURLLoader::StreamReaderURLLoader( // All InputStream work will be performed on this task runner. stream_work_task_runner_ = - base::CreateSequencedTaskRunner({base::ThreadPool(), base::MayBlock()}); + base::ThreadPool::CreateSequencedTaskRunner({base::MayBlock()}); } StreamReaderURLLoader::~StreamReaderURLLoader() { diff --git a/libcef/browser/net_service/stream_reader_url_loader.h b/libcef/browser/net_service/stream_reader_url_loader.h index b54893fbd..55c0a4166 100644 --- a/libcef/browser/net_service/stream_reader_url_loader.h +++ b/libcef/browser/net_service/stream_reader_url_loader.h @@ -63,54 +63,6 @@ class InputStream { ReadCallback callback) = 0; }; -// Unique identifier for RequestHandler callbacks. -// Based on components/viz/common/surfaces/frame_sink_id.h -class RequestId { - public: - constexpr RequestId() : request_id_(0), routing_id_(0) {} - - constexpr RequestId(const RequestId& other) - : request_id_(other.request_id_), routing_id_(other.routing_id_) {} - - constexpr RequestId(uint32_t request_id, uint32_t routing_id) - : request_id_(request_id), routing_id_(routing_id) {} - - constexpr bool is_valid() const { - return request_id_ != 0 || routing_id_ != 0; - } - - constexpr uint32_t request_id() const { return request_id_; } - - constexpr uint32_t routing_id() const { return routing_id_; } - - bool operator==(const RequestId& other) const { - return request_id_ == other.request_id_ && routing_id_ == other.routing_id_; - } - - bool operator!=(const RequestId& other) const { return !(*this == other); } - - bool operator<(const RequestId& other) const { - return std::tie(request_id_, routing_id_) < - std::tie(other.request_id_, other.routing_id_); - } - - size_t hash() const { return base::HashInts(request_id_, routing_id_); } - - std::string ToString() const; - - std::string ToString(base::StringPiece debug_label) const; - - private: - uint32_t request_id_; - uint32_t routing_id_; -}; - -std::ostream& operator<<(std::ostream& out, const RequestId& request_id); - -struct RequestIdHash { - size_t operator()(const RequestId& key) const { return key.hash(); } -}; - // Abstract class for handling intercepted resource responses. All methods are // called on the IO thread unless otherwise indicated. class ResourceResponse { @@ -125,13 +77,13 @@ class ResourceResponse { // |callback| to continue the request. Return false to cancel the request. // |request| may be different from the request used to create the // StreamReaderURLLoader if a redirect was followed. - virtual bool OpenInputStream(const RequestId& id, + virtual bool OpenInputStream(int32_t request_id, const network::ResourceRequest& request, OpenCallback callback) = 0; // This method is called to populate the response headers. using HeaderMap = std::multimap; - virtual void GetResponseHeaders(const RequestId& id, + virtual void GetResponseHeaders(int32_t request_id, int* status_code, std::string* reason_phrase, std::string* mime_type, @@ -153,12 +105,12 @@ class StreamReaderURLLoader : public network::mojom::URLLoader { // This method is called if the result of calling OpenInputStream was null. // The |restarted| parameter is set to true if the request was restarted // with a new loader. - virtual void OnInputStreamOpenFailed(const RequestId& id, + virtual void OnInputStreamOpenFailed(int32_t request_id, bool* restarted) = 0; }; StreamReaderURLLoader( - const RequestId& request_id, + int32_t request_id, const network::ResourceRequest& request, mojo::PendingRemote client, mojo::PendingRemote header_client, @@ -207,7 +159,7 @@ class StreamReaderURLLoader : public network::mojom::URLLoader { bool ParseRange(const net::HttpRequestHeaders& headers); bool byte_range_valid() const; - const RequestId request_id_; + const int32_t request_id_; size_t header_length_ = 0; int64_t total_bytes_read_ = 0; diff --git a/libcef/browser/osr/browser_platform_delegate_osr.cc b/libcef/browser/osr/browser_platform_delegate_osr.cc index 9baee1e25..fe23f4145 100644 --- a/libcef/browser/osr/browser_platform_delegate_osr.cc +++ b/libcef/browser/osr/browser_platform_delegate_osr.cc @@ -325,8 +325,9 @@ void CefBrowserPlatformDelegateOsr::DragTargetDragEnter( return; } - current_rwh_for_drag_->DragTargetDragEnter( - *drop_data, transformed_pt, gfx::PointF(screen_pt), ops, modifiers); + current_rwh_for_drag_->DragTargetDragEnter(*drop_data, transformed_pt, + gfx::PointF(screen_pt), ops, + modifiers, base::DoNothing()); } void CefBrowserPlatformDelegateOsr::DragTargetDragOver( @@ -381,7 +382,7 @@ void CefBrowserPlatformDelegateOsr::DragTargetDragOver( int modifiers = TranslateWebEventModifiers(event.modifiers); target_rwh->DragTargetDragOver(transformed_pt, gfx::PointF(screen_pt), ops, - modifiers); + modifiers, base::DoNothing()); } void CefBrowserPlatformDelegateOsr::DragTargetDragLeave() { @@ -451,7 +452,8 @@ void CefBrowserPlatformDelegateOsr::DragTargetDrop(const CefMouseEvent& event) { int modifiers = TranslateWebEventModifiers(event.modifiers); target_rwh->DragTargetDrop(*drop_data, transformed_pt, - gfx::PointF(screen_pt), modifiers); + gfx::PointF(screen_pt), modifiers, + base::DoNothing()); } drag_data_ = nullptr; diff --git a/libcef/browser/osr/render_widget_host_view_osr.cc b/libcef/browser/osr/render_widget_host_view_osr.cc index f8497b339..49c156828 100644 --- a/libcef/browser/osr/render_widget_host_view_osr.cc +++ b/libcef/browser/osr/render_widget_host_view_osr.cc @@ -653,7 +653,7 @@ void CefRenderWidgetHostViewOSR::Destroy() { } void CefRenderWidgetHostViewOSR::SetTooltipText( - const base::string16& tooltip_text) { + const std::u16string& tooltip_text) { if (!browser_impl_.get()) return; @@ -817,7 +817,7 @@ void CefRenderWidgetHostViewOSR::ImeCancelComposition() { RequestImeCompositionUpdate(false); } -void CefRenderWidgetHostViewOSR::SelectionChanged(const base::string16& text, +void CefRenderWidgetHostViewOSR::SelectionChanged(const std::u16string& text, size_t offset, const gfx::Range& range) { RenderWidgetHostViewBase::SelectionChanged(text, offset, range); @@ -1406,6 +1406,15 @@ void CefRenderWidgetHostViewOSR::SpeakSelection() {} void CefRenderWidgetHostViewOSR::SetWindowFrameInScreen(const gfx::Rect& rect) { } + +void CefRenderWidgetHostViewOSR::ShowSharePicker( + const std::string& title, + const std::string& text, + const std::string& url, + const std::vector& file_paths, + blink::mojom::ShareService::ShareCallback callback) { + std::move(callback).Run(blink::mojom::ShareError::INTERNAL_ERROR); +} #endif // defined(OS_MAC) void CefRenderWidgetHostViewOSR::OnPaint(const gfx::Rect& damage_rect, diff --git a/libcef/browser/osr/render_widget_host_view_osr.h b/libcef/browser/osr/render_widget_host_view_osr.h index ff0af0ef7..2f63d0d7d 100644 --- a/libcef/browser/osr/render_widget_host_view_osr.h +++ b/libcef/browser/osr/render_widget_host_view_osr.h @@ -134,6 +134,12 @@ class CefRenderWidgetHostViewOSR void ShowDefinitionForSelection() override; void SpeakSelection() override; void SetWindowFrameInScreen(const gfx::Rect& rect) override; + void ShowSharePicker( + const std::string& title, + const std::string& text, + const std::string& url, + const std::vector& file_paths, + blink::mojom::ShareService::ShareCallback callback) override; #endif // defined(OS_MAC) // RenderWidgetHostViewBase implementation. @@ -144,7 +150,7 @@ class CefRenderWidgetHostViewOSR void SetIsLoading(bool is_loading) override; void RenderProcessGone() override; void Destroy() override; - void SetTooltipText(const base::string16& tooltip_text) override; + void SetTooltipText(const std::u16string& tooltip_text) override; content::CursorManager* GetCursorManager() override; gfx::Size GetCompositorViewportPixelSize() override; void CopyFromSurface( @@ -171,7 +177,7 @@ class CefRenderWidgetHostViewOSR RenderWidgetHostViewBase* target_view, gfx::PointF* transformed_point) override; void DidNavigate() override; - void SelectionChanged(const base::string16& text, + void SelectionChanged(const std::u16string& text, size_t offset, const gfx::Range& range) override; const viz::LocalSurfaceId& GetLocalSurfaceId() const override; diff --git a/libcef/browser/osr/web_contents_view_osr.cc b/libcef/browser/osr/web_contents_view_osr.cc index d8f315d7c..2e29a5d9a 100644 --- a/libcef/browser/osr/web_contents_view_osr.cc +++ b/libcef/browser/osr/web_contents_view_osr.cc @@ -128,7 +128,7 @@ CefWebContentsViewOSR::CreateViewForChildWidget( render_widget_host, view); } -void CefWebContentsViewOSR::SetPageTitle(const base::string16& title) {} +void CefWebContentsViewOSR::SetPageTitle(const std::u16string& title) {} void CefWebContentsViewOSR::RenderViewReady() { RenderViewCreated(); diff --git a/libcef/browser/osr/web_contents_view_osr.h b/libcef/browser/osr/web_contents_view_osr.h index 39abba007..5d5e6fc80 100644 --- a/libcef/browser/osr/web_contents_view_osr.h +++ b/libcef/browser/osr/web_contents_view_osr.h @@ -50,7 +50,7 @@ class CefWebContentsViewOSR : public content::WebContentsView, content::RenderWidgetHost* render_widget_host) override; content::RenderWidgetHostViewBase* CreateViewForChildWidget( content::RenderWidgetHost* render_widget_host) override; - void SetPageTitle(const base::string16& title) override; + void SetPageTitle(const std::u16string& title) override; void RenderViewReady() override; void RenderViewHostChanged(content::RenderViewHost* old_host, content::RenderViewHost* new_host) override; diff --git a/libcef/browser/prefs/browser_prefs.cc b/libcef/browser/prefs/browser_prefs.cc index b261a3b91..cd57a925c 100644 --- a/libcef/browser/prefs/browser_prefs.cc +++ b/libcef/browser/prefs/browser_prefs.cc @@ -15,6 +15,7 @@ #include "base/files/file_path.h" #include "base/strings/string_number_conversions.h" #include "base/task/post_task.h" +#include "base/task/thread_pool.h" #include "base/values.h" #include "chrome/browser/accessibility/accessibility_ui.h" #include "chrome/browser/download/download_prefs.h" @@ -128,9 +129,8 @@ std::unique_ptr CreatePrefService(Profile* profile, // Get sequenced task runner for making sure that file operations are // executed in expected order (what was previously assured by the FILE // thread). - sequenced_task_runner = base::CreateSequencedTaskRunner( - {base::ThreadPool(), base::MayBlock(), - base::TaskShutdownBehavior::BLOCK_SHUTDOWN}); + sequenced_task_runner = base::ThreadPool::CreateSequencedTaskRunner( + {base::MayBlock(), base::TaskShutdownBehavior::BLOCK_SHUTDOWN}); } // Used to store user preferences. diff --git a/libcef/browser/prefs/pref_store.cc b/libcef/browser/prefs/pref_store.cc index fedd0603e..451e34c7c 100644 --- a/libcef/browser/prefs/pref_store.cc +++ b/libcef/browser/prefs/pref_store.cc @@ -42,7 +42,7 @@ void CefPrefStore::RemoveObserver(PrefStore::Observer* observer) { } bool CefPrefStore::HasObservers() const { - return observers_.might_have_observers(); + return !observers_.empty(); } bool CefPrefStore::IsInitializationComplete() const { diff --git a/libcef/browser/prefs/renderer_prefs.cc b/libcef/browser/prefs/renderer_prefs.cc index 5bba21fb1..d6521e2c1 100644 --- a/libcef/browser/prefs/renderer_prefs.cc +++ b/libcef/browser/prefs/renderer_prefs.cc @@ -165,12 +165,9 @@ void SetExtensionPrefs(content::RenderViewHost* rvh, if (!site_url.SchemeIs(extensions::kExtensionScheme)) return; - content::WebContents* web_contents = - content::WebContents::FromRenderViewHost(rvh); - extensions::ViewType view_type = extensions::GetViewType(web_contents); const extensions::Extension* extension = registry->enabled_extensions().GetByID(site_url.host()); - extension_webkit_preferences::SetPreferences(extension, view_type, &web); + extension_webkit_preferences::SetPreferences(extension, &web); } void SetString(CommandLinePrefStore* prefs, diff --git a/libcef/browser/printing/print_dialog_linux.cc b/libcef/browser/printing/print_dialog_linux.cc index 4e3395285..254289d10 100644 --- a/libcef/browser/printing/print_dialog_linux.cc +++ b/libcef/browser/printing/print_dialog_linux.cc @@ -186,7 +186,7 @@ void CefPrintDialogLinux::ShowDialog( void CefPrintDialogLinux::PrintDocument( const printing::MetafilePlayer& metafile, - const base::string16& document_name) { + const std::u16string& document_name) { // This runs on the print worker thread, does not block the UI thread. DCHECK(!CEF_CURRENTLY_ON_UIT()); @@ -260,7 +260,7 @@ bool CefPrintDialogLinux::UpdateSettings( } void CefPrintDialogLinux::SendDocumentToPrinter( - const base::string16& document_name) { + const std::u16string& document_name) { CEF_REQUIRE_UIT(); if (!handler_.get()) { diff --git a/libcef/browser/printing/print_dialog_linux.h b/libcef/browser/printing/print_dialog_linux.h index 64aa5d398..b205bdfaa 100644 --- a/libcef/browser/printing/print_dialog_linux.h +++ b/libcef/browser/printing/print_dialog_linux.h @@ -49,7 +49,7 @@ class CefPrintDialogLinux : public printing::PrintDialogGtkInterface, bool has_selection, PrintingContextLinux::PrintSettingsCallback callback) override; void PrintDocument(const printing::MetafilePlayer& metafile, - const base::string16& document_name) override; + const std::u16string& document_name) override; void AddRefToDialog() override; void ReleaseDialog() override; @@ -73,7 +73,7 @@ class CefPrintDialogLinux : public printing::PrintDialogGtkInterface, bool get_defaults); // Prints document named |document_name|. - void SendDocumentToPrinter(const base::string16& document_name); + void SendDocumentToPrinter(const std::u16string& document_name); // Handles print dialog response. void OnPrintContinue(CefRefPtr settings); diff --git a/libcef/browser/server_impl.cc b/libcef/browser/server_impl.cc index 8e36585ab..486020506 100644 --- a/libcef/browser/server_impl.cc +++ b/libcef/browser/server_impl.cc @@ -12,6 +12,7 @@ #include "base/format_macros.h" #include "base/memory/ptr_util.h" #include "base/strings/stringprintf.h" +#include "base/task/thread_pool.h" #include "base/threading/thread.h" #include "net/base/net_errors.h" #include "net/http/http_request_headers.h" @@ -607,9 +608,9 @@ void CefServerImpl::ShutdownOnUIThread() { // Make sure the task is executed on shutdown. Otherwise, |thread| might // be released outside of the correct scope. - base::PostTask( + base::ThreadPool::PostTask( FROM_HERE, - {base::ThreadPool(), base::TaskPriority::BEST_EFFORT, + {base::TaskPriority::BEST_EFFORT, base::TaskShutdownBehavior::BLOCK_SHUTDOWN, base::MayBlock()}, std::move(task)); diff --git a/libcef/browser/thread_util.h b/libcef/browser/thread_util.h index b5e7aab83..46572f737 100644 --- a/libcef/browser/thread_util.h +++ b/libcef/browser/thread_util.h @@ -9,6 +9,7 @@ #include "base/location.h" #include "base/logging.h" #include "base/task/post_task.h" +#include "base/task/thread_pool.h" #include "base/threading/scoped_blocking_call.h" #include "base/threading/thread_restrictions.h" #include "content/public/browser/browser_task_traits.h" @@ -55,11 +56,11 @@ // Sequenced runners at various priorities that always execute all pending tasks // before shutdown are available via CefTaskRunnerManager and exposed by the CEF // API. -#define CEF_POST_BLOCKING_TASK(priority, task) \ - base::PostTask( \ - FROM_HERE, \ - {base::ThreadPool(), priority, \ - base::TaskShutdownBehavior::SKIP_ON_SHUTDOWN, base::MayBlock()}, \ +#define CEF_POST_BLOCKING_TASK(priority, task) \ + base::ThreadPool::PostTask( \ + FROM_HERE, \ + {priority, base::TaskShutdownBehavior::SKIP_ON_SHUTDOWN, \ + base::MayBlock()}, \ task) // Post a blocking task that affects UI or responsiveness of future user diff --git a/libcef/browser/views/basic_label_button_view.h b/libcef/browser/views/basic_label_button_view.h index 9f615b290..2fa3d3d3b 100644 --- a/libcef/browser/views/basic_label_button_view.h +++ b/libcef/browser/views/basic_label_button_view.h @@ -23,7 +23,7 @@ class LabelButtonEx : public views::LabelButton { self->ButtonPressed(event); }, base::Unretained(this)), - base::string16()) {} + std::u16string()) {} virtual void ButtonPressed(const ui::Event& event) = 0; }; diff --git a/libcef/browser/views/menu_runner_views.cc b/libcef/browser/views/menu_runner_views.cc index 0454ea0c5..630dabe75 100644 --- a/libcef/browser/views/menu_runner_views.cc +++ b/libcef/browser/views/menu_runner_views.cc @@ -31,8 +31,8 @@ void CefMenuRunnerViews::CancelContextMenu() { window->CancelMenu(); } -bool CefMenuRunnerViews::FormatLabel(base::string16& label) { +bool CefMenuRunnerViews::FormatLabel(std::u16string& label) { // Remove the accelerator indicator (&) from label strings. - const base::string16::value_type replace[] = {L'&', 0}; - return base::ReplaceChars(label, replace, base::string16(), &label); + const std::u16string::value_type replace[] = {L'&', 0}; + return base::ReplaceChars(label, replace, std::u16string(), &label); } diff --git a/libcef/browser/views/menu_runner_views.h b/libcef/browser/views/menu_runner_views.h index 39d7b1859..d77ce82c9 100644 --- a/libcef/browser/views/menu_runner_views.h +++ b/libcef/browser/views/menu_runner_views.h @@ -20,7 +20,7 @@ class CefMenuRunnerViews : public CefMenuRunner { CefMenuModelImpl* model, const content::ContextMenuParams& params) override; void CancelContextMenu() override; - bool FormatLabel(base::string16& label) override; + bool FormatLabel(std::u16string& label) override; private: CefBrowserViewImpl* browser_view_; diff --git a/libcef/browser/views/window_view.cc b/libcef/browser/views/window_view.cc index 16333f8f1..9d811e030 100644 --- a/libcef/browser/views/window_view.cc +++ b/libcef/browser/views/window_view.cc @@ -359,7 +359,7 @@ bool CefWindowView::CanMaximize() const { return cef_delegate()->CanMaximize(GetCefWindow()); } -base::string16 CefWindowView::GetWindowTitle() const { +std::u16string CefWindowView::GetWindowTitle() const { return title_; } @@ -471,7 +471,7 @@ display::Display CefWindowView::GetDisplay() const { return display::Display(); } -void CefWindowView::SetTitle(const base::string16& title) { +void CefWindowView::SetTitle(const std::u16string& title) { title_ = title; views::Widget* widget = GetWidget(); if (widget) diff --git a/libcef/browser/views/window_view.h b/libcef/browser/views/window_view.h index c95f3ec82..188a5ae30 100644 --- a/libcef/browser/views/window_view.h +++ b/libcef/browser/views/window_view.h @@ -57,7 +57,7 @@ class CefWindowView bool CanResize() const override; bool CanMinimize() const override; bool CanMaximize() const override; - base::string16 GetWindowTitle() const override; + std::u16string GetWindowTitle() const override; gfx::ImageSkia GetWindowIcon() override; gfx::ImageSkia GetWindowAppIcon() override; void WindowClosing() override; @@ -79,8 +79,8 @@ class CefWindowView display::Display GetDisplay() const; // Set/get the window title. - void SetTitle(const base::string16& title); - base::string16 title() const { return title_; } + void SetTitle(const std::u16string& title); + std::u16string title() const { return title_; } // Set/get the window icon. This should be a 16x16 icon suitable for use in // the Windows's title bar. @@ -108,7 +108,7 @@ class CefWindowView // True if the window is frameless. It might still be resizable and draggable. bool is_frameless_; - base::string16 title_; + std::u16string title_; CefRefPtr window_icon_; CefRefPtr window_app_icon_; diff --git a/libcef/common/alloy/alloy_content_client.cc b/libcef/common/alloy/alloy_content_client.cc index 095b1040b..e8b1f7ac7 100644 --- a/libcef/common/alloy/alloy_content_client.cc +++ b/libcef/common/alloy/alloy_content_client.cc @@ -106,8 +106,8 @@ void AlloyContentClient::AddAdditionalSchemes(Schemes* schemes) { CefAppManager::Get()->AddAdditionalSchemes(schemes); } -base::string16 AlloyContentClient::GetLocalizedString(int message_id) { - base::string16 value = +std::u16string AlloyContentClient::GetLocalizedString(int message_id) { + std::u16string value = ui::ResourceBundle::GetSharedInstance().GetLocalizedString(message_id); if (value.empty()) LOG(ERROR) << "No localized string available for id " << message_id; @@ -115,10 +115,10 @@ base::string16 AlloyContentClient::GetLocalizedString(int message_id) { return value; } -base::string16 AlloyContentClient::GetLocalizedString( +std::u16string AlloyContentClient::GetLocalizedString( int message_id, - const base::string16& replacement) { - base::string16 value = l10n_util::GetStringFUTF16(message_id, replacement); + const std::u16string& replacement) { + std::u16string value = l10n_util::GetStringFUTF16(message_id, replacement); if (value.empty()) LOG(ERROR) << "No localized string available for id " << message_id; diff --git a/libcef/common/alloy/alloy_content_client.h b/libcef/common/alloy/alloy_content_client.h index 5c0d5d4e9..ca8910d14 100644 --- a/libcef/common/alloy/alloy_content_client.h +++ b/libcef/common/alloy/alloy_content_client.h @@ -25,9 +25,9 @@ class AlloyContentClient : public content::ContentClient { std::vector* cdms, std::vector* cdm_host_file_paths) override; void AddAdditionalSchemes(Schemes* schemes) override; - base::string16 GetLocalizedString(int message_id) override; - base::string16 GetLocalizedString(int message_id, - const base::string16& replacement) override; + std::u16string GetLocalizedString(int message_id) override; + std::u16string GetLocalizedString(int message_id, + const std::u16string& replacement) override; base::StringPiece GetDataResource(int resource_id, ui::ScaleFactor scale_factor) override; base::RefCountedMemory* GetDataResourceBytes(int resource_id) override; diff --git a/libcef/common/command_line_impl.cc b/libcef/common/command_line_impl.cc index 0b5cc48b2..78a3baf5e 100644 --- a/libcef/common/command_line_impl.cc +++ b/libcef/common/command_line_impl.cc @@ -43,7 +43,7 @@ void CefCommandLineImpl::InitFromArgv(int argc, const char* const* argv) { void CefCommandLineImpl::InitFromString(const CefString& command_line) { #if defined(OS_WIN) CEF_VALUE_VERIFY_RETURN_VOID(true); - const base::string16& str16 = command_line; + const std::wstring& str16 = command_line; mutable_value()->ParseFromString(str16); #else NOTREACHED() << "method not supported on this platform"; diff --git a/libcef/common/crash_reporter_client.cc b/libcef/common/crash_reporter_client.cc index 23ff7c3cf..b3088b4d7 100644 --- a/libcef/common/crash_reporter_client.cc +++ b/libcef/common/crash_reporter_client.cc @@ -13,7 +13,6 @@ #include "base/environment.h" #include "base/logging.h" #include "base/stl_util.h" -#include "base/strings/string16.h" #include "base/strings/string_number_conversions.h" #include "base/strings/string_piece.h" #include "base/strings/string_split.h" @@ -53,7 +52,7 @@ namespace { #if defined(OS_WIN) -typedef base::string16 PathString; +typedef std::wstring PathString; const char kPathSep = '\\'; #else typedef std::string PathString; @@ -568,7 +567,7 @@ void CefCrashReporterClient::InitializeCrashReportingForProcess() { } bool CefCrashReporterClient::GetAlternativeCrashDumpLocation( - base::string16* crash_dir) { + std::wstring* crash_dir) { // By setting the BREAKPAD_DUMP_LOCATION environment variable, an alternate // location to write breakpad crash dumps can be set. *crash_dir = install_static::GetEnvironmentString(L"BREAKPAD_DUMP_LOCATION"); @@ -576,29 +575,29 @@ bool CefCrashReporterClient::GetAlternativeCrashDumpLocation( } void CefCrashReporterClient::GetProductNameAndVersion( - const base::string16& exe_path, - base::string16* product_name, - base::string16* version, - base::string16* special_build, - base::string16* channel_name) { - *product_name = base::ASCIIToUTF16(product_name_); - *version = base::ASCIIToUTF16(product_version_); - *special_build = base::string16(); - *channel_name = base::string16(); + const std::wstring& exe_path, + std::wstring* product_name, + std::wstring* version, + std::wstring* special_build, + std::wstring* channel_name) { + *product_name = base::ASCIIToWide(product_name_); + *version = base::ASCIIToWide(product_version_); + *special_build = std::wstring(); + *channel_name = std::wstring(); } -bool CefCrashReporterClient::GetCrashDumpLocation(base::string16* crash_dir) { +bool CefCrashReporterClient::GetCrashDumpLocation(std::wstring* crash_dir) { // By setting the BREAKPAD_DUMP_LOCATION environment variable, an alternate // location to write breakpad crash dumps can be set. if (GetAlternativeCrashDumpLocation(crash_dir)) return true; - return GetDefaultCrashDumpLocation(crash_dir, base::UTF8ToUTF16(app_name_)); + return GetDefaultCrashDumpLocation(crash_dir, base::UTF8ToWide(app_name_)); } bool CefCrashReporterClient::GetCrashMetricsLocation( - base::string16* metrics_dir) { - return GetDefaultUserDataDirectory(metrics_dir, base::UTF8ToUTF16(app_name_)); + std::wstring* metrics_dir) { + return GetDefaultUserDataDirectory(metrics_dir, base::UTF8ToWide(app_name_)); } #elif defined(OS_POSIX) diff --git a/libcef/common/crash_reporter_client.h b/libcef/common/crash_reporter_client.h index bcd2586b3..0d0238887 100644 --- a/libcef/common/crash_reporter_client.h +++ b/libcef/common/crash_reporter_client.h @@ -43,14 +43,14 @@ class CefCrashReporterClient : public crash_reporter::CrashReporterClient { // the module address space. static void InitializeCrashReportingForProcess(); - bool GetAlternativeCrashDumpLocation(base::string16* crash_dir) override; - void GetProductNameAndVersion(const base::string16& exe_path, - base::string16* product_name, - base::string16* version, - base::string16* special_build, - base::string16* channel_name) override; - bool GetCrashDumpLocation(base::string16* crash_dir) override; - bool GetCrashMetricsLocation(base::string16* metrics_dir) override; + bool GetAlternativeCrashDumpLocation(std::wstring* crash_dir) override; + void GetProductNameAndVersion(const std::wstring& exe_path, + std::wstring* product_name, + std::wstring* version, + std::wstring* special_build, + std::wstring* channel_name) override; + bool GetCrashDumpLocation(std::wstring* crash_dir) override; + bool GetCrashMetricsLocation(std::wstring* metrics_dir) override; #elif defined(OS_POSIX) void GetProductNameAndVersion(const char** product_name, const char** version) override; diff --git a/libcef/common/request_impl.cc b/libcef/common/request_impl.cc index 4e43f4812..e605aed41 100644 --- a/libcef/common/request_impl.cc +++ b/libcef/common/request_impl.cc @@ -20,6 +20,7 @@ #include "base/strings/string_util.h" #include "base/strings/utf_string_conversions.h" #include "base/task/post_task.h" +#include "base/task/thread_pool.h" #include "components/navigation_interception/navigation_params.h" #include "content/public/browser/browser_thread.h" #include "content/public/common/content_switches.h" @@ -76,8 +77,8 @@ class BytesElementReader : public net::UploadBytesElementReader { }; scoped_refptr GetFileTaskRunner() { - return base::CreateSequencedTaskRunner( - {base::ThreadPool(), base::MayBlock(), base::TaskPriority::USER_VISIBLE}); + return base::ThreadPool::CreateSequencedTaskRunner( + {base::MayBlock(), base::TaskPriority::USER_VISIBLE}); } // A subclass of net::UploadFileElementReader that keeps the associated @@ -171,7 +172,7 @@ blink::WebString FilePathStringToWebString( #if defined(OS_POSIX) return blink::WebString::FromUTF8(str); #elif defined(OS_WIN) - return blink::WebString::FromUTF16(str); + return blink::WebString::FromUTF16(base::WideToUTF16(str)); #endif } @@ -632,9 +633,8 @@ void CefRequestImpl::Get(const CefMsg_LoadRequest_Params& params, } if (params.upload_data.get()) { - const base::string16& method = request.HttpMethod().Utf16(); - if (method == base::ASCIIToUTF16("GET") || - method == base::ASCIIToUTF16("HEAD")) { + const std::u16string& method = request.HttpMethod().Utf16(); + if (method == u"GET" || method == u"HEAD") { request.SetHttpMethod(blink::WebString::FromASCII("POST")); } diff --git a/libcef/common/resource_bundle_delegate.cc b/libcef/common/resource_bundle_delegate.cc index 64dce6620..f9788fb61 100644 --- a/libcef/common/resource_bundle_delegate.cc +++ b/libcef/common/resource_bundle_delegate.cc @@ -67,7 +67,7 @@ bool CefResourceBundleDelegate::GetRawDataResource( bool CefResourceBundleDelegate::GetLocalizedString( int message_id, - base::string16* value) const { + std::u16string* value) const { auto application = CefAppManager::Get()->GetApplication(); if (application) { CefRefPtr handler = diff --git a/libcef/common/resource_bundle_delegate.h b/libcef/common/resource_bundle_delegate.h index a96f846da..bbaba5e31 100644 --- a/libcef/common/resource_bundle_delegate.h +++ b/libcef/common/resource_bundle_delegate.h @@ -35,7 +35,7 @@ class CefResourceBundleDelegate : public ui::ResourceBundle::Delegate { bool GetRawDataResource(int resource_id, ui::ScaleFactor scale_factor, base::StringPiece* value) const override; - bool GetLocalizedString(int message_id, base::string16* value) const override; + bool GetLocalizedString(int message_id, std::u16string* value) const override; private: bool pack_loading_disabled_ = false; diff --git a/libcef/common/string_types_impl.cc b/libcef/common/string_types_impl.cc index 7e96872b4..dd1cfe6e7 100644 --- a/libcef/common/string_types_impl.cc +++ b/libcef/common/string_types_impl.cc @@ -8,7 +8,6 @@ #include "base/i18n/case_conversion.h" #include "base/logging.h" -#include "base/strings/string16.h" #include "base/strings/string_util.h" #include "base/strings/utf_string_conversions.h" @@ -171,9 +170,9 @@ CEF_EXPORT int cef_string_utf16_cmp(const cef_string_utf16_t* str1, if (str1->length == 0 && str2->length == 0) return 0; #if defined(WCHAR_T_IS_UTF32) - int r = std::char_traits::compare( - reinterpret_cast(str1->str), - reinterpret_cast(str2->str), + int r = std::char_traits::compare( + reinterpret_cast(str1->str), + reinterpret_cast(str2->str), std::min(str1->length, str2->length)); #else int r = wcsncmp(str1->str, str2->str, std::min(str1->length, str2->length)); @@ -210,7 +209,7 @@ CEF_EXPORT int cef_string_utf8_to_wide(const char* src, CEF_EXPORT int cef_string_wide_to_utf16(const wchar_t* src, size_t src_len, cef_string_utf16_t* output) { - base::string16 str; + std::u16string str; bool ret = base::WideToUTF16(src, src_len, &str); if (!cef_string_utf16_set(reinterpret_cast(str.c_str()), str.length(), output, true)) @@ -223,7 +222,7 @@ CEF_EXPORT int cef_string_utf16_to_wide(const char16* src, cef_string_wide_t* output) { std::wstring str; bool ret = base::UTF16ToWide( - reinterpret_cast(src), src_len, &str); + reinterpret_cast(src), src_len, &str); if (!cef_string_wide_set(str.c_str(), str.length(), output, true)) return false; return ret; @@ -232,7 +231,7 @@ CEF_EXPORT int cef_string_utf16_to_wide(const char16* src, CEF_EXPORT int cef_string_utf8_to_utf16(const char* src, size_t src_len, cef_string_utf16_t* output) { - base::string16 str; + std::u16string str; bool ret = base::UTF8ToUTF16(src, src_len, &str); if (!cef_string_utf16_set(reinterpret_cast(str.c_str()), str.length(), output, true)) @@ -245,7 +244,7 @@ CEF_EXPORT int cef_string_utf16_to_utf8(const char16* src, cef_string_utf8_t* output) { std::string str; bool ret = base::UTF16ToUTF8( - reinterpret_cast(src), src_len, &str); + reinterpret_cast(src), src_len, &str); if (!cef_string_utf8_set(str.c_str(), str.length(), output, true)) return false; return ret; @@ -261,7 +260,7 @@ CEF_EXPORT int cef_string_ascii_to_wide(const char* src, CEF_EXPORT int cef_string_ascii_to_utf16(const char* src, size_t src_len, cef_string_utf16_t* output) { - const base::string16& str = base::ASCIIToUTF16(std::string(src, src_len)); + const std::u16string& str = base::ASCIIToUTF16(std::string(src, src_len)); return cef_string_utf16_set(reinterpret_cast(str.c_str()), str.length(), output, true); } @@ -303,8 +302,8 @@ CEF_EXPORT void cef_string_userfree_utf16_free( CEF_EXPORT int cef_string_utf16_to_lower(const char16* src, size_t src_len, cef_string_utf16_t* output) { - const base::string16& str = base::i18n::ToLower(base::string16( - reinterpret_cast(src), src_len)); + const std::u16string& str = base::i18n::ToLower(std::u16string( + reinterpret_cast(src), src_len)); return cef_string_utf16_set(reinterpret_cast(str.c_str()), str.length(), output, true); } @@ -312,8 +311,8 @@ CEF_EXPORT int cef_string_utf16_to_lower(const char16* src, CEF_EXPORT int cef_string_utf16_to_upper(const char16* src, size_t src_len, cef_string_utf16_t* output) { - const base::string16& str = base::i18n::ToUpper(base::string16( - reinterpret_cast(src), src_len)); + const std::u16string& str = base::i18n::ToUpper(std::u16string( + reinterpret_cast(src), src_len)); return cef_string_utf16_set(reinterpret_cast(str.c_str()), str.length(), output, true); } diff --git a/libcef/renderer/alloy/alloy_content_renderer_client.cc b/libcef/renderer/alloy/alloy_content_renderer_client.cc index 10aa20370..096412f29 100644 --- a/libcef/renderer/alloy/alloy_content_renderer_client.cc +++ b/libcef/renderer/alloy/alloy_content_renderer_client.cc @@ -461,16 +461,12 @@ void AlloyContentRendererClient::DevToolsAgentDetached() { browser_manager_->DevToolsAgentDetached(); } -std::unique_ptr +std::unique_ptr AlloyContentRendererClient::CreateURLLoaderThrottleProvider( - content::URLLoaderThrottleProviderType provider_type) { + blink::URLLoaderThrottleProviderType provider_type) { return std::make_unique(provider_type); } -bool AlloyContentRendererClient::RequiresHtmlImports(const GURL& url) { - return url.SchemeIs(content::kChromeUIScheme); -} - void AlloyContentRendererClient::GetInterface( const std::string& interface_name, mojo::ScopedMessagePipeHandle interface_pipe) { diff --git a/libcef/renderer/alloy/alloy_content_renderer_client.h b/libcef/renderer/alloy/alloy_content_renderer_client.h index 490e7a151..8add71c6b 100644 --- a/libcef/renderer/alloy/alloy_content_renderer_client.h +++ b/libcef/renderer/alloy/alloy_content_renderer_client.h @@ -104,10 +104,9 @@ class AlloyContentRendererClient void RunScriptsAtDocumentIdle(content::RenderFrame* render_frame) override; void DevToolsAgentAttached() override; void DevToolsAgentDetached() override; - std::unique_ptr + std::unique_ptr CreateURLLoaderThrottleProvider( - content::URLLoaderThrottleProviderType provider_type) override; - bool RequiresHtmlImports(const GURL& url) override; + blink::URLLoaderThrottleProviderType provider_type) override; // service_manager::LocalInterfaceProvider implementation. void GetInterface(const std::string& name, diff --git a/libcef/renderer/alloy/url_loader_throttle_provider_impl.cc b/libcef/renderer/alloy/url_loader_throttle_provider_impl.cc index 097aef329..09bd30d87 100644 --- a/libcef/renderer/alloy/url_loader_throttle_provider_impl.cc +++ b/libcef/renderer/alloy/url_loader_throttle_provider_impl.cc @@ -18,7 +18,7 @@ #include "third_party/blink/public/platform/web_url.h" CefURLLoaderThrottleProviderImpl::CefURLLoaderThrottleProviderImpl( - content::URLLoaderThrottleProviderType type) + blink::URLLoaderThrottleProviderType type) : type_(type) { DETACH_FROM_THREAD(thread_checker_); } @@ -33,19 +33,19 @@ CefURLLoaderThrottleProviderImpl::CefURLLoaderThrottleProviderImpl( DETACH_FROM_THREAD(thread_checker_); } -std::unique_ptr +std::unique_ptr CefURLLoaderThrottleProviderImpl::Clone() { DCHECK_CALLED_ON_VALID_THREAD(thread_checker_); return base::WrapUnique(new CefURLLoaderThrottleProviderImpl(*this)); } -std::vector> +blink::WebVector> CefURLLoaderThrottleProviderImpl::CreateThrottles( int render_frame_id, const blink::WebURLRequest& request) { DCHECK_CALLED_ON_VALID_THREAD(thread_checker_); - std::vector> throttles; + blink::WebVector> throttles; const network::mojom::RequestDestination request_destination = request.GetRequestDestination(); @@ -56,9 +56,9 @@ CefURLLoaderThrottleProviderImpl::CreateThrottles( blink::IsRequestDestinationFrame(request_destination); DCHECK(!is_frame_resource || - type_ == content::URLLoaderThrottleProviderType::kFrame); + type_ == blink::URLLoaderThrottleProviderType::kFrame); - throttles.push_back(std::make_unique( + throttles.emplace_back(std::make_unique( AlloyRenderThreadObserver::GetDynamicParams())); return throttles; diff --git a/libcef/renderer/alloy/url_loader_throttle_provider_impl.h b/libcef/renderer/alloy/url_loader_throttle_provider_impl.h index 6724ca9c0..c78d4e2db 100644 --- a/libcef/renderer/alloy/url_loader_throttle_provider_impl.h +++ b/libcef/renderer/alloy/url_loader_throttle_provider_impl.h @@ -9,21 +9,21 @@ #include #include "base/threading/thread_checker.h" -#include "content/public/renderer/url_loader_throttle_provider.h" +#include "third_party/blink/public/platform/url_loader_throttle_provider.h" // Instances must be constructed on the render thread, and then used and // destructed on a single thread, which can be different from the render thread. class CefURLLoaderThrottleProviderImpl - : public content::URLLoaderThrottleProvider { + : public blink::URLLoaderThrottleProvider { public: explicit CefURLLoaderThrottleProviderImpl( - content::URLLoaderThrottleProviderType type); + blink::URLLoaderThrottleProviderType type); ~CefURLLoaderThrottleProviderImpl() override; - // content::URLLoaderThrottleProvider implementation. - std::unique_ptr Clone() override; - std::vector> CreateThrottles( + // blink::URLLoaderThrottleProvider implementation. + std::unique_ptr Clone() override; + blink::WebVector> CreateThrottles( int render_frame_id, const blink::WebURLRequest& request) override; void SetOnline(bool is_online) override; @@ -34,7 +34,7 @@ class CefURLLoaderThrottleProviderImpl CefURLLoaderThrottleProviderImpl( const CefURLLoaderThrottleProviderImpl& other); - content::URLLoaderThrottleProviderType type_; + blink::URLLoaderThrottleProviderType type_; THREAD_CHECKER(thread_checker_); diff --git a/libcef/renderer/blink_glue.cc b/libcef/renderer/blink_glue.cc index 24b513442..a730e1292 100644 --- a/libcef/renderer/blink_glue.cc +++ b/libcef/renderer/blink_glue.cc @@ -48,15 +48,13 @@ const int64_t kInvalidFrameId = -1; bool CanGoBack(blink::WebView* view) { if (!view) return false; - blink::WebViewImpl* impl = reinterpret_cast(view); - return (impl->Client()->HistoryBackListCount() > 0); + return view->HistoryBackListCount() > 0; } bool CanGoForward(blink::WebView* view) { if (!view) return false; - blink::WebViewImpl* impl = reinterpret_cast(view); - return (impl->Client()->HistoryForwardListCount() > 0); + return view->HistoryForwardListCount() > 0; } void GoBack(blink::WebView* view) { @@ -65,8 +63,7 @@ void GoBack(blink::WebView* view) { blink::WebFrame* main_frame = view->MainFrame(); if (main_frame && main_frame->IsWebLocalFrame()) { - blink::WebViewImpl* view_impl = reinterpret_cast(view); - if (view_impl->Client()->HistoryBackListCount() > 0) { + if (view->HistoryBackListCount() > 0) { blink::Frame* core_frame = blink::WebFrame::ToCoreFrame(*main_frame); blink::To(core_frame) ->GetLocalFrameHostRemote() @@ -81,8 +78,7 @@ void GoForward(blink::WebView* view) { blink::WebFrame* main_frame = view->MainFrame(); if (main_frame && main_frame->IsWebLocalFrame()) { - blink::WebViewImpl* view_impl = reinterpret_cast(view); - if (view_impl->Client()->HistoryForwardListCount() > 0) { + if (view->HistoryForwardListCount() > 0) { blink::Frame* core_frame = blink::WebFrame::ToCoreFrame(*main_frame); blink::To(core_frame) ->GetLocalFrameHostRemote() diff --git a/libcef/renderer/browser_impl.cc b/libcef/renderer/browser_impl.cc index aafbcfaf8..007692926 100644 --- a/libcef/renderer/browser_impl.cc +++ b/libcef/renderer/browser_impl.cc @@ -15,7 +15,6 @@ #include "libcef/renderer/render_frame_util.h" #include "libcef/renderer/thread_util.h" -#include "base/strings/string16.h" #include "base/strings/string_util.h" #include "base/strings/utf_string_conversions.h" #include "content/public/renderer/document_state.h" diff --git a/libcef/renderer/dom_node_impl.cc b/libcef/renderer/dom_node_impl.cc index 5bf838382..8060608e8 100644 --- a/libcef/renderer/dom_node_impl.cc +++ b/libcef/renderer/dom_node_impl.cc @@ -118,7 +118,7 @@ CefString CefDOMNodeImpl::GetFormControlElementType() { const WebFormControlElement& formElement = node_.ToConst(); - const base::string16& form_control_type = + const std::u16string& form_control_type = formElement.FormControlType().Utf16(); str = form_control_type; } @@ -162,14 +162,14 @@ CefString CefDOMNodeImpl::GetValue() { const WebFormControlElement& formElement = node_.ToConst(); - base::string16 value; - const base::string16& form_control_type = + std::u16string value; + const std::u16string& form_control_type = formElement.FormControlType().Utf16(); - if (form_control_type == base::ASCIIToUTF16("text")) { + if (form_control_type == u"text") { const WebInputElement& input_element = formElement.ToConst(); value = input_element.Value().Utf16(); - } else if (form_control_type == base::ASCIIToUTF16("select-one")) { + } else if (form_control_type == u"select-one") { const WebSelectElement& select_element = formElement.ToConst(); value = select_element.Value().Utf16(); @@ -339,8 +339,8 @@ void CefDOMNodeImpl::GetElementAttributes(AttributeMap& attrMap) { return; for (unsigned int i = 0; i < len; ++i) { - base::string16 name = element.AttributeLocalName(i).Utf16(); - base::string16 value = element.AttributeValue(i).Utf16(); + std::u16string name = element.AttributeLocalName(i).Utf16(); + std::u16string value = element.AttributeValue(i).Utf16(); attrMap.insert(std::make_pair(name, value)); } } diff --git a/libcef/resources/cef_strings.grd b/libcef/resources/cef_strings.grd index 3bd509cfe..876ec0006 100644 --- a/libcef/resources/cef_strings.grd +++ b/libcef/resources/cef_strings.grd @@ -103,6 +103,10 @@ need to be translated for each locale.--> + + + + diff --git a/libcef_dll/base/cef_string16.cc b/libcef_dll/base/cef_string16.cc deleted file mode 100644 index 16dea8c3b..000000000 --- a/libcef_dll/base/cef_string16.cc +++ /dev/null @@ -1,96 +0,0 @@ -// Copyright 2013 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "include/base/cef_string16.h" - -#if defined(OS_POSIX) -#if defined(WCHAR_T_IS_UTF16) - -#error This file should not be used on 2-byte wchar_t systems -// If this winds up being needed on 2-byte wchar_t systems, either the -// definitions below can be used, or the host system's wide character -// functions like wmemcmp can be wrapped. - -#elif defined(WCHAR_T_IS_UTF32) - -#include -#include - -#include "include/internal/cef_string_types.h" - -namespace cef { -namespace base { - -int c16memcmp(const char16* s1, const char16* s2, size_t n) { - // We cannot call memcmp because that changes the semantics. - while (n-- > 0) { - if (*s1 != *s2) { - // We cannot use (*s1 - *s2) because char16 is unsigned. - return ((*s1 < *s2) ? -1 : 1); - } - ++s1; - ++s2; - } - return 0; -} - -size_t c16len(const char16* s) { - const char16* s_orig = s; - while (*s) { - ++s; - } - return s - s_orig; -} - -const char16* c16memchr(const char16* s, char16 c, size_t n) { - while (n-- > 0) { - if (*s == c) { - return s; - } - ++s; - } - return 0; -} - -char16* c16memmove(char16* s1, const char16* s2, size_t n) { - return static_cast(memmove(s1, s2, n * sizeof(char16))); -} - -char16* c16memcpy(char16* s1, const char16* s2, size_t n) { - return static_cast(memcpy(s1, s2, n * sizeof(char16))); -} - -char16* c16memset(char16* s, char16 c, size_t n) { - char16* s_orig = s; - while (n-- > 0) { - *s = c; - ++s; - } - return s_orig; -} - -} // namespace base -} // namespace cef - -namespace base { - -std::ostream& operator<<(std::ostream& out, const string16& str) { - cef_string_utf8_t cef_str = {0}; - cef_string_utf16_to_utf8(str.c_str(), str.size(), &cef_str); - out << cef_str.str; - cef_string_utf8_clear(&cef_str); - return out; -} - -void PrintTo(const string16& str, std::ostream* out) { - *out << str; -} - -} // namespace base - -template class std::basic_string; - -#endif // WCHAR_T_IS_UTF32 -#endif // OS_POSIX diff --git a/patch/patch.cfg b/patch/patch.cfg index 8c823dd16..52a4562b6 100644 --- a/patch/patch.cfg +++ b/patch/patch.cfg @@ -70,6 +70,11 @@ patches = [ # https://bitbucket.org/chromiumembedded/cef/issues/2345 'name': 'webkit_popups_and_background', }, + { + # Give AlloyContentRendererClient access to protected + # RuntimeEnabledFeatures methods. + 'name': 'webkit_runtime_enabled_features', + }, { # Fix export of UnderlayOpenGLHostingWindow for 64-bit OS X builds. # https://bitbucket.org/chromiumembedded/cef/issues/1051 @@ -188,9 +193,6 @@ patches = [ }, { # Support CEF changes in chrome/browser. - # - # Linux: Fix duplicate symbol errors with Ozone and X11 enabled. - # https://bugs.chromium.org/p/chromium/issues/detail?id=1085700#c92 'name': 'chrome_browser', }, { @@ -255,9 +257,6 @@ patches = [ # Fix fatal error: 'components/printing/common/print.mojom.h' file not found # From chrome/browser/ui/browser_commands.cc via # chrome/browser/printing/print_view_manager_common.h - # - # Linux: Fix duplicate symbol errors with Ozone and X11 enabled. - # https://bugs.chromium.org/p/chromium/issues/detail?id=1085700#c93 'name': 'chrome_browser_net_export', }, { @@ -489,11 +488,6 @@ patches = [ # https://bitbucket.org/chromiumembedded/cef/issues/2819 'name': 'win_cpp17_msvc_sandbox_2819', }, - { - # Fix duplicate symbols in libphonenumber. - 'name': 'libphonenumber', - 'path': 'third_party/libphonenumber/dist', - }, { # libxml access is now limited to targets audited by the Security Team. # https://chromium-review.googlesource.com/c/chromium/src/+/1884750 @@ -543,10 +537,5 @@ patches = [ # Linux: Fix ATK assertion error when generating ARM build config. # https://bugs.chromium.org/p/chromium/issues/detail?id=1123214 'name': 'linux_atk_1123214', - }, - { - # Fix underflow in EventRouterForwarder::HandleEvent. - # https://bugs.chromium.org/p/chromium/issues/detail?id=1167149#c7 - 'name': 'chrome_extensions_event_router_3066', } ] diff --git a/patch/patches/base_sandbox_2743.patch b/patch/patches/base_sandbox_2743.patch index 6c3c1a8ec..68c5c5428 100644 --- a/patch/patches/base_sandbox_2743.patch +++ b/patch/patches/base_sandbox_2743.patch @@ -1,5 +1,5 @@ diff --git base/BUILD.gn base/BUILD.gn -index 70911a215498..52aea5cc2e70 100644 +index f9e098611a176..f956745c27fbe 100644 --- base/BUILD.gn +++ base/BUILD.gn @@ -34,6 +34,7 @@ import("//build/config/ui.gni") @@ -10,7 +10,7 @@ index 70911a215498..52aea5cc2e70 100644 import("//testing/libfuzzer/fuzzer_test.gni") import("//testing/test.gni") import("//third_party/icu/config.gni") -@@ -1731,7 +1732,11 @@ component("base") { +@@ -1742,7 +1743,11 @@ component("base") { "hash/md5_constexpr_internal.h", "hash/sha1.h", ] @@ -23,7 +23,7 @@ index 70911a215498..52aea5cc2e70 100644 sources += [ "hash/md5_nacl.cc", "hash/md5_nacl.h", -@@ -1938,6 +1943,12 @@ component("base") { +@@ -1951,6 +1956,12 @@ component("base") { defines += [ "COM_INIT_CHECK_HOOK_DISABLED" ] } @@ -37,7 +37,7 @@ index 70911a215498..52aea5cc2e70 100644 configs += [ "//build/config/compiler:no_size_t_to_int_warning" ] diff --git base/hash/md5.h base/hash/md5.h -index 8a49f08dcb04..2f03d7a6d1b3 100644 +index 8a49f08dcb04d..2f03d7a6d1b34 100644 --- base/hash/md5.h +++ base/hash/md5.h @@ -10,8 +10,9 @@ @@ -51,3 +51,18 @@ index 8a49f08dcb04..2f03d7a6d1b3 100644 #include "base/hash/md5_nacl.h" #else #include "base/hash/md5_boringssl.h" +diff --git base/hash/sha1.h base/hash/sha1.h +index 5bb10fe069850..206344d0fd3b1 100644 +--- base/hash/sha1.h ++++ base/hash/sha1.h +@@ -14,7 +14,9 @@ + #include "base/containers/span.h" + #include "base/strings/string_piece.h" + #include "build/build_config.h" +-#if defined(OS_NACL) ++#include "cef/libcef/features/features.h" ++ ++#if defined(OS_NACL) || BUILDFLAG(IS_CEF_SANDBOX_BUILD) + #include "base/hash/sha1_nacl.h" + #else + #include "base/hash/sha1_boringssl.h" diff --git a/patch/patches/base_string_piece_1049498.patch b/patch/patches/base_string_piece_1049498.patch index 50bf3a638..9a7879166 100644 --- a/patch/patches/base_string_piece_1049498.patch +++ b/patch/patches/base_string_piece_1049498.patch @@ -1,5 +1,5 @@ diff --git base/strings/string_piece.h base/strings/string_piece.h -index 038165ea1e1c..a559312bba57 100644 +index f4f37ad5242b2..ddb9b3fd87474 100644 --- base/strings/string_piece.h +++ base/strings/string_piece.h @@ -24,6 +24,7 @@ diff --git a/patch/patches/browser_scheduler.patch b/patch/patches/browser_scheduler.patch index c4206fc36..1cf65ba57 100644 --- a/patch/patches/browser_scheduler.patch +++ b/patch/patches/browser_scheduler.patch @@ -1,5 +1,5 @@ diff --git content/browser/scheduler/browser_task_executor.cc content/browser/scheduler/browser_task_executor.cc -index 82801d316d76..4616c1caf493 100644 +index 82801d316d76c..4616c1caf4934 100644 --- content/browser/scheduler/browser_task_executor.cc +++ content/browser/scheduler/browser_task_executor.cc @@ -240,7 +240,7 @@ void BrowserTaskExecutor::PostFeatureListSetup() { diff --git a/patch/patches/browser_security_policy_1081397.patch b/patch/patches/browser_security_policy_1081397.patch index 60247e465..6bcd82c2e 100644 --- a/patch/patches/browser_security_policy_1081397.patch +++ b/patch/patches/browser_security_policy_1081397.patch @@ -1,8 +1,8 @@ diff --git content/browser/child_process_security_policy_impl.cc content/browser/child_process_security_policy_impl.cc -index 52ebdbbc7c2e..822f2e41afec 100644 +index efb7c635e6885..cbbf37a092441 100644 --- content/browser/child_process_security_policy_impl.cc +++ content/browser/child_process_security_policy_impl.cc -@@ -1706,6 +1706,16 @@ bool ChildProcessSecurityPolicyImpl::CanAccessDataForOrigin( +@@ -1728,6 +1728,16 @@ bool ChildProcessSecurityPolicyImpl::CanAccessDataForOrigin( // DeclarativeApiTest.PersistRules. if (actual_process_lock.matches_scheme(url::kDataScheme)) return true; @@ -20,10 +20,10 @@ index 52ebdbbc7c2e..822f2e41afec 100644 // TODO(wjmaclean): We should update the ProcessLock comparison API diff --git content/browser/renderer_host/navigation_request.cc content/browser/renderer_host/navigation_request.cc -index dae1c91d2d72..c48bd5ea1fb7 100644 +index 12132d0bc651a..4c4b7821d9131 100644 --- content/browser/renderer_host/navigation_request.cc +++ content/browser/renderer_host/navigation_request.cc -@@ -4871,6 +4871,12 @@ url::Origin NavigationRequest::GetOriginForURLLoaderFactory() { +@@ -5304,6 +5304,12 @@ url::Origin NavigationRequest::GetOriginForURLLoaderFactory() { // Calculate an approximation of the origin. The sandbox/csp are ignored. url::Origin origin = GetOriginForURLLoaderFactoryUnchecked(this); diff --git a/patch/patches/build.patch b/patch/patches/build.patch index dd89ad974..4d7527b83 100644 --- a/patch/patches/build.patch +++ b/patch/patches/build.patch @@ -1,8 +1,8 @@ diff --git build/config/compiler/BUILD.gn build/config/compiler/BUILD.gn -index 266b74b3b50a..f242e8b08ec1 100644 +index 72ea590d69681..0c34d20addfa8 100644 --- build/config/compiler/BUILD.gn +++ build/config/compiler/BUILD.gn -@@ -1824,8 +1824,6 @@ config("thin_archive") { +@@ -1834,8 +1834,6 @@ config("thin_archive") { # archives. if ((is_posix && !is_nacl && (!is_apple || use_lld)) || is_fuchsia) { arflags = [ "-T" ] diff --git a/patch/patches/chrome_browser.patch b/patch/patches/chrome_browser.patch index 8d718459d..17022f3af 100644 --- a/patch/patches/chrome_browser.patch +++ b/patch/patches/chrome_browser.patch @@ -1,16 +1,16 @@ diff --git chrome/browser/BUILD.gn chrome/browser/BUILD.gn -index 72d91d05c23a..bfa8860bcd89 100644 +index c7970e581a976..045e18b4313b5 100644 --- chrome/browser/BUILD.gn +++ chrome/browser/BUILD.gn -@@ -12,6 +12,7 @@ import("//build/config/crypto.gni") - import("//build/config/features.gni") +@@ -13,6 +13,7 @@ import("//build/config/features.gni") import("//build/config/linux/gtk/gtk.gni") + import("//build/config/python.gni") import("//build/config/ui.gni") +import("//cef/libcef/features/features.gni") import("//chrome/browser/buildflags.gni") import("//chrome/browser/downgrade/buildflags.gni") import("//chrome/common/features.gni") -@@ -1964,6 +1965,7 @@ static_library("browser") { +@@ -1902,6 +1903,7 @@ static_library("browser") { "//build:chromeos_buildflags", "//build/config/compiler:compiler_buildflags", "//cc", @@ -18,7 +18,7 @@ index 72d91d05c23a..bfa8860bcd89 100644 "//chrome:extra_resources", "//chrome:resources", "//chrome:strings", -@@ -2504,6 +2506,10 @@ static_library("browser") { +@@ -2450,6 +2452,10 @@ static_library("browser") { ] } @@ -29,12 +29,3 @@ index 72d91d05c23a..bfa8860bcd89 100644 if (is_android) { sources += [ "after_startup_task_utils_android.cc", -@@ -5166,7 +5172,7 @@ static_library("browser") { - ] - } - -- if (use_ozone) { -+ if (use_ozone && !use_x11) { - sources += [ - "fullscreen_ozone.cc", - "media/webrtc/window_icon_util_ozone.cc", diff --git a/patch/patches/chrome_browser_background_mode_1100085.patch b/patch/patches/chrome_browser_background_mode_1100085.patch index 0fc958751..d5b134344 100644 --- a/patch/patches/chrome_browser_background_mode_1100085.patch +++ b/patch/patches/chrome_browser_background_mode_1100085.patch @@ -1,8 +1,8 @@ diff --git chrome/browser/app_controller_mac.mm chrome/browser/app_controller_mac.mm -index 596eabd15f44..b9b24760b7c2 100644 +index 3f0c080690084..52d0d8eb43c3e 100644 --- chrome/browser/app_controller_mac.mm +++ chrome/browser/app_controller_mac.mm -@@ -30,6 +30,7 @@ +@@ -31,6 +31,7 @@ #include "base/threading/scoped_blocking_call.h" #include "base/threading/thread_restrictions.h" #include "build/branding_buildflags.h" @@ -10,7 +10,7 @@ index 596eabd15f44..b9b24760b7c2 100644 #include "chrome/app/chrome_command_ids.h" #include "chrome/browser/apps/app_shim/app_shim_manager_mac.h" #include "chrome/browser/apps/app_shim/app_shim_termination_manager.h" -@@ -1219,6 +1220,7 @@ static base::mac::ScopedObjCClassSwizzler* g_swizzle_imk_input_session; +@@ -1211,6 +1212,7 @@ static base::mac::ScopedObjCClassSwizzler* g_swizzle_imk_input_session; // Run a (background) application in a new tab. - (void)executeApplication:(id)sender { @@ -18,7 +18,7 @@ index 596eabd15f44..b9b24760b7c2 100644 NSInteger tag = [sender tag]; Profile* profile = [self lastProfile]; DCHECK(profile); -@@ -1227,6 +1229,7 @@ static base::mac::ScopedObjCClassSwizzler* g_swizzle_imk_input_session; +@@ -1219,6 +1221,7 @@ static base::mac::ScopedObjCClassSwizzler* g_swizzle_imk_input_session; tag < static_cast(applications.size())); const extensions::Extension* extension = applications.GetExtension(tag); BackgroundModeManager::LaunchBackgroundApplication(profile, extension); @@ -26,7 +26,7 @@ index 596eabd15f44..b9b24760b7c2 100644 } // Same as |-commandDispatch:|, but executes commands using a disposition -@@ -1614,6 +1617,7 @@ static base::mac::ScopedObjCClassSwizzler* g_swizzle_imk_input_session; +@@ -1606,6 +1609,7 @@ static base::mac::ScopedObjCClassSwizzler* g_swizzle_imk_input_session; // TODO(rickcam): Mock out BackgroundApplicationListModel, then add unit // tests which use the mock in place of the profile-initialized model. @@ -34,7 +34,7 @@ index 596eabd15f44..b9b24760b7c2 100644 // Avoid breaking unit tests which have no profile. if (profile) { BackgroundApplicationListModel applications(profile); -@@ -1640,6 +1644,7 @@ static base::mac::ScopedObjCClassSwizzler* g_swizzle_imk_input_session; +@@ -1632,6 +1636,7 @@ static base::mac::ScopedObjCClassSwizzler* g_swizzle_imk_input_session; } } } @@ -42,7 +42,7 @@ index 596eabd15f44..b9b24760b7c2 100644 return dockMenu; } -@@ -1850,11 +1855,13 @@ static base::mac::ScopedObjCClassSwizzler* g_swizzle_imk_input_session; +@@ -1861,11 +1866,13 @@ static base::mac::ScopedObjCClassSwizzler* g_swizzle_imk_input_session; namespace { void UpdateProfileInUse(Profile* profile, Profile::CreateStatus status) { @@ -57,7 +57,7 @@ index 596eabd15f44..b9b24760b7c2 100644 } // namespace diff --git chrome/browser/browser_process.h chrome/browser/browser_process.h -index 3d634db18900..96e44ad48e5e 100644 +index 3d634db18900a..96e44ad48e5e5 100644 --- chrome/browser/browser_process.h +++ chrome/browser/browser_process.h @@ -197,9 +197,9 @@ class BrowserProcess { @@ -72,10 +72,10 @@ index 3d634db18900..96e44ad48e5e 100644 std::unique_ptr manager) = 0; #endif diff --git chrome/browser/browser_process_impl.cc chrome/browser/browser_process_impl.cc -index 067873339ce4..4bc021eb8c9a 100644 +index 89a682d5c9352..946ccbda587c7 100644 --- chrome/browser/browser_process_impl.cc +++ chrome/browser/browser_process_impl.cc -@@ -943,18 +943,14 @@ DownloadRequestLimiter* BrowserProcessImpl::download_request_limiter() { +@@ -947,18 +947,14 @@ DownloadRequestLimiter* BrowserProcessImpl::download_request_limiter() { return download_request_limiter_.get(); } @@ -96,7 +96,7 @@ index 067873339ce4..4bc021eb8c9a 100644 std::unique_ptr manager) { background_mode_manager_ = std::move(manager); diff --git chrome/browser/browser_process_impl.h chrome/browser/browser_process_impl.h -index b4ceefbccd08..7d60206c83b1 100644 +index b4ceefbccd083..7d60206c83b13 100644 --- chrome/browser/browser_process_impl.h +++ chrome/browser/browser_process_impl.h @@ -169,8 +169,8 @@ class BrowserProcessImpl : public BrowserProcess, @@ -110,7 +110,7 @@ index b4ceefbccd08..7d60206c83b1 100644 std::unique_ptr manager) override; #endif diff --git chrome/browser/lifetime/browser_close_manager.cc chrome/browser/lifetime/browser_close_manager.cc -index e0cafee5eedd..06ded156be3c 100644 +index e0cafee5eedd6..06ded156be3cc 100644 --- chrome/browser/lifetime/browser_close_manager.cc +++ chrome/browser/lifetime/browser_close_manager.cc @@ -148,12 +148,14 @@ void BrowserCloseManager::CloseBrowsers() { @@ -128,11 +128,29 @@ index e0cafee5eedd..06ded156be3c 100644 // Make a copy of the BrowserList to simplify the case where we need to // destroy a Browser during the loop. +diff --git chrome/browser/sessions/app_session_service.cc chrome/browser/sessions/app_session_service.cc +index 071884fe257bb..47160e3e47bdb 100644 +--- chrome/browser/sessions/app_session_service.cc ++++ chrome/browser/sessions/app_session_service.cc +@@ -90,8 +90,11 @@ void AppSessionService::MaybeDeleteSessionOnlyData() { + // Clear session data if the last window for a profile has been closed and + // closing the last window would normally close Chrome, unless background mode + // is active. Tests don't have a background_mode_manager. +- if (browser_defaults::kBrowserAliveWithNoWindows || +- g_browser_process->background_mode_manager()->IsBackgroundModeActive()) { ++ if (browser_defaults::kBrowserAliveWithNoWindows ++#if BUILDFLAG(ENABLE_BACKGROUND_MODE) ++ || g_browser_process->background_mode_manager()->IsBackgroundModeActive() ++#endif ++ ) { + return; + } + diff --git chrome/browser/sessions/session_service.cc chrome/browser/sessions/session_service.cc -index 867da7e78e1a..de849b67b1e3 100644 +index e5074800fbb00..e6c59d05ee204 100644 --- chrome/browser/sessions/session_service.cc +++ chrome/browser/sessions/session_service.cc -@@ -1047,12 +1047,19 @@ void SessionService::MaybeDeleteSessionOnlyData() { +@@ -553,12 +553,19 @@ void SessionService::MaybeDeleteSessionOnlyData() { if (profile()->AsTestingProfile()) return; diff --git a/patch/patches/chrome_browser_browser.patch b/patch/patches/chrome_browser_browser.patch index b554d0f5c..f765d7150 100644 --- a/patch/patches/chrome_browser_browser.patch +++ b/patch/patches/chrome_browser_browser.patch @@ -1,5 +1,5 @@ diff --git chrome/browser/browser_about_handler.cc chrome/browser/browser_about_handler.cc -index ba0c5c3fc044..b4df9af95ecd 100644 +index ba0c5c3fc0446..b4df9af95ecd1 100644 --- chrome/browser/browser_about_handler.cc +++ chrome/browser/browser_about_handler.cc @@ -70,6 +70,9 @@ bool HandleNonNavigationAboutURL(const GURL& url) { @@ -13,10 +13,10 @@ index ba0c5c3fc044..b4df9af95ecd 100644 return false; } diff --git chrome/browser/ui/browser.cc chrome/browser/ui/browser.cc -index f225525e74eb..2f3d13b087b0 100644 +index 37b121e2b667d..ae70272bf2764 100644 --- chrome/browser/ui/browser.cc +++ chrome/browser/ui/browser.cc -@@ -256,6 +256,20 @@ +@@ -257,6 +257,20 @@ #include "components/captive_portal/content/captive_portal_tab_helper.h" #endif @@ -37,7 +37,7 @@ index f225525e74eb..2f3d13b087b0 100644 #if BUILDFLAG(ENABLE_EXTENSIONS) #include "chrome/browser/extensions/extension_browser_window_helper.h" #endif -@@ -480,6 +494,13 @@ Browser::Browser(const CreateParams& params) +@@ -481,6 +495,13 @@ Browser::Browser(const CreateParams& params) tab_strip_model_->AddObserver(this); @@ -51,7 +51,7 @@ index f225525e74eb..2f3d13b087b0 100644 location_bar_model_ = std::make_unique( location_bar_model_delegate_.get(), content::kMaxURLDisplayChars); -@@ -1310,6 +1331,14 @@ content::KeyboardEventProcessingResult Browser::PreHandleKeyboardEvent( +@@ -1320,6 +1341,14 @@ content::KeyboardEventProcessingResult Browser::PreHandleKeyboardEvent( if (exclusive_access_manager_->HandleUserKeyEvent(event)) return content::KeyboardEventProcessingResult::HANDLED; @@ -66,7 +66,7 @@ index f225525e74eb..2f3d13b087b0 100644 return window()->PreHandleKeyboardEvent(event); } -@@ -1317,8 +1346,18 @@ bool Browser::HandleKeyboardEvent(content::WebContents* source, +@@ -1327,8 +1356,18 @@ bool Browser::HandleKeyboardEvent(content::WebContents* source, const NativeWebKeyboardEvent& event) { DevToolsWindow* devtools_window = DevToolsWindow::GetInstanceForInspectedWebContents(source); @@ -87,7 +87,7 @@ index f225525e74eb..2f3d13b087b0 100644 } bool Browser::TabsNeedBeforeUnloadFired() { -@@ -1538,6 +1577,14 @@ WebContents* Browser::OpenURLFromTab(WebContents* source, +@@ -1549,6 +1588,14 @@ WebContents* Browser::OpenURLFromTab(WebContents* source, return window->OpenURLFromTab(source, params); } @@ -102,7 +102,7 @@ index f225525e74eb..2f3d13b087b0 100644 NavigateParams nav_params(this, params.url, params.transition); nav_params.FillNavigateParamsFromOpenURLParams(params); nav_params.source_contents = source; -@@ -1633,6 +1680,15 @@ void Browser::AddNewContents(WebContents* source, +@@ -1648,6 +1695,15 @@ void Browser::AddNewContents(WebContents* source, source, disposition); } @@ -118,7 +118,7 @@ index f225525e74eb..2f3d13b087b0 100644 chrome::AddWebContents(this, source, std::move(new_contents), target_url, disposition, initial_rect); } -@@ -1651,6 +1707,8 @@ void Browser::LoadingStateChanged(WebContents* source, +@@ -1666,6 +1722,8 @@ void Browser::LoadingStateChanged(WebContents* source, bool to_different_document) { ScheduleUIUpdate(source, content::INVALIDATE_TYPE_LOAD); UpdateWindowForLoadingStateChanged(source, to_different_document); @@ -127,7 +127,7 @@ index f225525e74eb..2f3d13b087b0 100644 } void Browser::CloseContents(WebContents* source) { -@@ -1678,6 +1736,8 @@ void Browser::SetContentsBounds(WebContents* source, const gfx::Rect& bounds) { +@@ -1693,6 +1751,8 @@ void Browser::SetContentsBounds(WebContents* source, const gfx::Rect& bounds) { } void Browser::UpdateTargetURL(WebContents* source, const GURL& url) { @@ -136,16 +136,16 @@ index f225525e74eb..2f3d13b087b0 100644 if (!GetStatusBubble()) return; -@@ -1685,6 +1745,17 @@ void Browser::UpdateTargetURL(WebContents* source, const GURL& url) { +@@ -1700,6 +1760,17 @@ void Browser::UpdateTargetURL(WebContents* source, const GURL& url) { GetStatusBubble()->SetURL(url); } +bool Browser::DidAddMessageToConsole( + content::WebContents* source, + blink::mojom::ConsoleMessageLevel log_level, -+ const base::string16& message, ++ const std::u16string& message, + int32_t line_no, -+ const base::string16& source_id) { ++ const std::u16string& source_id) { + CALL_CEF_DELEGATE_RETURN(DidAddMessageToConsole, source, log_level, message, + line_no, source_id); + return false; @@ -154,7 +154,7 @@ index f225525e74eb..2f3d13b087b0 100644 void Browser::ContentsMouseEvent(WebContents* source, bool motion, bool exited) { -@@ -1801,6 +1872,10 @@ void Browser::WebContentsCreated(WebContents* source_contents, +@@ -1816,6 +1887,10 @@ void Browser::WebContentsCreated(WebContents* source_contents, // Make the tab show up in the task manager. task_manager::WebContentsTags::CreateForTabContents(new_contents); @@ -165,7 +165,7 @@ index f225525e74eb..2f3d13b087b0 100644 } void Browser::PortalWebContentsCreated(WebContents* portal_web_contents) { -@@ -1837,6 +1912,8 @@ void Browser::RendererResponsive( +@@ -1852,6 +1927,8 @@ void Browser::RendererResponsive( void Browser::DidNavigateMainFramePostCommit(WebContents* web_contents) { if (web_contents == tab_strip_model_->GetActiveWebContents()) UpdateBookmarkBarState(BOOKMARK_BAR_STATE_CHANGE_TAB_STATE); @@ -174,7 +174,7 @@ index f225525e74eb..2f3d13b087b0 100644 } content::JavaScriptDialogManager* Browser::GetJavaScriptDialogManager( -@@ -1883,11 +1960,15 @@ void Browser::EnterFullscreenModeForTab( +@@ -1898,11 +1975,15 @@ void Browser::EnterFullscreenModeForTab( const blink::mojom::FullscreenOptions& options) { exclusive_access_manager_->fullscreen_controller()->EnterFullscreenModeForTab( requesting_frame, options.display_id); @@ -190,7 +190,7 @@ index f225525e74eb..2f3d13b087b0 100644 } bool Browser::IsFullscreenForTabOrPending(const WebContents* web_contents) { -@@ -2730,6 +2811,8 @@ void Browser::SetAsDelegate(WebContents* web_contents, bool set_delegate) { +@@ -2742,6 +2823,8 @@ void Browser::SetAsDelegate(WebContents* web_contents, bool set_delegate) { content_translate_driver->RemoveTranslationObserver(this); BookmarkTabHelper::FromWebContents(web_contents)->RemoveObserver(this); } @@ -198,20 +198,20 @@ index f225525e74eb..2f3d13b087b0 100644 + CALL_CEF_DELEGATE(SetAsDelegate, web_contents, set_delegate); } - void Browser::CloseFrame() { + void Browser::TabDetachedAtImpl(content::WebContents* contents, diff --git chrome/browser/ui/browser.h chrome/browser/ui/browser.h -index 3a0202c2139b..5b950c1146d0 100644 +index f1c66751bff73..886375f473b91 100644 --- chrome/browser/ui/browser.h +++ chrome/browser/ui/browser.h -@@ -22,6 +22,7 @@ +@@ -21,6 +21,7 @@ #include "base/timer/elapsed_timer.h" #include "build/build_config.h" #include "build/chromeos_buildflags.h" +#include "cef/libcef/features/runtime.h" #include "chrome/browser/devtools/devtools_toggle_action.h" #include "chrome/browser/profiles/scoped_profile_keep_alive.h" - #include "chrome/browser/ui/bookmarks/bookmark_bar.h" -@@ -58,6 +59,10 @@ + #include "chrome/browser/themes/theme_service_observer.h" +@@ -56,6 +57,10 @@ #include "ui/gfx/geometry/rect.h" #include "ui/shell_dialogs/select_file_dialog.h" @@ -222,7 +222,7 @@ index 3a0202c2139b..5b950c1146d0 100644 #if defined(OS_ANDROID) #error This file should only be included on desktop. #endif -@@ -281,6 +286,11 @@ class Browser : public TabStripModelObserver, +@@ -279,6 +284,11 @@ class Browser : public TabStripModelObserver, // maximizable. bool can_maximize = true; @@ -234,7 +234,7 @@ index 3a0202c2139b..5b950c1146d0 100644 private: friend class Browser; friend class WindowSizerChromeOSTest; -@@ -345,6 +355,13 @@ class Browser : public TabStripModelObserver, +@@ -343,6 +353,13 @@ class Browser : public TabStripModelObserver, bool is_focus_mode() const { return is_focus_mode_; } @@ -248,7 +248,7 @@ index 3a0202c2139b..5b950c1146d0 100644 // Accessors //////////////////////////////////////////////////////////////// const CreateParams& create_params() const { return create_params_; } -@@ -403,6 +420,12 @@ class Browser : public TabStripModelObserver, +@@ -401,6 +418,12 @@ class Browser : public TabStripModelObserver, base::WeakPtr AsWeakPtr(); @@ -261,19 +261,19 @@ index 3a0202c2139b..5b950c1146d0 100644 // Get the FindBarController for this browser, creating it if it does not // yet exist. FindBarController* GetFindBarController(); -@@ -783,6 +806,11 @@ class Browser : public TabStripModelObserver, +@@ -781,6 +804,11 @@ class Browser : public TabStripModelObserver, void SetContentsBounds(content::WebContents* source, const gfx::Rect& bounds) override; void UpdateTargetURL(content::WebContents* source, const GURL& url) override; + bool DidAddMessageToConsole(content::WebContents* source, + blink::mojom::ConsoleMessageLevel log_level, -+ const base::string16& message, ++ const std::u16string& message, + int32_t line_no, -+ const base::string16& source_id) override; ++ const std::u16string& source_id) override; void ContentsMouseEvent(content::WebContents* source, bool motion, bool exited) override; -@@ -1182,6 +1210,8 @@ class Browser : public TabStripModelObserver, +@@ -1171,6 +1199,8 @@ class Browser : public TabStripModelObserver, const std::string initial_workspace_; bool initial_visible_on_all_workspaces_state_; @@ -282,7 +282,7 @@ index 3a0202c2139b..5b950c1146d0 100644 // Tracks when this browser is being created by session restore. bool is_session_restore_; -@@ -1242,6 +1272,10 @@ class Browser : public TabStripModelObserver, +@@ -1231,6 +1261,10 @@ class Browser : public TabStripModelObserver, extension_browser_window_helper_; #endif @@ -294,7 +294,7 @@ index 3a0202c2139b..5b950c1146d0 100644 // The following factory is used for chrome update coalescing. diff --git chrome/browser/ui/browser_navigator.cc chrome/browser/ui/browser_navigator.cc -index 019834353c02..894de692f35d 100644 +index a50d5b83afa2d..21c6ca8d7188f 100644 --- chrome/browser/ui/browser_navigator.cc +++ chrome/browser/ui/browser_navigator.cc @@ -454,6 +454,13 @@ std::unique_ptr CreateTargetContents( @@ -312,7 +312,7 @@ index 019834353c02..894de692f35d 100644 // tab helpers, so the entire set of tab helpers needs to be set up // immediately. diff --git chrome/browser/ui/browser_tabstrip.cc chrome/browser/ui/browser_tabstrip.cc -index 899b0e532c45..2fad68ec3e51 100644 +index 899b0e532c451..2fad68ec3e513 100644 --- chrome/browser/ui/browser_tabstrip.cc +++ chrome/browser/ui/browser_tabstrip.cc @@ -30,9 +30,13 @@ void AddTabAt(Browser* browser, diff --git a/patch/patches/chrome_browser_content_settings.patch b/patch/patches/chrome_browser_content_settings.patch index e88f79020..b2b6a44c8 100644 --- a/patch/patches/chrome_browser_content_settings.patch +++ b/patch/patches/chrome_browser_content_settings.patch @@ -1,5 +1,5 @@ diff --git chrome/browser/content_settings/host_content_settings_map_factory.cc chrome/browser/content_settings/host_content_settings_map_factory.cc -index c1e6c77a5726..d3c41d3dac05 100644 +index c1e6c77a57267..d3c41d3dac053 100644 --- chrome/browser/content_settings/host_content_settings_map_factory.cc +++ chrome/browser/content_settings/host_content_settings_map_factory.cc @@ -8,6 +8,7 @@ @@ -54,7 +54,7 @@ index c1e6c77a5726..d3c41d3dac05 100644 #if BUILDFLAG(ENABLE_SUPERVISED_USERS) SupervisedUserSettingsService* supervised_service = diff --git components/content_settings/renderer/content_settings_agent_impl.cc components/content_settings/renderer/content_settings_agent_impl.cc -index b6b38ab9a251..048c6f8c544f 100644 +index b6b38ab9a2513..048c6f8c544f1 100644 --- components/content_settings/renderer/content_settings_agent_impl.cc +++ components/content_settings/renderer/content_settings_agent_impl.cc @@ -172,7 +172,7 @@ ContentSetting GetContentSettingFromRulesImpl( diff --git a/patch/patches/chrome_browser_context_menus.patch b/patch/patches/chrome_browser_context_menus.patch index e6ecec585..0376117e2 100644 --- a/patch/patches/chrome_browser_context_menus.patch +++ b/patch/patches/chrome_browser_context_menus.patch @@ -1,8 +1,8 @@ diff --git chrome/browser/renderer_context_menu/render_view_context_menu.cc chrome/browser/renderer_context_menu/render_view_context_menu.cc -index 86f785a8658f..e7693b4a5efc 100644 +index 13ad2a7529bb1..0b003c26815e0 100644 --- chrome/browser/renderer_context_menu/render_view_context_menu.cc +++ chrome/browser/renderer_context_menu/render_view_context_menu.cc -@@ -253,6 +253,13 @@ base::OnceCallback* GetMenuShownCallback() { +@@ -254,6 +254,13 @@ base::OnceCallback* GetMenuShownCallback() { return callback.get(); } @@ -16,7 +16,7 @@ index 86f785a8658f..e7693b4a5efc 100644 enum class UmaEnumIdLookupType { GeneralEnumId, ContextSpecificEnumId, -@@ -461,6 +468,10 @@ int FindUMAEnumValueForCommand(int id, UmaEnumIdLookupType type) { +@@ -463,6 +470,10 @@ int FindUMAEnumValueForCommand(int id, UmaEnumIdLookupType type) { if (ContextMenuMatcher::IsExtensionsCustomCommandId(id)) return 1; @@ -27,7 +27,7 @@ index 86f785a8658f..e7693b4a5efc 100644 id = CollapseCommandsForUMA(id); const auto& map = GetIdcToUmaMap(type); auto it = map.find(id); -@@ -616,6 +627,14 @@ RenderViewContextMenu::RenderViewContextMenu( +@@ -618,6 +629,14 @@ RenderViewContextMenu::RenderViewContextMenu( } set_content_type( ContextMenuContentTypeFactory::Create(source_web_contents_, params)); @@ -42,7 +42,7 @@ index 86f785a8658f..e7693b4a5efc 100644 } RenderViewContextMenu::~RenderViewContextMenu() = default; -@@ -966,6 +985,12 @@ void RenderViewContextMenu::InitMenu() { +@@ -973,6 +992,12 @@ void RenderViewContextMenu::InitMenu() { // menu, meaning that each menu item added/removed in this function will cause // it to visibly jump on the screen (see b/173569669). AppendQuickAnswersItems(); @@ -55,7 +55,7 @@ index 86f785a8658f..e7693b4a5efc 100644 } Profile* RenderViewContextMenu::GetProfile() const { -@@ -2590,6 +2615,12 @@ void RenderViewContextMenu::RegisterMenuShownCallbackForTesting( +@@ -2594,6 +2619,12 @@ void RenderViewContextMenu::RegisterMenuShownCallbackForTesting( *GetMenuShownCallback() = std::move(cb); } @@ -69,10 +69,10 @@ index 86f785a8658f..e7693b4a5efc 100644 RenderViewContextMenu::GetHandlersForLinkUrl() { ProtocolHandlerRegistry::ProtocolHandlerList handlers = diff --git chrome/browser/renderer_context_menu/render_view_context_menu.h chrome/browser/renderer_context_menu/render_view_context_menu.h -index 25f331b10b01..5ea2e8ba1c7a 100644 +index 5178db60ba644..845461049e54e 100644 --- chrome/browser/renderer_context_menu/render_view_context_menu.h +++ chrome/browser/renderer_context_menu/render_view_context_menu.h -@@ -92,6 +92,12 @@ class RenderViewContextMenu : public RenderViewContextMenuBase { +@@ -91,6 +91,12 @@ class RenderViewContextMenu : public RenderViewContextMenuBase { static void RegisterMenuShownCallbackForTesting( base::OnceCallback cb); @@ -85,7 +85,7 @@ index 25f331b10b01..5ea2e8ba1c7a 100644 protected: Profile* GetProfile() const; -@@ -266,6 +272,9 @@ class RenderViewContextMenu : public RenderViewContextMenuBase { +@@ -265,6 +271,9 @@ class RenderViewContextMenu : public RenderViewContextMenuBase { ui::SimpleMenuModel protocol_handler_submenu_model_; ProtocolHandlerRegistry* protocol_handler_registry_; @@ -96,7 +96,7 @@ index 25f331b10b01..5ea2e8ba1c7a 100644 // "Use enhanced spell check" items. std::unique_ptr spelling_suggestions_menu_observer_; diff --git chrome/browser/ui/views/renderer_context_menu/render_view_context_menu_views.cc chrome/browser/ui/views/renderer_context_menu/render_view_context_menu_views.cc -index f6ff626c408e..b9300419672d 100644 +index feec153dcc146..0959c1020bad9 100644 --- chrome/browser/ui/views/renderer_context_menu/render_view_context_menu_views.cc +++ chrome/browser/ui/views/renderer_context_menu/render_view_context_menu_views.cc @@ -136,6 +136,9 @@ void RenderViewContextMenuViews::RunMenuAt(views::Widget* parent, @@ -110,10 +110,10 @@ index f6ff626c408e..b9300419672d 100644 // that Ctrl+C, Ctrl+V, Ctrl+X, Ctrl-A, etc do what they normally do. switch (command_id) { diff --git components/renderer_context_menu/render_view_context_menu_base.cc components/renderer_context_menu/render_view_context_menu_base.cc -index d8ef3850f0ad..d18382efec7f 100644 +index 62100403d27f0..54182e7d97e3c 100644 --- components/renderer_context_menu/render_view_context_menu_base.cc +++ components/renderer_context_menu/render_view_context_menu_base.cc -@@ -352,6 +352,17 @@ bool RenderViewContextMenuBase::IsCommandIdChecked(int id) const { +@@ -375,6 +375,17 @@ bool RenderViewContextMenuBase::IsCommandIdChecked(int id) const { return false; } @@ -132,10 +132,10 @@ index d8ef3850f0ad..d18382efec7f 100644 command_executed_ = true; RecordUsedItem(id); diff --git components/renderer_context_menu/render_view_context_menu_base.h components/renderer_context_menu/render_view_context_menu_base.h -index 2dca58a6553e..1d139e77da21 100644 +index 52002b190fded..ce3277e9f9350 100644 --- components/renderer_context_menu/render_view_context_menu_base.h +++ components/renderer_context_menu/render_view_context_menu_base.h -@@ -82,6 +82,9 @@ class RenderViewContextMenuBase : public ui::SimpleMenuModel::Delegate, +@@ -81,6 +81,9 @@ class RenderViewContextMenuBase : public ui::SimpleMenuModel::Delegate, const ui::SimpleMenuModel& menu_model() const { return menu_model_; } const content::ContextMenuParams& params() const { return params_; } @@ -145,7 +145,7 @@ index 2dca58a6553e..1d139e77da21 100644 // Returns true if the specified command id is known and valid for // this menu. If the command is known |enabled| is set to indicate -@@ -90,6 +93,9 @@ class RenderViewContextMenuBase : public ui::SimpleMenuModel::Delegate, +@@ -89,6 +92,9 @@ class RenderViewContextMenuBase : public ui::SimpleMenuModel::Delegate, // SimpleMenuModel::Delegate implementation. bool IsCommandIdChecked(int command_id) const override; @@ -176,7 +176,7 @@ index 2dca58a6553e..1d139e77da21 100644 bool IsCustomItemEnabled(int id) const; diff --git components/renderer_context_menu/render_view_context_menu_observer.cc components/renderer_context_menu/render_view_context_menu_observer.cc -index 2e2d05f91c64..85b256b2be9b 100644 +index 2e2d05f91c646..85b256b2be9bd 100644 --- components/renderer_context_menu/render_view_context_menu_observer.cc +++ components/renderer_context_menu/render_view_context_menu_observer.cc @@ -15,3 +15,8 @@ bool RenderViewContextMenuObserver::IsCommandIdChecked(int command_id) { @@ -189,7 +189,7 @@ index 2e2d05f91c64..85b256b2be9b 100644 + return false; +} diff --git components/renderer_context_menu/render_view_context_menu_observer.h components/renderer_context_menu/render_view_context_menu_observer.h -index b360a8eb4e82..6f9023a62904 100644 +index b360a8eb4e820..6f9023a629046 100644 --- components/renderer_context_menu/render_view_context_menu_observer.h +++ components/renderer_context_menu/render_view_context_menu_observer.h @@ -11,6 +11,10 @@ namespace content { diff --git a/patch/patches/chrome_browser_net_export.patch b/patch/patches/chrome_browser_net_export.patch index ae9942eb6..fd16cf2ba 100644 --- a/patch/patches/chrome_browser_net_export.patch +++ b/patch/patches/chrome_browser_net_export.patch @@ -1,5 +1,5 @@ diff --git chrome/browser/ui/BUILD.gn chrome/browser/ui/BUILD.gn -index ea17679df248..fe9280cb59ce 100644 +index 94e40ecd52276..597810f96ba53 100644 --- chrome/browser/ui/BUILD.gn +++ chrome/browser/ui/BUILD.gn @@ -12,6 +12,7 @@ import("//build/config/features.gni") @@ -10,7 +10,7 @@ index ea17679df248..fe9280cb59ce 100644 import("//chrome/browser/buildflags.gni") import("//chrome/common/features.gni") import("//chromeos/assistant/assistant.gni") -@@ -332,6 +333,10 @@ static_library("ui") { +@@ -335,6 +336,10 @@ static_library("ui") { "//build/config/compiler:wexit_time_destructors", ] @@ -21,7 +21,7 @@ index ea17679df248..fe9280cb59ce 100644 # Since browser and browser_ui actually depend on each other, # we must omit the dependency from browser_ui to browser. # However, this means browser_ui and browser should more or less -@@ -355,6 +360,7 @@ static_library("ui") { +@@ -357,6 +362,7 @@ static_library("ui") { "//build:branding_buildflags", "//build:chromeos_buildflags", "//cc/paint", @@ -29,7 +29,7 @@ index ea17679df248..fe9280cb59ce 100644 "//chrome:extra_resources", "//chrome:resources", "//chrome:strings", -@@ -1581,6 +1587,7 @@ static_library("ui") { +@@ -1609,6 +1615,7 @@ static_library("ui") { "//components/page_load_metrics/browser", "//components/performance_manager:site_data_proto", "//components/printing/browser", @@ -37,19 +37,8 @@ index ea17679df248..fe9280cb59ce 100644 "//components/profile_metrics", "//components/reading_list/features:flags", "//components/safe_browsing/core/common:safe_browsing_policy_handler", -@@ -3392,7 +3399,9 @@ static_library("ui") { - "views/frame/browser_desktop_window_tree_host_platform.h", - ] - } -- sources += [ "views/frame/native_browser_frame_factory_ozone.cc" ] -+ if (!use_x11) { -+ sources += [ "views/frame/native_browser_frame_factory_ozone.cc" ] -+ } - } - if (is_linux || is_chromeos_lacros) { - sources += [ diff --git chrome/browser/ui/webui/net_export_ui.cc chrome/browser/ui/webui/net_export_ui.cc -index a23323638a17..7bbfb9964415 100644 +index a12ad7b5e7eb6..9dba0f6642313 100644 --- chrome/browser/ui/webui/net_export_ui.cc +++ chrome/browser/ui/webui/net_export_ui.cc @@ -21,6 +21,7 @@ diff --git a/patch/patches/chrome_browser_profile_menu.patch b/patch/patches/chrome_browser_profile_menu.patch index 8bb8ee2be..3ebdeb545 100644 --- a/patch/patches/chrome_browser_profile_menu.patch +++ b/patch/patches/chrome_browser_profile_menu.patch @@ -1,8 +1,8 @@ diff --git chrome/browser/profiles/profile_window.cc chrome/browser/profiles/profile_window.cc -index 691ac8eea4fd..eda2d1c1f224 100644 +index 69d6f442d1208..46f2be62e0466 100644 --- chrome/browser/profiles/profile_window.cc +++ chrome/browser/profiles/profile_window.cc -@@ -335,7 +335,9 @@ void BubbleViewModeFromAvatarBubbleMode(BrowserWindow::AvatarBubbleMode mode, +@@ -262,7 +262,9 @@ void BubbleViewModeFromAvatarBubbleMode(BrowserWindow::AvatarBubbleMode mode, *bubble_view_mode = BUBBLE_VIEW_MODE_PROFILE_CHOOSER; return; case BrowserWindow::AVATAR_BUBBLE_MODE_DEFAULT: @@ -14,7 +14,7 @@ index 691ac8eea4fd..eda2d1c1f224 100644 : profiles::BUBBLE_VIEW_MODE_PROFILE_CHOOSER; } diff --git chrome/browser/ui/views/profiles/incognito_menu_view.cc chrome/browser/ui/views/profiles/incognito_menu_view.cc -index f8285d1b6ec1..1f526a44a0b6 100644 +index b6ce61c8f4b03..dc5d111325b1f 100644 --- chrome/browser/ui/views/profiles/incognito_menu_view.cc +++ chrome/browser/ui/views/profiles/incognito_menu_view.cc @@ -37,7 +37,9 @@ @@ -29,7 +29,7 @@ index f8285d1b6ec1..1f526a44a0b6 100644 chrome::RecordDialogCreation( diff --git chrome/browser/ui/views/profiles/profile_menu_view_base.cc chrome/browser/ui/views/profiles/profile_menu_view_base.cc -index c35334dea810..e1e9b453462f 100644 +index 319404417dc43..795dccb655e07 100644 --- chrome/browser/ui/views/profiles/profile_menu_view_base.cc +++ chrome/browser/ui/views/profiles/profile_menu_view_base.cc @@ -494,7 +494,9 @@ void ProfileMenuViewBase::ShowBubble( diff --git a/patch/patches/chrome_browser_profiles.patch b/patch/patches/chrome_browser_profiles.patch index 763be1d97..9c7950bd1 100644 --- a/patch/patches/chrome_browser_profiles.patch +++ b/patch/patches/chrome_browser_profiles.patch @@ -1,11 +1,11 @@ diff --git chrome/browser/profiles/off_the_record_profile_impl.cc chrome/browser/profiles/off_the_record_profile_impl.cc -index 6a9d6e152136..8d710c7617df 100644 +index 4e361cfd4ec86..bd156f6b76696 100644 --- chrome/browser/profiles/off_the_record_profile_impl.cc +++ chrome/browser/profiles/off_the_record_profile_impl.cc -@@ -618,7 +618,9 @@ std::unique_ptr Profile::CreateOffTheRecordProfile( +@@ -644,7 +644,9 @@ std::unique_ptr Profile::CreateOffTheRecordProfile( #endif if (!profile) - profile.reset(new OffTheRecordProfileImpl(parent, otr_profile_id)); + profile = std::make_unique(parent, otr_profile_id); - profile->Init(); + // With CEF we want to delay initialization. + if (!otr_profile_id.IsUniqueForCEF()) @@ -14,10 +14,10 @@ index 6a9d6e152136..8d710c7617df 100644 } diff --git chrome/browser/profiles/profile.cc chrome/browser/profiles/profile.cc -index 8e8a7abdcf17..15822ab615eb 100644 +index 94aafe60eb458..ebc3ecc2585a3 100644 --- chrome/browser/profiles/profile.cc +++ chrome/browser/profiles/profile.cc -@@ -77,6 +77,7 @@ base::LazyInstance>::Leaky +@@ -81,6 +81,7 @@ base::LazyInstance>::Leaky namespace { @@ -25,7 +25,7 @@ index 8e8a7abdcf17..15822ab615eb 100644 const char kDevToolsOTRProfileIDPrefix[] = "Devtools::BrowserContext"; const char kMediaRouterOTRProfileIDPrefix[] = "MediaRouter::Presentation"; -@@ -90,6 +91,8 @@ bool Profile::OTRProfileID::AllowsBrowserWindows() const { +@@ -94,6 +95,8 @@ bool Profile::OTRProfileID::AllowsBrowserWindows() const { // DevTools::BrowserContext and MediaRouter::Presentation are an // exception to this ban. return *this == PrimaryID() || @@ -34,8 +34,8 @@ index 8e8a7abdcf17..15822ab615eb 100644 base::StartsWith(profile_id_, kDevToolsOTRProfileIDPrefix, base::CompareCase::SENSITIVE) || base::StartsWith(profile_id_, kMediaRouterOTRProfileIDPrefix, -@@ -111,6 +114,16 @@ Profile::OTRProfileID Profile::OTRProfileID::CreateUnique( - first_unused_index_++)); +@@ -115,6 +118,16 @@ Profile::OTRProfileID Profile::OTRProfileID::CreateUnique( + base::GUID::GenerateRandomV4().AsLowercaseString().c_str())); } +// static @@ -52,10 +52,10 @@ index 8e8a7abdcf17..15822ab615eb 100644 Profile::OTRProfileID Profile::OTRProfileID::CreateUniqueForDevTools() { return CreateUnique(kDevToolsOTRProfileIDPrefix); diff --git chrome/browser/profiles/profile.h chrome/browser/profiles/profile.h -index e77f4b15ce32..3f5d61aeabe5 100644 +index a2b145ece628e..41afec2cfa4cb 100644 --- chrome/browser/profiles/profile.h +++ chrome/browser/profiles/profile.h -@@ -116,6 +116,10 @@ class Profile : public content::BrowserContext { +@@ -120,6 +120,10 @@ class Profile : public content::BrowserContext { // Creates a unique OTR profile id with the given profile id prefix. static OTRProfileID CreateUnique(const std::string& profile_id_prefix); @@ -66,16 +66,16 @@ index e77f4b15ce32..3f5d61aeabe5 100644 // Creates a unique OTR profile id to be used for DevTools browser contexts. static OTRProfileID CreateUniqueForDevTools(); -@@ -523,6 +527,8 @@ class Profile : public content::BrowserContext { - std::vector block_patterns, - base::OnceClosure closure) override; +@@ -524,6 +528,8 @@ class Profile : public content::BrowserContext { + + virtual void RecordMainFrameNavigation() = 0; + void NotifyOffTheRecordProfileCreated(Profile* off_the_record); + protected: void set_is_guest_profile(bool is_guest_profile) { is_guest_profile_ = is_guest_profile; -@@ -542,8 +548,6 @@ class Profile : public content::BrowserContext { +@@ -543,8 +549,6 @@ class Profile : public content::BrowserContext { static PrefStore* CreateExtensionPrefStore(Profile*, bool incognito_pref_store); @@ -85,10 +85,10 @@ index e77f4b15ce32..3f5d61aeabe5 100644 virtual bool IsSignedIn() = 0; diff --git chrome/browser/profiles/profile_impl.cc chrome/browser/profiles/profile_impl.cc -index e33b9cff8827..50b89735481e 100644 +index 14417b3a65486..9f0fc4b5316bc 100644 --- chrome/browser/profiles/profile_impl.cc +++ chrome/browser/profiles/profile_impl.cc -@@ -953,7 +953,9 @@ Profile* ProfileImpl::GetOffTheRecordProfile( +@@ -979,7 +979,9 @@ Profile* ProfileImpl::GetOffTheRecordProfile(const OTRProfileID& otr_profile_id, otr_profiles_[otr_profile_id] = std::move(otr_profile); @@ -100,12 +100,12 @@ index e33b9cff8827..50b89735481e 100644 return raw_otr_profile; } diff --git chrome/browser/profiles/profile_manager.cc chrome/browser/profiles/profile_manager.cc -index 71730949d2bd..eedcde617f01 100644 +index b470744df3fa1..8a4ecc623feab 100644 --- chrome/browser/profiles/profile_manager.cc +++ chrome/browser/profiles/profile_manager.cc -@@ -397,7 +397,7 @@ ProfileManager::ProfileManager(const base::FilePath& user_data_dir) - registrar_.Add(this, chrome::NOTIFICATION_BROWSER_CLOSE_CANCELLED, - content::NotificationService::AllSources()); +@@ -435,7 +435,7 @@ ProfileManager::ProfileManager(const base::FilePath& user_data_dir) + base::Unretained(this))); + #endif - if (ProfileShortcutManager::IsFeatureEnabled() && !user_data_dir_.empty()) + if (!user_data_dir_.empty() && ProfileShortcutManager::IsFeatureEnabled()) @@ -113,10 +113,10 @@ index 71730949d2bd..eedcde617f01 100644 } diff --git chrome/browser/profiles/profile_manager.h chrome/browser/profiles/profile_manager.h -index 743dccc6ddf4..204be4916f14 100644 +index 88ee84697998c..40ba18c66127e 100644 --- chrome/browser/profiles/profile_manager.h +++ chrome/browser/profiles/profile_manager.h -@@ -113,7 +113,7 @@ class ProfileManager : public content::NotificationObserver, +@@ -116,7 +116,7 @@ class ProfileManager : public Profile::Delegate { // acceptable. Returns null if creation of the new profile fails. // TODO(bauerb): Migrate calls from other code to GetProfileByPath(), then // make this method private. @@ -125,7 +125,7 @@ index 743dccc6ddf4..204be4916f14 100644 // Returns regular or off-the-record profile given its profile key. static Profile* GetProfileFromProfileKey(ProfileKey* profile_key); -@@ -146,7 +146,7 @@ class ProfileManager : public content::NotificationObserver, +@@ -150,7 +150,7 @@ class ProfileManager : public Profile::Delegate { // Returns true if the profile pointer is known to point to an existing // profile. @@ -134,17 +134,17 @@ index 743dccc6ddf4..204be4916f14 100644 // Returns the directory where the first created profile is stored, // relative to the user data directory currently in use. -@@ -155,7 +155,7 @@ class ProfileManager : public content::NotificationObserver, - // Get the Profile last used (the Profile to which owns the most recently - // focused window) with this Chrome build. If no signed profile has been +@@ -161,7 +161,7 @@ class ProfileManager : public Profile::Delegate { // stored in Local State, hand back the Default profile. + // TODO(https://crbug.com/1195201): Remove `user_data_dir` parameter since it + // always must match `user_data_dir_` field. - Profile* GetLastUsedProfile(const base::FilePath& user_data_dir); + virtual Profile* GetLastUsedProfile(const base::FilePath& user_data_dir); // Get the path of the last used profile, or if that's undefined, the default // profile. diff --git chrome/browser/profiles/renderer_updater.cc chrome/browser/profiles/renderer_updater.cc -index 04bbd816692b..1af61cacc5cb 100644 +index 8920c217f0b26..f4864793c5a29 100644 --- chrome/browser/profiles/renderer_updater.cc +++ chrome/browser/profiles/renderer_updater.cc @@ -8,6 +8,7 @@ diff --git a/patch/patches/chrome_browser_safe_browsing.patch b/patch/patches/chrome_browser_safe_browsing.patch index 48d65bac9..0d70dc2c1 100644 --- a/patch/patches/chrome_browser_safe_browsing.patch +++ b/patch/patches/chrome_browser_safe_browsing.patch @@ -1,8 +1,8 @@ diff --git chrome/browser/safe_browsing/BUILD.gn chrome/browser/safe_browsing/BUILD.gn -index a940b0d2a09b..328976b55299 100644 +index 825663c0ead5e..2029a401663f1 100644 --- chrome/browser/safe_browsing/BUILD.gn +++ chrome/browser/safe_browsing/BUILD.gn -@@ -26,6 +26,7 @@ static_library("safe_browsing") { +@@ -27,6 +27,7 @@ static_library("safe_browsing") { "//chrome/common:constants", "//components/browser_sync", "//components/enterprise/common:strings", diff --git a/patch/patches/chrome_browser_sharesheet_1123388.patch b/patch/patches/chrome_browser_sharesheet_1123388.patch index c0832f458..43eb4811b 100644 --- a/patch/patches/chrome_browser_sharesheet_1123388.patch +++ b/patch/patches/chrome_browser_sharesheet_1123388.patch @@ -1,5 +1,5 @@ diff --git chrome/browser/sharesheet/sharesheet_service_delegate.cc chrome/browser/sharesheet/sharesheet_service_delegate.cc -index 0b22a38aefb2..c7be7da822f6 100644 +index 3cb0c531e382e..a40b50e060483 100644 --- chrome/browser/sharesheet/sharesheet_service_delegate.cc +++ chrome/browser/sharesheet/sharesheet_service_delegate.cc @@ -19,8 +19,10 @@ SharesheetServiceDelegate::SharesheetServiceDelegate( @@ -13,25 +13,38 @@ index 0b22a38aefb2..c7be7da822f6 100644 sharesheet_service_(sharesheet_service) {} SharesheetServiceDelegate::~SharesheetServiceDelegate() = default; -@@ -36,21 +38,27 @@ void SharesheetServiceDelegate::ShowBubble( +@@ -36,8 +38,10 @@ void SharesheetServiceDelegate::ShowBubble( } return; } +#if defined(OS_CHROMEOS) sharesheet_bubble_view_->ShowBubble(std::move(targets), std::move(intent), - std::move(close_callback)); + std::move(delivered_callback)); +#endif is_bubble_open_ = true; } +@@ -52,15 +56,19 @@ void SharesheetServiceDelegate::ShowNearbyShareBubble( + } + return; + } ++#if defined(OS_CHROMEOS) + sharesheet_bubble_view_->ShowNearbyShareBubble(std::move(intent), + std::move(delivered_callback)); ++#endif + is_bubble_open_ = true; + } + #endif // BUILDFLAG(IS_CHROMEOS_ASH) + void SharesheetServiceDelegate::OnBubbleClosed( - const base::string16& active_action) { + const std::u16string& active_action) { +#if defined(OS_CHROMEOS) sharesheet_bubble_view_.release(); +#endif sharesheet_service_->OnBubbleClosed(native_window_, active_action); // This object is now deleted and nothing can be accessed any more. // Therefore there is no need to set is_bubble_open_ to false. +@@ -82,7 +90,9 @@ bool SharesheetServiceDelegate::OnAcceleratorPressed( } void SharesheetServiceDelegate::OnActionLaunched() { @@ -40,8 +53,8 @@ index 0b22a38aefb2..c7be7da822f6 100644 +#endif } - void SharesheetServiceDelegate::OnTargetSelected( -@@ -74,11 +82,15 @@ void SharesheetServiceDelegate::SetSharesheetSize(const int& width, + const gfx::VectorIcon* SharesheetServiceDelegate::GetVectorIcon( +@@ -102,11 +112,15 @@ void SharesheetServiceDelegate::SetSharesheetSize(const int& width, const int& height) { DCHECK_GT(width, 0); DCHECK_GT(height, 0); @@ -56,15 +69,15 @@ index 0b22a38aefb2..c7be7da822f6 100644 +#endif } - const gfx::VectorIcon* SharesheetServiceDelegate::GetVectorIcon( + } // namespace sharesheet diff --git chrome/browser/sharesheet/sharesheet_service_delegate.h chrome/browser/sharesheet/sharesheet_service_delegate.h -index 164a3a35a3f5..82b8c15820c9 100644 +index cba3392d1057c..b307678693797 100644 --- chrome/browser/sharesheet/sharesheet_service_delegate.h +++ chrome/browser/sharesheet/sharesheet_service_delegate.h -@@ -65,7 +65,9 @@ class SharesheetServiceDelegate : public SharesheetController { +@@ -72,7 +72,9 @@ class SharesheetServiceDelegate : public SharesheetController { gfx::NativeWindow native_window_; - base::string16 active_action_; + std::u16string active_action_; +#if defined(OS_CHROMEOS) std::unique_ptr sharesheet_bubble_view_; +#endif diff --git a/patch/patches/chrome_browser_themes.patch b/patch/patches/chrome_browser_themes.patch index 2a8df4682..9b97db6a4 100644 --- a/patch/patches/chrome_browser_themes.patch +++ b/patch/patches/chrome_browser_themes.patch @@ -1,16 +1,16 @@ diff --git chrome/browser/themes/theme_service.cc chrome/browser/themes/theme_service.cc -index 08cafea4eb1c..e21eff668695 100644 +index e48400619537d..635959d7ba9a7 100644 --- chrome/browser/themes/theme_service.cc +++ chrome/browser/themes/theme_service.cc -@@ -26,6 +26,7 @@ +@@ -27,6 +27,7 @@ #include "base/task/thread_pool.h" #include "base/threading/thread_task_runner_handle.h" #include "build/build_config.h" +#include "cef/libcef/features/runtime.h" - #include "chrome/browser/chrome_notification_types.h" #include "chrome/browser/extensions/extension_service.h" #include "chrome/browser/extensions/theme_installed_infobar_delegate.h" -@@ -55,6 +56,10 @@ + #include "chrome/browser/infobars/infobar_service.h" +@@ -57,6 +58,10 @@ #include "extensions/common/extension_set.h" #include "ui/base/layout.h" @@ -21,7 +21,7 @@ index 08cafea4eb1c..e21eff668695 100644 #if BUILDFLAG(ENABLE_EXTENSIONS) #include "base/scoped_observer.h" #include "extensions/browser/extension_registry_observer.h" -@@ -275,11 +280,19 @@ void ThemeService::Init() { +@@ -280,11 +285,19 @@ void ThemeService::Init() { // OnExtensionServiceReady. Otherwise, the ThemeObserver won't be // constructed in time to observe the corresponding events. #if BUILDFLAG(ENABLE_EXTENSIONS) @@ -39,10 +39,10 @@ index 08cafea4eb1c..e21eff668695 100644 weak_ptr_factory_.GetWeakPtr())); + } #endif - theme_syncable_service_.reset(new ThemeSyncableService(profile_, this)); - + theme_syncable_service_ = + std::make_unique(profile_, this); diff --git chrome/browser/themes/theme_service_factory.cc chrome/browser/themes/theme_service_factory.cc -index 4f82e3d34746..b485befab711 100644 +index dc2350f0b2443..7f4b9283534f3 100644 --- chrome/browser/themes/theme_service_factory.cc +++ chrome/browser/themes/theme_service_factory.cc @@ -7,6 +7,7 @@ diff --git a/patch/patches/chrome_extensions_event_router_3066.patch b/patch/patches/chrome_extensions_event_router_3066.patch deleted file mode 100644 index 8927d55eb..000000000 --- a/patch/patches/chrome_extensions_event_router_3066.patch +++ /dev/null @@ -1,27 +0,0 @@ -diff --git chrome/browser/extensions/event_router_forwarder.cc chrome/browser/extensions/event_router_forwarder.cc -index ba788f3a937f..627ea39e4648 100644 ---- chrome/browser/extensions/event_router_forwarder.cc -+++ chrome/browser/extensions/event_router_forwarder.cc -@@ -100,14 +100,18 @@ void EventRouterForwarder::HandleEvent( - } - } - -- DCHECK_GT(profiles_to_dispatch_to.size(), 0u) -- << "There should always be at least one profile!"; -+ // There should always be at least one profile when running as Chromium. -+ // However, some Chromium embedders are known to run without profiles, in -+ // which case there's nothing to dispatch to. -+ if (profiles_to_dispatch_to.size() == 0u) -+ return; - -+ // Use the same event_args for each profile (making copies as needed). - std::vector> per_profile_args; - per_profile_args.reserve(profiles_to_dispatch_to.size()); -- for (size_t i = 0; i < profiles_to_dispatch_to.size() - 1; ++i) -- per_profile_args.emplace_back(event_args->DeepCopy()); - per_profile_args.emplace_back(std::move(event_args)); -+ for (size_t i = 1; i < profiles_to_dispatch_to.size(); ++i) -+ per_profile_args.emplace_back(per_profile_args.front()->DeepCopy()); - DCHECK_EQ(per_profile_args.size(), profiles_to_dispatch_to.size()); - - size_t profile_args_index = 0; diff --git a/patch/patches/chrome_plugins.patch b/patch/patches/chrome_plugins.patch index 425791199..ed6c5fe5c 100644 --- a/patch/patches/chrome_plugins.patch +++ b/patch/patches/chrome_plugins.patch @@ -1,5 +1,5 @@ diff --git chrome/browser/plugins/plugin_info_host_impl.cc chrome/browser/plugins/plugin_info_host_impl.cc -index 6de814c6ed1e..302d6dcc789a 100644 +index 168f980572c10..ffdc06beb2b77 100644 --- chrome/browser/plugins/plugin_info_host_impl.cc +++ chrome/browser/plugins/plugin_info_host_impl.cc @@ -18,6 +18,7 @@ @@ -32,7 +32,7 @@ index 6de814c6ed1e..302d6dcc789a 100644 extensions::WebViewRendererState* renderer_state = extensions::WebViewRendererState::GetInstance(); std::string partition_id; -@@ -127,9 +136,6 @@ bool IsPluginLoadingAccessibleResourceInWebView( +@@ -127,14 +136,18 @@ bool IsPluginLoadingAccessibleResourceInWebView( PluginInfoHostImpl::Context::Context(int render_process_id, Profile* profile) : render_process_id_(render_process_id), @@ -42,10 +42,8 @@ index 6de814c6ed1e..302d6dcc789a 100644 host_content_settings_map_( HostContentSettingsMapFactory::GetForProfile(profile)), plugin_prefs_(PluginPrefs::GetForProfile(profile)) { -@@ -137,6 +143,13 @@ PluginInfoHostImpl::Context::Context(int render_process_id, Profile* profile) + allow_outdated_plugins_.Init(prefs::kPluginsAllowOutdated, profile->GetPrefs()); - run_all_flash_in_allow_mode_.Init(prefs::kRunAllFlashInAllowMode, - profile->GetPrefs()); + +#if BUILDFLAG(ENABLE_EXTENSIONS) +#if BUILDFLAG(ENABLE_CEF) @@ -56,7 +54,7 @@ index 6de814c6ed1e..302d6dcc789a 100644 } PluginInfoHostImpl::Context::~Context() {} -@@ -218,6 +231,15 @@ void PluginInfoHostImpl::Context::DecidePluginStatus( +@@ -214,6 +227,15 @@ void PluginInfoHostImpl::Context::DecidePluginStatus( PluginMetadata::SecurityStatus security_status, const std::string& plugin_identifier, chrome::mojom::PluginStatus* status) const { @@ -72,7 +70,7 @@ index 6de814c6ed1e..302d6dcc789a 100644 if (security_status == PluginMetadata::SECURITY_STATUS_FULLY_TRUSTED) { *status = chrome::mojom::PluginStatus::kAllowed; return; -@@ -334,17 +356,41 @@ bool PluginInfoHostImpl::Context::FindEnabledPlugin( +@@ -329,17 +351,41 @@ bool PluginInfoHostImpl::Context::FindEnabledPlugin( return false; } @@ -117,7 +115,7 @@ index 6de814c6ed1e..302d6dcc789a 100644 bool enabled = i < matching_plugins.size(); if (!enabled) { diff --git chrome/browser/plugins/plugin_utils.cc chrome/browser/plugins/plugin_utils.cc -index e547d5f00617..831d5794ecde 100644 +index a0b3175223f3e..a1117001ad1fc 100644 --- chrome/browser/plugins/plugin_utils.cc +++ chrome/browser/plugins/plugin_utils.cc @@ -5,6 +5,7 @@ @@ -125,7 +123,7 @@ index e547d5f00617..831d5794ecde 100644 #include "base/values.h" +#include "cef/libcef/features/runtime.h" - #include "chrome/browser/profiles/profile_io_data.h" + #include "chrome/browser/profiles/profile.h" #include "chrome/common/plugin_utils.h" #include "components/content_settings/core/browser/host_content_settings_map.h" @@ -15,6 +16,10 @@ @@ -153,7 +151,7 @@ index e547d5f00617..831d5794ecde 100644 Profile* profile = Profile::FromBrowserContext(browser_context); const std::vector& allowlist = diff --git chrome/common/google_url_loader_throttle.cc chrome/common/google_url_loader_throttle.cc -index 6555dfc37d5c..d54030b6f236 100644 +index 6555dfc37d5ce..d54030b6f2368 100644 --- chrome/common/google_url_loader_throttle.cc +++ chrome/common/google_url_loader_throttle.cc @@ -7,6 +7,7 @@ @@ -188,10 +186,10 @@ index 6555dfc37d5c..d54030b6f236 100644 // that the X-Frame-Options protection mechanism is set to either DENY or // SAMEORIGIN. diff --git chrome/renderer/chrome_content_renderer_client.cc chrome/renderer/chrome_content_renderer_client.cc -index b6fe493a6ddc..bc2f6487044f 100644 +index ceb29f83a9dc1..3f1601ae17931 100644 --- chrome/renderer/chrome_content_renderer_client.cc +++ chrome/renderer/chrome_content_renderer_client.cc -@@ -858,6 +858,7 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin( +@@ -862,6 +862,7 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin( if ((status == chrome::mojom::PluginStatus::kUnauthorized || status == chrome::mojom::PluginStatus::kBlocked) && @@ -199,7 +197,7 @@ index b6fe493a6ddc..bc2f6487044f 100644 content_settings_agent_delegate->IsPluginTemporarilyAllowed( identifier)) { status = chrome::mojom::PluginStatus::kAllowed; -@@ -1053,7 +1054,8 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin( +@@ -1067,7 +1068,8 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin( render_frame->GetRemoteAssociatedInterfaces()->GetInterface( plugin_auth_host.BindNewEndpointAndPassReceiver()); plugin_auth_host->BlockedUnauthorizedPlugin(group_name, identifier); @@ -209,7 +207,7 @@ index b6fe493a6ddc..bc2f6487044f 100644 break; } case chrome::mojom::PluginStatus::kBlocked: { -@@ -1062,7 +1064,8 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin( +@@ -1076,7 +1078,8 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin( l10n_util::GetStringFUTF16(IDS_PLUGIN_BLOCKED, group_name)); placeholder->AllowLoading(); RenderThread::Get()->RecordAction(UserMetricsAction("Plugin_Blocked")); @@ -219,7 +217,7 @@ index b6fe493a6ddc..bc2f6487044f 100644 break; } case chrome::mojom::PluginStatus::kBlockedByPolicy: { -@@ -1072,7 +1075,8 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin( +@@ -1086,7 +1089,8 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin( group_name)); RenderThread::Get()->RecordAction( UserMetricsAction("Plugin_BlockedByPolicy")); @@ -229,7 +227,7 @@ index b6fe493a6ddc..bc2f6487044f 100644 break; } case chrome::mojom::PluginStatus::kBlockedNoLoading: { -@@ -1080,7 +1084,8 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin( +@@ -1094,7 +1098,8 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin( IDR_BLOCKED_PLUGIN_HTML, l10n_util::GetStringFUTF16(IDS_PLUGIN_BLOCKED_NO_LOADING, group_name)); @@ -240,10 +238,10 @@ index b6fe493a6ddc..bc2f6487044f 100644 } } diff --git content/browser/browser_plugin/browser_plugin_guest.h content/browser/browser_plugin/browser_plugin_guest.h -index 06b6875bd37e..13c197b532ad 100644 +index cb6a2dfb9adcf..02f316d646cf7 100644 --- content/browser/browser_plugin/browser_plugin_guest.h +++ content/browser/browser_plugin/browser_plugin_guest.h -@@ -115,6 +115,8 @@ class CONTENT_EXPORT BrowserPluginGuest : public GuestHost, +@@ -116,6 +116,8 @@ class CONTENT_EXPORT BrowserPluginGuest : public GuestHost, gfx::Point GetScreenCoordinates(const gfx::Point& relative_position) const; diff --git a/patch/patches/chrome_pref_watcher.patch b/patch/patches/chrome_pref_watcher.patch index 3a6e261fd..1a435c153 100644 --- a/patch/patches/chrome_pref_watcher.patch +++ b/patch/patches/chrome_pref_watcher.patch @@ -1,5 +1,5 @@ diff --git chrome/browser/ui/prefs/pref_watcher.h chrome/browser/ui/prefs/pref_watcher.h -index 78d5b763970c..de98bd0b325b 100644 +index 78d5b763970c2..de98bd0b325b1 100644 --- chrome/browser/ui/prefs/pref_watcher.h +++ chrome/browser/ui/prefs/pref_watcher.h @@ -29,10 +29,10 @@ class PrefWatcher : public KeyedService { diff --git a/patch/patches/chrome_renderer.patch b/patch/patches/chrome_renderer.patch index 13f3f8330..95f62b365 100644 --- a/patch/patches/chrome_renderer.patch +++ b/patch/patches/chrome_renderer.patch @@ -1,5 +1,5 @@ diff --git chrome/renderer/BUILD.gn chrome/renderer/BUILD.gn -index a69e547cdaa1..5fde8ab27021 100644 +index cd4395923de75..61069e6965057 100644 --- chrome/renderer/BUILD.gn +++ chrome/renderer/BUILD.gn @@ -5,6 +5,7 @@ @@ -10,7 +10,7 @@ index a69e547cdaa1..5fde8ab27021 100644 import("//chrome/common/features.gni") import("//components/nacl/features.gni") import("//components/offline_pages/buildflags/features.gni") -@@ -146,6 +147,7 @@ static_library("renderer") { +@@ -147,6 +148,7 @@ static_library("renderer") { deps = [ "//base/allocator:buildflags", "//build:chromeos_buildflags", @@ -18,7 +18,7 @@ index a69e547cdaa1..5fde8ab27021 100644 "//chrome:resources", "//chrome:strings", "//chrome/common", -@@ -229,6 +231,10 @@ static_library("renderer") { +@@ -233,6 +235,10 @@ static_library("renderer") { configs += [ "//build/config/compiler:wexit_time_destructors" ] diff --git a/patch/patches/chrome_runtime.patch b/patch/patches/chrome_runtime.patch index 0f7764eff..ef766905a 100644 --- a/patch/patches/chrome_runtime.patch +++ b/patch/patches/chrome_runtime.patch @@ -1,5 +1,5 @@ diff --git chrome/app/chrome_main_delegate.cc chrome/app/chrome_main_delegate.cc -index 826ef32f3033..238750f1c2ba 100644 +index 94e871ea16b08..69929718b2704 100644 --- chrome/app/chrome_main_delegate.cc +++ chrome/app/chrome_main_delegate.cc @@ -29,6 +29,7 @@ @@ -19,7 +19,7 @@ index 826ef32f3033..238750f1c2ba 100644 #if defined(OS_WIN) // Reach out to chrome_elf for the truth on the user data directory. // Note that in tests, this links to chrome_elf_test_stubs. -@@ -657,7 +660,9 @@ void ChromeMainDelegate::PostFieldTrialInitialization() { +@@ -662,7 +665,9 @@ void ChromeMainDelegate::PostFieldTrialInitialization() { } #if defined(OS_WIN) @@ -29,7 +29,7 @@ index 826ef32f3033..238750f1c2ba 100644 base::sequence_manager::internal::ThreadControllerPowerMonitor:: InitializeOnMainThread(); #endif -@@ -950,6 +955,7 @@ void ChromeMainDelegate::PreSandboxStartup() { +@@ -955,6 +960,7 @@ void ChromeMainDelegate::PreSandboxStartup() { std::string process_type = command_line.GetSwitchValueASCII(switches::kProcessType); @@ -37,7 +37,7 @@ index 826ef32f3033..238750f1c2ba 100644 crash_reporter::InitializeCrashKeys(); #if defined(OS_POSIX) -@@ -960,6 +966,7 @@ void ChromeMainDelegate::PreSandboxStartup() { +@@ -965,6 +971,7 @@ void ChromeMainDelegate::PreSandboxStartup() { InitMacCrashReporter(command_line, process_type); SetUpInstallerPreferences(command_line); #endif @@ -45,7 +45,7 @@ index 826ef32f3033..238750f1c2ba 100644 #if defined(OS_WIN) child_process_logging::Init(); -@@ -1083,6 +1090,7 @@ void ChromeMainDelegate::PreSandboxStartup() { +@@ -1088,6 +1095,7 @@ void ChromeMainDelegate::PreSandboxStartup() { locale; } @@ -53,7 +53,7 @@ index 826ef32f3033..238750f1c2ba 100644 #if defined(OS_POSIX) && !defined(OS_MAC) // Zygote needs to call InitCrashReporter() in RunZygote(). if (process_type != switches::kZygoteProcess) { -@@ -1115,6 +1123,7 @@ void ChromeMainDelegate::PreSandboxStartup() { +@@ -1120,6 +1128,7 @@ void ChromeMainDelegate::PreSandboxStartup() { // After all the platform Breakpads have been initialized, store the command // line for crash reporting. crash_keys::SetCrashKeysFromCommandLine(command_line); @@ -61,7 +61,7 @@ index 826ef32f3033..238750f1c2ba 100644 #if BUILDFLAG(ENABLE_PDF) MaybeInitializeGDI(); -@@ -1213,6 +1222,7 @@ void ChromeMainDelegate::ZygoteForked() { +@@ -1218,6 +1227,7 @@ void ChromeMainDelegate::ZygoteForked() { SetUpProfilingShutdownHandler(); } @@ -69,7 +69,7 @@ index 826ef32f3033..238750f1c2ba 100644 // Needs to be called after we have chrome::DIR_USER_DATA. BrowserMain sets // this up for the browser process in a different manner. const base::CommandLine* command_line = -@@ -1229,6 +1239,7 @@ void ChromeMainDelegate::ZygoteForked() { +@@ -1234,6 +1244,7 @@ void ChromeMainDelegate::ZygoteForked() { // Reset the command line for the newly spawned process. crash_keys::SetCrashKeysFromCommandLine(*command_line); @@ -78,7 +78,7 @@ index 826ef32f3033..238750f1c2ba 100644 #endif // defined(OS_LINUX) || defined(OS_CHROMEOS) diff --git chrome/browser/chrome_browser_main.cc chrome/browser/chrome_browser_main.cc -index 65465803bd38..b521fd91a93b 100644 +index 86b9a324e5da5..b4e1bfebe1162 100644 --- chrome/browser/chrome_browser_main.cc +++ chrome/browser/chrome_browser_main.cc @@ -49,6 +49,7 @@ @@ -89,35 +89,36 @@ index 65465803bd38..b521fd91a93b 100644 #include "chrome/browser/about_flags.h" #include "chrome/browser/active_use_util.h" #include "chrome/browser/after_startup_task_utils.h" -@@ -900,8 +901,10 @@ int ChromeBrowserMainParts::PreCreateThreadsImpl() { +@@ -896,8 +897,10 @@ int ChromeBrowserMainParts::PreCreateThreadsImpl() { #if !defined(OS_ANDROID) // Create the RunLoop for MainMessageLoopRun() to use, and pass a copy of // its QuitClosure to the BrowserProcessImpl to call when it is time to exit. + // CEF with the Chrome runtime will create and manage its own RunLoop. - DCHECK(!g_run_loop); -- g_run_loop = new base::RunLoop; + DCHECK(!GetMainRunLoopInstance()); +- GetMainRunLoopInstance() = std::make_unique(); + if (!cef::IsChromeRuntimeEnabled()) -+ g_run_loop = new base::RunLoop; ++ GetMainRunLoopInstance() = std::make_unique(); // These members must be initialized before returning from this function. // Android doesn't use StartupBrowserCreator. -@@ -1633,11 +1636,13 @@ int ChromeBrowserMainParts::PreMainMessageLoopRunImpl() { +@@ -1639,11 +1642,14 @@ int ChromeBrowserMainParts::PreMainMessageLoopRunImpl() { // This step is costly and is already measured in // Startup.StartupBrowserCreator_Start. // See the comment above for an explanation of |process_command_line|. -+ // Bypass StartupBrowserCreator with CEF where |g_run_loop| is nullptr. ++ // Bypass StartupBrowserCreator with CEF where |GetMainRunLoopInstance()| is ++ // nullptr. const bool started = -+ !g_run_loop || ++ !GetMainRunLoopInstance() || !process_command_line || browser_creator_->Start(parsed_command_line(), base::FilePath(), profile_, last_opened_profiles); - if (started) { -+ if (started && g_run_loop) { ++ if (started && GetMainRunLoopInstance()) { // TODO(crbug.com/1052397): Revisit the macro expression once build flag switch // of lacros-chrome is complete. #if defined(OS_WIN) || (defined(OS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)) diff --git chrome/browser/chrome_browser_main_mac.mm chrome/browser/chrome_browser_main_mac.mm -index 8a33ce57766c..ca69a37eee22 100644 +index 8a33ce57766c5..ca69a37eee22b 100644 --- chrome/browser/chrome_browser_main_mac.mm +++ chrome/browser/chrome_browser_main_mac.mm @@ -16,6 +16,7 @@ @@ -128,7 +129,7 @@ index 8a33ce57766c..ca69a37eee22 100644 #import "chrome/browser/app_controller_mac.h" #include "chrome/browser/apps/app_shim/app_shim_listener.h" #include "chrome/browser/browser_process.h" -@@ -110,6 +111,7 @@ +@@ -110,6 +111,7 @@ void ChromeBrowserMainPartsMac::PreMainMessageLoopStart() { } } @@ -136,7 +137,7 @@ index 8a33ce57766c..ca69a37eee22 100644 // Create the app delegate. This object is intentionally leaked as a global // singleton. It is accessed through -[NSApp delegate]. AppController* app_controller = [[AppController alloc] init]; -@@ -118,6 +120,7 @@ +@@ -118,6 +120,7 @@ void ChromeBrowserMainPartsMac::PreMainMessageLoopStart() { chrome::BuildMainMenu(NSApp, app_controller, l10n_util::GetStringUTF16(IDS_PRODUCT_NAME), false); [app_controller mainMenuCreated]; @@ -144,7 +145,7 @@ index 8a33ce57766c..ca69a37eee22 100644 PrefService* local_state = g_browser_process->local_state(); DCHECK(local_state); -@@ -170,7 +173,9 @@ +@@ -170,7 +173,9 @@ void ChromeBrowserMainPartsMac::PostProfileInit() { } void ChromeBrowserMainPartsMac::DidEndMainMessageLoop() { @@ -155,7 +156,7 @@ index 8a33ce57766c..ca69a37eee22 100644 +#endif } diff --git chrome/browser/chrome_content_browser_client.cc chrome/browser/chrome_content_browser_client.cc -index 29ba5f21b38f..3ce05420eb78 100644 +index 3f152fd798e8c..19346821464f5 100644 --- chrome/browser/chrome_content_browser_client.cc +++ chrome/browser/chrome_content_browser_client.cc @@ -37,6 +37,7 @@ @@ -166,7 +167,7 @@ index 29ba5f21b38f..3ce05420eb78 100644 #include "chrome/browser/accessibility/accessibility_labels_service.h" #include "chrome/browser/accessibility/accessibility_labels_service_factory.h" #include "chrome/browser/accessibility/caption_util.h" -@@ -3591,9 +3592,11 @@ void ChromeContentBrowserClient::BrowserURLHandlerCreated( +@@ -3643,9 +3644,11 @@ void ChromeContentBrowserClient::BrowserURLHandlerCreated( &search::HandleNewTabURLReverseRewrite); #endif // defined(OS_ANDROID) @@ -179,7 +180,7 @@ index 29ba5f21b38f..3ce05420eb78 100644 base::FilePath ChromeContentBrowserClient::GetDefaultDownloadDirectory() { diff --git chrome/browser/notifications/alert_dispatcher_xpc.mm chrome/browser/notifications/alert_dispatcher_xpc.mm -index d126ddd3a24d..5e8c5ae7c093 100644 +index d126ddd3a24dd..5e8c5ae7c093a 100644 --- chrome/browser/notifications/alert_dispatcher_xpc.mm +++ chrome/browser/notifications/alert_dispatcher_xpc.mm @@ -19,6 +19,7 @@ @@ -190,7 +191,7 @@ index d126ddd3a24d..5e8c5ae7c093 100644 #include "chrome/browser/notifications/notification_platform_bridge_mac_utils.h" #import "chrome/browser/ui/cocoa/notifications/notification_delivery.h" #include "chrome/browser/ui/cocoa/notifications/xpc_mach_port.h" -@@ -180,6 +181,12 @@ - (void)notificationClick:(NSDictionary*)notificationResponseData { +@@ -180,6 +181,12 @@ void RecordXPCEvent(XPCConnectionEvent event) { - (id)serviceProxy { id proxy = [_xpcConnection remoteObjectProxy]; @@ -204,7 +205,7 @@ index d126ddd3a24d..5e8c5ae7c093 100644 base::mac::ScopedMachSendRight exceptionPort( crash_reporter::GetCrashpadClient().GetHandlerMachPort()); diff --git chrome/browser/prefs/browser_prefs.cc chrome/browser/prefs/browser_prefs.cc -index fbfeff04ce25..f5ab9f9bb8cf 100644 +index 7f814486ab674..512dbd488d752 100644 --- chrome/browser/prefs/browser_prefs.cc +++ chrome/browser/prefs/browser_prefs.cc @@ -10,6 +10,7 @@ @@ -215,7 +216,7 @@ index fbfeff04ce25..f5ab9f9bb8cf 100644 #include "chrome/browser/about_flags.h" #include "chrome/browser/accessibility/accessibility_labels_service.h" #include "chrome/browser/accessibility/accessibility_ui.h" -@@ -160,6 +161,10 @@ +@@ -159,6 +160,10 @@ #include "chrome/browser/background/background_mode_manager.h" #endif @@ -226,7 +227,7 @@ index fbfeff04ce25..f5ab9f9bb8cf 100644 #if BUILDFLAG(ENABLE_EXTENSIONS) #include "chrome/browser/accessibility/animation_policy_prefs.h" #include "chrome/browser/apps/platform_apps/shortcut_manager.h" -@@ -959,6 +964,10 @@ void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry, +@@ -974,6 +979,10 @@ void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry, RegisterSessionServiceLogProfilePrefs(registry); #endif diff --git a/patch/patches/chrome_runtime_views.patch b/patch/patches/chrome_runtime_views.patch index 12ac6e28f..a1a94b0d1 100644 --- a/patch/patches/chrome_runtime_views.patch +++ b/patch/patches/chrome_runtime_views.patch @@ -1,5 +1,5 @@ diff --git chrome/browser/ui/browser_command_controller.cc chrome/browser/ui/browser_command_controller.cc -index 8faaa9afc1e6..4dd8937fdc7b 100644 +index b0bde494f7b6f..19b11ac5766d0 100644 --- chrome/browser/ui/browser_command_controller.cc +++ chrome/browser/ui/browser_command_controller.cc @@ -354,8 +354,10 @@ bool BrowserCommandController::ExecuteCommandWithDisposition( @@ -31,10 +31,10 @@ index 8faaa9afc1e6..4dd8937fdc7b 100644 void BrowserCommandController::InitCommandState() { diff --git chrome/browser/ui/views/frame/browser_frame.cc chrome/browser/ui/views/frame/browser_frame.cc -index 7c0229c202ca..67320e907526 100644 +index 5aff6e51d2186..55a95564fb826 100644 --- chrome/browser/ui/views/frame/browser_frame.cc +++ chrome/browser/ui/views/frame/browser_frame.cc -@@ -64,15 +64,23 @@ bool IsUsingGtkTheme(Profile* profile) { +@@ -65,15 +65,23 @@ bool IsUsingGtkTheme(Profile* profile) { //////////////////////////////////////////////////////////////////////////////// // BrowserFrame, public: @@ -60,7 +60,7 @@ index 7c0229c202ca..67320e907526 100644 } BrowserFrame::~BrowserFrame() {} -@@ -131,6 +139,12 @@ gfx::Rect BrowserFrame::GetBoundsForTabStripRegion( +@@ -132,6 +140,12 @@ gfx::Rect BrowserFrame::GetBoundsForTabStripRegion( } int BrowserFrame::GetTopInset() const { @@ -73,7 +73,7 @@ index 7c0229c202ca..67320e907526 100644 return browser_frame_view_->GetTopInset(false); } -@@ -165,15 +179,21 @@ void BrowserFrame::GetWindowPlacement(gfx::Rect* bounds, +@@ -166,15 +180,21 @@ void BrowserFrame::GetWindowPlacement(gfx::Rect* bounds, content::KeyboardEventProcessingResult BrowserFrame::PreHandleKeyboardEvent( const content::NativeWebKeyboardEvent& event) { @@ -95,7 +95,7 @@ index 7c0229c202ca..67320e907526 100644 browser_frame_view_->OnBrowserViewInitViewsComplete(); } -@@ -206,7 +226,8 @@ const ui::ThemeProvider* BrowserFrame::GetThemeProvider() const { +@@ -207,7 +227,8 @@ const ui::ThemeProvider* BrowserFrame::GetThemeProvider() const { } const ui::NativeTheme* BrowserFrame::GetNativeTheme() const { @@ -106,7 +106,7 @@ index 7c0229c202ca..67320e907526 100644 ->UsingDefaultTheme()) { return ui::NativeTheme::GetInstanceForDarkUI(); diff --git chrome/browser/ui/views/frame/browser_frame.h chrome/browser/ui/views/frame/browser_frame.h -index 050c0e05e4e3..0bbcf4af9a92 100644 +index 050c0e05e4e3b..0bbcf4af9a92a 100644 --- chrome/browser/ui/views/frame/browser_frame.h +++ chrome/browser/ui/views/frame/browser_frame.h @@ -53,7 +53,9 @@ enum class TabDragKind { @@ -120,10 +120,10 @@ index 050c0e05e4e3..0bbcf4af9a92 100644 // Initialize the frame (creates the underlying native window). diff --git chrome/browser/ui/views/frame/browser_view.cc chrome/browser/ui/views/frame/browser_view.cc -index 7d93faeadd2c..8208964c4a88 100644 +index 7fc9e5493ca49..9cb598b648194 100644 --- chrome/browser/ui/views/frame/browser_view.cc +++ chrome/browser/ui/views/frame/browser_view.cc -@@ -557,11 +557,22 @@ class BrowserView::AccessibilityModeObserver : public ui::AXModeObserver { +@@ -576,11 +576,22 @@ class BrowserView::AccessibilityModeObserver : public ui::AXModeObserver { /////////////////////////////////////////////////////////////////////////////// // BrowserView, public: @@ -147,7 +147,7 @@ index 7d93faeadd2c..8208964c4a88 100644 SetShowIcon(::ShouldShowWindowIcon(browser_.get())); // In forced app mode, all size controls are always disabled. Otherwise, use -@@ -575,7 +586,6 @@ BrowserView::BrowserView(std::unique_ptr browser) +@@ -594,7 +605,6 @@ BrowserView::BrowserView(std::unique_ptr browser) } browser_->tab_strip_model()->AddObserver(this); @@ -155,7 +155,7 @@ index 7d93faeadd2c..8208964c4a88 100644 // Top container holds tab strip region and toolbar and lives at the front of // the view hierarchy. -@@ -619,8 +629,15 @@ BrowserView::BrowserView(std::unique_ptr browser) +@@ -638,8 +648,15 @@ BrowserView::BrowserView(std::unique_ptr browser) contents_container->SetLayoutManager(std::make_unique( devtools_web_view_, contents_web_view_)); @@ -173,7 +173,7 @@ index 7d93faeadd2c..8208964c4a88 100644 contents_separator_ = top_container_->AddChildView(std::make_unique()); -@@ -1368,6 +1385,8 @@ bool BrowserView::ShouldHideUIForFullscreen() const { +@@ -1407,6 +1424,8 @@ bool BrowserView::ShouldHideUIForFullscreen() const { if (immersive_mode_controller_->IsEnabled()) return false; @@ -182,7 +182,7 @@ index 7d93faeadd2c..8208964c4a88 100644 return frame_->GetFrameView()->ShouldHideTopUIForFullscreen(); } -@@ -2393,7 +2412,8 @@ BrowserView::GetNativeViewHostsForTopControlsSlide() const { +@@ -2427,7 +2446,8 @@ BrowserView::GetNativeViewHostsForTopControlsSlide() const { } void BrowserView::ReparentTopContainerForEndOfImmersive() { @@ -192,7 +192,7 @@ index 7d93faeadd2c..8208964c4a88 100644 top_container()->DestroyLayer(); AddChildViewAt(top_container(), 0); EnsureFocusOrder(); -@@ -2840,8 +2860,10 @@ void BrowserView::Layout() { +@@ -2889,8 +2909,10 @@ void BrowserView::Layout() { // TODO(jamescook): Why was this in the middle of layout code? toolbar_->location_bar()->omnibox_view()->SetFocusBehavior( @@ -205,7 +205,7 @@ index 7d93faeadd2c..8208964c4a88 100644 // Some of the situations when the BrowserView is laid out are: // - Enter/exit immersive fullscreen mode. -@@ -2898,6 +2920,11 @@ void BrowserView::AddedToWidget() { +@@ -2947,6 +2969,11 @@ void BrowserView::AddedToWidget() { SetThemeProfileForWindow(GetNativeWindow(), browser_->profile()); #endif @@ -217,7 +217,7 @@ index 7d93faeadd2c..8208964c4a88 100644 toolbar_->Init(); #if BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_CHROMEOS_LACROS) -@@ -2938,13 +2965,9 @@ void BrowserView::AddedToWidget() { +@@ -2987,13 +3014,9 @@ void BrowserView::AddedToWidget() { EnsureFocusOrder(); @@ -234,10 +234,10 @@ index 7d93faeadd2c..8208964c4a88 100644 MaybeInitializeWebUITabStrip(); diff --git chrome/browser/ui/views/frame/browser_view.h chrome/browser/ui/views/frame/browser_view.h -index e4955ccbb929..51a4133ba8d1 100644 +index 59ddc0ac10f94..d5f04bfd7ca5f 100644 --- chrome/browser/ui/views/frame/browser_view.h +++ chrome/browser/ui/views/frame/browser_view.h -@@ -114,7 +114,9 @@ class BrowserView : public BrowserWindow, +@@ -112,7 +112,9 @@ class BrowserView : public BrowserWindow, public webapps::AppBannerManager::Observer { public: METADATA_HEADER(BrowserView); @@ -247,7 +247,7 @@ index e4955ccbb929..51a4133ba8d1 100644 BrowserView(const BrowserView&) = delete; BrowserView& operator=(const BrowserView&) = delete; ~BrowserView() override; -@@ -617,6 +619,12 @@ class BrowserView : public BrowserWindow, +@@ -624,6 +626,12 @@ class BrowserView : public BrowserWindow, return accessibility_focus_highlight_.get(); } @@ -261,10 +261,10 @@ index e4955ccbb929..51a4133ba8d1 100644 // Do not friend BrowserViewLayout. Use the BrowserViewLayoutDelegate // interface to keep these two classes decoupled and testable. diff --git chrome/browser/ui/views/frame/browser_view_layout.cc chrome/browser/ui/views/frame/browser_view_layout.cc -index 1f790b4d87da..782d132ccac2 100644 +index 56ef53cf379d9..f0f1057896bdb 100644 --- chrome/browser/ui/views/frame/browser_view_layout.cc +++ chrome/browser/ui/views/frame/browser_view_layout.cc -@@ -402,6 +402,12 @@ int BrowserViewLayout::LayoutWebUITabStrip(int top) { +@@ -415,6 +415,12 @@ int BrowserViewLayout::LayoutWebUITabStrip(int top) { int BrowserViewLayout::LayoutToolbar(int top) { TRACE_EVENT0("ui", "BrowserViewLayout::LayoutToolbar"); @@ -278,7 +278,7 @@ index 1f790b4d87da..782d132ccac2 100644 bool toolbar_visible = delegate_->IsToolbarVisible(); int height = toolbar_visible ? toolbar_->GetPreferredSize().height() : 0; diff --git chrome/browser/ui/views/tabs/browser_tab_strip_controller.cc chrome/browser/ui/views/tabs/browser_tab_strip_controller.cc -index 975817e079eb..f77c24d294bc 100644 +index 9220245ea195d..90dd93503b570 100644 --- chrome/browser/ui/views/tabs/browser_tab_strip_controller.cc +++ chrome/browser/ui/views/tabs/browser_tab_strip_controller.cc @@ -571,37 +571,53 @@ gfx::Range BrowserTabStripController::ListTabsInGroup( @@ -336,10 +336,10 @@ index 975817e079eb..f77c24d294bc 100644 } diff --git chrome/browser/ui/views/toolbar/toolbar_view.cc chrome/browser/ui/views/toolbar/toolbar_view.cc -index 54ba2047729f..b288d841f7eb 100644 +index 5f6e182d017d9..be85e6df707d1 100644 --- chrome/browser/ui/views/toolbar/toolbar_view.cc +++ chrome/browser/ui/views/toolbar/toolbar_view.cc -@@ -150,12 +150,13 @@ auto& GetViewCommandMap() { +@@ -156,12 +156,13 @@ auto& GetViewCommandMap() { //////////////////////////////////////////////////////////////////////////////// // ToolbarView, public: @@ -355,8 +355,8 @@ index 54ba2047729f..b288d841f7eb 100644 SetID(VIEW_ID_TOOLBAR); UpgradeDetector::GetInstance()->AddObserver(this); -@@ -181,7 +182,7 @@ ToolbarView::~ToolbarView() { - void ToolbarView::Init() { +@@ -194,7 +195,7 @@ void ToolbarView::Init() { + #endif auto location_bar = std::make_unique( browser_, browser_->profile(), browser_->command_controller(), this, - display_mode_ != DisplayMode::NORMAL); @@ -365,10 +365,10 @@ index 54ba2047729f..b288d841f7eb 100644 size_animation_.Reset(1); diff --git chrome/browser/ui/views/toolbar/toolbar_view.h chrome/browser/ui/views/toolbar/toolbar_view.h -index 0b3492e04542..81e819582cb6 100644 +index 99358217419a6..425a0741b55a3 100644 --- chrome/browser/ui/views/toolbar/toolbar_view.h +++ chrome/browser/ui/views/toolbar/toolbar_view.h -@@ -88,7 +88,8 @@ class ToolbarView : public views::AccessiblePaneView, +@@ -87,7 +87,8 @@ class ToolbarView : public views::AccessiblePaneView, // needs to be displayed. }; diff --git a/patch/patches/chrome_widevine.patch b/patch/patches/chrome_widevine.patch index 6c377c1ce..9e5717716 100644 --- a/patch/patches/chrome_widevine.patch +++ b/patch/patches/chrome_widevine.patch @@ -1,5 +1,5 @@ diff --git third_party/widevine/cdm/BUILD.gn third_party/widevine/cdm/BUILD.gn -index e5009f30f6f5..8190a72bd450 100644 +index e5009f30f6f5a..8190a72bd450b 100644 --- third_party/widevine/cdm/BUILD.gn +++ third_party/widevine/cdm/BUILD.gn @@ -7,6 +7,7 @@ import("//build/config/chrome_build.gni") diff --git a/patch/patches/component_build.patch b/patch/patches/component_build.patch index 8393440d6..ffab43338 100644 --- a/patch/patches/component_build.patch +++ b/patch/patches/component_build.patch @@ -1,5 +1,5 @@ diff --git content/browser/devtools/devtools_instrumentation.h content/browser/devtools/devtools_instrumentation.h -index 572f521ae88c..995d17a90f0d 100644 +index d106889e860ff..af57383e609b8 100644 --- content/browser/devtools/devtools_instrumentation.h +++ content/browser/devtools/devtools_instrumentation.h @@ -12,6 +12,7 @@ @@ -10,7 +10,7 @@ index 572f521ae88c..995d17a90f0d 100644 #include "content/common/navigation_params.mojom.h" #include "content/public/browser/certificate_request_result_type.h" #include "mojo/public/cpp/bindings/pending_receiver.h" -@@ -76,7 +77,7 @@ bool ApplyUserAgentMetadataOverrides( +@@ -81,7 +82,7 @@ bool ApplyUserAgentMetadataOverrides( FrameTreeNode* frame_tree_node, base::Optional* override_out); @@ -20,7 +20,7 @@ index 572f521ae88c..995d17a90f0d 100644 bool is_navigation, bool is_download, diff --git content/browser/renderer_host/input/synthetic_gesture_target_base.h content/browser/renderer_host/input/synthetic_gesture_target_base.h -index eef661b3e095..6c0dacfa4bc3 100644 +index eef661b3e0950..6c0dacfa4bc3a 100644 --- content/browser/renderer_host/input/synthetic_gesture_target_base.h +++ content/browser/renderer_host/input/synthetic_gesture_target_base.h @@ -9,6 +9,7 @@ @@ -42,7 +42,7 @@ index eef661b3e095..6c0dacfa4bc3 100644 explicit SyntheticGestureTargetBase(RenderWidgetHostImpl* host); ~SyntheticGestureTargetBase() override; diff --git content/common/content_switches_internal.h content/common/content_switches_internal.h -index 57072bf1263a..0a93446e4d21 100644 +index 57072bf1263ae..0a93446e4d21c 100644 --- content/common/content_switches_internal.h +++ content/common/content_switches_internal.h @@ -15,7 +15,7 @@ class CommandLine; @@ -55,7 +55,7 @@ index 57072bf1263a..0a93446e4d21 100644 blink::mojom::V8CacheOptions GetV8CacheOptions(); diff --git third_party/blink/renderer/controller/BUILD.gn third_party/blink/renderer/controller/BUILD.gn -index 8ca399274164..d241798f4f28 100644 +index 8003cd409ff37..8ac3fefade6de 100644 --- third_party/blink/renderer/controller/BUILD.gn +++ third_party/blink/renderer/controller/BUILD.gn @@ -29,6 +29,7 @@ component("controller") { @@ -76,7 +76,7 @@ index 8ca399274164..d241798f4f28 100644 if (is_linux || is_chromeos) { diff --git ui/events/keycodes/BUILD.gn ui/events/keycodes/BUILD.gn -index 86bbf620ff0d..6c06b461c6da 100644 +index 86bbf620ff0d9..6c06b461c6da1 100644 --- ui/events/keycodes/BUILD.gn +++ ui/events/keycodes/BUILD.gn @@ -19,6 +19,8 @@ source_set("xkb") { @@ -89,23 +89,23 @@ index 86bbf620ff0d..6c06b461c6da 100644 "//base", "//build:chromeos_buildflags", diff --git ui/events/keycodes/keyboard_code_conversion_xkb.h ui/events/keycodes/keyboard_code_conversion_xkb.h -index a1f9b78704fb..c7d3558251d9 100644 +index 8f56878d4bb42..f0d2457f6a29d 100644 --- ui/events/keycodes/keyboard_code_conversion_xkb.h +++ ui/events/keycodes/keyboard_code_conversion_xkb.h -@@ -9,6 +9,7 @@ +@@ -10,6 +10,7 @@ + #include - #include "base/strings/string16.h" #include "ui/events/keycodes/dom/dom_key.h" +#include "ui/events/keycodes/keycodes_x_export.h" #include "ui/events/keycodes/xkb_keysym.h" namespace ui { -@@ -24,7 +25,7 @@ DomKey NonPrintableXKeySymToDomKey(xkb_keysym_t keysym); - // base::char16 DeadXKeySymToCombiningCharacter(xkb_keysym_t keysym); +@@ -25,7 +26,7 @@ DomKey NonPrintableXKeySymToDomKey(xkb_keysym_t keysym); + // char16_t DeadXKeySymToCombiningCharacter(xkb_keysym_t keysym); // Return the DomKey determined by the XKB layout result (keysym, character). --DomKey XKeySymToDomKey(xkb_keysym_t keysym, base::char16 character); -+KEYCODES_X_EXPORT DomKey XKeySymToDomKey(xkb_keysym_t keysym, base::char16 character); +-DomKey XKeySymToDomKey(xkb_keysym_t keysym, char16_t character); ++KEYCODES_X_EXPORT DomKey XKeySymToDomKey(xkb_keysym_t keysym, char16_t character); } // namespace ui diff --git a/patch/patches/content_2015.patch b/patch/patches/content_2015.patch index 7c00bd271..dbf4e00a1 100644 --- a/patch/patches/content_2015.patch +++ b/patch/patches/content_2015.patch @@ -1,5 +1,5 @@ diff --git chrome/browser/download/download_target_determiner.cc chrome/browser/download/download_target_determiner.cc -index f094105ac70c..b5f4616ff821 100644 +index f094105ac70c8..b5f4616ff821e 100644 --- chrome/browser/download/download_target_determiner.cc +++ chrome/browser/download/download_target_determiner.cc @@ -672,7 +672,7 @@ void IsHandledBySafePlugin(int render_process_id, @@ -12,7 +12,7 @@ index f094105ac70c..b5f4616ff821 100644 if (is_stale && stale_plugin_action == RETRY_IF_STALE_PLUGIN_LIST) { // The GetPlugins call causes the plugin list to be refreshed. Once that's diff --git chrome/browser/plugins/chrome_plugin_service_filter.cc chrome/browser/plugins/chrome_plugin_service_filter.cc -index c2bd9b8c3131..d1283cf3d9b2 100644 +index c2bd9b8c3131e..d1283cf3d9b21 100644 --- chrome/browser/plugins/chrome_plugin_service_filter.cc +++ chrome/browser/plugins/chrome_plugin_service_filter.cc @@ -132,6 +132,7 @@ bool ChromePluginServiceFilter::IsPluginAvailable( @@ -24,7 +24,7 @@ index c2bd9b8c3131..d1283cf3d9b2 100644 content::WebPluginInfo* plugin) { base::AutoLock auto_lock(lock_); diff --git chrome/browser/plugins/chrome_plugin_service_filter.h chrome/browser/plugins/chrome_plugin_service_filter.h -index 937d3d5bc84f..ac327392dcf3 100644 +index 937d3d5bc84fd..ac327392dcf37 100644 --- chrome/browser/plugins/chrome_plugin_service_filter.h +++ chrome/browser/plugins/chrome_plugin_service_filter.h @@ -64,6 +64,7 @@ class ChromePluginServiceFilter : public content::PluginServiceFilter, @@ -36,7 +36,7 @@ index 937d3d5bc84f..ac327392dcf3 100644 content::WebPluginInfo* plugin) override; diff --git chrome/browser/plugins/pdf_iframe_navigation_throttle.cc chrome/browser/plugins/pdf_iframe_navigation_throttle.cc -index d0a5a12620bd..a02e13bbd815 100644 +index d0a5a12620bd3..a02e13bbd8154 100644 --- chrome/browser/plugins/pdf_iframe_navigation_throttle.cc +++ chrome/browser/plugins/pdf_iframe_navigation_throttle.cc @@ -65,7 +65,7 @@ bool IsPDFPluginEnabled(content::NavigationHandle* navigation_handle, @@ -49,7 +49,7 @@ index d0a5a12620bd..a02e13bbd815 100644 false /* allow_wildcard */, is_stale, &plugin_info, nullptr /* actual_mime_type */); diff --git chrome/browser/ui/views/frame/browser_root_view.cc chrome/browser/ui/views/frame/browser_root_view.cc -index c2418d12834a..6705fd4c60b3 100644 +index df02e848472f6..955edd0b7ff1f 100644 --- chrome/browser/ui/views/frame/browser_root_view.cc +++ chrome/browser/ui/views/frame/browser_root_view.cc @@ -81,7 +81,7 @@ void OnFindURLMimeType(const GURL& url, @@ -62,10 +62,10 @@ index c2418d12834a..6705fd4c60b3 100644 #endif diff --git content/browser/devtools/devtools_http_handler.cc content/browser/devtools/devtools_http_handler.cc -index 962bb7e2de76..40fc7e92c7cb 100644 +index 7df791af69af7..6005886106e58 100644 --- content/browser/devtools/devtools_http_handler.cc +++ content/browser/devtools/devtools_http_handler.cc -@@ -570,7 +570,7 @@ void DevToolsHttpHandler::OnJsonRequest( +@@ -574,7 +574,7 @@ void DevToolsHttpHandler::OnJsonRequest( version.SetString("Protocol-Version", DevToolsAgentHost::GetProtocolVersion()); version.SetString("WebKit-Version", GetWebKitVersion()); @@ -75,10 +75,10 @@ index 962bb7e2de76..40fc7e92c7cb 100644 GetContentClient()->browser()->GetUserAgent()); version.SetString("V8-Version", V8_VERSION_STRING); diff --git content/browser/loader/navigation_url_loader_impl.cc content/browser/loader/navigation_url_loader_impl.cc -index 4ff0e88bce7a..abca390b7f82 100644 +index a46dbf3c52abe..2d83757cef53a 100644 --- content/browser/loader/navigation_url_loader_impl.cc +++ content/browser/loader/navigation_url_loader_impl.cc -@@ -628,6 +628,13 @@ NavigationURLLoaderImpl::PrepareForNonInterceptedRequest( +@@ -639,6 +639,13 @@ NavigationURLLoaderImpl::PrepareForNonInterceptedRequest( resource_request_->has_user_gesture, resource_request_->request_initiator, &loader_factory); @@ -92,7 +92,7 @@ index 4ff0e88bce7a..abca390b7f82 100644 if (loader_factory) { factory = base::MakeRefCounted( std::move(loader_factory)); -@@ -831,7 +838,7 @@ void NavigationURLLoaderImpl::CheckPluginAndContinueOnReceiveResponse( +@@ -859,7 +866,7 @@ void NavigationURLLoaderImpl::CheckPluginAndContinueOnReceiveResponse( frame_tree_node->current_frame_host()->GetProcess()->GetID(); int routing_id = frame_tree_node->current_frame_host()->GetRoutingID(); bool has_plugin = PluginService::GetInstance()->GetPluginInfo( @@ -102,10 +102,10 @@ index 4ff0e88bce7a..abca390b7f82 100644 if (stale) { diff --git content/browser/plugin_service_impl.cc content/browser/plugin_service_impl.cc -index 68fe71981ceb..1b9aa078b517 100644 +index 12e48ad8e3e31..1fd51c85ad6fb 100644 --- content/browser/plugin_service_impl.cc +++ content/browser/plugin_service_impl.cc -@@ -266,6 +266,7 @@ bool PluginServiceImpl::GetPluginInfoArray( +@@ -269,6 +269,7 @@ bool PluginServiceImpl::GetPluginInfoArray( bool PluginServiceImpl::GetPluginInfo(int render_process_id, int render_frame_id, const GURL& url, @@ -113,7 +113,7 @@ index 68fe71981ceb..1b9aa078b517 100644 const url::Origin& main_frame_origin, const std::string& mime_type, bool allow_wildcard, -@@ -283,7 +284,8 @@ bool PluginServiceImpl::GetPluginInfo(int render_process_id, +@@ -286,7 +287,8 @@ bool PluginServiceImpl::GetPluginInfo(int render_process_id, for (size_t i = 0; i < plugins.size(); ++i) { if (!filter_ || filter_->IsPluginAvailable(render_process_id, render_frame_id, url, @@ -124,7 +124,7 @@ index 68fe71981ceb..1b9aa078b517 100644 if (actual_mime_type) *actual_mime_type = mime_types[i]; diff --git content/browser/plugin_service_impl.h content/browser/plugin_service_impl.h -index c1d358b1e977..a40d09446c24 100644 +index 3ce3ad55eef18..77674a7224551 100644 --- content/browser/plugin_service_impl.h +++ content/browser/plugin_service_impl.h @@ -54,6 +54,7 @@ class CONTENT_EXPORT PluginServiceImpl : public PluginService { @@ -136,7 +136,7 @@ index c1d358b1e977..a40d09446c24 100644 const std::string& mime_type, bool allow_wildcard, diff --git content/browser/renderer_host/plugin_registry_impl.cc content/browser/renderer_host/plugin_registry_impl.cc -index a6d6188fb139..7ac57de6fd55 100644 +index a6d6188fb1390..7ac57de6fd55a 100644 --- content/browser/renderer_host/plugin_registry_impl.cc +++ content/browser/renderer_host/plugin_registry_impl.cc @@ -29,6 +29,7 @@ void PluginRegistryImpl::Bind( @@ -169,7 +169,7 @@ index a6d6188fb139..7ac57de6fd55 100644 auto plugin_blink = blink::mojom::PluginInfo::New(); plugin_blink->name = plugin.name; diff --git content/browser/renderer_host/plugin_registry_impl.h content/browser/renderer_host/plugin_registry_impl.h -index 632ae86c6fd6..55b749ec1242 100644 +index 632ae86c6fd69..55b749ec12421 100644 --- content/browser/renderer_host/plugin_registry_impl.h +++ content/browser/renderer_host/plugin_registry_impl.h @@ -24,11 +24,13 @@ class PluginRegistryImpl : public blink::mojom::PluginRegistry { @@ -188,10 +188,10 @@ index 632ae86c6fd6..55b749ec1242 100644 const std::vector& all_plugins); diff --git content/browser/renderer_host/render_frame_host_impl.cc content/browser/renderer_host/render_frame_host_impl.cc -index ea74ff6875fd..0c14ce034b96 100644 +index e5b9d4722ff48..e15707aa31976 100644 --- content/browser/renderer_host/render_frame_host_impl.cc +++ content/browser/renderer_host/render_frame_host_impl.cc -@@ -10452,6 +10452,7 @@ void RenderFrameHostImpl::BindHungDetectorHost( +@@ -10749,6 +10749,7 @@ void RenderFrameHostImpl::BindHungDetectorHost( } void RenderFrameHostImpl::GetPluginInfo(const GURL& url, @@ -199,7 +199,7 @@ index ea74ff6875fd..0c14ce034b96 100644 const url::Origin& main_frame_origin, const std::string& mime_type, GetPluginInfoCallback callback) { -@@ -10459,7 +10460,8 @@ void RenderFrameHostImpl::GetPluginInfo(const GURL& url, +@@ -10756,7 +10757,8 @@ void RenderFrameHostImpl::GetPluginInfo(const GURL& url, WebPluginInfo info; std::string actual_mime_type; bool found = PluginServiceImpl::GetInstance()->GetPluginInfo( @@ -210,10 +210,10 @@ index ea74ff6875fd..0c14ce034b96 100644 std::move(callback).Run(found, info, actual_mime_type); } diff --git content/browser/renderer_host/render_frame_host_impl.h content/browser/renderer_host/render_frame_host_impl.h -index 6f7b14d24a4d..8b34229944a8 100644 +index d8d7676dc885c..0cf11c7de7454 100644 --- content/browser/renderer_host/render_frame_host_impl.h +++ content/browser/renderer_host/render_frame_host_impl.h -@@ -2234,6 +2234,7 @@ class CONTENT_EXPORT RenderFrameHostImpl +@@ -2338,6 +2338,7 @@ class CONTENT_EXPORT RenderFrameHostImpl int32_t plugin_child_id, const base::FilePath& path) override; void GetPluginInfo(const GURL& url, @@ -222,7 +222,7 @@ index 6f7b14d24a4d..8b34229944a8 100644 const std::string& mime_type, GetPluginInfoCallback callback) override; diff --git content/common/pepper_plugin.mojom content/common/pepper_plugin.mojom -index a415743ed665..5115a2407a8b 100644 +index a544bfed7ed85..60aad01350c2f 100644 --- content/common/pepper_plugin.mojom +++ content/common/pepper_plugin.mojom @@ -29,6 +29,7 @@ interface PepperHost { @@ -234,7 +234,7 @@ index a415743ed665..5115a2407a8b 100644 string mime_type) => (bool found, diff --git content/public/browser/content_browser_client.cc content/public/browser/content_browser_client.cc -index c8926e0e832d..d50adb22082e 100644 +index 0fadf2a320b0c..8c491e3b48064 100644 --- content/public/browser/content_browser_client.cc +++ content/public/browser/content_browser_client.cc @@ -9,7 +9,7 @@ @@ -247,7 +247,7 @@ index c8926e0e832d..d50adb22082e 100644 #include diff --git content/public/browser/content_browser_client.h content/public/browser/content_browser_client.h -index 3aed911c525b..1ac73a132e3c 100644 +index b031e69e4fe09..8c91423f8c140 100644 --- content/public/browser/content_browser_client.h +++ content/public/browser/content_browser_client.h @@ -32,6 +32,7 @@ @@ -258,7 +258,7 @@ index 3aed911c525b..1ac73a132e3c 100644 #include "content/public/common/page_visibility_state.h" #include "content/public/common/window_container_type.mojom-forward.h" #include "device/vr/buildflags/buildflags.h" -@@ -1731,6 +1732,14 @@ class CONTENT_EXPORT ContentBrowserClient { +@@ -1747,6 +1748,14 @@ class CONTENT_EXPORT ContentBrowserClient { const base::Optional& initiating_origin, mojo::PendingRemote* out_factory); @@ -273,7 +273,7 @@ index 3aed911c525b..1ac73a132e3c 100644 // Creates an OverlayWindow to be used for Picture-in-Picture. This window // will house the content shown when in Picture-in-Picture mode. This will // return a new OverlayWindow. -@@ -1802,6 +1811,10 @@ class CONTENT_EXPORT ContentBrowserClient { +@@ -1820,6 +1829,10 @@ class CONTENT_EXPORT ContentBrowserClient { // Used as part of the user agent string. virtual std::string GetProduct(); @@ -285,10 +285,10 @@ index 3aed911c525b..1ac73a132e3c 100644 virtual std::string GetUserAgent(); diff --git content/public/browser/plugin_service.h content/public/browser/plugin_service.h -index dcfd3ff37186..4e822ee5f750 100644 +index 90fb0fcfa822b..d48e64b1573ca 100644 --- content/public/browser/plugin_service.h +++ content/public/browser/plugin_service.h -@@ -74,6 +74,7 @@ class CONTENT_EXPORT PluginService { +@@ -73,6 +73,7 @@ class CONTENT_EXPORT PluginService { virtual bool GetPluginInfo(int render_process_id, int render_frame_id, const GURL& url, @@ -297,7 +297,7 @@ index dcfd3ff37186..4e822ee5f750 100644 const std::string& mime_type, bool allow_wildcard, diff --git content/public/browser/plugin_service_filter.h content/public/browser/plugin_service_filter.h -index 98c59005599e..69752184745d 100644 +index 98c59005599e4..69752184745d3 100644 --- content/public/browser/plugin_service_filter.h +++ content/public/browser/plugin_service_filter.h @@ -32,6 +32,7 @@ class PluginServiceFilter { @@ -309,10 +309,10 @@ index 98c59005599e..69752184745d 100644 WebPluginInfo* plugin) = 0; diff --git content/public/renderer/content_renderer_client.h content/public/renderer/content_renderer_client.h -index 007e4df297a8..52017e661809 100644 +index f84df6e581606..38e5eeef558b6 100644 --- content/public/renderer/content_renderer_client.h +++ content/public/renderer/content_renderer_client.h -@@ -83,6 +83,9 @@ class CONTENT_EXPORT ContentRendererClient { +@@ -82,6 +82,9 @@ class CONTENT_EXPORT ContentRendererClient { // binding requests from RenderProcessHost::BindReceiver(). virtual void ExposeInterfacesToBrowser(mojo::BinderMap* binders) {} @@ -322,7 +322,7 @@ index 007e4df297a8..52017e661809 100644 // Notifies that a new RenderFrame has been created. virtual void RenderFrameCreated(RenderFrame* render_frame) {} -@@ -299,6 +302,10 @@ class CONTENT_EXPORT ContentRendererClient { +@@ -298,6 +301,10 @@ class CONTENT_EXPORT ContentRendererClient { // This method may invalidate the frame. virtual void RunScriptsAtDocumentIdle(RenderFrame* render_frame) {} @@ -334,10 +334,10 @@ index 007e4df297a8..52017e661809 100644 // started. virtual void SetRuntimeFeaturesDefaultsBeforeBlinkInitialization() {} diff --git content/renderer/render_frame_impl.cc content/renderer/render_frame_impl.cc -index 0c9fc86e80a1..6653b5de4385 100644 +index 580974507f1a3..86a0514c8b558 100644 --- content/renderer/render_frame_impl.cc +++ content/renderer/render_frame_impl.cc -@@ -3564,7 +3564,8 @@ blink::WebPlugin* RenderFrameImpl::CreatePlugin( +@@ -3548,7 +3548,8 @@ blink::WebPlugin* RenderFrameImpl::CreatePlugin( WebPluginInfo info; std::string mime_type; bool found = false; @@ -348,12 +348,12 @@ index 0c9fc86e80a1..6653b5de4385 100644 &mime_type); if (!found) diff --git content/renderer/render_thread_impl.cc content/renderer/render_thread_impl.cc -index ebc8e7006453..51f7d8044925 100644 +index 36365398f8fae..b2d3fa8798563 100644 --- content/renderer/render_thread_impl.cc +++ content/renderer/render_thread_impl.cc -@@ -608,6 +608,8 @@ void RenderThreadImpl::Init() { +@@ -618,6 +618,8 @@ void RenderThreadImpl::Init() { GetContentClient()->renderer()->CreateURLLoaderThrottleProvider( - URLLoaderThrottleProviderType::kFrame); + blink::URLLoaderThrottleProviderType::kFrame); + GetContentClient()->renderer()->RenderThreadConnected(); + @@ -361,10 +361,10 @@ index ebc8e7006453..51f7d8044925 100644 &RenderThreadImpl::OnRendererInterfaceReceiver, base::Unretained(this))); diff --git content/renderer/renderer_blink_platform_impl.cc content/renderer/renderer_blink_platform_impl.cc -index c5974db34669..520536f76c72 100644 +index 7aec578843ce5..f631601f1bb1e 100644 --- content/renderer/renderer_blink_platform_impl.cc +++ content/renderer/renderer_blink_platform_impl.cc -@@ -1026,6 +1026,15 @@ void RendererBlinkPlatformImpl::SetActiveURL(const blink::WebURL& url, +@@ -1022,6 +1022,15 @@ SkBitmap* RendererBlinkPlatformImpl::GetSadPageBitmap() { //------------------------------------------------------------------------------ @@ -381,12 +381,12 @@ index c5974db34669..520536f76c72 100644 if (!code_cache_host_) { code_cache_host_ = mojo::SharedRemote( diff --git content/renderer/renderer_blink_platform_impl.h content/renderer/renderer_blink_platform_impl.h -index bd141ff762ab..857a92a35a84 100644 +index 7a836b82ee155..8e026751ce350 100644 --- content/renderer/renderer_blink_platform_impl.h +++ content/renderer/renderer_blink_platform_impl.h -@@ -219,6 +219,9 @@ class CONTENT_EXPORT RendererBlinkPlatformImpl : public BlinkPlatformImpl { - void SetActiveURL(const blink::WebURL& url, +@@ -220,6 +220,9 @@ class CONTENT_EXPORT RendererBlinkPlatformImpl : public BlinkPlatformImpl { const blink::WebString& top_url) override; + SkBitmap* GetSadPageBitmap() override; + void DevToolsAgentAttached() override; + void DevToolsAgentDetached() override; @@ -395,7 +395,7 @@ index bd141ff762ab..857a92a35a84 100644 // plus eTLD+1, such as https://google.com), or to a more specific origin. void SetIsLockedToSite(); diff --git content/shell/browser/shell_plugin_service_filter.cc content/shell/browser/shell_plugin_service_filter.cc -index 427132c6920e..4809ddaf21e1 100644 +index c25b7d1a18432..7e007d964f1a1 100644 --- content/shell/browser/shell_plugin_service_filter.cc +++ content/shell/browser/shell_plugin_service_filter.cc @@ -17,6 +17,7 @@ bool ShellPluginServiceFilter::IsPluginAvailable( @@ -405,9 +405,9 @@ index 427132c6920e..4809ddaf21e1 100644 + bool is_main_frame, const url::Origin& main_frame_origin, WebPluginInfo* plugin) { - return plugin->name == base::ASCIIToUTF16("Blink Test Plugin") || + return plugin->name == u"Blink Test Plugin" || diff --git content/shell/browser/shell_plugin_service_filter.h content/shell/browser/shell_plugin_service_filter.h -index 337b4b0653fe..107ab4c9d8a8 100644 +index 337b4b0653fe2..107ab4c9d8a85 100644 --- content/shell/browser/shell_plugin_service_filter.h +++ content/shell/browser/shell_plugin_service_filter.h @@ -20,6 +20,7 @@ class ShellPluginServiceFilter : public PluginServiceFilter { @@ -419,7 +419,7 @@ index 337b4b0653fe..107ab4c9d8a8 100644 WebPluginInfo* plugin) override; diff --git content/test/fake_plugin_service.cc content/test/fake_plugin_service.cc -index eb280cd21c6d..b499b2536b2d 100644 +index f816fe5382c7e..7846e2b908675 100644 --- content/test/fake_plugin_service.cc +++ content/test/fake_plugin_service.cc @@ -28,6 +28,7 @@ bool FakePluginService::GetPluginInfoArray( @@ -431,7 +431,7 @@ index eb280cd21c6d..b499b2536b2d 100644 const std::string& mime_type, bool allow_wildcard, diff --git content/test/fake_plugin_service.h content/test/fake_plugin_service.h -index df49da7cbec0..edf526fff7f8 100644 +index e5f53ee41161e..b9d73ebee4ec8 100644 --- content/test/fake_plugin_service.h +++ content/test/fake_plugin_service.h @@ -29,6 +29,7 @@ class FakePluginService : public PluginService { diff --git a/patch/patches/content_main_654986.patch b/patch/patches/content_main_654986.patch index 640600117..1286b94ef 100644 --- a/patch/patches/content_main_654986.patch +++ b/patch/patches/content_main_654986.patch @@ -1,5 +1,5 @@ diff --git content/app/content_main.cc content/app/content_main.cc -index 2aba28d210db..00edc202e2c4 100644 +index 2aba28d210db9..00edc202e2c46 100644 --- content/app/content_main.cc +++ content/app/content_main.cc @@ -205,15 +205,10 @@ void InitializeMojo(mojo::core::Configuration* config) { @@ -111,7 +111,7 @@ index 2aba28d210db..00edc202e2c4 100644 return RunContentProcess(params, runner.get()); } diff --git content/app/content_main_runner_impl.cc content/app/content_main_runner_impl.cc -index 7873fad0a61b..425c30a56699 100644 +index 81e48e33cad43..84eabf287b0e9 100644 --- content/app/content_main_runner_impl.cc +++ content/app/content_main_runner_impl.cc @@ -44,6 +44,7 @@ @@ -122,7 +122,7 @@ index 7873fad0a61b..425c30a56699 100644 #include "base/time/time.h" #include "base/trace_event/trace_event.h" #include "build/build_config.h" -@@ -1092,6 +1093,11 @@ void ContentMainRunnerImpl::Shutdown() { +@@ -1111,6 +1112,11 @@ void ContentMainRunnerImpl::Shutdown() { is_shutdown_ = true; } @@ -135,7 +135,7 @@ index 7873fad0a61b..425c30a56699 100644 std::unique_ptr ContentMainRunner::Create() { return ContentMainRunnerImpl::Create(); diff --git content/app/content_main_runner_impl.h content/app/content_main_runner_impl.h -index 86c624e53cf9..090171f7db22 100644 +index 86c624e53cf99..090171f7db228 100644 --- content/app/content_main_runner_impl.h +++ content/app/content_main_runner_impl.h @@ -39,7 +39,7 @@ class ContentMainDelegate; @@ -157,7 +157,7 @@ index 86c624e53cf9..090171f7db22 100644 int RunBrowser(MainFunctionParams& main_function_params, bool start_minimal_browser); diff --git content/common/set_process_title.cc content/common/set_process_title.cc -index 8b829a488773..a69a08869728 100644 +index 8b829a4887739..a69a088697287 100644 --- content/common/set_process_title.cc +++ content/common/set_process_title.cc @@ -54,7 +54,7 @@ void SetProcessTitleFromCommandLine(const char** main_argv) { @@ -170,7 +170,7 @@ index 8b829a488773..a69a08869728 100644 if (main_argv) setproctitle_init(main_argv); diff --git content/public/app/content_main.h content/public/app/content_main.h -index 97aac3d0c758..fc795ae0287f 100644 +index 97aac3d0c7584..fc795ae0287f9 100644 --- content/public/app/content_main.h +++ content/public/app/content_main.h @@ -68,7 +68,16 @@ struct ContentMainParams { diff --git a/patch/patches/crashpad_1995.patch b/patch/patches/crashpad_1995.patch index 399b40c87..0523bf80d 100644 --- a/patch/patches/crashpad_1995.patch +++ b/patch/patches/crashpad_1995.patch @@ -1,5 +1,5 @@ diff --git chrome/chrome_elf/BUILD.gn chrome/chrome_elf/BUILD.gn -index 9b08e23e921b..49182504ae36 100644 +index 9b08e23e921b0..49182504ae361 100644 --- chrome/chrome_elf/BUILD.gn +++ chrome/chrome_elf/BUILD.gn @@ -7,6 +7,7 @@ @@ -47,7 +47,7 @@ index 9b08e23e921b..49182504ae36 100644 source_set("dll_hash") { diff --git chrome/chrome_elf/crash/crash_helper.cc chrome/chrome_elf/crash/crash_helper.cc -index 886372e11489..ad3bc2242883 100644 +index 886372e114899..ad3bc2242883b 100644 --- chrome/chrome_elf/crash/crash_helper.cc +++ chrome/chrome_elf/crash/crash_helper.cc @@ -11,12 +11,17 @@ @@ -81,7 +81,7 @@ index 886372e11489..ad3bc2242883 100644 g_crash_helper_enabled = true; return true; diff --git chrome/common/crash_keys.cc chrome/common/crash_keys.cc -index b84f727c9dc6..817df167e5a6 100644 +index b84f727c9dc64..817df167e5a6b 100644 --- chrome/common/crash_keys.cc +++ chrome/common/crash_keys.cc @@ -4,6 +4,8 @@ @@ -112,7 +112,7 @@ index b84f727c9dc6..817df167e5a6 100644 void SetActiveExtensions(const std::set& extensions) { diff --git chrome/common/crash_keys.h chrome/common/crash_keys.h -index bcf172e645a2..f879aa745adf 100644 +index bcf172e645a23..f879aa745adfc 100644 --- chrome/common/crash_keys.h +++ chrome/common/crash_keys.h @@ -17,6 +17,10 @@ class CommandLine; @@ -127,7 +127,7 @@ index bcf172e645a2..f879aa745adf 100644 // on the given |command_line|. void SetCrashKeysFromCommandLine(const base::CommandLine& command_line); diff --git components/crash/core/app/breakpad_linux.cc components/crash/core/app/breakpad_linux.cc -index 9e850c0380b8..559d93010edf 100644 +index 00009dacdc2b0..e6454d5b1a23d 100644 --- components/crash/core/app/breakpad_linux.cc +++ components/crash/core/app/breakpad_linux.cc @@ -28,6 +28,7 @@ @@ -138,7 +138,7 @@ index 9e850c0380b8..559d93010edf 100644 #include "base/files/file_path.h" #include "base/lazy_instance.h" #include "base/linux_util.h" -@@ -719,7 +720,7 @@ bool CrashDone(const MinidumpDescriptor& minidump, +@@ -720,7 +721,7 @@ bool CrashDone(const MinidumpDescriptor& minidump, info.process_type_length = 7; info.distro = base::g_linux_distro; info.distro_length = my_strlen(base::g_linux_distro); @@ -147,7 +147,7 @@ index 9e850c0380b8..559d93010edf 100644 info.process_start_time = g_process_start_time; info.oom_size = base::g_oom_size; info.pid = g_pid; -@@ -1733,10 +1734,27 @@ void HandleCrashDump(const BreakpadInfo& info) { +@@ -1734,10 +1735,27 @@ void HandleCrashDump(const BreakpadInfo& info) { GetCrashReporterClient()->GetProductNameAndVersion(&product_name, &version); writer.AddBoundary(); @@ -177,7 +177,7 @@ index 9e850c0380b8..559d93010edf 100644 if (info.pid > 0) { char pid_value_buf[kUint64StringSize]; uint64_t pid_value_len = my_uint64_len(info.pid); -@@ -1853,6 +1871,9 @@ void HandleCrashDump(const BreakpadInfo& info) { +@@ -1854,6 +1872,9 @@ void HandleCrashDump(const BreakpadInfo& info) { crash_reporter::internal::TransitionalCrashKeyStorage; CrashKeyStorage::Iterator crash_key_iterator(*info.crash_keys); const CrashKeyStorage::Entry* entry; @@ -187,7 +187,7 @@ index 9e850c0380b8..559d93010edf 100644 while ((entry = crash_key_iterator.Next())) { size_t key_size, value_size; // Check for malformed messages. -@@ -1863,7 +1884,13 @@ void HandleCrashDump(const BreakpadInfo& info) { +@@ -1864,7 +1885,13 @@ void HandleCrashDump(const BreakpadInfo& info) { ? CrashKeyStorage::value_size - 1 : my_strlen(entry->value); @@ -203,7 +203,7 @@ index 9e850c0380b8..559d93010edf 100644 writer.Flush(); } diff --git components/crash/core/app/breakpad_linux.h components/crash/core/app/breakpad_linux.h -index 9ea80370a842..3043f7d32f33 100644 +index 9ea80370a842c..3043f7d32f33d 100644 --- components/crash/core/app/breakpad_linux.h +++ components/crash/core/app/breakpad_linux.h @@ -20,6 +20,9 @@ extern void InitCrashReporter(const std::string& process_type); @@ -217,7 +217,7 @@ index 9ea80370a842..3043f7d32f33 100644 extern void InitCrashKeysForTesting(); diff --git components/crash/core/app/crash_reporter_client.cc components/crash/core/app/crash_reporter_client.cc -index 89b4bfccd5d3..7cb0a85470d2 100644 +index 89b4bfccd5d32..7cb0a85470d2f 100644 --- components/crash/core/app/crash_reporter_client.cc +++ components/crash/core/app/crash_reporter_client.cc @@ -87,7 +87,7 @@ int CrashReporterClient::GetResultCodeRespawnFailed() { @@ -290,7 +290,7 @@ index 89b4bfccd5d3..7cb0a85470d2 100644 } // namespace crash_reporter diff --git components/crash/core/app/crash_reporter_client.h components/crash/core/app/crash_reporter_client.h -index 39557cce4744..236806090021 100644 +index 39557cce47443..236806090021a 100644 --- components/crash/core/app/crash_reporter_client.h +++ components/crash/core/app/crash_reporter_client.h @@ -5,7 +5,9 @@ @@ -357,7 +357,7 @@ index 39557cce4744..236806090021 100644 } // namespace crash_reporter diff --git components/crash/core/app/crashpad.cc components/crash/core/app/crashpad.cc -index 5117ded1e214..0d86e0363315 100644 +index 27f5504d544a3..fd901ccd5b759 100644 --- components/crash/core/app/crashpad.cc +++ components/crash/core/app/crashpad.cc @@ -152,7 +152,8 @@ void InitializeCrashpadImpl(bool initial_client, @@ -371,7 +371,7 @@ index 5117ded1e214..0d86e0363315 100644 ->set_system_crash_reporter_forwarding(crashpad::TriState::kDisabled); } diff --git components/crash/core/app/crashpad_mac.mm components/crash/core/app/crashpad_mac.mm -index eb675321436a..9f95323b9b35 100644 +index 2be2fd857bc5f..04ebef6442af2 100644 --- components/crash/core/app/crashpad_mac.mm +++ components/crash/core/app/crashpad_mac.mm @@ -16,12 +16,15 @@ @@ -420,8 +420,8 @@ index eb675321436a..9f95323b9b35 100644 #if BUILDFLAG(GOOGLE_CHROME_BRANDING) // Empty means stable. -@@ -68,12 +81,20 @@ std::map GetProcessSimpleAnnotations() { - process_annotations["channel"] = base::SysNSStringToUTF8(channel); +@@ -77,12 +90,20 @@ std::map GetProcessSimpleAnnotations() { + } } - NSString* version = @@ -446,7 +446,7 @@ index eb675321436a..9f95323b9b35 100644 } // @autoreleasepool return process_annotations; }(); -@@ -133,10 +154,10 @@ base::FilePath PlatformCrashpadInitialization( +@@ -142,10 +163,10 @@ base::FilePath PlatformCrashpadInitialization( if (initial_client) { @autoreleasepool { @@ -461,7 +461,7 @@ index eb675321436a..9f95323b9b35 100644 // Is there a way to recover if this fails? CrashReporterClient* crash_reporter_client = GetCrashReporterClient(); -@@ -165,6 +186,12 @@ base::FilePath PlatformCrashpadInitialization( +@@ -174,6 +195,12 @@ base::FilePath PlatformCrashpadInitialization( "--reset-own-crash-exception-port-to-system-default"); } @@ -475,7 +475,7 @@ index eb675321436a..9f95323b9b35 100644 handler_path, database_path, metrics_path, url, GetProcessSimpleAnnotations(), arguments, true, false); diff --git components/crash/core/app/crashpad_win.cc components/crash/core/app/crashpad_win.cc -index c66a6dfc6f5d..0a612b0afaa6 100644 +index 686be7964d77d..6059aab2b69a7 100644 --- components/crash/core/app/crashpad_win.cc +++ components/crash/core/app/crashpad_win.cc @@ -36,8 +36,8 @@ void GetPlatformCrashpadAnnotations( @@ -489,7 +489,7 @@ index c66a6dfc6f5d..0a612b0afaa6 100644 #if BUILDFLAG(GOOGLE_CHROME_BRANDING) // Empty means stable. const bool allow_empty_channel = true; -@@ -49,9 +49,11 @@ void GetPlatformCrashpadAnnotations( +@@ -54,9 +54,11 @@ void GetPlatformCrashpadAnnotations( if (!special_build.empty()) (*annotations)["special"] = base::WideToUTF8(special_build); #if defined(ARCH_CPU_X86) @@ -503,7 +503,7 @@ index c66a6dfc6f5d..0a612b0afaa6 100644 #endif } -@@ -66,7 +68,9 @@ base::FilePath PlatformCrashpadInitialization( +@@ -71,7 +73,9 @@ base::FilePath PlatformCrashpadInitialization( base::FilePath metrics_path; // Only valid in the browser process. const char kPipeNameVar[] = "CHROME_CRASHPAD_PIPE_NAME"; @@ -513,7 +513,7 @@ index c66a6dfc6f5d..0a612b0afaa6 100644 std::unique_ptr env(base::Environment::Create()); CrashReporterClient* crash_reporter_client = GetCrashReporterClient(); -@@ -87,9 +91,11 @@ base::FilePath PlatformCrashpadInitialization( +@@ -92,9 +96,11 @@ base::FilePath PlatformCrashpadInitialization( std::string url = crash_reporter_client->GetUploadUrl(); @@ -525,7 +525,7 @@ index c66a6dfc6f5d..0a612b0afaa6 100644 base::FilePath exe_file(exe_path); if (exe_file.empty()) { -@@ -100,13 +106,14 @@ base::FilePath PlatformCrashpadInitialization( +@@ -105,13 +111,14 @@ base::FilePath PlatformCrashpadInitialization( exe_file = base::FilePath(exe_file_path); } @@ -545,7 +545,7 @@ index c66a6dfc6f5d..0a612b0afaa6 100644 if (!user_data_dir.empty()) { start_arguments.push_back(std::string("--user-data-dir=") + user_data_dir); -@@ -117,9 +124,12 @@ base::FilePath PlatformCrashpadInitialization( +@@ -122,9 +129,12 @@ base::FilePath PlatformCrashpadInitialization( start_arguments.push_back("/prefetch:7"); } else { base::FilePath exe_dir = exe_file.DirName(); diff --git a/patch/patches/crashpad_tp_1995.patch b/patch/patches/crashpad_tp_1995.patch index 094aa2843..a4cab606f 100644 --- a/patch/patches/crashpad_tp_1995.patch +++ b/patch/patches/crashpad_tp_1995.patch @@ -1,5 +1,5 @@ diff --git third_party/crashpad/crashpad/client/prune_crash_reports.cc third_party/crashpad/crashpad/client/prune_crash_reports.cc -index 492d466239d1..a1df635870ed 100644 +index 492d466239d1a..a1df635870ede 100644 --- third_party/crashpad/crashpad/client/prune_crash_reports.cc +++ third_party/crashpad/crashpad/client/prune_crash_reports.cc @@ -73,13 +73,19 @@ size_t PruneCrashReportDatabase(CrashReportDatabase* database, @@ -26,7 +26,7 @@ index 492d466239d1..a1df635870ed 100644 static const time_t kSecondsInDay = 60 * 60 * 24; diff --git third_party/crashpad/crashpad/client/prune_crash_reports.h third_party/crashpad/crashpad/client/prune_crash_reports.h -index 07a70980f12a..ddf7f17325fe 100644 +index 07a70980f12af..ddf7f17325fed 100644 --- third_party/crashpad/crashpad/client/prune_crash_reports.h +++ third_party/crashpad/crashpad/client/prune_crash_reports.h @@ -59,7 +59,8 @@ class PruneCondition { @@ -40,7 +40,7 @@ index 07a70980f12a..ddf7f17325fe 100644 virtual ~PruneCondition() {} diff --git third_party/crashpad/crashpad/client/settings.cc third_party/crashpad/crashpad/client/settings.cc -index 0aa525f1b4c0..2ddb73e7dd0c 100644 +index 0aa525f1b4c00..2ddb73e7dd0cb 100644 --- third_party/crashpad/crashpad/client/settings.cc +++ third_party/crashpad/crashpad/client/settings.cc @@ -86,7 +86,7 @@ void ScopedLockedFileHandleTraits::Free(FileHandle handle) { @@ -130,7 +130,7 @@ index 0aa525f1b4c0..2ddb73e7dd0c 100644 Settings::ScopedLockedFileHandle Settings::MakeScopedLockedFileHandle( FileHandle file, diff --git third_party/crashpad/crashpad/client/settings.h third_party/crashpad/crashpad/client/settings.h -index 5761c6b965b5..aee4e6c96033 100644 +index 5761c6b965b5c..aee4e6c96033e 100644 --- third_party/crashpad/crashpad/client/settings.h +++ third_party/crashpad/crashpad/client/settings.h @@ -115,6 +115,11 @@ class Settings { @@ -146,7 +146,7 @@ index 5761c6b965b5..aee4e6c96033 100644 struct Data; diff --git third_party/crashpad/crashpad/handler/BUILD.gn third_party/crashpad/crashpad/handler/BUILD.gn -index 1d5951e8fc00..599dde825883 100644 +index 1d5951e8fc00c..599dde825883e 100644 --- third_party/crashpad/crashpad/handler/BUILD.gn +++ third_party/crashpad/crashpad/handler/BUILD.gn @@ -12,6 +12,7 @@ @@ -184,7 +184,7 @@ index 1d5951e8fc00..599dde825883 100644 if (crashpad_is_win) { diff --git third_party/crashpad/crashpad/handler/crash_report_upload_thread.cc third_party/crashpad/crashpad/handler/crash_report_upload_thread.cc -index 1e5f12374ce1..d227dea8649c 100644 +index b7e445fd9f3ed..c5f1a3c3ceee7 100644 --- third_party/crashpad/crashpad/handler/crash_report_upload_thread.cc +++ third_party/crashpad/crashpad/handler/crash_report_upload_thread.cc @@ -263,6 +263,8 @@ CrashReportUploadThread::UploadResult CrashReportUploadThread::UploadReport( @@ -197,7 +197,7 @@ index 1e5f12374ce1..d227dea8649c 100644 if (!reader->SeekSet(start_offset)) { diff --git third_party/crashpad/crashpad/handler/crash_report_upload_thread.h third_party/crashpad/crashpad/handler/crash_report_upload_thread.h -index 2ec1147d2620..8ff9a72e0bd7 100644 +index 2ec1147d2620d..8ff9a72e0bd79 100644 --- third_party/crashpad/crashpad/handler/crash_report_upload_thread.h +++ third_party/crashpad/crashpad/handler/crash_report_upload_thread.h @@ -15,6 +15,7 @@ @@ -248,7 +248,7 @@ index 2ec1147d2620..8ff9a72e0bd7 100644 //! \brief Calls ProcessPendingReports() in response to ReportPending() having //! been called on any thread, as well as periodically on a timer. diff --git third_party/crashpad/crashpad/handler/handler_main.cc third_party/crashpad/crashpad/handler/handler_main.cc -index 737ee4e09f67..f5a8727f7e6b 100644 +index 737ee4e09f676..f5a8727f7e6b1 100644 --- third_party/crashpad/crashpad/handler/handler_main.cc +++ third_party/crashpad/crashpad/handler/handler_main.cc @@ -39,6 +39,7 @@ diff --git a/patch/patches/embedder_product_override.patch b/patch/patches/embedder_product_override.patch index 8f5676d68..f6b4b3844 100644 --- a/patch/patches/embedder_product_override.patch +++ b/patch/patches/embedder_product_override.patch @@ -1,5 +1,5 @@ diff --git components/embedder_support/user_agent_utils.cc components/embedder_support/user_agent_utils.cc -index cf596ae9aae8..7c1869000cf3 100644 +index 569518f209aeb..a4944e7060570 100644 --- components/embedder_support/user_agent_utils.cc +++ components/embedder_support/user_agent_utils.cc @@ -7,6 +7,7 @@ diff --git a/patch/patches/extensions_1947.patch b/patch/patches/extensions_1947.patch index 5a42564a8..a211b44f7 100644 --- a/patch/patches/extensions_1947.patch +++ b/patch/patches/extensions_1947.patch @@ -1,5 +1,5 @@ diff --git chrome/browser/extensions/api/streams_private/streams_private_api.cc chrome/browser/extensions/api/streams_private/streams_private_api.cc -index 5c903a13a14e..d385c6c0c95c 100644 +index 5c903a13a14ed..d385c6c0c95c4 100644 --- chrome/browser/extensions/api/streams_private/streams_private_api.cc +++ chrome/browser/extensions/api/streams_private/streams_private_api.cc @@ -6,6 +6,7 @@ @@ -27,13 +27,13 @@ index 5c903a13a14e..d385c6c0c95c 100644 auto* browser_context = web_contents->GetBrowserContext(); diff --git extensions/browser/extension_host.cc extensions/browser/extension_host.cc -index b4878f7497df..8a87d04740b7 100644 +index 231a3b6c8ce1d..14776d981f506 100644 --- extensions/browser/extension_host.cc +++ extensions/browser/extension_host.cc -@@ -61,11 +61,12 @@ ExtensionHost::ExtensionHost(const Extension* extension, - DCHECK(host_type == VIEW_TYPE_EXTENSION_BACKGROUND_PAGE || - host_type == VIEW_TYPE_EXTENSION_DIALOG || - host_type == VIEW_TYPE_EXTENSION_POPUP); +@@ -63,11 +63,12 @@ ExtensionHost::ExtensionHost(const Extension* extension, + DCHECK(host_type == mojom::ViewType::kExtensionBackgroundPage || + host_type == mojom::ViewType::kExtensionDialog || + host_type == mojom::ViewType::kExtensionPopup); - host_contents_ = WebContents::Create( + host_contents_owned_ = WebContents::Create( WebContents::CreateParams(browser_context_, site_instance)), @@ -46,7 +46,7 @@ index b4878f7497df..8a87d04740b7 100644 main_frame_host_ = host_contents_->GetMainFrame(); // Listen for when an extension is unloaded from the same profile, as it may -@@ -79,6 +80,44 @@ ExtensionHost::ExtensionHost(const Extension* extension, +@@ -81,6 +82,44 @@ ExtensionHost::ExtensionHost(const Extension* extension, dispatcher()->set_delegate(this); } @@ -55,7 +55,7 @@ index b4878f7497df..8a87d04740b7 100644 + content::BrowserContext* browser_context, + content::WebContents* host_contents, + const GURL& url, -+ ViewType host_type) ++ mojom::ViewType host_type) + : delegate_(delegate), + extension_(extension), + extension_id_(extension->id()), @@ -68,9 +68,9 @@ index b4878f7497df..8a87d04740b7 100644 + DCHECK(host_contents); + + // Not used for panels, see PanelHost. -+ DCHECK(host_type == VIEW_TYPE_EXTENSION_BACKGROUND_PAGE || -+ host_type == VIEW_TYPE_EXTENSION_DIALOG || -+ host_type == VIEW_TYPE_EXTENSION_POPUP); ++ DCHECK(host_type == mojom::ViewType::kExtensionBackgroundPage || ++ host_type == mojom::ViewType::kExtensionDialog || ++ host_type == mojom::ViewType::kExtensionPopup); + + content::WebContentsObserver::Observe(host_contents_); + SetViewType(host_contents_, host_type); @@ -92,19 +92,19 @@ index b4878f7497df..8a87d04740b7 100644 ExtensionRegistry::Get(browser_context_)->RemoveObserver(this); diff --git extensions/browser/extension_host.h extensions/browser/extension_host.h -index 59798a628937..2018abb8324b 100644 +index 305726557f2ea..caa4b798a013e 100644 --- extensions/browser/extension_host.h +++ extensions/browser/extension_host.h -@@ -52,13 +52,19 @@ class ExtensionHost : public DeferredStartRenderHost, - ExtensionHost(const Extension* extension, +@@ -53,13 +53,19 @@ class ExtensionHost : public DeferredStartRenderHost, content::SiteInstance* site_instance, - const GURL& url, ViewType host_type); + const GURL& url, + mojom::ViewType host_type); + ExtensionHost(ExtensionHostDelegate* delegate, + const Extension* extension, + content::BrowserContext* browser_context, + content::WebContents* host_contents, + const GURL& url, -+ ViewType host_type); ++ mojom::ViewType host_type); ~ExtensionHost() override; // This may be null if the extension has been or is being unloaded. @@ -116,7 +116,7 @@ index 59798a628937..2018abb8324b 100644 content::RenderFrameHost* main_frame_host() const { return main_frame_host_; } content::RenderProcessHost* render_process_host() const; bool has_loaded_once() const { return has_loaded_once_; } -@@ -180,7 +186,8 @@ class ExtensionHost : public DeferredStartRenderHost, +@@ -182,7 +188,8 @@ class ExtensionHost : public DeferredStartRenderHost, content::BrowserContext* browser_context_; // The host for our HTML content. @@ -127,7 +127,7 @@ index 59798a628937..2018abb8324b 100644 // A pointer to the current or speculative main frame in `host_contents_`. We // can't access this frame through the `host_contents_` directly as it does diff --git extensions/browser/extensions_browser_client.h extensions/browser/extensions_browser_client.h -index c2d194ec21be..3a7354f648ed 100644 +index 7eb3d073c7b79..3844a9c6033a5 100644 --- extensions/browser/extensions_browser_client.h +++ extensions/browser/extensions_browser_client.h @@ -27,6 +27,7 @@ @@ -162,16 +162,14 @@ index c2d194ec21be..3a7354f648ed 100644 // once each time the extensions system is loaded per browser_context. The // implementation may wish to use the BrowserContext to record the current diff --git extensions/browser/process_manager.cc extensions/browser/process_manager.cc -index 2bc2248ba920..583419786f28 100644 +index 26bff09c646be..830ff12c5fc9c 100644 --- extensions/browser/process_manager.cc +++ extensions/browser/process_manager.cc -@@ -389,9 +389,16 @@ bool ProcessManager::CreateBackgroundHost(const Extension* extension, +@@ -392,9 +392,17 @@ bool ProcessManager::CreateBackgroundHost(const Extension* extension, return true; // TODO(kalman): return false here? It might break things... DVLOG(1) << "CreateBackgroundHost " << extension->id(); - ExtensionHost* host = -- new ExtensionHost(extension, GetSiteInstanceForURL(url).get(), url, -- VIEW_TYPE_EXTENSION_BACKGROUND_PAGE); + ExtensionHost* host = nullptr; + if (ExtensionsBrowserClient::Get()->CreateBackgroundExtensionHost( + extension, browser_context_, url, &host) && !host) { @@ -179,8 +177,9 @@ index 2bc2248ba920..583419786f28 100644 + return false; + } + if (!host) { -+ host = new ExtensionHost(extension, GetSiteInstanceForURL(url).get(), url, -+ VIEW_TYPE_EXTENSION_BACKGROUND_PAGE); ++ host = + new ExtensionHost(extension, GetSiteInstanceForURL(url).get(), url, + mojom::ViewType::kExtensionBackgroundPage); + } host->CreateRendererSoon(); OnBackgroundHostCreated(host); diff --git a/patch/patches/font_family_cache_1501.patch b/patch/patches/font_family_cache_1501.patch index 8747d1f43..498802108 100644 --- a/patch/patches/font_family_cache_1501.patch +++ b/patch/patches/font_family_cache_1501.patch @@ -1,5 +1,5 @@ diff --git chrome/browser/font_family_cache.h chrome/browser/font_family_cache.h -index 3e15bc56d69a..c398bfec8583 100644 +index 0e5573a7326a2..28eb26fb7af55 100644 --- chrome/browser/font_family_cache.h +++ chrome/browser/font_family_cache.h @@ -19,6 +19,8 @@ class Profile; diff --git a/patch/patches/gn_config.patch b/patch/patches/gn_config.patch index b2b1e047d..8ad561719 100644 --- a/patch/patches/gn_config.patch +++ b/patch/patches/gn_config.patch @@ -1,8 +1,8 @@ diff --git .gn .gn -index 01b2f70c1378..a14dd637774e 100644 +index 5b010cc8b0147..6f7dce7dd8e4b 100644 --- .gn +++ .gn -@@ -190,6 +190,8 @@ exec_script_whitelist = +@@ -184,6 +184,8 @@ exec_script_whitelist = "//chrome/android/webapk/shell_apk/prepare_upload_dir/BUILD.gn", @@ -12,7 +12,7 @@ index 01b2f70c1378..a14dd637774e 100644 # https://crbug.com/474506. "//clank/java/BUILD.gn", diff --git BUILD.gn BUILD.gn -index 6df566bd7df4..d8f539493342 100644 +index 106e853ef8179..2d2fa6b9c284f 100644 --- BUILD.gn +++ BUILD.gn @@ -16,6 +16,7 @@ import("//build/config/sanitizers/sanitizers.gni") @@ -23,7 +23,7 @@ index 6df566bd7df4..d8f539493342 100644 import("//chrome/browser/buildflags.gni") import("//chrome/browser/media/router/features.gni") import("//components/nacl/features.gni") -@@ -247,6 +248,9 @@ group("gn_all") { +@@ -251,6 +252,9 @@ group("gn_all") { "//media/cast:cast_unittests", "//third_party/catapult/telemetry:bitmaptools($host_toolchain)", ] @@ -34,7 +34,7 @@ index 6df566bd7df4..d8f539493342 100644 deps += [ "//ios:all", diff --git build/config/win/visual_studio_version.gni build/config/win/visual_studio_version.gni -index 982fbe8d3f0d..e757be4688f1 100644 +index 982fbe8d3f0d0..e757be4688f10 100644 --- build/config/win/visual_studio_version.gni +++ build/config/win/visual_studio_version.gni @@ -12,9 +12,8 @@ declare_args() { @@ -66,7 +66,7 @@ index 982fbe8d3f0d..e757be4688f1 100644 + "studio path") } diff --git chrome/app/framework.order chrome/app/framework.order -index 839144aa1e9b..29c8ab32398a 100644 +index 839144aa1e9bd..29c8ab32398a7 100644 --- chrome/app/framework.order +++ chrome/app/framework.order @@ -28,3 +28,8 @@ _ChromeMain @@ -79,7 +79,7 @@ index 839144aa1e9b..29c8ab32398a 100644 +_OBJC_METACLASS_$_UnderlayOpenGLHostingWindow + diff --git chrome/chrome_paks.gni chrome/chrome_paks.gni -index 63e7ca2c10c1..14f777c10cd6 100644 +index 8e17878f175bf..3d8fc8848fe9c 100644 --- chrome/chrome_paks.gni +++ chrome/chrome_paks.gni @@ -4,6 +4,7 @@ @@ -90,7 +90,7 @@ index 63e7ca2c10c1..14f777c10cd6 100644 import("//chrome/browser/buildflags.gni") import("//chrome/browser/resources/pdf/ink/ink.gni") import("//chrome/common/features.gni") -@@ -269,6 +270,10 @@ template("chrome_extra_paks") { +@@ -277,6 +278,10 @@ template("chrome_extra_paks") { "//chrome/browser/resources/welcome:resources", ] } @@ -102,7 +102,7 @@ index 63e7ca2c10c1..14f777c10cd6 100644 sources += [ "$root_gen_dir/chrome/extensions_resources.pak", diff --git chrome/chrome_repack_locales.gni chrome/chrome_repack_locales.gni -index a64a23560460..b08eee1f789a 100644 +index a64a23560460a..b08eee1f789a7 100644 --- chrome/chrome_repack_locales.gni +++ chrome/chrome_repack_locales.gni @@ -6,6 +6,7 @@ import("//build/config/chrome_build.gni") @@ -125,7 +125,7 @@ index a64a23560460..b08eee1f789a 100644 source_patterns += [ "${root_gen_dir}/extensions/strings/extensions_strings_" ] diff --git chrome/installer/mini_installer/BUILD.gn chrome/installer/mini_installer/BUILD.gn -index ae43217ef207..2f0b95687263 100644 +index ae43217ef2075..2f0b956872631 100644 --- chrome/installer/mini_installer/BUILD.gn +++ chrome/installer/mini_installer/BUILD.gn @@ -6,6 +6,7 @@ import("//build/config/compiler/compiler.gni") @@ -151,3 +151,29 @@ index ae43217ef207..2f0b95687263 100644 outputs = [ # See also chrome.packed.7z conditionally added below. +diff --git tools/grit/grit_defines.gni tools/grit/grit_defines.gni +index 5b92d7a6cd920..ceb274146131c 100644 +--- tools/grit/grit_defines.gni ++++ tools/grit/grit_defines.gni +@@ -5,6 +5,7 @@ + import("//build/config/chrome_build.gni") + import("//build/config/chromeos/ui_mode.gni") + import("//build/config/crypto.gni") ++import("//build/config/locales.gni") + import("//build/config/ui.gni") + + grit_defines = [ +@@ -104,6 +105,13 @@ if (is_android) { + ] + } + ++if (enable_pseudolocales) { ++ grit_defines += [ ++ "-D", ++ "enable_pseudolocales", ++ ] ++} ++ + # When cross-compiling, explicitly pass the target system to grit. + if (current_toolchain != host_toolchain) { + if (is_android) { diff --git a/patch/patches/gritsettings.patch b/patch/patches/gritsettings.patch index bd80a6115..04b7de1fe 100644 --- a/patch/patches/gritsettings.patch +++ b/patch/patches/gritsettings.patch @@ -1,8 +1,8 @@ diff --git tools/gritsettings/resource_ids.spec tools/gritsettings/resource_ids.spec -index c9e9d621c730..edeaa3662ede 100644 +index 1d3809cbdc35c..f5206f1c96c32 100644 --- tools/gritsettings/resource_ids.spec +++ tools/gritsettings/resource_ids.spec -@@ -739,4 +739,13 @@ +@@ -750,4 +750,13 @@ # Please read the header and find the right section above instead. # Resource ids starting at 31000 are reserved for projects built on Chromium. diff --git a/patch/patches/ime_1610.patch b/patch/patches/ime_1610.patch index 6bcd62060..3ed0a134b 100644 --- a/patch/patches/ime_1610.patch +++ b/patch/patches/ime_1610.patch @@ -1,8 +1,8 @@ diff --git ui/base/ime/win/input_method_win_base.cc ui/base/ime/win/input_method_win_base.cc -index f07ce6fef458..c3d3b2eb50dd 100644 +index bc80f95a6892a..43a87836ebd3e 100644 --- ui/base/ime/win/input_method_win_base.cc +++ ui/base/ime/win/input_method_win_base.cc -@@ -246,8 +246,9 @@ bool InputMethodWinBase::IsWindowFocused(const TextInputClient* client) const { +@@ -262,8 +262,9 @@ bool InputMethodWinBase::IsWindowFocused(const TextInputClient* client) const { // receiving keyboard input as long as it is an active window. This works well // even when the |attached_window_handle| becomes active but has not received // WM_FOCUS yet. diff --git a/patch/patches/libphonenumber.patch b/patch/patches/libphonenumber.patch deleted file mode 100644 index 231919c62..000000000 --- a/patch/patches/libphonenumber.patch +++ /dev/null @@ -1,160 +0,0 @@ -diff --git cpp/src/phonenumbers/encoding_utils.h cpp/src/phonenumbers/encoding_utils.h -index d4271832..0c65d2bf 100644 ---- cpp/src/phonenumbers/encoding_utils.h -+++ cpp/src/phonenumbers/encoding_utils.h -@@ -29,7 +29,7 @@ class EncodingUtils { - // the function stores 0xFFFD in the output variable and returns 1. - static inline int DecodeUTF8Char(const char* in, char32* out) { - Rune r; -- int len = chartorune(&r, in); -+ int len = _chartorune(&r, in); - *out = r; - return len; - } -diff --git cpp/src/phonenumbers/utf/rune.c cpp/src/phonenumbers/utf/rune.c -index b4aa93b5..6f7b0358 100644 ---- cpp/src/phonenumbers/utf/rune.c -+++ cpp/src/phonenumbers/utf/rune.c -@@ -64,7 +64,7 @@ enum - * reasons, we return 1 instead of 0. - */ - int --charntorune(Rune *rune, const char *str, int length) -+_charntorune(Rune *rune, const char *str, int length) - { - int c, c1, c2, c3; - long l; -@@ -167,7 +167,7 @@ badlen: - * null-terminated strings. - */ - int --chartorune(Rune *rune, const char *str) -+_chartorune(Rune *rune, const char *str) - { - int c, c1, c2, c3; - long l; -@@ -247,12 +247,12 @@ bad: - int - isvalidcharntorune(const char* str, int length, Rune* rune, int* consumed) - { -- *consumed = charntorune(rune, str, length); -+ *consumed = _charntorune(rune, str, length); - return *rune != Runeerror || *consumed == 3; - } - - int --runetochar(char *str, const Rune *rune) -+_runetochar(char *str, const Rune *rune) - { - /* Runes are signed, so convert to unsigned for range check. */ - unsigned long c; -@@ -311,15 +311,15 @@ runetochar(char *str, const Rune *rune) - } - - int --runelen(Rune rune) -+_runelen(Rune rune) - { - char str[10]; - -- return runetochar(str, &rune); -+ return _runetochar(str, &rune); - } - - int --runenlen(const Rune *r, int nrune) -+_runenlen(const Rune *r, int nrune) - { - int nb, c; - -@@ -339,7 +339,7 @@ runenlen(const Rune *r, int nrune) - } - - int --fullrune(const char *str, int n) -+_fullrune(const char *str, int n) - { - if (n > 0) { - int c = *(uchar*)str; -diff --git cpp/src/phonenumbers/utf/unicodetext.cc cpp/src/phonenumbers/utf/unicodetext.cc -index 11f68f76..86504a31 100644 ---- cpp/src/phonenumbers/utf/unicodetext.cc -+++ cpp/src/phonenumbers/utf/unicodetext.cc -@@ -362,7 +362,7 @@ void UnicodeText::push_back(char32 c) { - if (UniLib::IsValidCodepoint(c)) { - char buf[UTFmax]; - Rune rune = c; -- int len = runetochar(buf, &rune); -+ int len = _runetochar(buf, &rune); - if (UniLib::IsInterchangeValid(buf, len)) { - repr_.append(buf, len); - } else { -diff --git cpp/src/phonenumbers/utf/unilib.cc cpp/src/phonenumbers/utf/unilib.cc -index e890f974..ce549363 100644 ---- cpp/src/phonenumbers/utf/unilib.cc -+++ cpp/src/phonenumbers/utf/unilib.cc -@@ -50,7 +50,7 @@ int SpanInterchangeValid(const char* begin, int byte_length) { - const char* p = begin; - const char* end = begin + byte_length; - while (p < end) { -- int bytes_consumed = charntorune(&rune, p, end - p); -+ int bytes_consumed = _charntorune(&rune, p, end - p); - // We want to accept Runeerror == U+FFFD as a valid char, but it is used - // by chartorune to indicate error. Luckily, the real codepoint is size 3 - // while errors return bytes_consumed <= 1. -diff --git cpp/src/phonenumbers/utf/utf.h cpp/src/phonenumbers/utf/utf.h -index 72d01ed6..35fd0ea9 100644 ---- cpp/src/phonenumbers/utf/utf.h -+++ cpp/src/phonenumbers/utf/utf.h -@@ -46,7 +46,7 @@ extern "C" { - // runetochar copies (encodes) one rune, pointed to by r, to at most - // UTFmax bytes starting at s and returns the number of bytes generated. - --int runetochar(char* s, const Rune* r); -+int _runetochar(char* s, const Rune* r); - - - // chartorune copies (decodes) at most UTFmax bytes starting at s to -@@ -59,7 +59,7 @@ int runetochar(char* s, const Rune* r); - // Unicode value 0 (i.e., ASCII NULL). A byte value of 0 is illegal - // anywhere else in a UTF sequence. - --int chartorune(Rune* r, const char* s); -+int _chartorune(Rune* r, const char* s); - - - // charntorune is like chartorune, except that it will access at most -@@ -69,7 +69,7 @@ int chartorune(Rune* r, const char* s); - // - // Added 2004-09-24 by Wei-Hwa Huang - --int charntorune(Rune* r, const char* s, int n); -+int _charntorune(Rune* r, const char* s, int n); - - // isvalidcharntorune(str, n, r, consumed) - // is a convenience function that calls "*consumed = charntorune(r, str, n)" -@@ -80,13 +80,13 @@ int isvalidcharntorune(const char* str, int n, Rune* r, int* consumed); - - // runelen returns the number of bytes required to convert r into UTF. - --int runelen(Rune r); -+int _runelen(Rune r); - - - // runenlen returns the number of bytes required to convert the n - // runes pointed to by r into UTF. - --int runenlen(const Rune* r, int n); -+int _runenlen(const Rune* r, int n); - - - // fullrune returns 1 if the string s of length n is long enough to be -@@ -95,7 +95,7 @@ int runenlen(const Rune* r, int n); - // by programs that obtain input one byte at a time and need to know - // when a full rune has arrived. - --int fullrune(const char* s, int n); -+int _fullrune(const char* s, int n); - - // The following routines are analogous to the corresponding string - // routines with "utf" substituted for "str", and "rune" substituted diff --git a/patch/patches/libxml_visibility.patch b/patch/patches/libxml_visibility.patch index f0d36c780..ae50679bd 100644 --- a/patch/patches/libxml_visibility.patch +++ b/patch/patches/libxml_visibility.patch @@ -1,5 +1,5 @@ diff --git third_party/libxml/BUILD.gn third_party/libxml/BUILD.gn -index 8068e573cbd4..2fc10cf03bc5 100644 +index 8068e573cbd48..2fc10cf03bc50 100644 --- third_party/libxml/BUILD.gn +++ third_party/libxml/BUILD.gn @@ -142,6 +142,7 @@ static_library("libxml") { diff --git a/patch/patches/linux_assets_path_1936.patch b/patch/patches/linux_assets_path_1936.patch index b15e0f8bc..1f9153f01 100644 --- a/patch/patches/linux_assets_path_1936.patch +++ b/patch/patches/linux_assets_path_1936.patch @@ -1,5 +1,5 @@ diff --git content/browser/child_process_launcher_helper_linux.cc content/browser/child_process_launcher_helper_linux.cc -index f3d40b628ec2..7efc41048b3c 100644 +index f3d40b628ec20..7efc41048b3c1 100644 --- content/browser/child_process_launcher_helper_linux.cc +++ content/browser/child_process_launcher_helper_linux.cc @@ -162,7 +162,7 @@ void ChildProcessLauncherHelper::SetProcessPriorityOnLauncherThread( @@ -12,7 +12,7 @@ index f3d40b628ec2..7efc41048b3c 100644 base::File file(exe_dir.Append(path), base::File::FLAG_OPEN | base::File::FLAG_READ); diff --git sandbox/linux/suid/client/setuid_sandbox_host.cc sandbox/linux/suid/client/setuid_sandbox_host.cc -index 0aaed76c1dda..517c3d8b5772 100644 +index 0aaed76c1dda2..517c3d8b57725 100644 --- sandbox/linux/suid/client/setuid_sandbox_host.cc +++ sandbox/linux/suid/client/setuid_sandbox_host.cc @@ -120,7 +120,7 @@ bool SetuidSandboxHost::IsDisabledViaEnvironment() { @@ -25,7 +25,7 @@ index 0aaed76c1dda..517c3d8b5772 100644 if (base::PathExists(sandbox_candidate)) sandbox_binary = sandbox_candidate; diff --git ui/gl/init/gl_initializer_linux_x11.cc ui/gl/init/gl_initializer_linux_x11.cc -index b1f21c4bf0e0..0eea60fa82f7 100644 +index 016046d6caa4f..116e4919cda08 100644 --- ui/gl/init/gl_initializer_linux_x11.cc +++ ui/gl/init/gl_initializer_linux_x11.cc @@ -82,7 +82,7 @@ bool InitializeStaticEGLInternalFromLibrary(GLImplementation implementation) { diff --git a/patch/patches/linux_atk_1123214.patch b/patch/patches/linux_atk_1123214.patch index 96d14c3a6..a628038c4 100644 --- a/patch/patches/linux_atk_1123214.patch +++ b/patch/patches/linux_atk_1123214.patch @@ -1,5 +1,5 @@ diff --git build/config/linux/atk/BUILD.gn build/config/linux/atk/BUILD.gn -index bc8e27894732..5d06ce988f25 100644 +index bc8e27894732a..5d06ce988f25f 100644 --- build/config/linux/atk/BUILD.gn +++ build/config/linux/atk/BUILD.gn @@ -12,7 +12,7 @@ import("//build/config/ui.gni") @@ -12,7 +12,7 @@ index bc8e27894732..5d06ce988f25 100644 if (use_atk) { assert(use_glib, "use_atk=true requires that use_glib=true") diff --git build/config/linux/atspi2/BUILD.gn build/config/linux/atspi2/BUILD.gn -index 988a99568136..1791ea607550 100644 +index 988a995681361..1791ea607550e 100644 --- build/config/linux/atspi2/BUILD.gn +++ build/config/linux/atspi2/BUILD.gn @@ -6,7 +6,7 @@ import("//build/config/linux/pkg_config.gni") diff --git a/patch/patches/linux_chrome_page_info_1099927.patch b/patch/patches/linux_chrome_page_info_1099927.patch index 4688e9c68..3fc41f322 100644 --- a/patch/patches/linux_chrome_page_info_1099927.patch +++ b/patch/patches/linux_chrome_page_info_1099927.patch @@ -1,5 +1,5 @@ diff --git chrome/browser/ui/page_info/chrome_page_info_client.cc chrome/browser/ui/page_info/chrome_page_info_client.cc -index e2972da9e548..2f356616ed97 100644 +index e2972da9e548d..2f356616ed97c 100644 --- chrome/browser/ui/page_info/chrome_page_info_client.cc +++ chrome/browser/ui/page_info/chrome_page_info_client.cc @@ -17,5 +17,9 @@ std::unique_ptr ChromePageInfoClient::CreatePageInfoDelegate( diff --git a/patch/patches/linux_poll_2466.patch b/patch/patches/linux_poll_2466.patch index 2515848e2..6764b1eb9 100644 --- a/patch/patches/linux_poll_2466.patch +++ b/patch/patches/linux_poll_2466.patch @@ -1,5 +1,5 @@ diff --git base/files/file_path_watcher_linux.cc base/files/file_path_watcher_linux.cc -index b125a023576b..2ed33e44379c 100644 +index 713444ccb2d3e..6759f454d1563 100644 --- base/files/file_path_watcher_linux.cc +++ base/files/file_path_watcher_linux.cc @@ -5,6 +5,7 @@ @@ -18,7 +18,7 @@ index b125a023576b..2ed33e44379c 100644 #include #include #include -@@ -264,19 +266,16 @@ void InotifyReaderThreadDelegate::ThreadMain() { +@@ -274,19 +276,16 @@ void InotifyReaderThreadDelegate::ThreadMain() { PlatformThread::SetName("inotify_reader"); // Make sure the file descriptors are good for use with select(). diff --git a/patch/patches/mac_event_observer_2539.patch b/patch/patches/mac_event_observer_2539.patch index a38408643..dc3832a7f 100644 --- a/patch/patches/mac_event_observer_2539.patch +++ b/patch/patches/mac_event_observer_2539.patch @@ -1,5 +1,5 @@ diff --git content/browser/scheduler/responsiveness/native_event_observer_mac.mm content/browser/scheduler/responsiveness/native_event_observer_mac.mm -index 7cb3238e97ed..ae800739b686 100644 +index 7cb3238e97edb..ae800739b6863 100644 --- content/browser/scheduler/responsiveness/native_event_observer_mac.mm +++ content/browser/scheduler/responsiveness/native_event_observer_mac.mm @@ -12,13 +12,15 @@ namespace content { diff --git a/patch/patches/mac_fling_scheduler_2540.patch b/patch/patches/mac_fling_scheduler_2540.patch index 8a7776a8b..cfd64e2b1 100644 --- a/patch/patches/mac_fling_scheduler_2540.patch +++ b/patch/patches/mac_fling_scheduler_2540.patch @@ -1,5 +1,5 @@ diff --git content/browser/renderer_host/input/fling_scheduler_mac.mm content/browser/renderer_host/input/fling_scheduler_mac.mm -index f10c5d161dd1..92a751dd984e 100644 +index f10c5d161dd13..92a751dd984e5 100644 --- content/browser/renderer_host/input/fling_scheduler_mac.mm +++ content/browser/renderer_host/input/fling_scheduler_mac.mm @@ -26,6 +26,10 @@ ui::Compositor* FlingSchedulerMac::GetCompositor() { diff --git a/patch/patches/mac_gpu.patch b/patch/patches/mac_gpu.patch index c3d13956d..dedd4d1b6 100644 --- a/patch/patches/mac_gpu.patch +++ b/patch/patches/mac_gpu.patch @@ -1,5 +1,5 @@ diff --git ui/gl/init/gl_initializer_mac.cc ui/gl/init/gl_initializer_mac.cc -index f659291023ac..3b8c88a37814 100644 +index 98f3c5a43da3b..55bef97cfc336 100644 --- ui/gl/init/gl_initializer_mac.cc +++ ui/gl/init/gl_initializer_mac.cc @@ -46,11 +46,8 @@ bool InitializeOneOffForSandbox() { diff --git a/patch/patches/message_loop.patch b/patch/patches/message_loop.patch index 7524b67c2..a6ec943ea 100644 --- a/patch/patches/message_loop.patch +++ b/patch/patches/message_loop.patch @@ -1,5 +1,5 @@ diff --git base/message_loop/message_pump_win.cc base/message_loop/message_pump_win.cc -index 9f6dfb1d1c00..b48c1d45aa11 100644 +index 0a3f329f4a524..9546c5add9c8c 100644 --- base/message_loop/message_pump_win.cc +++ base/message_loop/message_pump_win.cc @@ -2,6 +2,7 @@ @@ -10,7 +10,7 @@ index 9f6dfb1d1c00..b48c1d45aa11 100644 #include "base/message_loop/message_pump_win.h" #include -@@ -497,7 +498,17 @@ bool MessagePumpForUI::ProcessNextWindowsMessage() { +@@ -493,7 +494,17 @@ bool MessagePumpForUI::ProcessNextWindowsMessage() { ctx.event()->set_chrome_message_pump(); msg_pump_data->set_sent_messages_in_queue(more_work_is_plausible); }); @@ -30,10 +30,10 @@ index 9f6dfb1d1c00..b48c1d45aa11 100644 } if (has_msg) diff --git base/task/current_thread.cc base/task/current_thread.cc -index bc572011b138..ccb208620402 100644 +index 9641285fde742..51cc852fcc165 100644 --- base/task/current_thread.cc +++ base/task/current_thread.cc -@@ -47,6 +47,8 @@ void CurrentThread::AddDestructionObserver( +@@ -48,6 +48,8 @@ void CurrentThread::AddDestructionObserver( void CurrentThread::RemoveDestructionObserver( DestructionObserver* destruction_observer) { @@ -43,7 +43,7 @@ index bc572011b138..ccb208620402 100644 current_->RemoveDestructionObserver(destruction_observer); } diff --git base/task/current_thread.h base/task/current_thread.h -index 3f64b403c7eb..1130936a5f1f 100644 +index bdcd661bfa282..823a1d02ca858 100644 --- base/task/current_thread.h +++ base/task/current_thread.h @@ -127,6 +127,12 @@ class BASE_EXPORT CurrentThread { diff --git a/patch/patches/message_pump_mac_2495.patch b/patch/patches/message_pump_mac_2495.patch index 639b9a317..0cbb2282a 100644 --- a/patch/patches/message_pump_mac_2495.patch +++ b/patch/patches/message_pump_mac_2495.patch @@ -1,8 +1,8 @@ diff --git base/message_loop/message_pump_mac.mm base/message_loop/message_pump_mac.mm -index 1d0ac66a9174..4ddaca449e8b 100644 +index 5846dcf03078b..b8d8d9e684161 100644 --- base/message_loop/message_pump_mac.mm +++ base/message_loop/message_pump_mac.mm -@@ -644,7 +644,8 @@ void MessagePumpUIApplication::Detach() { +@@ -670,7 +670,8 @@ void MessagePumpUIApplication::Detach() { #else ScopedPumpMessagesInPrivateModes::ScopedPumpMessagesInPrivateModes() { @@ -12,7 +12,7 @@ index 1d0ac66a9174..4ddaca449e8b 100644 DCHECK_EQ(kNSApplicationModalSafeModeMask, g_app_pump->GetModeMask()); // Pumping events in private runloop modes is known to interact badly with // app modal windows like NSAlert. -@@ -654,7 +655,8 @@ ScopedPumpMessagesInPrivateModes::ScopedPumpMessagesInPrivateModes() { +@@ -680,7 +681,8 @@ ScopedPumpMessagesInPrivateModes::ScopedPumpMessagesInPrivateModes() { } ScopedPumpMessagesInPrivateModes::~ScopedPumpMessagesInPrivateModes() { diff --git a/patch/patches/mime_handler_view_guest_1565_2727.patch b/patch/patches/mime_handler_view_guest_1565_2727.patch index 7709bf216..d1df10211 100644 --- a/patch/patches/mime_handler_view_guest_1565_2727.patch +++ b/patch/patches/mime_handler_view_guest_1565_2727.patch @@ -1,8 +1,8 @@ diff --git content/browser/web_contents/web_contents_view.h content/browser/web_contents/web_contents_view.h -index 954e32c842a5..7563507d52d0 100644 +index cdbc0273838e5..ee2809a0bb98a 100644 --- content/browser/web_contents/web_contents_view.h +++ content/browser/web_contents/web_contents_view.h -@@ -23,7 +23,7 @@ struct DropData; +@@ -22,7 +22,7 @@ struct DropData; // The WebContentsView is an interface that is implemented by the platform- // dependent web contents views. The WebContents uses this interface to talk to // them. @@ -12,10 +12,10 @@ index 954e32c842a5..7563507d52d0 100644 virtual ~WebContentsView() {} diff --git extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.cc extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.cc -index 8f4c53f3f3ca..ecc27f3f224c 100644 +index e2b5240255bfd..fc0037f552ec1 100644 --- extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.cc +++ extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.cc -@@ -207,6 +207,8 @@ void MimeHandlerViewGuest::CreateWebContents( +@@ -205,6 +205,8 @@ void MimeHandlerViewGuest::CreateWebContents( WebContents::CreateParams params(browser_context(), guest_site_instance.get()); params.guest_delegate = this; @@ -24,7 +24,7 @@ index 8f4c53f3f3ca..ecc27f3f224c 100644 // TODO(erikchen): Fix ownership semantics for guest views. // https://crbug.com/832879. std::move(callback).Run( -@@ -217,6 +219,9 @@ void MimeHandlerViewGuest::CreateWebContents( +@@ -215,6 +217,9 @@ void MimeHandlerViewGuest::CreateWebContents( } void MimeHandlerViewGuest::DidAttachToEmbedder() { @@ -34,7 +34,7 @@ index 8f4c53f3f3ca..ecc27f3f224c 100644 DCHECK(stream_->handler_url().SchemeIs(extensions::kExtensionScheme)); web_contents()->GetController().LoadURL( stream_->handler_url(), content::Referrer(), -@@ -247,6 +252,11 @@ bool MimeHandlerViewGuest::ShouldDestroyOnDetach() const { +@@ -245,6 +250,11 @@ bool MimeHandlerViewGuest::ShouldDestroyOnDetach() const { return true; } @@ -47,10 +47,10 @@ index 8f4c53f3f3ca..ecc27f3f224c 100644 WebContents* source, const content::OpenURLParams& params) { diff --git extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.h extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.h -index d9e22ce31927..e02b791a19f1 100644 +index 7d27e12c4e9a7..55c307b5e86ae 100644 --- extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.h +++ extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.h -@@ -129,6 +129,7 @@ class MimeHandlerViewGuest +@@ -130,6 +130,7 @@ class MimeHandlerViewGuest void EmbedderFullscreenToggled(bool entered_fullscreen) final; bool ZoomPropagatesFromEmbedderToGuest() const final; bool ShouldDestroyOnDetach() const final; @@ -59,7 +59,7 @@ index d9e22ce31927..e02b791a19f1 100644 // WebContentsDelegate implementation. content::WebContents* OpenURLFromTab( diff --git extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest_delegate.h extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest_delegate.h -index 98689e261460..a1b08274f455 100644 +index 98689e2614604..a1b08274f4556 100644 --- extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest_delegate.h +++ extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest_delegate.h @@ -8,9 +8,9 @@ diff --git a/patch/patches/net_cookie_flags.patch b/patch/patches/net_cookie_flags.patch index d297b66f9..86e3263bc 100644 --- a/patch/patches/net_cookie_flags.patch +++ b/patch/patches/net_cookie_flags.patch @@ -1,5 +1,5 @@ diff --git net/base/load_flags_list.h net/base/load_flags_list.h -index 96d1a51ec107..e8120a818b1f 100644 +index 96d1a51ec1078..e8120a818b1f2 100644 --- net/base/load_flags_list.h +++ net/base/load_flags_list.h @@ -101,3 +101,6 @@ LOAD_FLAG(RESTRICTED_PREFETCH, 1 << 15) @@ -10,10 +10,10 @@ index 96d1a51ec107..e8120a818b1f 100644 +// This load will not send any cookies. For CEF usage. +LOAD_FLAG(DO_NOT_SEND_COOKIES, 1 << 17) diff --git net/url_request/url_request_http_job.cc net/url_request/url_request_http_job.cc -index 15cacc16cfa7..d7aa30baf147 100644 +index 393b89a5624a3..ba6e79471c7ba 100644 --- net/url_request/url_request_http_job.cc +++ net/url_request/url_request_http_job.cc -@@ -539,7 +539,8 @@ void URLRequestHttpJob::AddCookieHeaderAndStart() { +@@ -549,7 +549,8 @@ void URLRequestHttpJob::AddCookieHeaderAndStart() { // Read cookies whenever allow_credentials() is true, even if the PrivacyMode // is being overridden by NetworkDelegate and will eventually block them, as // blocked cookies still need to be logged in that case. @@ -24,10 +24,10 @@ index 15cacc16cfa7..d7aa30baf147 100644 request_->force_ignore_site_for_cookies(); if (cookie_store->cookie_access_delegate() && diff --git services/network/public/cpp/resource_request.cc services/network/public/cpp/resource_request.cc -index 61a6f05d5d70..396b495e1598 100644 +index f1bc5816aad10..dfe54f1169e8e 100644 --- services/network/public/cpp/resource_request.cc +++ services/network/public/cpp/resource_request.cc -@@ -206,7 +206,8 @@ bool ResourceRequest::EqualsForTesting(const ResourceRequest& request) const { +@@ -233,7 +233,8 @@ bool ResourceRequest::EqualsForTesting(const ResourceRequest& request) const { } bool ResourceRequest::SendsCookies() const { diff --git a/patch/patches/osr_fling_2745.patch b/patch/patches/osr_fling_2745.patch index 06a5e7f75..b188f5725 100644 --- a/patch/patches/osr_fling_2745.patch +++ b/patch/patches/osr_fling_2745.patch @@ -1,5 +1,5 @@ diff --git content/browser/renderer_host/input/fling_scheduler.cc content/browser/renderer_host/input/fling_scheduler.cc -index c7a4f1f0c3d0..7e6e3b4e56d4 100644 +index c7a4f1f0c3d00..7e6e3b4e56d42 100644 --- content/browser/renderer_host/input/fling_scheduler.cc +++ content/browser/renderer_host/input/fling_scheduler.cc @@ -68,6 +68,9 @@ void FlingScheduler::ProgressFlingOnBeginFrameIfneeded( @@ -13,7 +13,7 @@ index c7a4f1f0c3d0..7e6e3b4e56d4 100644 if (host_->GetView() && host_->GetView()->GetNativeView() && host_->GetView()->GetNativeView()->GetHost() && diff --git content/browser/renderer_host/input/fling_scheduler_base.h content/browser/renderer_host/input/fling_scheduler_base.h -index cc4b13a7b9c6..84f3b9ed7cf4 100644 +index cc4b13a7b9c67..84f3b9ed7cf49 100644 --- content/browser/renderer_host/input/fling_scheduler_base.h +++ content/browser/renderer_host/input/fling_scheduler_base.h @@ -7,12 +7,23 @@ @@ -41,10 +41,10 @@ index cc4b13a7b9c6..84f3b9ed7cf4 100644 } // namespace content diff --git content/browser/renderer_host/render_widget_host_impl.cc content/browser/renderer_host/render_widget_host_impl.cc -index b8e3f8e88495..9dcc23f28781 100644 +index a0e7d4a24f658..e1dec578df6bd 100644 --- content/browser/renderer_host/render_widget_host_impl.cc +++ content/browser/renderer_host/render_widget_host_impl.cc -@@ -2892,6 +2892,11 @@ void RenderWidgetHostImpl::OnInvalidInputEventSource() { +@@ -3042,6 +3042,11 @@ void RenderWidgetHostImpl::OnInvalidInputEventSource() { GetProcess(), bad_message::INPUT_ROUTER_INVALID_EVENT_SOURCE); } @@ -57,10 +57,10 @@ index b8e3f8e88495..9dcc23f28781 100644 const WebInputEvent& event) { if ((base::FeatureList::IsEnabled( diff --git content/browser/renderer_host/render_widget_host_impl.h content/browser/renderer_host/render_widget_host_impl.h -index dcc44adc51d8..ab20b3f355e7 100644 +index 7b2ea5e91a29a..5fda523b778de 100644 --- content/browser/renderer_host/render_widget_host_impl.h +++ content/browser/renderer_host/render_widget_host_impl.h -@@ -737,6 +737,7 @@ class CONTENT_EXPORT RenderWidgetHostImpl +@@ -756,6 +756,7 @@ class CONTENT_EXPORT RenderWidgetHostImpl void ProgressFlingIfNeeded(base::TimeTicks current_time); void StopFling(); diff --git a/patch/patches/print_preview_123.patch b/patch/patches/print_preview_123.patch index 0a0055026..07f8a7e54 100644 --- a/patch/patches/print_preview_123.patch +++ b/patch/patches/print_preview_123.patch @@ -1,5 +1,5 @@ diff --git chrome/browser/download/download_prefs.cc chrome/browser/download/download_prefs.cc -index 4e04a86c2d06..6d82d55acd15 100644 +index a95103026c8c3..ae6c676defcc6 100644 --- chrome/browser/download/download_prefs.cc +++ chrome/browser/download/download_prefs.cc @@ -24,6 +24,7 @@ @@ -34,7 +34,7 @@ index 4e04a86c2d06..6d82d55acd15 100644 } diff --git chrome/browser/printing/print_preview_dialog_controller.cc chrome/browser/printing/print_preview_dialog_controller.cc -index fa088bfa0019..7f00e2a2154f 100644 +index 74536431f6649..3fc69b6560298 100644 --- chrome/browser/printing/print_preview_dialog_controller.cc +++ chrome/browser/printing/print_preview_dialog_controller.cc @@ -17,6 +17,7 @@ @@ -58,7 +58,7 @@ index fa088bfa0019..7f00e2a2154f 100644 // Add an entry to the map. preview_dialog_map_[preview_dialog] = initiator; diff --git chrome/browser/printing/print_view_manager_base.cc chrome/browser/printing/print_view_manager_base.cc -index 81df8a2cb0c3..ae4dcf5beb16 100644 +index 9aa99b764ad86..c45424d20315a 100644 --- chrome/browser/printing/print_view_manager_base.cc +++ chrome/browser/printing/print_view_manager_base.cc @@ -21,6 +21,7 @@ @@ -97,7 +97,7 @@ index 81df8a2cb0c3..ae4dcf5beb16 100644 void NotifySystemDialogCancelled(int render_process_id, int routing_id) { diff --git chrome/browser/printing/print_view_manager_base.h chrome/browser/printing/print_view_manager_base.h -index 93103940036e..1b12b91cdf4b 100644 +index a96e5a33643e4..def5bced1c965 100644 --- chrome/browser/printing/print_view_manager_base.h +++ chrome/browser/printing/print_view_manager_base.h @@ -122,9 +122,6 @@ class PrintViewManagerBase : public content::NotificationObserver, @@ -111,7 +111,7 @@ index 93103940036e..1b12b91cdf4b 100644 void Observe(int type, const content::NotificationSource& source, diff --git chrome/browser/resources/print_preview/ui/destination_dialog.html chrome/browser/resources/print_preview/ui/destination_dialog.html -index df858712d3be..cd146ea0f26b 100644 +index df858712d3be8..cd146ea0f26b4 100644 --- chrome/browser/resources/print_preview/ui/destination_dialog.html +++ chrome/browser/resources/print_preview/ui/destination_dialog.html @@ -25,10 +25,7 @@ @@ -127,7 +127,7 @@ index df858712d3be..cd146ea0f26b 100644 $i18n{cancel} diff --git chrome/browser/resources/print_preview/ui/destination_select.html chrome/browser/resources/print_preview/ui/destination_select.html -index 6d3d49c902e7..4769176b9550 100644 +index 6d3d49c902e7b..4769176b9550c 100644 --- chrome/browser/resources/print_preview/ui/destination_select.html +++ chrome/browser/resources/print_preview/ui/destination_select.html @@ -20,10 +20,6 @@ @@ -142,7 +142,7 @@ index 6d3d49c902e7..4769176b9550 100644 hidden$="[[!noDestinations]]" selected$="[[noDestinations]]"> $i18n{noDestinationsMessage} diff --git chrome/browser/ui/webui/constrained_web_dialog_ui.cc chrome/browser/ui/webui/constrained_web_dialog_ui.cc -index 3d415a60d436..807ab41ee6ef 100644 +index 3d415a60d4361..807ab41ee6ef1 100644 --- chrome/browser/ui/webui/constrained_web_dialog_ui.cc +++ chrome/browser/ui/webui/constrained_web_dialog_ui.cc @@ -26,6 +26,8 @@ @@ -166,7 +166,7 @@ index 3d415a60d436..807ab41ee6ef 100644 ConstrainedWebDialogUI::~ConstrainedWebDialogUI() { diff --git chrome/browser/ui/webui/print_preview/pdf_printer_handler.cc chrome/browser/ui/webui/print_preview/pdf_printer_handler.cc -index e64ac255c18f..ef40c08e3373 100644 +index 6c43d5381f7c8..d5373865c9850 100644 --- chrome/browser/ui/webui/print_preview/pdf_printer_handler.cc +++ chrome/browser/ui/webui/print_preview/pdf_printer_handler.cc @@ -22,6 +22,7 @@ @@ -178,7 +178,7 @@ index e64ac255c18f..ef40c08e3373 100644 #include "chrome/browser/browser_process.h" #include "chrome/browser/download/download_prefs.h" @@ -55,6 +56,10 @@ - #include "chrome/browser/chromeos/drive/drive_integration_service.h" + #include "chrome/browser/ash/drive/drive_integration_service.h" #endif +#if BUILDFLAG(ENABLE_CEF) @@ -268,18 +268,18 @@ index e64ac255c18f..ef40c08e3373 100644 #if BUILDFLAG(IS_CHROMEOS_ASH) drive::DriveIntegrationService* drive_service = diff --git chrome/browser/ui/webui/print_preview/pdf_printer_handler.h chrome/browser/ui/webui/print_preview/pdf_printer_handler.h -index d796486f6b74..1a7b0d23128d 100644 +index 9730721279eff..cd3ec0c7e0af6 100644 --- chrome/browser/ui/webui/print_preview/pdf_printer_handler.h +++ chrome/browser/ui/webui/print_preview/pdf_printer_handler.h -@@ -12,6 +12,7 @@ +@@ -11,6 +11,7 @@ + #include "base/memory/ref_counted.h" #include "base/memory/weak_ptr.h" - #include "base/strings/string16.h" #include "build/chromeos_buildflags.h" +#include "cef/libcef/features/features.h" #include "chrome/browser/ui/webui/print_preview/printer_handler.h" #include "ui/shell_dialogs/select_file_dialog.h" -@@ -89,6 +90,15 @@ class PdfPrinterHandler : public PrinterHandler, +@@ -88,6 +89,15 @@ class PdfPrinterHandler : public PrinterHandler, void OnDirectorySelected(const base::FilePath& filename, const base::FilePath& directory); @@ -296,10 +296,10 @@ index d796486f6b74..1a7b0d23128d 100644 base::FilePath GetSaveLocation() const; diff --git chrome/browser/ui/webui/print_preview/print_preview_handler.cc chrome/browser/ui/webui/print_preview/print_preview_handler.cc -index 5beb6ac1f575..56e0fca6f317 100644 +index 5c8ae1be08334..e7074994d89d0 100644 --- chrome/browser/ui/webui/print_preview/print_preview_handler.cc +++ chrome/browser/ui/webui/print_preview/print_preview_handler.cc -@@ -25,6 +25,7 @@ +@@ -24,6 +24,7 @@ #include "base/values.h" #include "build/build_config.h" #include "build/chromeos_buildflags.h" @@ -307,7 +307,7 @@ index 5beb6ac1f575..56e0fca6f317 100644 #include "chrome/browser/account_manager_facade_factory.h" #include "chrome/browser/app_mode/app_mode_utils.h" #include "chrome/browser/bad_message.h" -@@ -1081,7 +1082,7 @@ PrinterHandler* PrintPreviewHandler::GetPrinterHandler( +@@ -1076,7 +1077,7 @@ PrinterHandler* PrintPreviewHandler::GetPrinterHandler( } return extension_printer_handler_.get(); } @@ -316,7 +316,7 @@ index 5beb6ac1f575..56e0fca6f317 100644 if (printer_type == PrinterType::kPrivet && GetPrefs()->GetBoolean(prefs::kForceEnablePrivetPrinting)) { if (!privet_printer_handler_) { -@@ -1090,6 +1091,9 @@ PrinterHandler* PrintPreviewHandler::GetPrinterHandler( +@@ -1085,6 +1086,9 @@ PrinterHandler* PrintPreviewHandler::GetPrinterHandler( } return privet_printer_handler_.get(); } @@ -326,7 +326,7 @@ index 5beb6ac1f575..56e0fca6f317 100644 #endif if (printer_type == PrinterType::kPdf) { if (!pdf_printer_handler_) { -@@ -1152,6 +1156,7 @@ void PrintPreviewHandler::OnPrintResult(const std::string& callback_id, +@@ -1147,6 +1151,7 @@ void PrintPreviewHandler::OnPrintResult(const std::string& callback_id, } void PrintPreviewHandler::RegisterForGaiaCookieChanges() { @@ -334,7 +334,7 @@ index 5beb6ac1f575..56e0fca6f317 100644 DCHECK(!identity_manager_); cloud_print_enabled_ = !base::Contains(printer_type_deny_list_, PrinterType::kCloud) && -@@ -1168,6 +1173,7 @@ void PrintPreviewHandler::RegisterForGaiaCookieChanges() { +@@ -1163,6 +1168,7 @@ void PrintPreviewHandler::RegisterForGaiaCookieChanges() { identity_manager_ = IdentityManagerFactory::GetForProfile(profile); identity_manager_->AddObserver(this); @@ -343,7 +343,7 @@ index 5beb6ac1f575..56e0fca6f317 100644 void PrintPreviewHandler::UnregisterForGaiaCookieChanges() { diff --git chrome/browser/ui/webui/print_preview/print_preview_ui.cc chrome/browser/ui/webui/print_preview/print_preview_ui.cc -index 60b1fe2311c0..74ee97dbbf6d 100644 +index eb353375b0549..45b14ee354677 100644 --- chrome/browser/ui/webui/print_preview/print_preview_ui.cc +++ chrome/browser/ui/webui/print_preview/print_preview_ui.cc @@ -30,6 +30,7 @@ diff --git a/patch/patches/printing_context_2196.patch b/patch/patches/printing_context_2196.patch index ec5be3676..bae99cd29 100644 --- a/patch/patches/printing_context_2196.patch +++ b/patch/patches/printing_context_2196.patch @@ -1,5 +1,5 @@ diff --git chrome/browser/printing/print_job_worker.cc chrome/browser/printing/print_job_worker.cc -index 47a5b3c2a11e..0a37d7c1e753 100644 +index 91edb6e296fd9..bcb84f308df69 100644 --- chrome/browser/printing/print_job_worker.cc +++ chrome/browser/printing/print_job_worker.cc @@ -135,6 +135,7 @@ PrintJobWorker::PrintJobWorker(int render_process_id, int render_frame_id) @@ -11,10 +11,10 @@ index 47a5b3c2a11e..0a37d7c1e753 100644 PrintJobWorker::~PrintJobWorker() { diff --git printing/printing_context.h printing/printing_context.h -index 268e03d2b8d4..f1b573207b88 100644 +index 0a9bf2b3a6c1f..7bc8b8b1d1548 100644 --- printing/printing_context.h +++ printing/printing_context.h -@@ -134,6 +134,13 @@ class PRINTING_EXPORT PrintingContext { +@@ -133,6 +133,13 @@ class PRINTING_EXPORT PrintingContext { int job_id() const { return job_id_; } @@ -28,7 +28,7 @@ index 268e03d2b8d4..f1b573207b88 100644 protected: explicit PrintingContext(Delegate* delegate); -@@ -157,6 +164,10 @@ class PRINTING_EXPORT PrintingContext { +@@ -156,6 +163,10 @@ class PRINTING_EXPORT PrintingContext { // The job id for the current job. The value is 0 if no jobs are active. int job_id_; diff --git a/patch/patches/renderer_host_1070713.patch b/patch/patches/renderer_host_1070713.patch index da9bff317..acaf8520f 100644 --- a/patch/patches/renderer_host_1070713.patch +++ b/patch/patches/renderer_host_1070713.patch @@ -1,8 +1,8 @@ diff --git content/browser/renderer_host/render_view_host_impl.cc content/browser/renderer_host/render_view_host_impl.cc -index 517ee0e43e83..6c3bab2f5780 100644 +index 00644aa7553c8..2b99e7d84b3f2 100644 --- content/browser/renderer_host/render_view_host_impl.cc +++ content/browser/renderer_host/render_view_host_impl.cc -@@ -598,6 +598,8 @@ bool RenderViewHostImpl::IsRenderViewLive() { +@@ -606,6 +606,8 @@ bool RenderViewHostImpl::IsRenderViewLive() { } void RenderViewHostImpl::SetBackgroundOpaque(bool opaque) { diff --git a/patch/patches/renderer_preferences_util_545103.patch b/patch/patches/renderer_preferences_util_545103.patch index 2670330b8..9633e33bf 100644 --- a/patch/patches/renderer_preferences_util_545103.patch +++ b/patch/patches/renderer_preferences_util_545103.patch @@ -1,5 +1,5 @@ diff --git chrome/browser/renderer_preferences_util.cc chrome/browser/renderer_preferences_util.cc -index 794160f870d4..9caa8b6df341 100644 +index 794160f870d4b..9caa8b6df3416 100644 --- chrome/browser/renderer_preferences_util.cc +++ chrome/browser/renderer_preferences_util.cc @@ -38,7 +38,8 @@ diff --git a/patch/patches/resource_bundle_2512.patch b/patch/patches/resource_bundle_2512.patch index 984a06e38..02ac6ed57 100644 --- a/patch/patches/resource_bundle_2512.patch +++ b/patch/patches/resource_bundle_2512.patch @@ -1,5 +1,5 @@ diff --git ui/base/resource/resource_bundle.cc ui/base/resource/resource_bundle.cc -index 910662d25a4f..4323dada7c98 100644 +index bb1381fd20f96..cb593885166cb 100644 --- ui/base/resource/resource_bundle.cc +++ ui/base/resource/resource_bundle.cc @@ -832,6 +832,12 @@ ResourceBundle::ResourceBundle(Delegate* delegate) @@ -28,10 +28,10 @@ index 910662d25a4f..4323dada7c98 100644 void ResourceBundle::InitSharedInstance(Delegate* delegate) { DCHECK(g_shared_instance_ == nullptr) << "ResourceBundle initialized twice"; diff --git ui/base/resource/resource_bundle.h ui/base/resource/resource_bundle.h -index 48c329f00c3f..a1a0cbc98771 100644 +index 9487fbaa237b1..26c42332fa3d6 100644 --- ui/base/resource/resource_bundle.h +++ ui/base/resource/resource_bundle.h -@@ -192,6 +192,11 @@ class COMPONENT_EXPORT(UI_BASE) ResourceBundle { +@@ -191,6 +191,11 @@ class COMPONENT_EXPORT(UI_BASE) ResourceBundle { // Return the global resource loader instance. static ResourceBundle& GetSharedInstance(); diff --git a/patch/patches/runhooks.patch b/patch/patches/runhooks.patch index f3fa07697..d7fad84ad 100644 --- a/patch/patches/runhooks.patch +++ b/patch/patches/runhooks.patch @@ -1,5 +1,5 @@ diff --git build/toolchain/win/setup_toolchain.py build/toolchain/win/setup_toolchain.py -index f66de0aa63c9..98a510a6a244 100644 +index f66de0aa63c9e..98a510a6a2440 100644 --- build/toolchain/win/setup_toolchain.py +++ build/toolchain/win/setup_toolchain.py @@ -154,13 +154,17 @@ def _LoadToolchainEnv(cpu, toolchain_root, sdk_dir, target_store): @@ -26,7 +26,7 @@ index f66de0aa63c9..98a510a6a244 100644 if (cpu != 'x64'): # x64 is default target CPU thus any other CPU requires a target set diff --git build/vs_toolchain.py build/vs_toolchain.py -index c3b1182b75b4..04a472b149d4 100755 +index c3b1182b75b4f..04a472b149d42 100755 --- build/vs_toolchain.py +++ build/vs_toolchain.py @@ -102,9 +102,16 @@ def SetEnvironmentAndGetRuntimeDllDirs(): diff --git a/patch/patches/rwh_background_color_1984.patch b/patch/patches/rwh_background_color_1984.patch index 98a870f4d..44e19d1a3 100644 --- a/patch/patches/rwh_background_color_1984.patch +++ b/patch/patches/rwh_background_color_1984.patch @@ -1,8 +1,8 @@ diff --git content/browser/renderer_host/render_widget_host_view_aura.cc content/browser/renderer_host/render_widget_host_view_aura.cc -index 8e71577881b0..70b4f77fe954 100644 +index 9b474bb0f927e..febee0f9afa6e 100644 --- content/browser/renderer_host/render_widget_host_view_aura.cc +++ content/browser/renderer_host/render_widget_host_view_aura.cc -@@ -645,10 +645,12 @@ gfx::Rect RenderWidgetHostViewAura::GetViewBounds() { +@@ -648,10 +648,12 @@ gfx::Rect RenderWidgetHostViewAura::GetViewBounds() { void RenderWidgetHostViewAura::UpdateBackgroundColor() { DCHECK(GetBackgroundColor()); @@ -19,7 +19,7 @@ index 8e71577881b0..70b4f77fe954 100644 } base::Optional RenderWidgetHostViewAura::GetDisplayFeature() { -@@ -2015,6 +2017,16 @@ void RenderWidgetHostViewAura::CreateAuraWindow(aura::client::WindowType type) { +@@ -2018,6 +2020,16 @@ void RenderWidgetHostViewAura::CreateAuraWindow(aura::client::WindowType type) { // This needs to happen only after |window_| has been initialized using // Init(), because it needs to have the layer. window_->SetEmbedFrameSinkId(frame_sink_id_); diff --git a/patch/patches/services_network_2622.patch b/patch/patches/services_network_2622.patch index b10507f49..2c77da7e4 100644 --- a/patch/patches/services_network_2622.patch +++ b/patch/patches/services_network_2622.patch @@ -1,8 +1,8 @@ diff --git chrome/browser/net/profile_network_context_service.cc chrome/browser/net/profile_network_context_service.cc -index 33681db05353..646e875a6235 100644 +index b41fe282dea38..c5fc618d2fe89 100644 --- chrome/browser/net/profile_network_context_service.cc +++ chrome/browser/net/profile_network_context_service.cc -@@ -20,6 +20,7 @@ +@@ -21,6 +21,7 @@ #include "base/task/post_task.h" #include "base/task/thread_pool.h" #include "build/chromeos_buildflags.h" @@ -10,7 +10,7 @@ index 33681db05353..646e875a6235 100644 #include "chrome/browser/browser_process.h" #include "chrome/browser/content_settings/cookie_settings_factory.h" #include "chrome/browser/content_settings/host_content_settings_map_factory.h" -@@ -683,7 +684,19 @@ void ProfileNetworkContextService::ConfigureNetworkContextParamsInternal( +@@ -684,7 +685,19 @@ void ProfileNetworkContextService::ConfigureNetworkContextParamsInternal( // Configure on-disk storage for non-OTR profiles. OTR profiles just use // default behavior (in memory storage, default sizes). @@ -31,7 +31,7 @@ index 33681db05353..646e875a6235 100644 PrefService* local_state = g_browser_process->local_state(); // Configure the HTTP cache path and size. base::FilePath base_cache_path; -@@ -696,7 +709,9 @@ void ProfileNetworkContextService::ConfigureNetworkContextParamsInternal( +@@ -697,7 +710,9 @@ void ProfileNetworkContextService::ConfigureNetworkContextParamsInternal( base_cache_path.Append(chrome::kCacheDirname); network_context_params->http_cache_max_size = local_state->GetInteger(prefs::kDiskCacheSize); @@ -42,10 +42,10 @@ index 33681db05353..646e875a6235 100644 // change. network_context_params->http_server_properties_path = diff --git net/cookies/cookie_monster.cc net/cookies/cookie_monster.cc -index e8e5c326c794..9ed417d9d20d 100644 +index dd1ff2e34abc6..755c3ac5441f2 100644 --- net/cookies/cookie_monster.cc +++ net/cookies/cookie_monster.cc -@@ -475,6 +475,25 @@ void CookieMonster::SetCookieableSchemes( +@@ -495,6 +495,25 @@ void CookieMonster::SetCookieableSchemes( MaybeRunCookieCallback(std::move(callback), true); } @@ -72,10 +72,10 @@ index e8e5c326c794..9ed417d9d20d 100644 void CookieMonster::SetPersistSessionCookies(bool persist_session_cookies) { DCHECK(thread_checker_.CalledOnValidThread()); diff --git net/cookies/cookie_monster.h net/cookies/cookie_monster.h -index 426507596516..2ae97326e653 100644 +index 00446acaabc1f..78235cfc1ed37 100644 --- net/cookies/cookie_monster.h +++ net/cookies/cookie_monster.h -@@ -184,6 +184,8 @@ class NET_EXPORT CookieMonster : public CookieStore { +@@ -180,6 +180,8 @@ class NET_EXPORT CookieMonster : public CookieStore { CookieChangeDispatcher& GetChangeDispatcher() override; void SetCookieableSchemes(const std::vector& schemes, SetCookieableSchemesCallback callback) override; @@ -85,7 +85,7 @@ index 426507596516..2ae97326e653 100644 // Enables writing session cookies into the cookie database. If this this // method is called, it must be called before first use of the instance diff --git net/cookies/cookie_store.h net/cookies/cookie_store.h -index 5ffbe648343d..3d9a0f2e828f 100644 +index 5ffbe648343da..3d9a0f2e828f6 100644 --- net/cookies/cookie_store.h +++ net/cookies/cookie_store.h @@ -149,6 +149,11 @@ class NET_EXPORT CookieStore { @@ -101,7 +101,7 @@ index 5ffbe648343d..3d9a0f2e828f 100644 virtual void DumpMemoryStats(base::trace_event::ProcessMemoryDump* pmd, const std::string& parent_absolute_name) const; diff --git services/network/cookie_manager.cc services/network/cookie_manager.cc -index f91ffe61dba5..f3482e68cd11 100644 +index f91ffe61dba5a..f3482e68cd114 100644 --- services/network/cookie_manager.cc +++ services/network/cookie_manager.cc @@ -230,14 +230,9 @@ void CookieManager::FlushCookieStore(FlushCookieStoreCallback callback) { @@ -123,10 +123,10 @@ index f91ffe61dba5..f3482e68cd11 100644 void CookieManager::SetForceKeepSessionState() { diff --git services/network/network_context.cc services/network/network_context.cc -index cbef8450741b..c0177e62cdc4 100644 +index 8f70586b27c92..4c59ca3c452ec 100644 --- services/network/network_context.cc +++ services/network/network_context.cc -@@ -1987,16 +1987,27 @@ URLRequestContextOwner NetworkContext::MakeURLRequestContext( +@@ -2000,16 +2000,27 @@ URLRequestContextOwner NetworkContext::MakeURLRequestContext( network_service_->network_quality_estimator()); } @@ -157,10 +157,10 @@ index cbef8450741b..c0177e62cdc4 100644 trust_token_store_ = std::make_unique(); diff --git services/network/public/mojom/network_context.mojom services/network/public/mojom/network_context.mojom -index 5aca8515f5ce..bbbb982ae52e 100644 +index ee27133a56df4..3da7932bac49c 100644 --- services/network/public/mojom/network_context.mojom +++ services/network/public/mojom/network_context.mojom -@@ -251,6 +251,9 @@ struct NetworkContextParams { +@@ -252,6 +252,9 @@ struct NetworkContextParams { // cookies. Otherwise it should be false. bool persist_session_cookies = false; diff --git a/patch/patches/services_network_2718.patch b/patch/patches/services_network_2718.patch index a02f30e2b..c0bc26a3d 100644 --- a/patch/patches/services_network_2718.patch +++ b/patch/patches/services_network_2718.patch @@ -1,8 +1,8 @@ diff --git content/browser/storage_partition_impl.cc content/browser/storage_partition_impl.cc -index a948dde94213..4f4b09647fdb 100644 +index 2a08f566a353e..d361989b60567 100644 --- content/browser/storage_partition_impl.cc +++ content/browser/storage_partition_impl.cc -@@ -495,10 +495,6 @@ class LoginHandlerDelegate { +@@ -489,10 +489,6 @@ class LoginHandlerDelegate { } WebContents* web_contents = web_contents_getter_.Run(); @@ -13,7 +13,7 @@ index a948dde94213..4f4b09647fdb 100644 // WeakPtr is not strictly necessary here due to OnRequestCancelled. creating_login_delegate_ = true; -@@ -551,12 +547,6 @@ void OnAuthRequiredContinuation( +@@ -545,12 +541,6 @@ void OnAuthRequiredContinuation( mojo::PendingRemote auth_challenge_responder, base::RepeatingCallback web_contents_getter) { @@ -26,7 +26,7 @@ index a948dde94213..4f4b09647fdb 100644 new LoginHandlerDelegate(std::move(auth_challenge_responder), std::move(web_contents_getter), auth_info, is_request_for_main_frame, process_id, routing_id, -@@ -2479,8 +2469,12 @@ void StoragePartitionImpl::GetQuotaSettings( +@@ -2502,8 +2492,12 @@ void StoragePartitionImpl::GetQuotaSettings( return; } @@ -40,7 +40,7 @@ index a948dde94213..4f4b09647fdb 100644 storage::GetDefaultDeviceInfoHelper(), std::move(callback)); } -@@ -2493,6 +2487,11 @@ void StoragePartitionImpl::InitNetworkContext() { +@@ -2516,6 +2510,11 @@ void StoragePartitionImpl::InitNetworkContext() { GetContentClient()->browser()->ConfigureNetworkContextParams( browser_context_, is_in_memory_, relative_partition_path_, context_params.get(), cert_verifier_creation_params.get()); diff --git a/patch/patches/set_resize_background_color.patch b/patch/patches/set_resize_background_color.patch index b1574521d..a056c2bee 100644 --- a/patch/patches/set_resize_background_color.patch +++ b/patch/patches/set_resize_background_color.patch @@ -1,8 +1,8 @@ diff --git ui/views/controls/native/native_view_host.cc ui/views/controls/native/native_view_host.cc -index a5a09b31bd8d..673da74e75aa 100644 +index 52f9b871022de..4cad419a8e373 100644 --- ui/views/controls/native/native_view_host.cc +++ ui/views/controls/native/native_view_host.cc -@@ -157,7 +157,7 @@ void NativeViewHost::OnPaint(gfx::Canvas* canvas) { +@@ -161,7 +161,7 @@ void NativeViewHost::OnPaint(gfx::Canvas* canvas) { // It would be nice if this used some approximation of the page's // current background color. if (native_wrapper_->HasInstalledClip()) @@ -12,7 +12,7 @@ index a5a09b31bd8d..673da74e75aa 100644 void NativeViewHost::VisibilityChanged(View* starting_from, bool is_visible) { diff --git ui/views/controls/native/native_view_host.h ui/views/controls/native/native_view_host.h -index ab2371857a00..8dccc190fa89 100644 +index ab2371857a00a..8dccc190fa896 100644 --- ui/views/controls/native/native_view_host.h +++ ui/views/controls/native/native_view_host.h @@ -95,6 +95,12 @@ class VIEWS_EXPORT NativeViewHost : public View { @@ -39,10 +39,10 @@ index ab2371857a00..8dccc190fa89 100644 }; diff --git ui/views/controls/webview/webview.cc ui/views/controls/webview/webview.cc -index 2ade47b0077d..7d64510adebb 100644 +index 9cb29421a3df9..a5ed399820a81 100644 --- ui/views/controls/webview/webview.cc +++ ui/views/controls/webview/webview.cc -@@ -129,6 +129,10 @@ void WebView::EnableSizingFromWebContents(const gfx::Size& min_size, +@@ -130,6 +130,10 @@ void WebView::EnableSizingFromWebContents(const gfx::Size& min_size, MaybeEnableAutoResize(web_contents()->GetMainFrame()); } @@ -54,7 +54,7 @@ index 2ade47b0077d..7d64510adebb 100644 if (crashed_overlay_view_ == crashed_overlay_view) return; diff --git ui/views/controls/webview/webview.h ui/views/controls/webview/webview.h -index 94e25679eab8..3943f8c4866f 100644 +index 1bb2399d0d139..5bb1fcde4e3bc 100644 --- ui/views/controls/webview/webview.h +++ ui/views/controls/webview/webview.h @@ -78,6 +78,10 @@ class WEBVIEW_EXPORT WebView : public View, diff --git a/patch/patches/storage_incognito_2289.patch b/patch/patches/storage_incognito_2289.patch index ed7b86c21..aa3bd4f72 100644 --- a/patch/patches/storage_incognito_2289.patch +++ b/patch/patches/storage_incognito_2289.patch @@ -1,5 +1,5 @@ diff --git content/browser/blob_storage/chrome_blob_storage_context.cc content/browser/blob_storage/chrome_blob_storage_context.cc -index 676c2cc22bac..e6f9642e1cba 100644 +index 676c2cc22baca..e6f9642e1cba5 100644 --- content/browser/blob_storage/chrome_blob_storage_context.cc +++ content/browser/blob_storage/chrome_blob_storage_context.cc @@ -120,7 +120,8 @@ ChromeBlobStorageContext* ChromeBlobStorageContext::GetFor( @@ -13,34 +13,57 @@ index 676c2cc22bac..e6f9642e1cba 100644 {base::MayBlock(), base::TaskPriority::USER_VISIBLE, base::TaskShutdownBehavior::SKIP_ON_SHUTDOWN}); diff --git content/browser/browser_context.cc content/browser/browser_context.cc -index 8b053971dea9..170f5c1b3863 100644 +index eb88768c1e1c2..2c6c143d4660e 100644 --- content/browser/browser_context.cc +++ content/browser/browser_context.cc -@@ -235,7 +235,7 @@ StoragePartition* BrowserContext::GetStoragePartition( - GetStoragePartitionMap(browser_context); +@@ -152,7 +152,7 @@ StoragePartition* BrowserContext::GetStoragePartition( + BrowserContext* self, + const StoragePartitionConfig& storage_partition_config, + bool can_create) { +- if (self->IsOffTheRecord()) { ++ if (self->IsOffTheRecord() || self->GetPath().empty()) { + // An off the record profile MUST only use in memory storage partitions. + CHECK(storage_partition_config.in_memory()); + } +@@ -430,7 +430,8 @@ BrowserContext::CreateVideoDecodePerfHistory() { + const bool kUseInMemoryDBDefault = false; + bool use_in_memory_db = base::GetFieldTrialParamByFeatureAsBool( + media::kMediaCapabilitiesWithParameters, kUseInMemoryDBParamName, +- kUseInMemoryDBDefault); ++ kUseInMemoryDBDefault) || ++ GetPath().empty(); - auto config_to_use = storage_partition_config; -- if (browser_context->IsOffTheRecord()) -+ if (browser_context->IsOffTheRecord() || browser_context->GetPath().empty()) - config_to_use = storage_partition_config.CopyWithInMemorySet(); + std::unique_ptr stats_db; + if (use_in_memory_db) { +diff --git content/public/browser/storage_partition_config.cc content/public/browser/storage_partition_config.cc +index 9d87aa95e9300..ae82242746e45 100644 +--- content/public/browser/storage_partition_config.cc ++++ content/public/browser/storage_partition_config.cc +@@ -7,6 +7,7 @@ + #include - return partition_map->Get(config_to_use, can_create); -@@ -540,7 +540,7 @@ media::VideoDecodePerfHistory* BrowserContext::GetVideoDecodePerfHistory() { - kUseInMemoryDBDefault); + #include "base/check.h" ++#include "base/files/file_path.h" + #include "base/strings/string_number_conversions.h" + #include "content/public/browser/browser_context.h" + #include "url/gurl.h" +@@ -36,7 +37,8 @@ StoragePartitionConfig& StoragePartitionConfig::operator=( + // static + StoragePartitionConfig StoragePartitionConfig::CreateDefault( + BrowserContext* browser_context) { +- return StoragePartitionConfig("", "", browser_context->IsOffTheRecord()); ++ return StoragePartitionConfig("", "", browser_context->IsOffTheRecord() || ++ browser_context->GetPath().empty()); + } - std::unique_ptr stats_db; -- if (use_in_memory_db) { -+ if (use_in_memory_db || GetPath().empty()) { - stats_db = - std::make_unique(nullptr); - } else { + // static diff --git storage/browser/database/database_tracker.cc storage/browser/database/database_tracker.cc -index cb40db947624..807a7c24bc6d 100644 +index 806e42d494176..1f16adce58383 100644 --- storage/browser/database/database_tracker.cc +++ storage/browser/database/database_tracker.cc -@@ -495,7 +495,7 @@ bool DatabaseTracker::LazyInit() { - databases_table_.reset(new DatabasesTable(db_.get())); - meta_table_.reset(new sql::MetaTable()); +@@ -494,7 +494,7 @@ bool DatabaseTracker::LazyInit() { + databases_table_ = std::make_unique(db_.get()); + meta_table_ = std::make_unique(); - is_initialized_ = base::CreateDirectory(db_dir_) && + is_initialized_ = (is_incognito_ ? true : base::CreateDirectory(db_dir_)) && diff --git a/patch/patches/trace_event.patch b/patch/patches/trace_event.patch index 1ca98ff9f..449465464 100644 --- a/patch/patches/trace_event.patch +++ b/patch/patches/trace_event.patch @@ -1,5 +1,5 @@ diff --git base/trace_event/builtin_categories.h base/trace_event/builtin_categories.h -index 1a3fe9a570a1..dd7c52961464 100644 +index c697f7ced74e8..0982cd85150bc 100644 --- base/trace_event/builtin_categories.h +++ base/trace_event/builtin_categories.h @@ -59,6 +59,8 @@ diff --git a/patch/patches/ui_dragdrop_355390.patch b/patch/patches/ui_dragdrop_355390.patch index fa6715601..b6894c123 100644 --- a/patch/patches/ui_dragdrop_355390.patch +++ b/patch/patches/ui_dragdrop_355390.patch @@ -1,5 +1,5 @@ diff --git ui/base/x/x11_os_exchange_data_provider.cc ui/base/x/x11_os_exchange_data_provider.cc -index 78d2b362c2d6..93cff0224ce1 100644 +index cbf6e7f50b83a..2786d99a8b936 100644 --- ui/base/x/x11_os_exchange_data_provider.cc +++ ui/base/x/x11_os_exchange_data_provider.cc @@ -122,7 +122,8 @@ void XOSExchangeDataProvider::SetURL(const GURL& url, diff --git a/patch/patches/underlay_1051.patch b/patch/patches/underlay_1051.patch index 864c7def1..634f7d1d7 100644 --- a/patch/patches/underlay_1051.patch +++ b/patch/patches/underlay_1051.patch @@ -1,5 +1,5 @@ diff --git ui/base/cocoa/underlay_opengl_hosting_window.h ui/base/cocoa/underlay_opengl_hosting_window.h -index ec1c6c972ee8..9f7334205132 100644 +index ec1c6c972ee8d..9f73342051325 100644 --- ui/base/cocoa/underlay_opengl_hosting_window.h +++ ui/base/cocoa/underlay_opengl_hosting_window.h @@ -12,7 +12,7 @@ diff --git a/patch/patches/views_1749_2102.patch b/patch/patches/views_1749_2102.patch index 516840403..f13c6bfd1 100644 --- a/patch/patches/views_1749_2102.patch +++ b/patch/patches/views_1749_2102.patch @@ -1,8 +1,8 @@ diff --git ui/base/models/menu_model.h ui/base/models/menu_model.h -index bf7988cab13a..1c58c54bc7b6 100644 +index 2f8dd2c08a95b..e2ca02b74ffba 100644 --- ui/base/models/menu_model.h +++ ui/base/models/menu_model.h -@@ -12,8 +12,11 @@ +@@ -13,8 +13,11 @@ #include "ui/base/models/menu_separator_types.h" #include "ui/gfx/native_widget_types.h" @@ -14,7 +14,7 @@ index bf7988cab13a..1c58c54bc7b6 100644 } namespace ui { -@@ -137,6 +140,27 @@ class COMPONENT_EXPORT(UI_BASE) MenuModel +@@ -138,6 +141,27 @@ class COMPONENT_EXPORT(UI_BASE) MenuModel // |event_flags| is a bit mask of ui::EventFlags. virtual void ActivatedAt(int index, int event_flags); @@ -43,10 +43,10 @@ index bf7988cab13a..1c58c54bc7b6 100644 virtual void MenuWillShow() {} diff --git ui/gfx/render_text.cc ui/gfx/render_text.cc -index 8b6064d15996..5004292484ef 100644 +index c80c92f084177..609a2681a4c6d 100644 --- ui/gfx/render_text.cc +++ ui/gfx/render_text.cc -@@ -617,6 +617,14 @@ void RenderText::SetWhitespaceElision(base::Optional whitespace_elision) { +@@ -623,6 +623,14 @@ void RenderText::SetWhitespaceElision(base::Optional whitespace_elision) { } } @@ -61,7 +61,7 @@ index 8b6064d15996..5004292484ef 100644 void RenderText::SetDisplayRect(const Rect& r) { if (r != display_rect_) { display_rect_ = r; -@@ -2003,6 +2011,19 @@ void RenderText::OnTextAttributeChanged() { +@@ -2009,6 +2017,19 @@ void RenderText::OnTextAttributeChanged() { layout_text_up_to_date_ = false; @@ -82,10 +82,10 @@ index 8b6064d15996..5004292484ef 100644 } diff --git ui/gfx/render_text.h ui/gfx/render_text.h -index bb7ce1ca82b4..a1c0d16b6fea 100644 +index b4e825ddfb6bd..3b894beade251 100644 --- ui/gfx/render_text.h +++ ui/gfx/render_text.h -@@ -346,6 +346,10 @@ class GFX_EXPORT RenderText { +@@ -345,6 +345,10 @@ class GFX_EXPORT RenderText { return whitespace_elision_; } @@ -96,7 +96,7 @@ index bb7ce1ca82b4..a1c0d16b6fea 100644 const Rect& display_rect() const { return display_rect_; } void SetDisplayRect(const Rect& r); -@@ -1054,6 +1058,8 @@ class GFX_EXPORT RenderText { +@@ -1053,6 +1057,8 @@ class GFX_EXPORT RenderText { // Tell whether or not the |layout_text_| needs an update or is up to date. mutable bool layout_text_up_to_date_ = false; @@ -106,7 +106,7 @@ index bb7ce1ca82b4..a1c0d16b6fea 100644 }; diff --git ui/views/animation/ink_drop_host_view.h ui/views/animation/ink_drop_host_view.h -index 8c8f77fc26db..0a9f50df07c1 100644 +index 8c8f77fc26db3..0a9f50df07c1d 100644 --- ui/views/animation/ink_drop_host_view.h +++ ui/views/animation/ink_drop_host_view.h @@ -142,6 +142,8 @@ class VIEWS_EXPORT InkDropHostView : public View { @@ -119,10 +119,10 @@ index 8c8f77fc26db..0a9f50df07c1 100644 // Size used for the default SquareInkDropRipple. static constexpr gfx::Size kDefaultInkDropSize = gfx::Size(24, 24); diff --git ui/views/controls/button/label_button.cc ui/views/controls/button/label_button.cc -index e8b6cd6b290d..3293e3f081b9 100644 +index 7e744be3c39e2..0150a0e347111 100644 --- ui/views/controls/button/label_button.cc +++ ui/views/controls/button/label_button.cc -@@ -506,6 +506,12 @@ void LabelButton::OnThemeChanged() { +@@ -498,6 +498,12 @@ void LabelButton::OnThemeChanged() { SchedulePaint(); } @@ -136,7 +136,7 @@ index e8b6cd6b290d..3293e3f081b9 100644 Button::StateChanged(old_state); ResetLabelEnabledColor(); diff --git ui/views/controls/button/label_button.h ui/views/controls/button/label_button.h -index 39887eb2625c..727c1ff325f7 100644 +index 1ad627bb786b8..624061e6ba3c7 100644 --- ui/views/controls/button/label_button.h +++ ui/views/controls/button/label_button.h @@ -133,6 +133,9 @@ class VIEWS_EXPORT LabelButton : public Button, public NativeThemeDelegate { @@ -150,7 +150,7 @@ index 39887eb2625c..727c1ff325f7 100644 ImageView* image() const { return image_; } Label* label() const { return label_; } diff --git ui/views/controls/label.cc ui/views/controls/label.cc -index d7f4226a37fe..d8fd16500b3c 100644 +index 382b0ea115a5c..32d213250c938 100644 --- ui/views/controls/label.cc +++ ui/views/controls/label.cc @@ -49,12 +49,27 @@ enum LabelPropertyKey { @@ -167,7 +167,7 @@ index d7f4226a37fe..d8fd16500b3c 100644 +// Strips accelerator character prefixes in |text| if needed, based on |flags|. +// Returns a range in |text| to underline or Range::InvalidRange() if +// underlining is not needed. -+gfx::Range StripAcceleratorChars(int flags, base::string16* text) { ++gfx::Range StripAcceleratorChars(int flags, std::u16string* text) { + if (flags & (gfx::Canvas::SHOW_PREFIX | gfx::Canvas::HIDE_PREFIX)) { + int char_pos = -1; + int char_span = 0; @@ -181,8 +181,8 @@ index d7f4226a37fe..d8fd16500b3c 100644 } // namespace namespace views { -@@ -413,6 +428,15 @@ base::string16 Label::GetTooltipText() const { - return tooltip_text_; +@@ -409,6 +424,15 @@ void Label::SetElideBehavior(gfx::ElideBehavior elide_behavior) { + OnPropertyChanged(&elide_behavior_, kPropertyEffectsPreferredSizeChanged); } +void Label::SetDrawStringsFlags(int flags) { @@ -194,15 +194,15 @@ index d7f4226a37fe..d8fd16500b3c 100644 + kPropertyEffectsPreferredSizeChanged); +} + - void Label::SetTooltipText(const base::string16& tooltip_text) { - DCHECK(handles_tooltips_); - if (tooltip_text_ == tooltip_text) + std::u16string Label::GetTooltipText() const { + return tooltip_text_; + } @@ -706,6 +730,16 @@ std::unique_ptr Label::CreateRenderText() const { render_text->SelectRange(stored_selection_range_); } + if (draw_strings_flags_ != 0) { -+ base::string16 text_str = GetText(); ++ auto text_str = GetText(); + gfx::Range range = StripAcceleratorChars(draw_strings_flags_, &text_str); + render_text->SetText(text_str); + if (range.IsValid()) { @@ -215,7 +215,7 @@ index d7f4226a37fe..d8fd16500b3c 100644 } diff --git ui/views/controls/label.h ui/views/controls/label.h -index 793189681a67..92397be97b0e 100644 +index 269425ed7c04a..5dea3a3dbd652 100644 --- ui/views/controls/label.h +++ ui/views/controls/label.h @@ -225,6 +225,10 @@ class VIEWS_EXPORT Label : public View, @@ -238,10 +238,10 @@ index 793189681a67..92397be97b0e 100644 std::unique_ptr selection_controller_; diff --git ui/views/controls/menu/menu_controller.cc ui/views/controls/menu/menu_controller.cc -index 3beb5516e121..36d9f5e42460 100644 +index 7c081b7d8a4e1..36c5bb5e8f93a 100644 --- ui/views/controls/menu/menu_controller.cc +++ ui/views/controls/menu/menu_controller.cc -@@ -2738,8 +2738,13 @@ MenuItemView* MenuController::FindNextSelectableMenuItem( +@@ -2748,8 +2748,13 @@ MenuItemView* MenuController::FindNextSelectableMenuItem( void MenuController::OpenSubmenuChangeSelectionIfCan() { MenuItemView* item = pending_state_.item; @@ -256,7 +256,7 @@ index 3beb5516e121..36d9f5e42460 100644 MenuItemView* to_select = nullptr; if (!item->GetSubmenu()->GetMenuItems().empty()) to_select = FindInitialSelectableMenuItem(item, INCREMENT_SELECTION_DOWN); -@@ -2758,8 +2763,10 @@ void MenuController::OpenSubmenuChangeSelectionIfCan() { +@@ -2768,8 +2773,10 @@ void MenuController::OpenSubmenuChangeSelectionIfCan() { void MenuController::CloseSubmenu() { MenuItemView* item = state_.item; DCHECK(item); @@ -269,10 +269,10 @@ index 3beb5516e121..36d9f5e42460 100644 SetSelection(item, SELECTION_UPDATE_IMMEDIATELY); else if (item->GetParentMenuItem()->GetParentMenuItem()) diff --git ui/views/controls/menu/menu_delegate.h ui/views/controls/menu/menu_delegate.h -index d863d6f874aa..f0310ca3b776 100644 +index a280e9d74016e..59a8eda9b1d84 100644 --- ui/views/controls/menu/menu_delegate.h +++ ui/views/controls/menu/menu_delegate.h -@@ -81,6 +81,22 @@ class VIEWS_EXPORT MenuDelegate { +@@ -79,6 +79,22 @@ class VIEWS_EXPORT MenuDelegate { // parts of |style| or leave it unmodified. virtual void GetLabelStyle(int id, LabelStyle* style) const; @@ -294,8 +294,8 @@ index d863d6f874aa..f0310ca3b776 100644 + // The tooltip shown for the menu item. This is invoked when the user // hovers over the item, and no tooltip text has been set for that item. - virtual base::string16 GetTooltipText(int id, -@@ -209,6 +225,11 @@ class VIEWS_EXPORT MenuDelegate { + virtual std::u16string GetTooltipText(int id, +@@ -207,6 +223,11 @@ class VIEWS_EXPORT MenuDelegate { bool* has_mnemonics, MenuButton** button); @@ -308,10 +308,10 @@ index d863d6f874aa..f0310ca3b776 100644 virtual int GetMaxWidthForMenu(MenuItemView* menu); diff --git ui/views/controls/menu/menu_item_view.cc ui/views/controls/menu/menu_item_view.cc -index 89f6c657d0a6..6d1a0673f94f 100644 +index e12fe2ac6ad80..347174b8c21a3 100644 --- ui/views/controls/menu/menu_item_view.cc +++ ui/views/controls/menu/menu_item_view.cc -@@ -1097,6 +1097,15 @@ void MenuItemView::PaintBackground(gfx::Canvas* canvas, +@@ -1087,6 +1087,15 @@ void MenuItemView::PaintBackground(gfx::Canvas* canvas, spilling_rect.set_y(spilling_rect.y() - corner_radius_); spilling_rect.set_height(spilling_rect.height() + corner_radius_); canvas->DrawRoundRect(spilling_rect, corner_radius_, flags); @@ -327,7 +327,7 @@ index 89f6c657d0a6..6d1a0673f94f 100644 } else if (render_selection) { gfx::Rect item_bounds = GetLocalBounds(); if (type_ == Type::kActionableSubMenu) { -@@ -1164,6 +1173,13 @@ void MenuItemView::PaintMinorIconAndText( +@@ -1154,6 +1163,13 @@ void MenuItemView::PaintMinorIconAndText( } SkColor MenuItemView::GetTextColor(bool minor, bool render_selection) const { @@ -342,7 +342,7 @@ index 89f6c657d0a6..6d1a0673f94f 100644 GetMenuController() && GetMenuController()->use_touchable_layout() ? style::CONTEXT_TOUCH_MENU diff --git ui/views/controls/menu/menu_model_adapter.cc ui/views/controls/menu/menu_model_adapter.cc -index 5dd4a9bbb8cf..33894ceb408f 100644 +index fbd30c4914bbe..851d03a9d45e8 100644 --- ui/views/controls/menu/menu_model_adapter.cc +++ ui/views/controls/menu/menu_model_adapter.cc @@ -242,6 +242,77 @@ bool MenuModelAdapter::IsItemChecked(int id) const { @@ -424,7 +424,7 @@ index 5dd4a9bbb8cf..33894ceb408f 100644 // Look up the menu model for this menu. const std::map::const_iterator map_iterator = diff --git ui/views/controls/menu/menu_model_adapter.h ui/views/controls/menu/menu_model_adapter.h -index 78f832fd3acf..cb030c991614 100644 +index c7aaf7286b74d..2ba3a9c10fe03 100644 --- ui/views/controls/menu/menu_model_adapter.h +++ ui/views/controls/menu/menu_model_adapter.h @@ -84,6 +84,20 @@ class VIEWS_EXPORT MenuModelAdapter : public MenuDelegate, @@ -449,10 +449,10 @@ index 78f832fd3acf..cb030c991614 100644 void WillHideMenu(MenuItemView* menu) override; void OnMenuClosed(MenuItemView* menu) override; diff --git ui/views/controls/menu/menu_scroll_view_container.cc ui/views/controls/menu/menu_scroll_view_container.cc -index 8e21f427f6af..2dd8451c0fdc 100644 +index 3f9f76315def1..9f0e0c791eb0e 100644 --- ui/views/controls/menu/menu_scroll_view_container.cc +++ ui/views/controls/menu/menu_scroll_view_container.cc -@@ -211,6 +211,11 @@ MenuScrollViewContainer::MenuScrollViewContainer(SubmenuView* content_view) +@@ -234,6 +234,11 @@ MenuScrollViewContainer::MenuScrollViewContainer(SubmenuView* content_view) scroll_down_button_ = AddChildView(std::make_unique(content_view, false)); @@ -465,7 +465,7 @@ index 8e21f427f6af..2dd8451c0fdc 100644 content_view_->GetMenuItem()->GetMenuController()->GetAnchorPosition()); diff --git ui/views/test/ui_controls_factory_desktop_aurax11.cc ui/views/test/ui_controls_factory_desktop_aurax11.cc -index 64e09ff4359a..714e8e9ff661 100644 +index 64e09ff4359a8..714e8e9ff6610 100644 --- ui/views/test/ui_controls_factory_desktop_aurax11.cc +++ ui/views/test/ui_controls_factory_desktop_aurax11.cc @@ -89,10 +89,6 @@ class UIControlsDesktopX11 : public UIControlsAura { @@ -480,7 +480,7 @@ index 64e09ff4359a..714e8e9ff661 100644 x11_ui_controls_test_helper_.ButtonDownMask() == 0) { // Move the cursor because EnterNotify/LeaveNotify are generated with the diff --git ui/views/view.h ui/views/view.h -index 0ae7efa30827..51f3ff3ebeae 100644 +index b13e80f12a5c1..5c19ea1854e65 100644 --- ui/views/view.h +++ ui/views/view.h @@ -25,6 +25,7 @@ @@ -491,7 +491,7 @@ index 0ae7efa30827..51f3ff3ebeae 100644 #include "build/build_config.h" #include "third_party/skia/include/core/SkPath.h" #include "ui/accessibility/ax_enums.mojom-forward.h" -@@ -272,6 +273,7 @@ class VIEWS_EXPORT View : public ui::LayerDelegate, +@@ -273,6 +274,7 @@ class VIEWS_EXPORT View : public ui::LayerDelegate, public ui::EventTarget, public ui::EventHandler, public ui::PropertyHandler, diff --git a/patch/patches/views_widget.patch b/patch/patches/views_widget.patch index 3450834b5..d57eddcc1 100644 --- a/patch/patches/views_widget.patch +++ b/patch/patches/views_widget.patch @@ -1,8 +1,8 @@ diff --git content/browser/renderer_host/render_widget_host_view_base.cc content/browser/renderer_host/render_widget_host_view_base.cc -index e2085913e2f4..6c6bd46cb125 100644 +index cb85ae32d6f0d..530375718eb09 100644 --- content/browser/renderer_host/render_widget_host_view_base.cc +++ content/browser/renderer_host/render_widget_host_view_base.cc -@@ -527,6 +527,14 @@ float RenderWidgetHostViewBase::GetDeviceScaleFactor() { +@@ -561,6 +561,14 @@ float RenderWidgetHostViewBase::GetDeviceScaleFactor() { return screen_info.device_scale_factor; } @@ -18,7 +18,7 @@ index e2085913e2f4..6c6bd46cb125 100644 if (!GetMouseWheelPhaseHandler()) return; diff --git content/browser/renderer_host/render_widget_host_view_base.h content/browser/renderer_host/render_widget_host_view_base.h -index cf71a09595af..49d41b5d7c52 100644 +index b9d5c2bba2a9f..b4de628ddaacc 100644 --- content/browser/renderer_host/render_widget_host_view_base.h +++ content/browser/renderer_host/render_widget_host_view_base.h @@ -65,6 +65,7 @@ class CursorManager; @@ -29,7 +29,7 @@ index cf71a09595af..49d41b5d7c52 100644 class SyntheticGestureTarget; class TextInputManager; class TouchSelectionControllerClientManager; -@@ -114,6 +115,8 @@ class CONTENT_EXPORT RenderWidgetHostViewBase : public RenderWidgetHostView { +@@ -116,6 +117,8 @@ class CONTENT_EXPORT RenderWidgetHostViewBase : public RenderWidgetHostView { const gfx::Size& max_size) override; void DisableAutoResize(const gfx::Size& new_size) override; float GetDeviceScaleFactor() final; @@ -38,7 +38,7 @@ index cf71a09595af..49d41b5d7c52 100644 TouchSelectionControllerClientManager* GetTouchSelectionControllerClientManager() override; void SetRecordContentToVisibleTimeRequest( -@@ -404,6 +407,12 @@ class CONTENT_EXPORT RenderWidgetHostViewBase : public RenderWidgetHostView { +@@ -405,6 +408,12 @@ class CONTENT_EXPORT RenderWidgetHostViewBase : public RenderWidgetHostView { virtual void InitAsPopup(RenderWidgetHostView* parent_host_view, const gfx::Rect& bounds) = 0; @@ -51,7 +51,7 @@ index cf71a09595af..49d41b5d7c52 100644 // Sets the cursor for this view to the one associated with the specified // cursor_type. virtual void UpdateCursor(const WebCursor& cursor) = 0; -@@ -579,6 +588,10 @@ class CONTENT_EXPORT RenderWidgetHostViewBase : public RenderWidgetHostView { +@@ -580,6 +589,10 @@ class CONTENT_EXPORT RenderWidgetHostViewBase : public RenderWidgetHostView { bool is_currently_scrolling_viewport_ = false; @@ -63,11 +63,11 @@ index cf71a09595af..49d41b5d7c52 100644 FRIEND_TEST_ALL_PREFIXES( BrowserSideFlingBrowserTest, diff --git content/browser/renderer_host/render_widget_host_view_event_handler.cc content/browser/renderer_host/render_widget_host_view_event_handler.cc -index ffa7faf1cbd0..4aefbdc37ecb 100644 +index b18cbdf6cd352..b28104e40ccc7 100644 --- content/browser/renderer_host/render_widget_host_view_event_handler.cc +++ content/browser/renderer_host/render_widget_host_view_event_handler.cc @@ -37,6 +37,10 @@ - #include "ui/events/keycodes/dom/dom_code.h" + #include "ui/gfx/delegated_ink_point.h" #include "ui/touch_selection/touch_selection_controller.h" +#if defined(OS_LINUX) @@ -77,7 +77,7 @@ index ffa7faf1cbd0..4aefbdc37ecb 100644 #if defined(OS_WIN) #include "content/browser/renderer_host/render_frame_host_impl.h" #include "ui/aura/window_tree_host.h" -@@ -944,6 +948,14 @@ void RenderWidgetHostViewEventHandler::MoveCursorToCenter( +@@ -950,6 +954,14 @@ void RenderWidgetHostViewEventHandler::MoveCursorToCenter( } return; } @@ -92,7 +92,7 @@ index ffa7faf1cbd0..4aefbdc37ecb 100644 #endif synthetic_move_position_ = center_in_screen; } -@@ -973,6 +985,17 @@ bool RenderWidgetHostViewEventHandler::MatchesSynthesizedMovePosition( +@@ -979,6 +991,17 @@ bool RenderWidgetHostViewEventHandler::MatchesSynthesizedMovePosition( } void RenderWidgetHostViewEventHandler::SetKeyboardFocus() { @@ -111,10 +111,10 @@ index ffa7faf1cbd0..4aefbdc37ecb 100644 if (host_ && set_focus_on_mouse_down_or_key_event_) { set_focus_on_mouse_down_or_key_event_ = false; diff --git content/public/browser/render_widget_host_view.h content/public/browser/render_widget_host_view.h -index beba7a3a40b8..941acdfbff8b 100644 +index 12761b4460f00..3263598db64f8 100644 --- content/public/browser/render_widget_host_view.h +++ content/public/browser/render_widget_host_view.h -@@ -241,6 +241,14 @@ class CONTENT_EXPORT RenderWidgetHostView { +@@ -249,6 +249,14 @@ class CONTENT_EXPORT RenderWidgetHostView { // This must always return the same device scale factor as GetScreenInfo. virtual float GetDeviceScaleFactor() = 0; @@ -129,54 +129,22 @@ index beba7a3a40b8..941acdfbff8b 100644 #if defined(OS_MAC) // Set the view's active state (i.e., tint state of controls). virtual void SetActive(bool active) = 0; -diff --git ui/base/x/x11_window.cc ui/base/x/x11_window.cc -index 585a09a2b6d8..d38924a42ea6 100644 ---- ui/base/x/x11_window.cc -+++ ui/base/x/x11_window.cc -@@ -264,7 +264,8 @@ void XWindow::Init(const Configuration& config) { +diff --git ui/platform_window/x11/x11_window.cc ui/platform_window/x11/x11_window.cc +index 37649f7f332fc..4a77ed9229d53 100644 +--- ui/platform_window/x11/x11_window.cc ++++ ui/platform_window/x11/x11_window.cc +@@ -1610,7 +1610,8 @@ void X11Window::CreateXWindow(const PlatformWindowInitProperties& properties, req.border_pixel = 0; - bounds_in_pixels_ = SanitizeBounds(config.bounds); + bounds_in_pixels_ = SanitizeBounds(bounds); - req.parent = x_root_window_; -+ req.parent = config.parent_widget == gfx::kNullAcceleratedWidget ? -+ x_root_window_ : static_cast(config.parent_widget); ++ req.parent = properties.parent_widget == gfx::kNullAcceleratedWidget ? ++ x_root_window_ : static_cast(properties.parent_widget); req.x = bounds_in_pixels_.x(); req.y = bounds_in_pixels_.y(); req.width = bounds_in_pixels_.width(); -diff --git ui/base/x/x11_window.h ui/base/x/x11_window.h -index 0a870d41a042..74401dd1635f 100644 ---- ui/base/x/x11_window.h -+++ ui/base/x/x11_window.h -@@ -21,6 +21,7 @@ - #include "ui/gfx/geometry/rect.h" - #include "ui/gfx/geometry/size.h" - #include "ui/gfx/geometry/size_f.h" -+#include "ui/gfx/native_widget_types.h" - #include "ui/gfx/x/event.h" - #include "ui/gfx/x/sync.h" - #include "ui/gfx/x/xfixes.h" -@@ -94,6 +95,7 @@ class COMPONENT_EXPORT(UI_BASE_X) XWindow { - std::string wm_class_name; - std::string wm_class_class; - std::string wm_role_name; -+ gfx::AcceleratedWidget parent_widget = gfx::kNullAcceleratedWidget; - }; - - XWindow(); -diff --git ui/platform_window/x11/x11_window.cc ui/platform_window/x11/x11_window.cc -index 967dd5f1c099..7d135d890202 100644 ---- ui/platform_window/x11/x11_window.cc -+++ ui/platform_window/x11/x11_window.cc -@@ -93,6 +93,7 @@ ui::XWindow::Configuration ConvertInitPropertiesToXWindowConfig( - config.wm_class_class = properties.wm_class_class; - config.wm_role_name = properties.wm_role_name; - config.activatable = properties.activatable; -+ config.parent_widget = properties.parent_widget; - config.prefer_dark_theme = properties.prefer_dark_theme; - config.background_color = properties.background_color; - return config; diff --git ui/views/widget/desktop_aura/desktop_screen_win.cc ui/views/widget/desktop_aura/desktop_screen_win.cc -index 91c516429c2a..762a108fedf6 100644 +index 91c516429c2a4..762a108fedf69 100644 --- ui/views/widget/desktop_aura/desktop_screen_win.cc +++ ui/views/widget/desktop_aura/desktop_screen_win.cc @@ -18,6 +18,8 @@ DesktopScreenWin::~DesktopScreenWin() { @@ -189,7 +157,7 @@ index 91c516429c2a..762a108fedf6 100644 return host ? host->GetAcceleratedWidget() : nullptr; } diff --git ui/views/widget/desktop_aura/desktop_window_tree_host_linux.cc ui/views/widget/desktop_aura/desktop_window_tree_host_linux.cc -index a0f75cc909f7..aa06be74ea9c 100644 +index 1493ae74f478d..f793ddb33c288 100644 --- ui/views/widget/desktop_aura/desktop_window_tree_host_linux.cc +++ ui/views/widget/desktop_aura/desktop_window_tree_host_linux.cc @@ -187,6 +187,18 @@ Widget::MoveLoopResult DesktopWindowTreeHostLinux::RunMoveLoop( @@ -211,7 +179,7 @@ index a0f75cc909f7..aa06be74ea9c 100644 void DesktopWindowTreeHostLinux::DispatchEvent(ui::Event* event) { // The input can be disabled and the widget marked as non-active in case of // opened file-dialogs. -@@ -319,6 +331,8 @@ void DesktopWindowTreeHostLinux::AddAdditionalInitProperties( +@@ -322,6 +334,8 @@ void DesktopWindowTreeHostLinux::AddAdditionalInitProperties( properties->wm_class_class = params.wm_class_class; properties->wm_role_name = params.wm_role_name; @@ -221,7 +189,7 @@ index a0f75cc909f7..aa06be74ea9c 100644 properties->x11_extension_delegate = this; } diff --git ui/views/widget/desktop_aura/desktop_window_tree_host_linux.h ui/views/widget/desktop_aura/desktop_window_tree_host_linux.h -index e0339379e1a8..b31f4ac179f6 100644 +index e0339379e1a85..b31f4ac179f69 100644 --- ui/views/widget/desktop_aura/desktop_window_tree_host_linux.h +++ ui/views/widget/desktop_aura/desktop_window_tree_host_linux.h @@ -66,6 +66,8 @@ class VIEWS_EXPORT DesktopWindowTreeHostLinux @@ -253,7 +221,7 @@ index e0339379e1a8..b31f4ac179f6 100644 base::WeakPtrFactory weak_factory_{this}; diff --git ui/views/widget/desktop_aura/desktop_window_tree_host_win.cc ui/views/widget/desktop_aura/desktop_window_tree_host_win.cc -index 7476de34aa6e..1dc6eb8f12f3 100644 +index c8c26cfacffb6..703fe69604b59 100644 --- ui/views/widget/desktop_aura/desktop_window_tree_host_win.cc +++ ui/views/widget/desktop_aura/desktop_window_tree_host_win.cc @@ -140,8 +140,12 @@ void DesktopWindowTreeHostWin::Init(const Widget::InitParams& params) { @@ -289,7 +257,7 @@ index 7476de34aa6e..1dc6eb8f12f3 100644 bool DesktopWindowTreeHostWin::HandleMouseEvent(ui::MouseEvent* event) { diff --git ui/views/widget/desktop_aura/desktop_window_tree_host_win.h ui/views/widget/desktop_aura/desktop_window_tree_host_win.h -index ed3b2fe48665..20f40ec2440c 100644 +index 5642a689cb3f0..126184e619cc7 100644 --- ui/views/widget/desktop_aura/desktop_window_tree_host_win.h +++ ui/views/widget/desktop_aura/desktop_window_tree_host_win.h @@ -292,6 +292,10 @@ class VIEWS_EXPORT DesktopWindowTreeHostWin @@ -304,10 +272,10 @@ index ed3b2fe48665..20f40ec2440c 100644 // a reference. corewm::TooltipWin* tooltip_; diff --git ui/views/widget/widget.cc ui/views/widget/widget.cc -index 494b38c5b486..8897d78097fc 100644 +index 59f7da0e3c1a1..3c3b03767a97f 100644 --- ui/views/widget/widget.cc +++ ui/views/widget/widget.cc -@@ -313,7 +313,8 @@ void Widget::Init(InitParams params) { +@@ -314,7 +314,8 @@ void Widget::Init(InitParams params) { parent_ = params.parent ? GetWidgetForNativeView(params.parent) : nullptr; params.child |= (params.type == InitParams::TYPE_CONTROL); @@ -317,7 +285,7 @@ index 494b38c5b486..8897d78097fc 100644 if (params.opacity == views::Widget::InitParams::WindowOpacity::kInferred && params.type != views::Widget::InitParams::TYPE_WINDOW) { -@@ -395,7 +396,12 @@ void Widget::Init(InitParams params) { +@@ -396,7 +397,12 @@ void Widget::Init(InitParams params) { } } else if (delegate) { SetContentsView(delegate->TransferOwnershipOfContentsView()); @@ -331,7 +299,7 @@ index 494b38c5b486..8897d78097fc 100644 } observation_.Observe(GetNativeTheme()); -@@ -1191,10 +1197,16 @@ void Widget::OnNativeWidgetDestroyed() { +@@ -1203,10 +1209,16 @@ void Widget::OnNativeWidgetDestroyed() { } gfx::Size Widget::GetMinimumSize() const { @@ -349,10 +317,10 @@ index 494b38c5b486..8897d78097fc 100644 } diff --git ui/views/widget/widget.h ui/views/widget/widget.h -index cd0c29c10bfe..5f8f286fe17a 100644 +index dde160f1a382f..f04bc2b4f98a5 100644 --- ui/views/widget/widget.h +++ ui/views/widget/widget.h -@@ -321,6 +321,8 @@ class VIEWS_EXPORT Widget : public internal::NativeWidgetDelegate, +@@ -322,6 +322,8 @@ class VIEWS_EXPORT Widget : public internal::NativeWidgetDelegate, // the concept with bubble anchoring a la BubbleDialogDelegateView. gfx::NativeView parent = nullptr; @@ -362,7 +330,7 @@ index cd0c29c10bfe..5f8f286fe17a 100644 // the NativeWidget may specify a default size. If the parent is specified, // |bounds| is in the parent's coordinate system. If the parent is not diff --git ui/views/widget/widget_delegate.h ui/views/widget/widget_delegate.h -index 623bbcf37780..10efeaac5686 100644 +index eba8040b8e1b9..27bc5a210fc1a 100644 --- ui/views/widget/widget_delegate.h +++ ui/views/widget/widget_delegate.h @@ -385,6 +385,10 @@ class VIEWS_EXPORT WidgetDelegate { @@ -377,7 +345,7 @@ index 623bbcf37780..10efeaac5686 100644 bool enable_arrow_key_traversal() const { return params_.enable_arrow_key_traversal; diff --git ui/views/widget/widget_hwnd_utils.cc ui/views/widget/widget_hwnd_utils.cc -index 89f5b62f95df..8f6971929a12 100644 +index 89f5b62f95dfe..8f6971929a12e 100644 --- ui/views/widget/widget_hwnd_utils.cc +++ ui/views/widget/widget_hwnd_utils.cc @@ -67,7 +67,7 @@ void CalculateWindowStylesFromInitParams( @@ -390,10 +358,10 @@ index 89f5b62f95df..8f6971929a12 100644 if (native_widget_delegate->IsDialogBox()) { *style |= DS_MODALFRAME; diff --git ui/views/win/hwnd_message_handler.cc ui/views/win/hwnd_message_handler.cc -index 0a3940b75170..ad31ce630abb 100644 +index 8bcb03a45d2fa..bc8062171c818 100644 --- ui/views/win/hwnd_message_handler.cc +++ ui/views/win/hwnd_message_handler.cc -@@ -3105,10 +3105,13 @@ LRESULT HWNDMessageHandler::HandleMouseEventInternal(UINT message, +@@ -3108,10 +3108,13 @@ LRESULT HWNDMessageHandler::HandleMouseEventInternal(UINT message, } else if (event.type() == ui::ET_MOUSEWHEEL) { ui::MouseWheelEvent mouse_wheel_event(msg); // Reroute the mouse wheel to the window under the pointer if applicable. diff --git a/patch/patches/viz_osr_2575.patch b/patch/patches/viz_osr_2575.patch index 07a4225ef..9720523ff 100644 --- a/patch/patches/viz_osr_2575.patch +++ b/patch/patches/viz_osr_2575.patch @@ -1,5 +1,5 @@ diff --git components/viz/host/host_display_client.cc components/viz/host/host_display_client.cc -index 3b00759e513d..90fe332d59f5 100644 +index 3b00759e513dc..90fe332d59f5b 100644 --- components/viz/host/host_display_client.cc +++ components/viz/host/host_display_client.cc @@ -45,9 +45,14 @@ void HostDisplayClient::OnDisplayReceivedCALayerParams( @@ -29,7 +29,7 @@ index 3b00759e513d..90fe332d59f5 100644 // TODO(crbug.com/1052397): Revisit the macro expression once build flag switch // of lacros-chrome is complete. diff --git components/viz/host/host_display_client.h components/viz/host/host_display_client.h -index 5e260e13762f..1ccff27f2fdb 100644 +index 5e260e13762f6..1ccff27f2fdbe 100644 --- components/viz/host/host_display_client.h +++ components/viz/host/host_display_client.h @@ -32,17 +32,17 @@ class VIZ_HOST_EXPORT HostDisplayClient : public mojom::DisplayClient { @@ -54,7 +54,7 @@ index 5e260e13762f..1ccff27f2fdb 100644 // TODO(crbug.com/1052397): Revisit the macro expression once build flag switch // of lacros-chrome is complete. diff --git components/viz/host/layered_window_updater_impl.cc components/viz/host/layered_window_updater_impl.cc -index b04f654fe820..131977a36591 100644 +index b04f654fe820f..131977a36591d 100644 --- components/viz/host/layered_window_updater_impl.cc +++ components/viz/host/layered_window_updater_impl.cc @@ -44,7 +44,7 @@ void LayeredWindowUpdaterImpl::OnAllocatedSharedMemory( @@ -67,7 +67,7 @@ index b04f654fe820..131977a36591 100644 if (!canvas_) { diff --git components/viz/host/layered_window_updater_impl.h components/viz/host/layered_window_updater_impl.h -index 1026b739d283..fe562ab60ce9 100644 +index 1026b739d283f..fe562ab60ce98 100644 --- components/viz/host/layered_window_updater_impl.h +++ components/viz/host/layered_window_updater_impl.h @@ -35,7 +35,7 @@ class VIZ_HOST_EXPORT LayeredWindowUpdaterImpl @@ -80,10 +80,10 @@ index 1026b739d283..fe562ab60ce9 100644 private: const HWND hwnd_; diff --git components/viz/service/BUILD.gn components/viz/service/BUILD.gn -index 898571527429..5e31b5ceafc3 100644 +index 159fa9efa79fd..b430e2385a5b1 100644 --- components/viz/service/BUILD.gn +++ components/viz/service/BUILD.gn -@@ -198,6 +198,8 @@ viz_component("service") { +@@ -202,6 +202,8 @@ viz_component("service") { "transitions/transferable_resource_tracker.cc", "transitions/transferable_resource_tracker.h", "viz_service_export.h", @@ -93,7 +93,7 @@ index 898571527429..5e31b5ceafc3 100644 defines = [ "VIZ_SERVICE_IMPLEMENTATION" ] diff --git components/viz/service/display_embedder/output_surface_provider_impl.cc components/viz/service/display_embedder/output_surface_provider_impl.cc -index 79c800e77a16..c1593b597325 100644 +index 79c800e77a160..c1593b5973253 100644 --- components/viz/service/display_embedder/output_surface_provider_impl.cc +++ components/viz/service/display_embedder/output_surface_provider_impl.cc @@ -16,6 +16,7 @@ @@ -126,10 +126,10 @@ index 79c800e77a16..c1593b597325 100644 return CreateSoftwareOutputDeviceWin(surface_handle, &output_device_backing_, display_client); diff --git components/viz/service/display_embedder/software_output_device_win.cc components/viz/service/display_embedder/software_output_device_win.cc -index 2bb30e5318b6..535535dd6c10 100644 +index 599b06c1765ef..e8ae98b0b1320 100644 --- components/viz/service/display_embedder/software_output_device_win.cc +++ components/viz/service/display_embedder/software_output_device_win.cc -@@ -188,8 +188,9 @@ void SoftwareOutputDeviceWinProxy::EndPaintDelegated( +@@ -191,8 +191,9 @@ void SoftwareOutputDeviceWinProxy::EndPaintDelegated( if (!canvas_) return; @@ -142,10 +142,10 @@ index 2bb30e5318b6..535535dd6c10 100644 TRACE_EVENT_ASYNC_BEGIN0("viz", "SoftwareOutputDeviceWinProxy::Draw", this); diff --git content/browser/compositor/viz_process_transport_factory.cc content/browser/compositor/viz_process_transport_factory.cc -index 11ac1649ed0f..ab4aaf5e69b1 100644 +index 2d80f84280b5a..41e45223367f0 100644 --- content/browser/compositor/viz_process_transport_factory.cc +++ content/browser/compositor/viz_process_transport_factory.cc -@@ -414,8 +414,13 @@ void VizProcessTransportFactory::OnEstablishedGpuChannel( +@@ -418,8 +418,13 @@ void VizProcessTransportFactory::OnEstablishedGpuChannel( compositor_data.display_private.reset(); root_params->display_private = compositor_data.display_private.BindNewEndpointAndPassReceiver(); @@ -162,10 +162,10 @@ index 11ac1649ed0f..ab4aaf5e69b1 100644 compositor_data.display_client->GetBoundRemote(resize_task_runner_); diff --git mojo/public/cpp/bindings/sync_call_restrictions.h mojo/public/cpp/bindings/sync_call_restrictions.h -index 4ff82130b358..6c2e3e4d3e9b 100644 +index b6b7ef090eaaf..a892bd4583d7e 100644 --- mojo/public/cpp/bindings/sync_call_restrictions.h +++ mojo/public/cpp/bindings/sync_call_restrictions.h -@@ -33,6 +33,7 @@ class Compositor; +@@ -34,6 +34,7 @@ class Compositor; namespace viz { class HostFrameSinkManager; @@ -173,7 +173,7 @@ index 4ff82130b358..6c2e3e4d3e9b 100644 } namespace mojo { -@@ -86,6 +87,8 @@ class COMPONENT_EXPORT(MOJO_CPP_BINDINGS) SyncCallRestrictions { +@@ -87,6 +88,8 @@ class COMPONENT_EXPORT(MOJO_CPP_BINDINGS) SyncCallRestrictions { // For preventing frame swaps of wrong size during resize on Windows. // (https://crbug.com/811945) friend class ui::Compositor; @@ -183,10 +183,10 @@ index 4ff82130b358..6c2e3e4d3e9b 100644 // running in the same process, so it won't block anything. // TODO(159346933) Remove once the origin isolation logic is moved outside of diff --git services/viz/privileged/mojom/compositing/display_private.mojom services/viz/privileged/mojom/compositing/display_private.mojom -index 0c9686f3c807..6fc92dda1072 100644 +index cd26a3dcf99e0..282c5d55c7df3 100644 --- services/viz/privileged/mojom/compositing/display_private.mojom +++ services/viz/privileged/mojom/compositing/display_private.mojom -@@ -80,12 +80,14 @@ interface DisplayPrivate { +@@ -85,12 +85,14 @@ interface DisplayPrivate { }; interface DisplayClient { @@ -203,7 +203,7 @@ index 0c9686f3c807..6fc92dda1072 100644 // Notifies that a swap has occurred and provides information about the pixel diff --git services/viz/privileged/mojom/compositing/layered_window_updater.mojom services/viz/privileged/mojom/compositing/layered_window_updater.mojom -index 6b7fbb6cf13d..e2af75168cb9 100644 +index 6b7fbb6cf13dc..e2af75168cb91 100644 --- services/viz/privileged/mojom/compositing/layered_window_updater.mojom +++ services/viz/privileged/mojom/compositing/layered_window_updater.mojom @@ -26,5 +26,5 @@ interface LayeredWindowUpdater { @@ -214,7 +214,7 @@ index 6b7fbb6cf13d..e2af75168cb9 100644 + Draw(gfx.mojom.Rect damage_rect) => (); }; diff --git ui/compositor/compositor.h ui/compositor/compositor.h -index e4ff4cb0a2ec..5023c6139f4e 100644 +index e4ff4cb0a2ec2..5023c6139f4eb 100644 --- ui/compositor/compositor.h +++ ui/compositor/compositor.h @@ -28,7 +28,9 @@ diff --git a/patch/patches/web_contents_1257_1565.patch b/patch/patches/web_contents_1257_1565.patch index 0aa07377b..b3ec01e3a 100644 --- a/patch/patches/web_contents_1257_1565.patch +++ b/patch/patches/web_contents_1257_1565.patch @@ -1,10 +1,10 @@ diff --git content/browser/web_contents/web_contents_impl.cc content/browser/web_contents/web_contents_impl.cc -index 588ad8311491..7aa76b084da5 100644 +index b7e32f44573be..11e64de06065b 100644 --- content/browser/web_contents/web_contents_impl.cc +++ content/browser/web_contents/web_contents_impl.cc -@@ -2749,6 +2749,12 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params) { +@@ -2739,6 +2739,12 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params) { frame_tree_.Init(site_instance.get(), params.renderer_initiated_creation, - params.main_frame_name, params.is_prerendering); + params.main_frame_name, type); + if (params.view && params.delegate_view) { + view_.reset(params.view); @@ -15,7 +15,7 @@ index 588ad8311491..7aa76b084da5 100644 WebContentsViewDelegate* delegate = GetContentClient()->browser()->GetWebContentsViewDelegate(this); -@@ -2759,6 +2765,7 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params) { +@@ -2749,6 +2755,7 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params) { view_.reset(CreateWebContentsView(this, delegate, &render_view_host_delegate_view_)); } @@ -23,7 +23,7 @@ index 588ad8311491..7aa76b084da5 100644 CHECK(render_view_host_delegate_view_); CHECK(view_.get()); -@@ -3615,6 +3622,15 @@ RenderFrameHostDelegate* WebContentsImpl::CreateNewWindow( +@@ -3598,6 +3605,15 @@ RenderFrameHostDelegate* WebContentsImpl::CreateNewWindow( // objects. create_params.renderer_initiated_creation = !is_new_browsing_instance; @@ -39,7 +39,7 @@ index 588ad8311491..7aa76b084da5 100644 std::unique_ptr new_contents; if (!is_guest) { create_params.context = view_->GetNativeView(); -@@ -7277,6 +7293,9 @@ void WebContentsImpl::SetFocusedFrame(FrameTreeNode* node, +@@ -7270,6 +7286,9 @@ void WebContentsImpl::SetFocusedFrame(FrameTreeNode* node, // This is an outermost WebContents. SetAsFocusedWebContentsIfNecessary(); } @@ -50,7 +50,7 @@ index 588ad8311491..7aa76b084da5 100644 void WebContentsImpl::DidCallFocus() { diff --git content/public/browser/web_contents.cc content/public/browser/web_contents.cc -index f1dcf53ea481..192f7c0ddd04 100644 +index f1dcf53ea481b..192f7c0ddd04f 100644 --- content/public/browser/web_contents.cc +++ content/public/browser/web_contents.cc @@ -29,6 +29,7 @@ WebContents::CreateParams::CreateParams(BrowserContext* context, @@ -62,10 +62,10 @@ index f1dcf53ea481..192f7c0ddd04 100644 WebContents::CreateParams::CreateParams(const CreateParams& other) = default; diff --git content/public/browser/web_contents.h content/public/browser/web_contents.h -index f1bdd0c7bad8..46a33d9094e1 100644 +index fe5bc4ade5cdb..266a37c66001d 100644 --- content/public/browser/web_contents.h +++ content/public/browser/web_contents.h -@@ -87,8 +87,10 @@ class BrowserContext; +@@ -88,8 +88,10 @@ class BrowserContext; class BrowserPluginGuestDelegate; class RenderFrameHost; class RenderViewHost; @@ -76,7 +76,7 @@ index f1bdd0c7bad8..46a33d9094e1 100644 class WebUI; struct DropData; struct MHTMLGenerationParams; -@@ -228,6 +230,10 @@ class WebContents : public PageNavigator, +@@ -229,6 +231,10 @@ class WebContents : public PageNavigator, // Sandboxing flags set on the new WebContents. network::mojom::WebSandboxFlags starting_sandbox_flags; @@ -88,10 +88,10 @@ index f1bdd0c7bad8..46a33d9094e1 100644 // the value that'll be returned by GetLastActiveTime(). If this is left // default initialized then the value is not passed on to the WebContents diff --git content/public/browser/web_contents_delegate.h content/public/browser/web_contents_delegate.h -index 9075cda6487f..c7deaa1c9752 100644 +index 96c3b9e9b7e10..087a717df3680 100644 --- content/public/browser/web_contents_delegate.h +++ content/public/browser/web_contents_delegate.h -@@ -60,10 +60,12 @@ class EyeDropperListener; +@@ -59,10 +59,12 @@ class EyeDropperListener; class FileSelectListener; class JavaScriptDialogManager; class RenderFrameHost; @@ -104,8 +104,8 @@ index 9075cda6487f..c7deaa1c9752 100644 struct ContextMenuParams; struct DropData; struct MediaPlayerWatchTime; -@@ -337,6 +339,14 @@ class CONTENT_EXPORT WebContentsDelegate { - const std::string& partition_id, +@@ -340,6 +342,14 @@ class CONTENT_EXPORT WebContentsDelegate { + const StoragePartitionId& partition_id, SessionStorageNamespace* session_storage_namespace); + virtual void GetCustomWebContentsView( @@ -120,10 +120,10 @@ index 9075cda6487f..c7deaa1c9752 100644 // typically happens when popups are created. virtual void WebContentsCreated(WebContents* source_contents, diff --git content/public/browser/web_contents_observer.h content/public/browser/web_contents_observer.h -index adbfea805ecc..18f3f3240a08 100644 +index 7ee27742d3c05..0998a74a5ec0f 100644 --- content/public/browser/web_contents_observer.h +++ content/public/browser/web_contents_observer.h -@@ -610,6 +610,10 @@ class CONTENT_EXPORT WebContentsObserver : public IPC::Listener { +@@ -648,6 +648,10 @@ class CONTENT_EXPORT WebContentsObserver : public IPC::Listener { // WebContents has gained/lost focus. virtual void OnFocusChangedInPage(FocusedNodeDetails* details) {} diff --git a/patch/patches/web_url_loader_cancel_1617042.patch b/patch/patches/web_url_loader_cancel_1617042.patch index 14c1dac6a..2fe6ed5bb 100644 --- a/patch/patches/web_url_loader_cancel_1617042.patch +++ b/patch/patches/web_url_loader_cancel_1617042.patch @@ -1,5 +1,5 @@ diff --git third_party/blink/public/platform/web_url_loader.h third_party/blink/public/platform/web_url_loader.h -index 48b95a412fe0..569e8c750e0a 100644 +index 48b95a412fe0a..569e8c750e0a7 100644 --- third_party/blink/public/platform/web_url_loader.h +++ third_party/blink/public/platform/web_url_loader.h @@ -161,12 +161,14 @@ class BLINK_PLATFORM_EXPORT WebURLLoader { diff --git a/patch/patches/webkit_plugin_info_2015.patch b/patch/patches/webkit_plugin_info_2015.patch index f2106e3b1..009f8a707 100644 --- a/patch/patches/webkit_plugin_info_2015.patch +++ b/patch/patches/webkit_plugin_info_2015.patch @@ -1,5 +1,5 @@ diff --git third_party/blink/public/mojom/plugins/plugin_registry.mojom third_party/blink/public/mojom/plugins/plugin_registry.mojom -index ff7a8ed89e94..77f44956ff22 100644 +index ff7a8ed89e94a..77f44956ff22f 100644 --- third_party/blink/public/mojom/plugins/plugin_registry.mojom +++ third_party/blink/public/mojom/plugins/plugin_registry.mojom @@ -36,5 +36,5 @@ interface PluginRegistry { @@ -10,12 +10,12 @@ index ff7a8ed89e94..77f44956ff22 100644 + GetPlugins(bool refresh, bool is_main_frame, url.mojom.Origin main_frame_origin) => (array plugins); }; diff --git third_party/blink/public/platform/platform.h third_party/blink/public/platform/platform.h -index 4b29748968bc..6d781517518c 100644 +index b5904a748f70b..a936bd95229b7 100644 --- third_party/blink/public/platform/platform.h +++ third_party/blink/public/platform/platform.h -@@ -771,6 +771,11 @@ class BLINK_PLATFORM_EXPORT Platform { - // unset pass an empty WebURL and WebString. - virtual void SetActiveURL(const WebURL& url, const WebString& top_url) {} +@@ -774,6 +774,11 @@ class BLINK_PLATFORM_EXPORT Platform { + // Returns a sad page bitmap used when the child frame has crashed. + virtual SkBitmap* GetSadPageBitmap() { return nullptr; } + // DevTools ------------------------------------------------------------ + @@ -26,7 +26,7 @@ index 4b29748968bc..6d781517518c 100644 static void InitializeMainThreadCommon(Platform* platform, std::unique_ptr main_thread); diff --git third_party/blink/renderer/core/dom/document_init.cc third_party/blink/renderer/core/dom/document_init.cc -index a43dcce78e48..46bbd086516f 100644 +index a43dcce78e486..46bbd086516f8 100644 --- third_party/blink/renderer/core/dom/document_init.cc +++ third_party/blink/renderer/core/dom/document_init.cc @@ -185,11 +185,11 @@ PluginData* DocumentInit::GetPluginData(LocalFrame* frame, const KURL& url) { @@ -44,10 +44,10 @@ index a43dcce78e48..46bbd086516f 100644 DocumentInit& DocumentInit::WithTypeFrom(const String& mime_type) { diff --git third_party/blink/renderer/core/frame/local_frame.cc third_party/blink/renderer/core/frame/local_frame.cc -index 74d1e79e332c..6b96bf4a2543 100644 +index 4da1c9cbfdbf6..acd69b393cfc0 100644 --- third_party/blink/renderer/core/frame/local_frame.cc +++ third_party/blink/renderer/core/frame/local_frame.cc -@@ -1850,7 +1850,7 @@ WebContentSettingsClient* LocalFrame::GetContentSettingsClient() { +@@ -1967,7 +1967,7 @@ WebContentSettingsClient* LocalFrame::GetContentSettingsClient() { PluginData* LocalFrame::GetPluginData() const { if (!Loader().AllowPlugins()) return nullptr; @@ -57,7 +57,7 @@ index 74d1e79e332c..6b96bf4a2543 100644 } diff --git third_party/blink/renderer/core/inspector/devtools_session.cc third_party/blink/renderer/core/inspector/devtools_session.cc -index 242653b4e723..385e4b4d3f07 100644 +index 242653b4e7237..385e4b4d3f075 100644 --- third_party/blink/renderer/core/inspector/devtools_session.cc +++ third_party/blink/renderer/core/inspector/devtools_session.cc @@ -8,6 +8,7 @@ @@ -85,7 +85,7 @@ index 242653b4e723..385e4b4d3f07 100644 void DevToolsSession::DispatchProtocolCommand( diff --git third_party/blink/renderer/core/page/page.cc third_party/blink/renderer/core/page/page.cc -index 415b29342170..5aebc6d6379a 100644 +index 415b29342170a..5aebc6d6379a5 100644 --- third_party/blink/renderer/core/page/page.cc +++ third_party/blink/renderer/core/page/page.cc @@ -210,7 +210,8 @@ Page::Page(PageClients& page_clients, @@ -160,7 +160,7 @@ index 415b29342170..5aebc6d6379a 100644 visitor->Trace(plugins_changed_observers_); visitor->Trace(next_related_page_); diff --git third_party/blink/renderer/core/page/page.h third_party/blink/renderer/core/page/page.h -index d2efc89d1305..4934e23c3b08 100644 +index d2efc89d1305e..4934e23c3b085 100644 --- third_party/blink/renderer/core/page/page.h +++ third_party/blink/renderer/core/page/page.h @@ -156,7 +156,8 @@ class CORE_EXPORT Page final : public GarbageCollected, @@ -184,7 +184,7 @@ index d2efc89d1305..4934e23c3b08 100644 Member validation_message_client_; diff --git third_party/blink/renderer/core/page/plugin_data.cc third_party/blink/renderer/core/page/plugin_data.cc -index 89beb74dae8a..63bfa84b45b7 100644 +index 89beb74dae8a9..63bfa84b45b72 100644 --- third_party/blink/renderer/core/page/plugin_data.cc +++ third_party/blink/renderer/core/page/plugin_data.cc @@ -91,10 +91,12 @@ void PluginData::RefreshBrowserSidePluginCache() { @@ -212,7 +212,7 @@ index 89beb74dae8a..63bfa84b45b7 100644 auto* plugin_info = MakeGarbageCollected( plugin->name, FilePathToWebString(plugin->filename), diff --git third_party/blink/renderer/core/page/plugin_data.h third_party/blink/renderer/core/page/plugin_data.h -index fe5aa20243d8..c2b3540d3bb5 100644 +index fe5aa20243d89..c2b3540d3bb54 100644 --- third_party/blink/renderer/core/page/plugin_data.h +++ third_party/blink/renderer/core/page/plugin_data.h @@ -97,7 +97,8 @@ class CORE_EXPORT PluginData final : public GarbageCollected { diff --git a/patch/patches/webkit_popups_and_background.patch b/patch/patches/webkit_popups_and_background.patch index 4a3506fd6..adbd09752 100644 --- a/patch/patches/webkit_popups_and_background.patch +++ b/patch/patches/webkit_popups_and_background.patch @@ -1,8 +1,8 @@ diff --git third_party/blink/common/web_preferences/web_preferences.cc third_party/blink/common/web_preferences/web_preferences.cc -index 758b0b1616ec..b35748d8180c 100644 +index 1363ee73abdfb..dca6c5b9bf66f 100644 --- third_party/blink/common/web_preferences/web_preferences.cc +++ third_party/blink/common/web_preferences/web_preferences.cc -@@ -151,6 +151,7 @@ WebPreferences::WebPreferences() +@@ -153,6 +153,7 @@ WebPreferences::WebPreferences() animation_policy( blink::mojom::ImageAnimationPolicy::kImageAnimationPolicyAllowed), user_gesture_required_for_presentation(true), @@ -11,10 +11,10 @@ index 758b0b1616ec..b35748d8180c 100644 text_track_margin_percentage(0.0f), immersive_mode_enabled(false), diff --git third_party/blink/common/web_preferences/web_preferences_mojom_traits.cc third_party/blink/common/web_preferences/web_preferences_mojom_traits.cc -index ba1ba323ec45..10829ad5220c 100644 +index 7fa49dd367b28..af16c09d0b85f 100644 --- third_party/blink/common/web_preferences/web_preferences_mojom_traits.cc +++ third_party/blink/common/web_preferences/web_preferences_mojom_traits.cc -@@ -157,6 +157,7 @@ bool StructTraitsuser_gesture_required_for_presentation = data.user_gesture_required_for_presentation(); @@ -23,7 +23,7 @@ index ba1ba323ec45..10829ad5220c 100644 out->text_track_margin_percentage = data.text_track_margin_percentage(); out->immersive_mode_enabled = data.immersive_mode_enabled(); diff --git third_party/blink/public/common/web_preferences/web_preferences.h third_party/blink/public/common/web_preferences/web_preferences.h -index ab727750abcb..07a2418b92e1 100644 +index c457698eba5dc..5e1e6b80cee3c 100644 --- third_party/blink/public/common/web_preferences/web_preferences.h +++ third_party/blink/public/common/web_preferences/web_preferences.h @@ -177,6 +177,8 @@ struct BLINK_COMMON_EXPORT WebPreferences { @@ -36,10 +36,10 @@ index ab727750abcb..07a2418b92e1 100644 // These fields specify the foreground and background color for WebVTT text diff --git third_party/blink/public/common/web_preferences/web_preferences_mojom_traits.h third_party/blink/public/common/web_preferences/web_preferences_mojom_traits.h -index 68d33ca3be29..4a0403dc0707 100644 +index e35980e72f5d7..92f222bb29d06 100644 --- third_party/blink/public/common/web_preferences/web_preferences_mojom_traits.h +++ third_party/blink/public/common/web_preferences/web_preferences_mojom_traits.h -@@ -460,6 +460,11 @@ struct BLINK_COMMON_EXPORT StructTraits(this)), minimum_zoom_level_(PageZoomFactorToZoomLevel(kMinimumPageZoomFactor)), maximum_zoom_level_(PageZoomFactorToZoomLevel(kMaximumPageZoomFactor)), @@ -104,7 +104,7 @@ index a8e1730397b7..4ac6f472ea11 100644 does_composite_(does_composite), fullscreen_controller_(std::make_unique(this)), receiver_(this, -@@ -1763,6 +1769,8 @@ void WebView::ApplyWebPreferences(const web_pref::WebPreferences& prefs, +@@ -1769,6 +1775,8 @@ void WebView::ApplyWebPreferences(const web_pref::WebPreferences& prefs, RuntimeEnabledFeatures::SetTranslateServiceEnabled( prefs.translate_service_available); @@ -114,10 +114,10 @@ index a8e1730397b7..4ac6f472ea11 100644 void WebViewImpl::ThemeChanged() { diff --git third_party/blink/renderer/core/exported/web_view_impl.h third_party/blink/renderer/core/exported/web_view_impl.h -index 297d3e515abe..c61105a13fc0 100644 +index ace66b559cdc5..130638e2dfaba 100644 --- third_party/blink/renderer/core/exported/web_view_impl.h +++ third_party/blink/renderer/core/exported/web_view_impl.h -@@ -127,7 +127,8 @@ class CORE_EXPORT WebViewImpl final : public WebView, +@@ -128,7 +128,8 @@ class CORE_EXPORT WebViewImpl final : public WebView, static HashSet& AllInstances(); // Returns true if popup menus should be rendered by the browser, false if // they should be rendered by WebKit (which is the default). @@ -127,7 +127,7 @@ index 297d3e515abe..c61105a13fc0 100644 // Returns whether frames under this WebView are backed by a compositor. bool does_composite() const { return does_composite_; } -@@ -726,6 +727,8 @@ class CORE_EXPORT WebViewImpl final : public WebView, +@@ -749,6 +750,8 @@ class CORE_EXPORT WebViewImpl final : public WebView, float fake_page_scale_animation_page_scale_factor_ = 0.f; bool fake_page_scale_animation_use_anchor_ = false; @@ -137,10 +137,10 @@ index 297d3e515abe..c61105a13fc0 100644 TransformationMatrix device_emulation_transform_; diff --git third_party/blink/renderer/core/page/chrome_client_impl.cc third_party/blink/renderer/core/page/chrome_client_impl.cc -index ae4d460aaeea..4b325fb82793 100644 +index 4e33591b87e15..f3381f4436024 100644 --- third_party/blink/renderer/core/page/chrome_client_impl.cc +++ third_party/blink/renderer/core/page/chrome_client_impl.cc -@@ -808,7 +808,7 @@ bool ChromeClientImpl::HasOpenedPopup() const { +@@ -811,7 +811,7 @@ bool ChromeClientImpl::HasOpenedPopup() const { PopupMenu* ChromeClientImpl::OpenPopupMenu(LocalFrame& frame, HTMLSelectElement& select) { NotifyPopupOpeningObservers(); diff --git a/patch/patches/webkit_runtime_enabled_features.patch b/patch/patches/webkit_runtime_enabled_features.patch new file mode 100644 index 000000000..19cab1d21 --- /dev/null +++ b/patch/patches/webkit_runtime_enabled_features.patch @@ -0,0 +1,21 @@ +diff --git third_party/blink/renderer/build/scripts/templates/runtime_enabled_features.h.tmpl third_party/blink/renderer/build/scripts/templates/runtime_enabled_features.h.tmpl +index 602131e3d6407..7791b570547ed 100644 +--- third_party/blink/renderer/build/scripts/templates/runtime_enabled_features.h.tmpl ++++ third_party/blink/renderer/build/scripts/templates/runtime_enabled_features.h.tmpl +@@ -11,6 +11,8 @@ + #include "third_party/blink/renderer/platform/platform_export.h" + #include "third_party/blink/renderer/platform/wtf/allocator/allocator.h" + ++class AlloyContentRendererClient; ++ + #define ASSERT_ORIGIN_TRIAL(feature) \ + static_assert(std::is_same diff --git a/patch/patches/win_cpp17_msvc_sandbox_2819.patch b/patch/patches/win_cpp17_msvc_sandbox_2819.patch index 5b541d8de..1cb641eba 100644 --- a/patch/patches/win_cpp17_msvc_sandbox_2819.patch +++ b/patch/patches/win_cpp17_msvc_sandbox_2819.patch @@ -1,5 +1,5 @@ diff --git base/third_party/double_conversion/BUILD.gn base/third_party/double_conversion/BUILD.gn -index 0083efdcd9c8..6f647c31e28a 100644 +index 0083efdcd9c85..6f647c31e28aa 100644 --- base/third_party/double_conversion/BUILD.gn +++ base/third_party/double_conversion/BUILD.gn @@ -9,6 +9,11 @@ config("config") { @@ -15,7 +15,7 @@ index 0083efdcd9c8..6f647c31e28a 100644 static_library("double_conversion") { diff --git base/win/BUILD.gn base/win/BUILD.gn -index eb5dca74bcea..be10cc59b39c 100644 +index eb5dca74bcea3..be10cc59b39c7 100644 --- base/win/BUILD.gn +++ base/win/BUILD.gn @@ -33,4 +33,7 @@ static_library("pe_image") { diff --git a/tests/cefclient/browser/views_menu_bar.cc b/tests/cefclient/browser/views_menu_bar.cc index a7b4b4fd2..135d52680 100644 --- a/tests/cefclient/browser/views_menu_bar.cc +++ b/tests/cefclient/browser/views_menu_bar.cc @@ -19,7 +19,7 @@ const int kMenuBarGroupId = 100; // If the mnemonic is capital I and the UI language is Turkish, lowercasing it // results in 'small dotless i', which is different from a 'dotted i'. Similar // issues may exist for az and lt locales. -base::char16 ToLower(base::char16 c) { +char16 ToLower(char16 c) { CefStringUTF16 str16; cef_string_utf16_to_lower(&c, 1, str16.GetWritableStruct()); return str16.length() > 0 ? str16.c_str()[0] : 0; @@ -27,16 +27,16 @@ base::char16 ToLower(base::char16 c) { // Extract the mnemonic character from |title|. For example, if |title| is // "&Test" then the mnemonic character is 'T'. -base::char16 GetMnemonic(const base::string16& title) { +char16 GetMnemonic(const std::u16string& title) { size_t index = 0; do { index = title.find('&', index); - if (index != base::string16::npos) { + if (index != std::u16string::npos) { if (index + 1 != title.size() && title[index + 1] != '&') return ToLower(title[index + 1]); index++; } - } while (index != base::string16::npos); + } while (index != std::u16string::npos); return 0; } @@ -89,7 +89,7 @@ CefRefPtr ViewsMenuBar::CreateMenuModel(const CefString& label, panel_->AddChildView(button); // Extract the mnemonic that triggers the menu, if any. - base::char16 mnemonic = GetMnemonic(label); + char16 mnemonic = GetMnemonic(label); if (mnemonic != 0) mnemonics_.insert(std::make_pair(mnemonic, new_menu_id)); diff --git a/tests/cefclient/browser/views_menu_bar.h b/tests/cefclient/browser/views_menu_bar.h index 0bf1b2d37..c0f0a933b 100644 --- a/tests/cefclient/browser/views_menu_bar.h +++ b/tests/cefclient/browser/views_menu_bar.h @@ -112,7 +112,7 @@ class ViewsMenuBar : public CefMenuButtonDelegate, public CefMenuModelDelegate { bool last_nav_with_keyboard_; // Map of mnemonic to MenuButton ID. - typedef std::map MnemonicMap; + typedef std::map MnemonicMap; MnemonicMap mnemonics_; IMPLEMENT_REFCOUNTING(ViewsMenuBar); diff --git a/tests/ceftests/string_unittest.cc b/tests/ceftests/string_unittest.cc index a2609604a..2d911a658 100644 --- a/tests/ceftests/string_unittest.cc +++ b/tests/ceftests/string_unittest.cc @@ -5,7 +5,6 @@ #include #include -#include "include/base/cef_string16.h" #include "include/internal/cef_string.h" #include "include/internal/cef_string_list.h" #include "include/internal/cef_string_map.h" @@ -126,12 +125,12 @@ TEST(StringTest, Wide) { EXPECT_EQ(str1, str2); } -// Test base::string16 convertion to/from CefString types. +// Test std::u16string convertion to/from CefString types. TEST(StringTest, string16) { CefStringUTF8 str8("Test String 1"), str8b; CefStringUTF16 str16("Test String 2"), str16b; CefStringWide strwide("Test String 3"), strwideb; - base::string16 base_str; + std::u16string base_str; base_str = str8; str8b = base_str; diff --git a/tools/make_distrib.py b/tools/make_distrib.py index 101618892..8f9946cb8 100644 --- a/tools/make_distrib.py +++ b/tools/make_distrib.py @@ -205,7 +205,8 @@ def create_fuzed_gtest(tests_dir): # gtest LICENSE file at tests/gtest/LICENSE copy_file( - os.path.join(src_gtest_dir, 'LICENSE'), target_gtest_dir, options.quiet) + os.path.join(src_gtest_dir, os.pardir, 'LICENSE'), target_gtest_dir, + options.quiet) # CEF README file at tests/gtest/README.cef copy_file(