Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(422)

Unified Diff: content/browser/browser_plugin/browser_plugin_embedder.cc

Issue 10978028: Propagate storage partition id and persistence to the browser. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merging with incoming changes (159475). Created 8 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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 4a7c2293130c7d2d03d1cebe442a9ca6ad9f7901..09057f721b744cb67216a1d56b01544a787fb567 100644
--- a/content/browser/browser_plugin/browser_plugin_embedder.cc
+++ b/content/browser/browser_plugin/browser_plugin_embedder.cc
@@ -77,43 +77,49 @@ 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,
+ std::string storage_partition_id,
+ bool persist_storage) {
+ WebContentsImpl* guest_web_contents = NULL;
+ BrowserPluginGuest* guest = GetGuestByInstanceID(instance_id);
+ CHECK(!guest);
+
+ const std::string& host =
+ render_view_host->GetSiteInstance()->GetSiteURL().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());
+
+ RendererPreferences* guest_renderer_prefs =
+ guest_web_contents->GetMutableRendererPrefs();
+ // Copy renderer preferences (and nothing else) from the embedder's
+ // TabContents to the guest.
+ //
+ // For GTK and Aura this is necessary to get proper renderer configuration
+ // values for caret blinking interval, colors related to selection and
+ // focus.
+ *guest_renderer_prefs = *web_contents()->GetMutableRendererPrefs();
+
+ guest_renderer_prefs->throttle_input_events = false;
+ AddGuest(instance_id, guest_web_contents);
+ guest_web_contents->SetDelegate(guest);
+}
+
void BrowserPluginEmbedder::NavigateGuest(
RenderViewHost* render_view_host,
int instance_id,
const std::string& src,
const BrowserPluginHostMsg_ResizeGuest_Params& resize_params) {
BrowserPluginGuest* guest = GetGuestByInstanceID(instance_id);
- WebContentsImpl* guest_web_contents = NULL;
+ CHECK(guest);
GURL url(src);
- if (!guest) {
- const std::string& host =
- render_view_host->GetSiteInstance()->GetSiteURL().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());
-
- RendererPreferences* guest_renderer_prefs =
- guest_web_contents->GetMutableRendererPrefs();
- // Copy renderer preferences (and nothing else) from the embedder's
- // TabContents to the guest.
- //
- // For GTK and Aura this is necessary to get proper renderer configuration
- // values for caret blinking interval, colors related to selection and
- // focus.
- *guest_renderer_prefs = *web_contents()->GetMutableRendererPrefs();
-
- guest_renderer_prefs->throttle_input_events = false;
- AddGuest(instance_id, guest_web_contents);
- guest_web_contents->SetDelegate(guest);
- } else {
- guest_web_contents =
- static_cast<WebContentsImpl*>(guest->GetWebContents());
- }
+ 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
« no previous file with comments | « content/browser/browser_plugin/browser_plugin_embedder.h ('k') | content/browser/web_contents/web_contents_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698