Skip to content

Commit

Permalink
chore: update patch
Browse files Browse the repository at this point in the history
  • Loading branch information
VerteDinde committed May 19, 2022
1 parent a7cab77 commit 9d6df29
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions patches/chromium/feat_add_data_parameter_to_processsingleton.patch
Expand Up @@ -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 5a64220aaf1309832dc0ad543e353de67fe0a779..3956eaaf8fd4ba8f2ac0b8e93939f703123749e6 100644
index 5a64220aaf1309832dc0ad543e353de67fe0a779..eae9bc40c4156481ae5797d0eac1b61d54618f79 100644
--- a/chrome/browser/process_singleton.h
+++ b/chrome/browser/process_singleton.h
@@ -18,6 +18,7 @@
Expand All @@ -24,13 +24,13 @@ index 5a64220aaf1309832dc0ad543e353de67fe0a779..3956eaaf8fd4ba8f2ac0b8e93939f703
#include "ui/gfx/native_widget_types.h"

#if BUILDFLAG(IS_POSIX) && !BUILDFLAG(IS_ANDROID)
@@ -100,21 +101,24 @@ class ProcessSingleton {
@@ -100,21 +101,23 @@ class ProcessSingleton {
// should handle it (i.e., because the current process is shutting down).
using NotificationCallback =
base::RepeatingCallback<bool(const base::CommandLine& command_line,
- const base::FilePath& current_directory)>;
+ const base::FilePath& current_directory,
+ const std::vector<const uint8_t> additional_data)>;
+ const std::vector<const uint8_t> additional_data))>;

#if BUILDFLAG(IS_WIN)
ProcessSingleton(const std::string& program_name,
Expand All @@ -40,7 +40,6 @@ index 5a64220aaf1309832dc0ad543e353de67fe0a779..3956eaaf8fd4ba8f2ac0b8e93939f703
const NotificationCallback& notification_callback);
#else
ProcessSingleton(const base::FilePath& user_data_dir,
+ const base::span<const uint8_t> additional_data,
const NotificationCallback& notification_callback);
+#endif

Expand All @@ -51,7 +50,7 @@ index 5a64220aaf1309832dc0ad543e353de67fe0a779..3956eaaf8fd4ba8f2ac0b8e93939f703
~ProcessSingleton();

// Notify another process, if available. Otherwise sets ourselves as the
@@ -178,6 +182,8 @@ class ProcessSingleton {
@@ -178,6 +181,8 @@ class ProcessSingleton {

private:
NotificationCallback notification_callback_; // Handler for notifications.
Expand Down Expand Up @@ -175,16 +174,17 @@ index 7d3a441bdb64268ed5fbfa7bf589fb35a2fd1b75..a3e45e9baa09bfc87be5b7ff589ac768
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 0ea5eb3e3cf055d981ab73486115bac53287f2d7..6ba40a3ebc0e44c512ce7822505ec6ee3d008672 100644
index 0ea5eb3e3cf055d981ab73486115bac53287f2d7..f5ff23943d45403f5bc846b2ebfeffa4746f1761 100644
--- a/chrome/browser/process_singleton_win.cc
+++ b/chrome/browser/process_singleton_win.cc
@@ -80,10 +80,13 @@ BOOL CALLBACK BrowserWindowEnumeration(HWND window, LPARAM param) {
@@ -79,11 +79,12 @@ BOOL CALLBACK BrowserWindowEnumeration(HWND window, LPARAM param) {
}

bool ParseCommandLine(const COPYDATASTRUCT* cds,
base::CommandLine* parsed_command_line,
- base::CommandLine* parsed_command_line,
- base::FilePath* current_directory) {
+ base::FilePath* current_directory,
+ std::vector<const uint8_t>* parsed_additional_data) {
base::FilePath* current_directory) {
// 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).
Expand All @@ -193,7 +193,7 @@ index 0ea5eb3e3cf055d981ab73486115bac53287f2d7..6ba40a3ebc0e44c512ce7822505ec6ee
static const int min_message_size = 7;
if (cds->cbData < min_message_size * sizeof(wchar_t) ||
cds->cbData % sizeof(wchar_t) != 0) {
@@ -133,11 +145,82 @@ bool ParseCommandLine(const COPYDATASTRUCT* cds,
@@ -133,6 +134,37 @@ bool ParseCommandLine(const COPYDATASTRUCT* cds,
const std::wstring cmd_line =
msg.substr(second_null + 1, third_null - second_null);
*parsed_command_line = base::CommandLine::FromString(cmd_line);
Expand Down Expand Up @@ -231,7 +231,7 @@ index 0ea5eb3e3cf055d981ab73486115bac53287f2d7..6ba40a3ebc0e44c512ce7822505ec6ee
return true;
}
return false;
@@ -154,13 +188,14 @@ bool ProcessLaunchNotification(
@@ -154,13 +186,14 @@ bool ProcessLaunchNotification(

base::CommandLine parsed_command_line(base::CommandLine::NO_PROGRAM);
base::FilePath current_directory;
Expand All @@ -249,7 +249,7 @@ index 0ea5eb3e3cf055d981ab73486115bac53287f2d7..6ba40a3ebc0e44c512ce7822505ec6ee
return true;
}

@@ -254,9 +289,11 @@ bool ProcessSingleton::EscapeVirtualization(
@@ -254,9 +287,11 @@ bool ProcessSingleton::EscapeVirtualization(
ProcessSingleton::ProcessSingleton(
const std::string& program_name,
const base::FilePath& user_data_dir,
Expand All @@ -261,7 +261,7 @@ index 0ea5eb3e3cf055d981ab73486115bac53287f2d7..6ba40a3ebc0e44c512ce7822505ec6ee
program_name_(program_name),
is_app_sandboxed_(is_app_sandboxed),
is_virtualized_(false),
@@ -283,7 +320,7 @@ ProcessSingleton::NotifyResult ProcessSingleton::NotifyOtherProcess() {
@@ -283,7 +318,7 @@ ProcessSingleton::NotifyResult ProcessSingleton::NotifyOtherProcess() {
return PROCESS_NONE;
}

Expand Down

0 comments on commit 9d6df29

Please sign in to comment.