Skip to content

Commit 3be78bc

Browse files
committed
tried to move crash dump initialization earlier
1 parent 27dff7c commit 3be78bc

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

src/shell_browser_main_parts.cc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
#include "chrome/common/chrome_switches.h"
3131
#include "content/nw/src/api/app/app.h"
3232
#include "content/nw/src/api/dispatcher_host.h"
33+
#include "content/nw/src/breakpad_linux.h"
3334
#include "content/nw/src/browser/printing/print_job_manager.h"
3435
#include "content/nw/src/browser/shell_devtools_delegate.h"
3536
#include "content/nw/src/common/shell_switches.h"
@@ -160,6 +161,7 @@ int ShellBrowserMainParts::PreCreateThreads() {
160161

161162
void ShellBrowserMainParts::Init() {
162163
package_.reset(new nw::Package());
164+
CommandLine& command_line = *CommandLine::ForCurrentProcess();
163165

164166
browser_context_.reset(new ShellBrowserContext(false, package()));
165167
off_the_record_browser_context_.reset(
@@ -181,7 +183,7 @@ void ShellBrowserMainParts::Init() {
181183
int port = 0;
182184
// See if the user specified a port on the command line (useful for
183185
// automation). If not, use an ephemeral port by specifying 0.
184-
CommandLine& command_line = *CommandLine::ForCurrentProcess();
186+
185187
if (command_line.HasSwitch(switches::kRemoteDebuggingPort)) {
186188
int temp_port;
187189
std::string port_str =

src/shell_main_delegate.cc

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,11 @@ void ShellMainDelegate::PreSandboxStartup() {
142142
InitializeResourceBundle();
143143

144144
CommandLine* command_line = CommandLine::ForCurrentProcess();
145+
std::string process_type =
146+
command_line->GetSwitchValueASCII(switches::kProcessType);
147+
148+
if (process_type != switches::kZygoteProcess)
149+
InitCrashReporter();
145150

146151
// Just prevent sandbox.
147152
command_line->AppendSwitch(switches::kNoSandbox);
@@ -159,11 +164,6 @@ void ShellMainDelegate::PreSandboxStartup() {
159164
command_line->AppendSwitch(switches::kAllowFileAccessFromFiles);
160165
command_line->AppendSwitch(switches::kEnableExperimentalWebPlatformFeatures);
161166
command_line->AppendSwitch(switches::kEnableCssShaders);
162-
std::string process_type =
163-
command_line->GetSwitchValueASCII(switches::kProcessType);
164-
165-
if (process_type != switches::kZygoteProcess)
166-
InitCrashReporter();
167167
}
168168

169169
int ShellMainDelegate::RunProcess(

0 commit comments

Comments
 (0)