110 lines
6.0 KiB
Diff
110 lines
6.0 KiB
Diff
--- a/patches/chromium/feat_add_data_parameter_to_processsingleton.patch
|
|
+++ b/patches/chromium/feat_add_data_parameter_to_processsingleton.patch
|
|
@@ -32,7 +32,7 @@ index 5a64220aaf1309832dc0ad543e353de67fe0a779..e75c4f0d7cf1cac2e5862eb858800359
|
|
- const base::FilePath& current_directory)>;
|
|
+ base::RepeatingCallback<bool(const base::CommandLine& command_line,
|
|
+ const base::FilePath& current_directory,
|
|
-+ const std::vector<const uint8_t> additional_data)>;
|
|
++ const std::vector<uint8_t> additional_data)>;
|
|
|
|
#if BUILDFLAG(IS_WIN)
|
|
ProcessSingleton(const std::string& program_name,
|
|
@@ -73,7 +73,7 @@ index 7d3a441bdb64268ed5fbfa7bf589fb35a2fd1b75..a3e45e9baa09bfc87be5b7ff589ac768
|
|
// |reader| is for sending back ACK message.
|
|
void HandleMessage(const std::string& current_dir,
|
|
const std::vector<std::string>& argv,
|
|
-+ const std::vector<const uint8_t> additional_data,
|
|
++ const std::vector<uint8_t> additional_data,
|
|
SocketReader* reader);
|
|
|
|
private:
|
|
@@ -84,7 +84,7 @@ index 7d3a441bdb64268ed5fbfa7bf589fb35a2fd1b75..a3e45e9baa09bfc87be5b7ff589ac768
|
|
- const std::string& current_dir, const std::vector<std::string>& argv,
|
|
+ const std::string& current_dir,
|
|
+ const std::vector<std::string>& argv,
|
|
-+ const std::vector<const uint8_t> additional_data,
|
|
++ const std::vector<uint8_t> additional_data,
|
|
SocketReader* reader) {
|
|
DCHECK(ui_task_runner_->BelongsToCurrentThread());
|
|
DCHECK(reader);
|
|
@@ -114,7 +114,7 @@ index 7d3a441bdb64268ed5fbfa7bf589fb35a2fd1b75..a3e45e9baa09bfc87be5b7ff589ac768
|
|
+ base::StringToSizeT(tokens[0], &num_args);
|
|
+ std::vector<std::string> command_line(tokens.begin() + 1, tokens.begin() + 1 + num_args);
|
|
+
|
|
-+ std::vector<const uint8_t> additional_data;
|
|
++ std::vector<uint8_t> additional_data;
|
|
+ if (tokens.size() >= 3 + num_args) {
|
|
+ size_t additional_data_size;
|
|
+ base::StringToSizeT(tokens[1 + num_args], &additional_data_size);
|
|
@@ -123,7 +123,7 @@ index 7d3a441bdb64268ed5fbfa7bf589fb35a2fd1b75..a3e45e9baa09bfc87be5b7ff589ac768
|
|
+ std::string(1, kTokenDelimiter));
|
|
+ const uint8_t* additional_data_bits =
|
|
+ reinterpret_cast<const uint8_t*>(remaining_args.c_str());
|
|
-+ additional_data = std::vector<const uint8_t>(
|
|
++ additional_data = std::vector<uint8_t>(
|
|
+ additional_data_bits, additional_data_bits + additional_data_size);
|
|
+ }
|
|
+
|
|
@@ -189,7 +189,7 @@ index 0ea5eb3e3cf055d981ab73486115bac53287f2d7..fe68beb4b2522d27e07dbbb3341f100f
|
|
base::CommandLine* parsed_command_line,
|
|
- base::FilePath* current_directory) {
|
|
+ base::FilePath* current_directory,
|
|
-+ std::vector<const uint8_t>* parsed_additional_data) {
|
|
++ std::vector<uint8_t>* 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).
|
|
@@ -230,7 +230,7 @@ index 0ea5eb3e3cf055d981ab73486115bac53287f2d7..fe68beb4b2522d27e07dbbb3341f100f
|
|
+ msg.substr(fourth_null + 1, fifth_null - fourth_null);
|
|
+ const uint8_t* additional_data_bytes =
|
|
+ reinterpret_cast<const uint8_t*>(additional_data.c_str());
|
|
-+ *parsed_additional_data = std::vector<const uint8_t>(additional_data_bytes,
|
|
++ *parsed_additional_data = std::vector<uint8_t>(additional_data_bytes,
|
|
+ additional_data_bytes + additional_data_length);
|
|
+
|
|
return true;
|
|
@@ -241,7 +241,7 @@ index 0ea5eb3e3cf055d981ab73486115bac53287f2d7..fe68beb4b2522d27e07dbbb3341f100f
|
|
base::CommandLine parsed_command_line(base::CommandLine::NO_PROGRAM);
|
|
base::FilePath current_directory;
|
|
- if (!ParseCommandLine(cds, &parsed_command_line, ¤t_directory)) {
|
|
-+ std::vector<const uint8_t> additional_data;
|
|
++ std::vector<uint8_t> additional_data;
|
|
+ if (!ParseCommandLine(cds, &parsed_command_line, ¤t_directory, &additional_data)) {
|
|
*result = TRUE;
|
|
return true;
|
|
--- a/shell/browser/api/electron_api_app.cc
|
|
+++ b/shell/browser/api/electron_api_app.cc
|
|
@@ -519,10 +519,10 @@ bool NotificationCallbackWrapper(
|
|
const base::RepeatingCallback<
|
|
void(const base::CommandLine& command_line,
|
|
const base::FilePath& current_directory,
|
|
- const std::vector<const uint8_t> additional_data)>& callback,
|
|
+ const std::vector<uint8_t> additional_data)>& callback,
|
|
const base::CommandLine& cmd,
|
|
const base::FilePath& cwd,
|
|
- const std::vector<const uint8_t> additional_data) {
|
|
+ const std::vector<uint8_t> additional_data) {
|
|
// Make sure the callback is called after app gets ready.
|
|
if (Browser::Get()->is_ready()) {
|
|
callback.Run(cmd, cwd, std::move(additional_data));
|
|
@@ -1083,7 +1083,7 @@ std::string App::GetLocaleCountryCode() {
|
|
|
|
void App::OnSecondInstance(const base::CommandLine& cmd,
|
|
const base::FilePath& cwd,
|
|
- const std::vector<const uint8_t> additional_data) {
|
|
+ const std::vector<uint8_t> additional_data) {
|
|
v8::Isolate* isolate = JavascriptEnvironment::GetIsolate();
|
|
v8::Locker locker(isolate);
|
|
v8::HandleScope handle_scope(isolate);
|
|
--- a/shell/browser/api/electron_api_app.h
|
|
+++ b/shell/browser/api/electron_api_app.h
|
|
@@ -195,7 +195,7 @@ class App : public ElectronBrowserClient::Delegate,
|
|
std::string GetLocaleCountryCode();
|
|
void OnSecondInstance(const base::CommandLine& cmd,
|
|
const base::FilePath& cwd,
|
|
- const std::vector<const uint8_t> additional_data);
|
|
+ const std::vector<uint8_t> additional_data);
|
|
bool HasSingleInstanceLock() const;
|
|
bool RequestSingleInstanceLock(gin::Arguments* args);
|
|
void ReleaseSingleInstanceLock();
|