chore: bump chromium to 106.0.5216.0 (main) (#34993)
This commit is contained in:
parent
e15e66f229
commit
97b353a30a
114 changed files with 886 additions and 779 deletions
|
@ -23,8 +23,35 @@ This patch adds a few changes to the Chromium code:
|
|||
`ProcessSingleton` instance that tries to connect to the socket
|
||||
before the browser thread is ready.
|
||||
|
||||
diff --git a/chrome/browser/chrome_browser_main.cc b/chrome/browser/chrome_browser_main.cc
|
||||
index aca2f19f53657fc2b944b69418e099b056c8e734..e43b0d89e2e6ad0bcb2c34bfacc4ef3b59eaaab1 100644
|
||||
--- a/chrome/browser/chrome_browser_main.cc
|
||||
+++ b/chrome/browser/chrome_browser_main.cc
|
||||
@@ -1424,7 +1424,6 @@ int ChromeBrowserMainParts::PreMainMessageLoopRunImpl() {
|
||||
switch (notify_result_) {
|
||||
case ProcessSingleton::PROCESS_NONE:
|
||||
// No process already running, fall through to starting a new one.
|
||||
- process_singleton_->StartWatching();
|
||||
g_browser_process->platform_part()->PlatformSpecificCommandLineProcessing(
|
||||
*base::CommandLine::ForCurrentProcess());
|
||||
break;
|
||||
diff --git a/chrome/browser/chrome_process_singleton.cc b/chrome/browser/chrome_process_singleton.cc
|
||||
index d97fa8a96c110acc25b0ef46d7a4ac1c708f7c76..0919af8e8b0a51ef8e8dd28f2f07139d197a7384 100644
|
||||
--- a/chrome/browser/chrome_process_singleton.cc
|
||||
+++ b/chrome/browser/chrome_process_singleton.cc
|
||||
@@ -31,10 +31,6 @@ ProcessSingleton::NotifyResult
|
||||
return process_singleton_.NotifyOtherProcessOrCreate();
|
||||
}
|
||||
|
||||
-void ChromeProcessSingleton::StartWatching() {
|
||||
- process_singleton_.StartWatching();
|
||||
-}
|
||||
-
|
||||
void ChromeProcessSingleton::Cleanup() {
|
||||
process_singleton_.Cleanup();
|
||||
}
|
||||
diff --git a/chrome/browser/process_singleton.h b/chrome/browser/process_singleton.h
|
||||
index 16bb3aa15a5378e8319f75f4b6b72b39177828f4..5a64220aaf1309832dc0ad543e353de67fe0a779 100644
|
||||
index 7cd82d27a741f194da5d0b3fcfd9c15c8ea1fa5c..5a64220aaf1309832dc0ad543e353de67fe0a779 100644
|
||||
--- a/chrome/browser/process_singleton.h
|
||||
+++ b/chrome/browser/process_singleton.h
|
||||
@@ -102,12 +102,19 @@ class ProcessSingleton {
|
||||
|
@ -56,7 +83,17 @@ index 16bb3aa15a5378e8319f75f4b6b72b39177828f4..5a64220aaf1309832dc0ad543e353de6
|
|||
|
||||
// Sets ourself up as the singleton instance. Returns true on success. If
|
||||
// false is returned, we are not the singleton instance and the caller must
|
||||
@@ -173,6 +182,8 @@ class ProcessSingleton {
|
||||
@@ -127,9 +136,6 @@ class ProcessSingleton {
|
||||
// another process should call this directly.
|
||||
bool Create();
|
||||
|
||||
- // Start watching for notifications from other processes.
|
||||
- void StartWatching();
|
||||
-
|
||||
// Clear any lock state during shutdown.
|
||||
void Cleanup();
|
||||
|
||||
@@ -176,6 +182,8 @@ class ProcessSingleton {
|
||||
#if BUILDFLAG(IS_WIN)
|
||||
bool EscapeVirtualization(const base::FilePath& user_data_dir);
|
||||
|
||||
|
@ -65,7 +102,13 @@ index 16bb3aa15a5378e8319f75f4b6b72b39177828f4..5a64220aaf1309832dc0ad543e353de6
|
|||
HWND remote_window_; // The HWND_MESSAGE of another browser.
|
||||
base::win::MessageWindow window_; // The message-only window.
|
||||
bool is_virtualized_; // Stuck inside Microsoft Softricity VM environment.
|
||||
@@ -222,6 +233,8 @@ class ProcessSingleton {
|
||||
@@ -220,12 +228,13 @@ class ProcessSingleton {
|
||||
|
||||
// Temporary directory to hold the socket.
|
||||
base::ScopedTempDir socket_dir_;
|
||||
- int sock_ = -1;
|
||||
|
||||
// Helper class for linux specific messages. LinuxWatcher is ref counted
|
||||
// because it posts messages between threads.
|
||||
class LinuxWatcher;
|
||||
scoped_refptr<LinuxWatcher> watcher_;
|
||||
|
@ -75,7 +118,7 @@ index 16bb3aa15a5378e8319f75f4b6b72b39177828f4..5a64220aaf1309832dc0ad543e353de6
|
|||
|
||||
#if BUILDFLAG(IS_MAC)
|
||||
diff --git a/chrome/browser/process_singleton_posix.cc b/chrome/browser/process_singleton_posix.cc
|
||||
index fa7ae4812ae5c13355d06dde1e99a17b17da6184..2de07460462632680f9b16a019744527dcee5125 100644
|
||||
index 7e4cc9cdd350e814c20feccdcc8d70b1080e60a1..2de07460462632680f9b16a019744527dcee5125 100644
|
||||
--- a/chrome/browser/process_singleton_posix.cc
|
||||
+++ b/chrome/browser/process_singleton_posix.cc
|
||||
@@ -54,6 +54,7 @@
|
||||
|
@ -138,7 +181,17 @@ index fa7ae4812ae5c13355d06dde1e99a17b17da6184..2de07460462632680f9b16a019744527
|
|||
bool ConnectSocket(ScopedSocket* socket,
|
||||
const base::FilePath& socket_path,
|
||||
const base::FilePath& cookie_path) {
|
||||
@@ -769,6 +791,10 @@ ProcessSingleton::ProcessSingleton(
|
||||
@@ -757,7 +779,8 @@ ProcessSingleton::ProcessSingleton(
|
||||
const base::FilePath& user_data_dir,
|
||||
const NotificationCallback& notification_callback)
|
||||
: notification_callback_(notification_callback),
|
||||
- current_pid_(base::GetCurrentProcId()) {
|
||||
+ current_pid_(base::GetCurrentProcId()),
|
||||
+ watcher_(new LinuxWatcher(this)) {
|
||||
socket_path_ = user_data_dir.Append(chrome::kSingletonSocketFilename);
|
||||
lock_path_ = user_data_dir.Append(chrome::kSingletonLockFilename);
|
||||
cookie_path_ = user_data_dir.Append(chrome::kSingletonCookieFilename);
|
||||
@@ -768,6 +791,10 @@ ProcessSingleton::ProcessSingleton(
|
||||
|
||||
ProcessSingleton::~ProcessSingleton() {
|
||||
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
|
||||
|
@ -149,7 +202,7 @@ index fa7ae4812ae5c13355d06dde1e99a17b17da6184..2de07460462632680f9b16a019744527
|
|||
}
|
||||
|
||||
ProcessSingleton::NotifyResult ProcessSingleton::NotifyOtherProcess() {
|
||||
@@ -933,6 +959,20 @@ ProcessSingleton::NotifyResult ProcessSingleton::NotifyOtherProcessOrCreate() {
|
||||
@@ -932,6 +959,20 @@ ProcessSingleton::NotifyResult ProcessSingleton::NotifyOtherProcessOrCreate() {
|
||||
base::Seconds(kTimeoutInSeconds));
|
||||
}
|
||||
|
||||
|
@ -170,7 +223,7 @@ index fa7ae4812ae5c13355d06dde1e99a17b17da6184..2de07460462632680f9b16a019744527
|
|||
ProcessSingleton::NotifyResult
|
||||
ProcessSingleton::NotifyOtherProcessWithTimeoutOrCreate(
|
||||
const base::CommandLine& command_line,
|
||||
@@ -1032,14 +1072,32 @@ bool ProcessSingleton::Create() {
|
||||
@@ -1031,14 +1072,32 @@ bool ProcessSingleton::Create() {
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@ -208,26 +261,58 @@ index fa7ae4812ae5c13355d06dde1e99a17b17da6184..2de07460462632680f9b16a019744527
|
|||
// Check that the directory was created with the correct permissions.
|
||||
int dir_mode = 0;
|
||||
CHECK(base::GetPosixFilePermissions(socket_dir_.GetPath(), &dir_mode) &&
|
||||
@@ -1082,10 +1140,13 @@ bool ProcessSingleton::Create() {
|
||||
if (listen(sock, 5) < 0)
|
||||
@@ -1050,9 +1109,10 @@ bool ProcessSingleton::Create() {
|
||||
// leaving a dangling symlink.
|
||||
base::FilePath socket_target_path =
|
||||
socket_dir_.GetPath().Append(chrome::kSingletonSocketFilename);
|
||||
+ int sock;
|
||||
SockaddrUn addr;
|
||||
socklen_t socklen;
|
||||
- SetupSocket(socket_target_path.value(), &sock_, &addr, &socklen);
|
||||
+ SetupSocket(socket_target_path.value(), &sock, &addr, &socklen);
|
||||
|
||||
// Setup the socket symlink and the two cookies.
|
||||
base::FilePath cookie(GenerateCookie());
|
||||
@@ -1071,26 +1131,24 @@ bool ProcessSingleton::Create() {
|
||||
return false;
|
||||
}
|
||||
|
||||
- if (bind(sock_, reinterpret_cast<sockaddr*>(&addr), socklen) < 0) {
|
||||
+ if (bind(sock, reinterpret_cast<sockaddr*>(&addr), socklen) < 0) {
|
||||
PLOG(ERROR) << "Failed to bind() " << socket_target_path.value();
|
||||
- CloseSocket(sock_);
|
||||
+ CloseSocket(sock);
|
||||
return false;
|
||||
}
|
||||
|
||||
- if (listen(sock_, 5) < 0)
|
||||
+ if (listen(sock, 5) < 0)
|
||||
NOTREACHED() << "listen failed: " << base::safe_strerror(errno);
|
||||
|
||||
- return true;
|
||||
-}
|
||||
+ sock_ = sock;
|
||||
|
||||
-void ProcessSingleton::StartWatching() {
|
||||
- DCHECK_GE(sock_, 0);
|
||||
- DCHECK(!watcher_);
|
||||
- watcher_ = new LinuxWatcher(this);
|
||||
- DCHECK(BrowserThread::IsThreadInitialized(BrowserThread::IO));
|
||||
- content::GetIOThreadTaskRunner({})->PostTask(
|
||||
- FROM_HERE, base::BindOnce(&ProcessSingleton::LinuxWatcher::StartListening,
|
||||
- watcher_, sock));
|
||||
+ sock_ = sock;
|
||||
+
|
||||
- watcher_, sock_));
|
||||
+ if (BrowserThread::IsThreadInitialized(BrowserThread::IO)) {
|
||||
+ StartListeningOnSocket();
|
||||
+ } else {
|
||||
+ listen_on_ready_ = true;
|
||||
+ }
|
||||
|
||||
return true;
|
||||
+
|
||||
+ return true;
|
||||
}
|
||||
|
||||
void ProcessSingleton::Cleanup() {
|
||||
diff --git a/chrome/browser/process_singleton_win.cc b/chrome/browser/process_singleton_win.cc
|
||||
index 363c18e4d9d5c0fe30f843d32df67e97e3d73111..0c87fc8ccb4511904f19b76ae5e03a5df6664391 100644
|
||||
index 41bc176510f93ef667e4f1373eab61142f3e264f..0c87fc8ccb4511904f19b76ae5e03a5df6664391 100644
|
||||
--- a/chrome/browser/process_singleton_win.cc
|
||||
+++ b/chrome/browser/process_singleton_win.cc
|
||||
@@ -29,7 +29,9 @@
|
||||
|
@ -316,3 +401,12 @@ index 363c18e4d9d5c0fe30f843d32df67e97e3d73111..0c87fc8ccb4511904f19b76ae5e03a5d
|
|||
CHECK(result && window_.hwnd());
|
||||
}
|
||||
}
|
||||
@@ -430,8 +455,6 @@ bool ProcessSingleton::Create() {
|
||||
return window_.hwnd() != NULL;
|
||||
}
|
||||
|
||||
-void ProcessSingleton::StartWatching() {}
|
||||
-
|
||||
void ProcessSingleton::Cleanup() {
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue