| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "extensions/shell/browser/shell_content_browser_client.h" | 5 #include "extensions/shell/browser/shell_content_browser_client.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "content/public/browser/browser_thread.h" | 8 #include "content/public/browser/browser_thread.h" |
| 9 #include "content/public/browser/render_process_host.h" | 9 #include "content/public/browser/render_process_host.h" |
| 10 #include "content/public/browser/site_instance.h" | 10 #include "content/public/browser/site_instance.h" |
| (...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 196 extension->id(), | 196 extension->id(), |
| 197 site_instance->GetProcess()->GetID(), | 197 site_instance->GetProcess()->GetID(), |
| 198 site_instance->GetId())); | 198 site_instance->GetId())); |
| 199 } | 199 } |
| 200 | 200 |
| 201 void ShellContentBrowserClient::AppendExtraCommandLineSwitches( | 201 void ShellContentBrowserClient::AppendExtraCommandLineSwitches( |
| 202 base::CommandLine* command_line, | 202 base::CommandLine* command_line, |
| 203 int child_process_id) { | 203 int child_process_id) { |
| 204 std::string process_type = | 204 std::string process_type = |
| 205 command_line->GetSwitchValueASCII(::switches::kProcessType); | 205 command_line->GetSwitchValueASCII(::switches::kProcessType); |
| 206 |
| 207 #if defined(OS_POSIX) && !defined(OS_MACOSX) |
| 208 #if defined(V8_USE_EXTERNAL_STARTUP_DATA) |
| 209 if (process_type != switches::kZygoteProcess) { |
| 210 command_line->AppendSwitch(::switches::kV8NativesPassedByFD); |
| 211 command_line->AppendSwitch(::switches::kV8SnapshotPassedByFD); |
| 212 } |
| 213 #endif // V8_USE_EXTERNAL_STARTUP_DATA |
| 214 #endif // OS_POSIX && !OS_MACOSX |
| 215 |
| 206 if (process_type == ::switches::kRendererProcess) | 216 if (process_type == ::switches::kRendererProcess) |
| 207 AppendRendererSwitches(command_line); | 217 AppendRendererSwitches(command_line); |
| 208 } | 218 } |
| 209 | 219 |
| 210 content::SpeechRecognitionManagerDelegate* | 220 content::SpeechRecognitionManagerDelegate* |
| 211 ShellContentBrowserClient::CreateSpeechRecognitionManagerDelegate() { | 221 ShellContentBrowserClient::CreateSpeechRecognitionManagerDelegate() { |
| 212 return new speech::ShellSpeechRecognitionManagerDelegate(); | 222 return new speech::ShellSpeechRecognitionManagerDelegate(); |
| 213 } | 223 } |
| 214 | 224 |
| 215 content::BrowserPpapiHost* | 225 content::BrowserPpapiHost* |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 290 | 300 |
| 291 const Extension* ShellContentBrowserClient::GetExtension( | 301 const Extension* ShellContentBrowserClient::GetExtension( |
| 292 content::SiteInstance* site_instance) { | 302 content::SiteInstance* site_instance) { |
| 293 ExtensionRegistry* registry = | 303 ExtensionRegistry* registry = |
| 294 ExtensionRegistry::Get(site_instance->GetBrowserContext()); | 304 ExtensionRegistry::Get(site_instance->GetBrowserContext()); |
| 295 return registry->enabled_extensions().GetExtensionOrAppByURL( | 305 return registry->enabled_extensions().GetExtensionOrAppByURL( |
| 296 site_instance->GetSiteURL()); | 306 site_instance->GetSiteURL()); |
| 297 } | 307 } |
| 298 | 308 |
| 299 } // namespace extensions | 309 } // namespace extensions |
| OLD | NEW |