File electron-16-std-vector-non-const.patch of Package nodejs-electron
Index: electron-17.1.0/chrome/browser/process_singleton.h
===================================================================
--- electron-17.1.0.orig/chrome/browser/process_singleton.h 2022-03-07 17:39:06.993345117 +0100
+++ electron-17.1.0/chrome/browser/process_singleton.h 2022-03-09 08:29:01.682773127 +0100
@@ -102,7 +102,7 @@ class ProcessSingleton {
using NotificationCallback =
base::RepeatingCallback<bool(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,
Index: electron-17.1.0/chrome/browser/process_singleton_posix.cc
===================================================================
--- electron-17.1.0.orig/chrome/browser/process_singleton_posix.cc 2022-03-07 17:39:06.993345117 +0100
+++ electron-17.1.0/chrome/browser/process_singleton_posix.cc 2022-03-09 08:29:01.682773127 +0100
@@ -627,7 +627,7 @@ class ProcessSingleton::LinuxWatcher
// |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);
// Called when the ProcessSingleton that owns this class is about to be
@@ -684,7 +684,7 @@ void ProcessSingleton::LinuxWatcher::Sta
void ProcessSingleton::LinuxWatcher::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) {
DCHECK(ui_task_runner_->BelongsToCurrentThread());
DCHECK(reader);
@@ -774,7 +774,7 @@ void ProcessSingleton::LinuxWatcher::Soc
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);
@@ -783,7 +783,7 @@ void ProcessSingleton::LinuxWatcher::Soc
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);
}
Index: electron-17.1.0/chrome/browser/process_singleton_win.cc
===================================================================
--- electron-17.1.0.orig/chrome/browser/process_singleton_win.cc 2022-03-07 17:39:06.993345117 +0100
+++ electron-17.1.0/chrome/browser/process_singleton_win.cc 2022-03-09 08:29:01.682773127 +0100
@@ -81,7 +81,7 @@ BOOL CALLBACK BrowserWindowEnumeration(H
bool ParseCommandLine(const COPYDATASTRUCT* cds,
base::CommandLine* parsed_command_line,
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 command line, current directory,
@@ -163,7 +163,7 @@ bool ParseCommandLine(const COPYDATASTRU
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;
@@ -187,7 +187,7 @@ bool ProcessLaunchNotification(
base::CommandLine parsed_command_line(base::CommandLine::NO_PROGRAM);
base::FilePath current_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;
Index: electron-17.1.0/electron/shell/browser/api/electron_api_app.cc
===================================================================
--- electron-17.1.0.orig/electron/shell/browser/api/electron_api_app.cc 2022-03-07 16:07:24.343397858 +0100
+++ electron-17.1.0/electron/shell/browser/api/electron_api_app.cc 2022-03-09 08:29:01.682773127 +0100
@@ -517,10 +517,10 @@ bool NotificationCallbackWrapper(
const base::RepeatingCallback<
void(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,
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(std::move(cmd), cwd, std::move(additional_data));
@@ -1081,7 +1081,7 @@ std::string App::GetLocaleCountryCode()
void App::OnSecondInstance(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::HandleScope handle_scope(isolate);
v8::Local<v8::Value> data_value =
Index: electron-17.1.0/electron/shell/browser/api/electron_api_app.h
===================================================================
--- electron-17.1.0.orig/electron/shell/browser/api/electron_api_app.h 2022-03-07 16:07:24.343397858 +0100
+++ electron-17.1.0/electron/shell/browser/api/electron_api_app.h 2022-03-09 08:29:01.682773127 +0100
@@ -194,7 +194,7 @@ class App : public ElectronBrowserClient
std::string GetSystemLocale(gin_helper::ErrorThrower thrower) const;
void OnSecondInstance(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();