Chromium Code Reviews| 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..b3f4dfec0cf7e7d499e2f4afe010a1c357fecb79 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_; |
|
Charlie Reis
2013/03/26 17:02:32
The partition name and whether it is persistent is
Fady Samuel
2013/03/26 17:15:40
I thought about that. The issue is BrowserPluginGu
Charlie Reis
2013/03/26 17:49:30
I'm not happy with having a separate copy of these
|
| + |
| // 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,13 @@ 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. |
| + 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)); |
|
Charlie Reis
2013/03/26 17:02:32
I don't understand why we need to send these in th
Fady Samuel
2013/03/26 17:15:40
No, the BrowserPlugin is a pre-existing BrowserPlu
Charlie Reis
2013/03/26 17:49:30
So the guest is already created in the correct par
|
| } |
| void BrowserPluginGuest::OnDragStatusUpdate(int instance_id, |