Chromium Code Reviews| Index: content/browser/browser_plugin/browser_plugin_embedder.cc |
| diff --git a/content/browser/browser_plugin/browser_plugin_embedder.cc b/content/browser/browser_plugin/browser_plugin_embedder.cc |
| index 930db2726a3e556f6b711610177a1f13c68d73da..d5ede7749ca988f7ae9ad4a3191e675f6a6f28c2 100644 |
| --- a/content/browser/browser_plugin/browser_plugin_embedder.cc |
| +++ b/content/browser/browser_plugin/browser_plugin_embedder.cc |
| @@ -77,34 +77,40 @@ void BrowserPluginEmbedder::AddGuest(int instance_id, |
| guest_web_contents_by_instance_id_[instance_id] = guest_web_contents; |
| } |
| +void BrowserPluginEmbedder::CreateGuest(RenderViewHost* render_view_host, |
| + int instance_id, |
| + int64 frame_id, |
| + std::string storage_partition_id, |
| + bool persist_storage) { |
|
Fady Samuel
2012/09/25 19:22:40
Hmm, this isn't actually used yet?
nasko
2012/09/25 22:57:22
Yes, as per our discussion, this will be a smaller
Fady Samuel
2012/09/25 23:04:38
sgtm.
|
| + WebContentsImpl* guest_web_contents = NULL; |
| + BrowserPluginGuest* guest = GetGuestByInstanceID(instance_id); |
| + CHECK(!guest); |
| + |
| + const std::string& host = |
| + render_view_host->GetSiteInstance()->GetSite().host(); |
| + guest_web_contents = WebContentsImpl::CreateGuest( |
| + web_contents()->GetBrowserContext(), |
| + host, |
| + instance_id); |
| + |
| + guest = guest_web_contents->GetBrowserPluginGuest(); |
| + guest->set_embedder_render_process_host(render_view_host->GetProcess()); |
| + |
| + guest_web_contents->GetMutableRendererPrefs()->throttle_input_events = false; |
| + AddGuest(instance_id, guest_web_contents, frame_id); |
| + guest_web_contents->SetDelegate(guest); |
| +} |
| + |
| void BrowserPluginEmbedder::NavigateGuest(RenderViewHost* render_view_host, |
| int instance_id, |
| int64 frame_id, |
| const std::string& src, |
| const gfx::Size& size) { |
| - BrowserPluginGuest* guest = GetGuestByInstanceID(instance_id); |
| - WebContentsImpl* guest_web_contents = NULL; |
| GURL url(src); |
| - if (!guest) { |
| - const std::string& host = |
| - render_view_host->GetSiteInstance()->GetSite().host(); |
| - guest_web_contents = WebContentsImpl::CreateGuest( |
| - web_contents()->GetBrowserContext(), |
| - host, |
| - instance_id); |
| - |
| - guest = guest_web_contents->GetBrowserPluginGuest(); |
| - guest->set_embedder_render_process_host( |
| - render_view_host->GetProcess()); |
| - |
| - guest_web_contents->GetMutableRendererPrefs()-> |
| - throttle_input_events = false; |
| - AddGuest(instance_id, guest_web_contents, frame_id); |
| - guest_web_contents->SetDelegate(guest); |
| - } else { |
| - guest_web_contents = |
| - static_cast<WebContentsImpl*>(guest->GetWebContents()); |
| - } |
| + BrowserPluginGuest* guest = GetGuestByInstanceID(instance_id); |
| + CHECK(guest); |
| + WebContentsImpl* guest_web_contents = |
| + static_cast<WebContentsImpl*>(guest->GetWebContents()); |
| // We ignore loading empty urls in web_contents. |
| // If a guest sets empty src attribute after it has navigated to some |