Index: content/browser/browser_plugin/browser_plugin_guest.cc |
diff --git a/content/browser/browser_plugin/browser_plugin_guest.cc b/content/browser/browser_plugin/browser_plugin_guest.cc |
index 973408fbd476f1fa1a1d651c24368d9a7ca8a06c..a69b76e11ed13b7332cc8d705ce688def5682465 100644 |
--- a/content/browser/browser_plugin/browser_plugin_guest.cc |
+++ b/content/browser/browser_plugin/browser_plugin_guest.cc |
@@ -120,7 +120,8 @@ BrowserPluginGuest::BrowserPluginGuest( |
pending_lock_request_(false), |
embedder_visible_(true), |
opener_(NULL), |
- next_permission_request_id_(0) { |
+ next_permission_request_id_(0), |
+ persist_storage_(false) { |
DCHECK(web_contents); |
web_contents->SetDelegate(this); |
GetWebContents()->GetBrowserPluginGuestManager()->AddGuest(instance_id_, |
@@ -191,6 +192,10 @@ void BrowserPluginGuest::Initialize( |
auto_size_enabled_ = params.auto_size_params.enable; |
max_auto_size_ = params.auto_size_params.max_size; |
min_auto_size_ = params.auto_size_params.min_size; |
+ if (!params.storage_partition_id.empty()) { |
+ storage_partition_id_ = params.storage_partition_id; |
+ persist_storage_ = params.persist_storage; |
+ } |
// Once a BrowserPluginGuest has an embedder WebContents, it's considered to |
// be attached. |
@@ -697,6 +702,10 @@ void BrowserPluginGuest::Attach( |
// lifetime of the new guest is no longer managed by the opener guest. |
opener()->pending_new_windows_.erase(this); |
+ // The new window inherits the opener's storage partition. |
+ storage_partition_id_ = opener()->storage_partition_id_; |
+ persist_storage_ = opener()->persist_storage_; |
+ |
// The guest's frame name takes precedence over the BrowserPlugin's name. |
// The guest's frame name is assigned in |
// BrowserPluginGuest::WebContentsCreated. |
@@ -713,11 +722,14 @@ void BrowserPluginGuest::Attach( |
GetWebContents()->GetRenderViewHost())->Init(); |
} |
- // Inform the embedder BrowserPlugin of the attached guest. |
- if (!name_.empty()) { |
- SendMessageToEmbedder( |
- new BrowserPluginMsg_UpdatedName(instance_id_, name_)); |
- } |
+ // Inform the embedder of the guest's information. |
+ |
lazyboy
2013/03/25 18:12:55
nit: remove new line after comment line.
Fady Samuel
2013/03/25 19:28:20
Done.
|
+ BrowserPluginMsg_Attach_ACK_Params ack_params; |
+ ack_params.storage_partition_id = storage_partition_id_; |
+ ack_params.persist_storage = persist_storage_; |
+ ack_params.name = name_; |
+ SendMessageToEmbedder( |
+ new BrowserPluginMsg_Attach_ACK(instance_id_, ack_params)); |
} |
void BrowserPluginGuest::OnDragStatusUpdate(int instance_id, |