OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "content/shell/browser/shell_content_browser_client.h" | 5 #include "content/shell/browser/shell_content_browser_client.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.h" | 9 #include "base/files/file.h" |
10 #include "base/files/file_util.h" | 10 #include "base/files/file_util.h" |
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
202 for (size_t i = 0; i < arraysize(kProtocolList); ++i) { | 202 for (size_t i = 0; i < arraysize(kProtocolList); ++i) { |
203 if (url.scheme() == kProtocolList[i]) | 203 if (url.scheme() == kProtocolList[i]) |
204 return true; | 204 return true; |
205 } | 205 } |
206 return false; | 206 return false; |
207 } | 207 } |
208 | 208 |
209 void ShellContentBrowserClient::AppendExtraCommandLineSwitches( | 209 void ShellContentBrowserClient::AppendExtraCommandLineSwitches( |
210 base::CommandLine* command_line, | 210 base::CommandLine* command_line, |
211 int child_process_id) { | 211 int child_process_id) { |
| 212 #if defined(OS_POSIX) && !defined(OS_MACOSX) |
| 213 #if defined(V8_USE_EXTERNAL_STARTUP_DATA) |
| 214 std::string process_type = |
| 215 command_line->GetSwitchValueASCII(switches::kProcessType); |
| 216 if (process_type != switches::kZygoteProcess) { |
| 217 command_line->AppendSwitch(::switches::kV8NativesPassedByFD); |
| 218 command_line->AppendSwitch(::switches::kV8SnapshotPassedByFD); |
| 219 } |
| 220 #endif // V8_USE_EXTERNAL_STARTUP_DATA |
| 221 #endif // OS_POSIX && !OS_MACOSX |
212 if (base::CommandLine::ForCurrentProcess()->HasSwitch( | 222 if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
213 switches::kRunLayoutTest)) | 223 switches::kRunLayoutTest)) |
214 command_line->AppendSwitch(switches::kRunLayoutTest); | 224 command_line->AppendSwitch(switches::kRunLayoutTest); |
215 if (base::CommandLine::ForCurrentProcess()->HasSwitch( | 225 if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
216 switches::kEnableFontAntialiasing)) | 226 switches::kEnableFontAntialiasing)) |
217 command_line->AppendSwitch(switches::kEnableFontAntialiasing); | 227 command_line->AppendSwitch(switches::kEnableFontAntialiasing); |
218 if (base::CommandLine::ForCurrentProcess()->HasSwitch( | 228 if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
219 switches::kExposeInternalsForTesting)) | 229 switches::kExposeInternalsForTesting)) |
220 command_line->AppendSwitch(switches::kExposeInternalsForTesting); | 230 command_line->AppendSwitch(switches::kExposeInternalsForTesting); |
221 if (base::CommandLine::ForCurrentProcess()->HasSwitch( | 231 if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
415 ShellBrowserContext* | 425 ShellBrowserContext* |
416 ShellContentBrowserClient::ShellBrowserContextForBrowserContext( | 426 ShellContentBrowserClient::ShellBrowserContextForBrowserContext( |
417 BrowserContext* content_browser_context) { | 427 BrowserContext* content_browser_context) { |
418 if (content_browser_context == browser_context()) | 428 if (content_browser_context == browser_context()) |
419 return browser_context(); | 429 return browser_context(); |
420 DCHECK_EQ(content_browser_context, off_the_record_browser_context()); | 430 DCHECK_EQ(content_browser_context, off_the_record_browser_context()); |
421 return off_the_record_browser_context(); | 431 return off_the_record_browser_context(); |
422 } | 432 } |
423 | 433 |
424 } // namespace content | 434 } // namespace content |
OLD | NEW |