Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(311)

Side by Side Diff: headless/lib/headless_content_main_delegate.cc

Issue 2690163005: Change platform methods and try to make init logging logic clearer (Closed)
Patch Set: Uploaded upstream Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « headless/lib/browser/headless_web_contents_impl.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "headless/lib/headless_content_main_delegate.h" 5 #include "headless/lib/headless_content_main_delegate.h"
6 6
7 #include "base/base_switches.h" 7 #include "base/base_switches.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/files/file_util.h" 9 #include "base/files/file_util.h"
10 #include "base/lazy_instance.h" 10 #include "base/lazy_instance.h"
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after
153 } 153 }
154 #if defined(HEADLESS_USE_BREAKPAD) 154 #if defined(HEADLESS_USE_BREAKPAD)
155 if (process_type != switches::kZygoteProcess) 155 if (process_type != switches::kZygoteProcess)
156 breakpad::InitCrashReporter(process_type); 156 breakpad::InitCrashReporter(process_type);
157 #endif // defined(HEADLESS_USE_BREAKPAD) 157 #endif // defined(HEADLESS_USE_BREAKPAD)
158 } 158 }
159 159
160 void HeadlessContentMainDelegate::PreSandboxStartup() { 160 void HeadlessContentMainDelegate::PreSandboxStartup() {
161 const base::CommandLine& command_line( 161 const base::CommandLine& command_line(
162 *base::CommandLine::ForCurrentProcess()); 162 *base::CommandLine::ForCurrentProcess());
163 const std::string process_type = 163 #if defined(OS_WIN)
164 command_line.GetSwitchValueASCII(switches::kProcessType); 164 // Windows always needs to initialize logging, otherwise you get a renderer
165 // crash.
165 InitLogging(command_line); 166 InitLogging(command_line);
167 #else
168 if (command_line.HasSwitch(switches::kEnableLogging))
169 InitLogging(command_line);
170 #endif
166 InitCrashReporter(command_line); 171 InitCrashReporter(command_line);
167 InitializeResourceBundle(); 172 InitializeResourceBundle();
168 } 173 }
169 174
170 int HeadlessContentMainDelegate::RunProcess( 175 int HeadlessContentMainDelegate::RunProcess(
171 const std::string& process_type, 176 const std::string& process_type,
172 const content::MainFunctionParams& main_function_params) { 177 const content::MainFunctionParams& main_function_params) {
173 if (!process_type.empty()) 178 if (!process_type.empty())
174 return -1; 179 return -1;
175 180
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
239 #endif 244 #endif
240 } 245 }
241 246
242 content::ContentBrowserClient* 247 content::ContentBrowserClient*
243 HeadlessContentMainDelegate::CreateContentBrowserClient() { 248 HeadlessContentMainDelegate::CreateContentBrowserClient() {
244 browser_client_.reset(new HeadlessContentBrowserClient(browser_.get())); 249 browser_client_.reset(new HeadlessContentBrowserClient(browser_.get()));
245 return browser_client_.get(); 250 return browser_client_.get();
246 } 251 }
247 252
248 } // namespace headless 253 } // namespace headless
OLDNEW
« no previous file with comments | « headless/lib/browser/headless_web_contents_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698