Chromium Code Reviews| Index: chrome/browser/ui/extensions/shell_window.cc |
| diff --git a/chrome/browser/ui/extensions/shell_window.cc b/chrome/browser/ui/extensions/shell_window.cc |
| index fa3e848f33454e88f744523709a8b5077b3b67be..9626ef0e511443e4d95bb6df8f219e260176f204 100644 |
| --- a/chrome/browser/ui/extensions/shell_window.cc |
| +++ b/chrome/browser/ui/extensions/shell_window.cc |
| @@ -68,7 +68,8 @@ void SuspendRenderViewHost(RenderViewHost* rvh) { |
| ShellWindow::CreateParams::CreateParams() |
| : frame(ShellWindow::CreateParams::FRAME_CHROME), |
| bounds(-1, -1, kDefaultWidth, kDefaultHeight), |
| - restore_position(true), restore_size(true) { |
| + restore_position(true), restore_size(true), |
| + creator_process_id(0) { |
| } |
| ShellWindow::CreateParams::~CreateParams() { |
| @@ -131,10 +132,19 @@ void ShellWindow::Init(const GURL& url, |
| } |
| } |
| - |
| - // Block the created RVH from loading anything until the background page |
| - // has had a chance to do any initialization it wants. |
| - SuspendRenderViewHost(web_contents_->GetRenderViewHost()); |
| + // If the new view is in the same process as the creator, block the created |
| + // RVH from loading anything until the background page has had a chance to do |
| + // any initialization it wants. If it's a different process, the new RVH |
| + // shouldn't communicate with the background page anyway (e.g. sandboxed). |
| + if (web_contents_->GetRenderViewHost()->GetProcess()->GetID() |
| + == params.creator_process_id) { |
|
sky
2012/10/12 16:30:21
== on previous line.
tapted
2012/10/15 02:32:39
Done.
|
| + SuspendRenderViewHost(web_contents_->GetRenderViewHost()); |
| + } else { |
| + DLOG(INFO) << "ShellWindow created in new process (" |
|
sky
2012/10/12 16:30:21
VLOG
tapted
2012/10/15 02:32:39
Done.
|
| + << web_contents_->GetRenderViewHost()->GetProcess()->GetID() |
| + << ") != creator (" << params.creator_process_id |
| + << "). Routing disabled."; |
| + } |
| // TODO(jeremya): there's a bug where navigating a web contents to an |
| // extension URL causes it to create a new RVH and discard the old (perfectly |