diff --git a/patches/chromium/feat_add_data_parameter_to_processsingleton.patch b/patches/chromium/feat_add_data_parameter_to_processsingleton.patch index a1a044cd1d..a0ccf4b049 100644 --- a/patches/chromium/feat_add_data_parameter_to_processsingleton.patch +++ b/patches/chromium/feat_add_data_parameter_to_processsingleton.patch @@ -13,7 +13,7 @@ app.requestSingleInstanceLock API so that users can pass in a JSON object for the second instance to send to the first instance. diff --git a/chrome/browser/process_singleton.h b/chrome/browser/process_singleton.h -index 31f5b160e4cd755cfb56a62b04261ee1bee80277..191d43392d1ca76882e9da32548fd8e6a713e701 100644 +index 31f5b160e4cd755cfb56a62b04261ee1bee80277..8dbc5ac458481d2f805f90101069f02adcfe4090 100644 --- a/chrome/browser/process_singleton.h +++ b/chrome/browser/process_singleton.h @@ -18,6 +18,7 @@ @@ -30,7 +30,7 @@ index 31f5b160e4cd755cfb56a62b04261ee1bee80277..191d43392d1ca76882e9da32548fd8e6 base::RepeatingCallback; + const base::FilePath& current_directory, -+ const std::vector additional_data)>; ++ const std::vector additional_data)>; #if BUILDFLAG(IS_WIN) ProcessSingleton(const std::string& program_name, @@ -63,14 +63,14 @@ index 31f5b160e4cd755cfb56a62b04261ee1bee80277..191d43392d1ca76882e9da32548fd8e6 #if BUILDFLAG(IS_WIN) bool EscapeVirtualization(const base::FilePath& user_data_dir); diff --git a/chrome/browser/process_singleton_posix.cc b/chrome/browser/process_singleton_posix.cc -index 298c9c81fa110ad7900d0bd6822136bb57f0382e..da7aaed23e4e0cdc037490bbe8beaea705b48df5 100644 +index 298c9c81fa110ad7900d0bd6822136bb57f0382e..f662580a6fc23d06c5e4795d5e7d41e788c8f90d 100644 --- a/chrome/browser/process_singleton_posix.cc +++ b/chrome/browser/process_singleton_posix.cc @@ -610,6 +610,7 @@ class ProcessSingleton::LinuxWatcher // |reader| is for sending back ACK message. void HandleMessage(const std::string& current_dir, const std::vector& argv, -+ const std::vector additional_data, ++ const std::vector additional_data, SocketReader* reader); // Called when the ProcessSingleton that owns this class is about to be @@ -81,7 +81,7 @@ index 298c9c81fa110ad7900d0bd6822136bb57f0382e..da7aaed23e4e0cdc037490bbe8beaea7 - const std::string& current_dir, const std::vector& argv, + const std::string& current_dir, + const std::vector& argv, -+ const std::vector additional_data, ++ const std::vector additional_data, SocketReader* reader) { DCHECK(ui_task_runner_->BelongsToCurrentThread()); DCHECK(reader); @@ -112,7 +112,7 @@ index 298c9c81fa110ad7900d0bd6822136bb57f0382e..da7aaed23e4e0cdc037490bbe8beaea7 + base::StringToSizeT(tokens[0], &num_args); + std::vector command_line(tokens.begin() + 1, tokens.begin() + 1 + num_args); + -+ std::vector additional_data; ++ std::vector additional_data; + if (tokens.size() >= 3 + num_args) { + size_t additional_data_size; + base::StringToSizeT(tokens[1 + num_args], &additional_data_size); @@ -121,7 +121,7 @@ index 298c9c81fa110ad7900d0bd6822136bb57f0382e..da7aaed23e4e0cdc037490bbe8beaea7 + std::string(1, kTokenDelimiter)); + const uint8_t* additional_data_bits = + reinterpret_cast(remaining_args.c_str()); -+ additional_data = std::vector( ++ additional_data = std::vector( + additional_data_bits, additional_data_bits + additional_data_size); + } + @@ -178,7 +178,7 @@ index 298c9c81fa110ad7900d0bd6822136bb57f0382e..da7aaed23e4e0cdc037490bbe8beaea7 if (!WriteToSocket(socket.fd(), to_send.data(), to_send.length())) { // Try to kill the other process, because it might have been dead. diff --git a/chrome/browser/process_singleton_win.cc b/chrome/browser/process_singleton_win.cc -index 11f35769cc53b4aa111a319d155a3916f0040fa7..8e3e870eaac14ce6886878b027c7cf2eba19a759 100644 +index 11f35769cc53b4aa111a319d155a3916f0040fa7..4a87d6c425aa27fb8dcec91287f8714e39b2c429 100644 --- a/chrome/browser/process_singleton_win.cc +++ b/chrome/browser/process_singleton_win.cc @@ -80,10 +80,12 @@ BOOL CALLBACK BrowserWindowEnumeration(HWND window, LPARAM param) { @@ -187,7 +187,7 @@ index 11f35769cc53b4aa111a319d155a3916f0040fa7..8e3e870eaac14ce6886878b027c7cf2e base::CommandLine* parsed_command_line, - base::FilePath* current_directory) { + base::FilePath* current_directory, -+ std::vector* parsed_additional_data) { ++ std::vector* parsed_additional_data) { // We should have enough room for the shortest command (min_message_size) // and also be a multiple of wchar_t bytes. The shortest command - // possible is L"START\0\0" (empty current directory and command line). @@ -228,7 +228,7 @@ index 11f35769cc53b4aa111a319d155a3916f0040fa7..8e3e870eaac14ce6886878b027c7cf2e + msg.substr(fourth_null + 1, fifth_null - fourth_null); + const uint8_t* additional_data_bytes = + reinterpret_cast(additional_data.c_str()); -+ *parsed_additional_data = std::vector(additional_data_bytes, ++ *parsed_additional_data = std::vector(additional_data_bytes, + additional_data_bytes + additional_data_length); + return true; @@ -239,7 +239,7 @@ index 11f35769cc53b4aa111a319d155a3916f0040fa7..8e3e870eaac14ce6886878b027c7cf2e base::CommandLine parsed_command_line(base::CommandLine::NO_PROGRAM); base::FilePath current_directory; - if (!ParseCommandLine(cds, &parsed_command_line, ¤t_directory)) { -+ std::vector additional_data; ++ std::vector additional_data; + if (!ParseCommandLine(cds, &parsed_command_line, ¤t_directory, &additional_data)) { *result = TRUE; return true; diff --git a/shell/browser/api/electron_api_app.cc b/shell/browser/api/electron_api_app.cc index cad66ef5e8..4881834a7b 100644 --- a/shell/browser/api/electron_api_app.cc +++ b/shell/browser/api/electron_api_app.cc @@ -407,10 +407,10 @@ bool NotificationCallbackWrapper( const base::RepeatingCallback< void(base::CommandLine command_line, const base::FilePath& current_directory, - const std::vector additional_data)>& callback, + const std::vector additional_data)>& callback, base::CommandLine cmd, const base::FilePath& cwd, - const std::vector additional_data) { + const std::vector additional_data) { // Make sure the callback is called after app gets ready. if (Browser::Get()->is_ready()) { callback.Run(std::move(cmd), cwd, std::move(additional_data)); @@ -987,7 +987,7 @@ std::string App::GetLocaleCountryCode() { void App::OnSecondInstance(base::CommandLine cmd, const base::FilePath& cwd, - const std::vector additional_data) { + const std::vector additional_data) { v8::Isolate* isolate = JavascriptEnvironment::GetIsolate(); v8::HandleScope handle_scope(isolate); v8::Local data_value = diff --git a/shell/browser/api/electron_api_app.h b/shell/browser/api/electron_api_app.h index be9b7af97b..96f47b273a 100644 --- a/shell/browser/api/electron_api_app.h +++ b/shell/browser/api/electron_api_app.h @@ -196,7 +196,7 @@ class App : public ElectronBrowserClient::Delegate, std::string GetSystemLocale(gin_helper::ErrorThrower thrower) const; void OnSecondInstance(base::CommandLine cmd, const base::FilePath& cwd, - const std::vector additional_data); + const std::vector additional_data); bool HasSingleInstanceLock() const; bool RequestSingleInstanceLock(gin::Arguments* args); void ReleaseSingleInstanceLock();