Chromium Code Reviews| Index: chrome/renderer/chrome_content_renderer_client.cc |
| diff --git a/chrome/renderer/chrome_content_renderer_client.cc b/chrome/renderer/chrome_content_renderer_client.cc |
| index 5f3b5c47af3f2084d3a1f518656e166a051c6210..b86c8b6ef74018553f9e3e6f92b71c1ac68ec19e 100644 |
| --- a/chrome/renderer/chrome_content_renderer_client.cc |
| +++ b/chrome/renderer/chrome_content_renderer_client.cc |
| @@ -283,6 +283,11 @@ GURL GetPluginInstancePosterImage(const blink::WebPluginParams& params, |
| } |
| #endif |
| +bool IsSingleProcess() { |
|
Lei Zhang
2015/02/26 22:17:58
Given you want to do this check in every place in
not at google - send to devlin
2015/02/26 22:25:03
I don't know this code that well either, but note
Devlin
2015/02/27 16:54:32
Two things:
- I tend to agree with Ben - if "lying
João Eiras
2015/03/02 17:02:48
I changed the dispatcher code then. Thanks for you
|
| + return !base::CommandLine::ForCurrentProcess()->HasSwitch( |
| + switches::kSingleProcess); |
| +} |
| + |
| } // namespace |
| ChromeContentRendererClient::ChromeContentRendererClient() { |
| @@ -1160,7 +1165,7 @@ void ChromeContentRendererClient::GetNavigationErrorStrings( |
| bool ChromeContentRendererClient::RunIdleHandlerWhenWidgetsHidden() { |
| #if defined(ENABLE_EXTENSIONS) |
| - return !extension_dispatcher_->is_extension_process(); |
| + return !extension_dispatcher_->is_extension_process() || IsSingleProcess(); |
| #else |
| return true; |
| #endif |
| @@ -1275,7 +1280,8 @@ bool ChromeContentRendererClient::ShouldFork(WebFrame* frame, |
| // in a normal process, or if it's a process for an extension that has been |
| // uninstalled. |
| if (frame->top()->document().url() == url) { |
| - if (is_extension_url != extension_dispatcher_->is_extension_process()) |
| + if (is_extension_url != extension_dispatcher_->is_extension_process() && |
| + !IsSingleProcess()) |
| return true; |
| } |
| #endif // defined(ENABLE_EXTENSIONS) |
| @@ -1400,6 +1406,7 @@ bool ChromeContentRendererClient::CrossesExtensionExtents( |
| if (!is_extension_url && |
| !opener_is_extension_url && |
| extension_dispatcher_->is_extension_process() && |
| + !IsSingleProcess() && |
| opener.canRequest(WebURL(new_url))) |
| return false; |