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

Unified Diff: content/renderer/browser_plugin/browser_plugin.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/renderer/browser_plugin/browser_plugin.cc
diff --git a/content/renderer/browser_plugin/browser_plugin.cc b/content/renderer/browser_plugin/browser_plugin.cc
index 1d8bdb6878044497536130ff05dba2b51b0d9221..712c41a93f060738323e498f6fa612bbd476bcd5 100644
--- a/content/renderer/browser_plugin/browser_plugin.cc
+++ b/content/renderer/browser_plugin/browser_plugin.cc
@@ -94,10 +94,24 @@ std::string BrowserPlugin::GetSrcAttribute() const {
void BrowserPlugin::SetSrcAttribute(const std::string& src) {
if (src == src_ && !guest_crashed_)
return;
- if (!src.empty() || navigate_src_sent_) {
+
+ // If we haven't created the guest yet, do so now, if |src| is not empty and
+ // we will navigate it right after creation. If |src| is empty, we can delay
+ // the creation until we acutally need it.
+ if (!navigate_src_sent_ && !src.empty()) {
+ BrowserPluginManager::Get()->Send(
+ new BrowserPluginHostMsg_CreateGuest(
+ render_view_->GetRoutingID(),
+ instance_id_,
+ storage_partition_id_,
+ persist_storage_));
+ }
+
+ if (navigate_src_sent_ || !src.empty()) {
scoped_ptr<BrowserPluginHostMsg_ResizeGuest_Params> params(
GetPendingResizeParams());
DCHECK(!params->resize_pending);
+
BrowserPluginManager::Get()->Send(
new BrowserPluginHostMsg_NavigateGuest(
render_view_->GetRoutingID(),
« no previous file with comments | « content/common/browser_plugin_messages.h ('k') | content/renderer/browser_plugin/browser_plugin_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698