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

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

Issue 1908983002: headless: Switch to multiprocess mode by default (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased Created 4 years, 8 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 | « no previous file | headless/public/headless_browser.h » ('j') | 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/command_line.h" 7 #include "base/command_line.h"
8 #include "base/path_service.h" 8 #include "base/path_service.h"
9 #include "base/run_loop.h" 9 #include "base/run_loop.h"
10 #include "base/trace_event/trace_event.h" 10 #include "base/trace_event/trace_event.h"
(...skipping 23 matching lines...) Expand all
34 } 34 }
35 35
36 HeadlessContentMainDelegate::~HeadlessContentMainDelegate() { 36 HeadlessContentMainDelegate::~HeadlessContentMainDelegate() {
37 DCHECK(g_current_headless_content_main_delegate == this); 37 DCHECK(g_current_headless_content_main_delegate == this);
38 g_current_headless_content_main_delegate = nullptr; 38 g_current_headless_content_main_delegate = nullptr;
39 } 39 }
40 40
41 bool HeadlessContentMainDelegate::BasicStartupComplete(int* exit_code) { 41 bool HeadlessContentMainDelegate::BasicStartupComplete(int* exit_code) {
42 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); 42 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
43 43
44 command_line->AppendSwitch(switches::kNoSandbox); 44 if (browser_->options().single_process_mode)
45 command_line->AppendSwitch(switches::kSingleProcess); 45 command_line->AppendSwitch(switches::kSingleProcess);
46 46
47 // The headless backend is automatically chosen for a headless build, but also 47 // The headless backend is automatically chosen for a headless build, but also
48 // adding it here allows us to run in a non-headless build too. 48 // adding it here allows us to run in a non-headless build too.
49 command_line->AppendSwitchASCII(switches::kOzonePlatform, "headless"); 49 command_line->AppendSwitchASCII(switches::kOzonePlatform, "headless");
50 50
51 // TODO(skyostil): Investigate using Mesa/SwiftShader for output. 51 // TODO(skyostil): Investigate using Mesa/SwiftShader for output.
52 command_line->AppendSwitch(switches::kDisableGpu); 52 command_line->AppendSwitch(switches::kDisableGpu);
53 53
54 SetContentClient(&content_client_); 54 SetContentClient(&content_client_);
55 return false; 55 return false;
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 return renderer_client_.get(); 115 return renderer_client_.get();
116 } 116 }
117 117
118 content::ContentUtilityClient* 118 content::ContentUtilityClient*
119 HeadlessContentMainDelegate::CreateContentUtilityClient() { 119 HeadlessContentMainDelegate::CreateContentUtilityClient() {
120 utility_client_.reset(new HeadlessContentUtilityClient); 120 utility_client_.reset(new HeadlessContentUtilityClient);
121 return utility_client_.get(); 121 return utility_client_.get();
122 } 122 }
123 123
124 } // namespace headless 124 } // namespace headless
OLDNEW
« no previous file with comments | « no previous file | headless/public/headless_browser.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698