| 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 d01bbd0acdc250463bc3fb19610ca7c8628ada8c..f4b506ec44becc375ed88fd1f62f6b6f8d5e0a83 100644
|
| --- a/content/browser/browser_plugin/browser_plugin_guest.cc
|
| +++ b/content/browser/browser_plugin/browser_plugin_guest.cc
|
| @@ -140,7 +140,6 @@ bool BrowserPluginGuest::OnMessageReceivedFromEmbedder(
|
| IPC_MESSAGE_HANDLER(BrowserPluginHostMsg_ImeSetComposition,
|
| OnImeSetComposition)
|
| IPC_MESSAGE_HANDLER(BrowserPluginHostMsg_LockMouse_ACK, OnLockMouseAck)
|
| - IPC_MESSAGE_HANDLER(BrowserPluginHostMsg_NavigateGuest, OnNavigateGuest)
|
| IPC_MESSAGE_HANDLER(BrowserPluginHostMsg_PluginDestroyed, OnPluginDestroyed)
|
| IPC_MESSAGE_HANDLER(BrowserPluginHostMsg_ReclaimCompositorResources,
|
| OnReclaimCompositorResources)
|
| @@ -161,7 +160,8 @@ bool BrowserPluginGuest::OnMessageReceivedFromEmbedder(
|
|
|
| void BrowserPluginGuest::Initialize(
|
| const BrowserPluginHostMsg_Attach_Params& params,
|
| - WebContentsImpl* embedder_web_contents) {
|
| + WebContentsImpl* embedder_web_contents,
|
| + const base::DictionaryValue& extra_params) {
|
| focused_ = params.focused;
|
| guest_visible_ = params.visible;
|
| guest_opaque_ = params.opaque;
|
| @@ -214,12 +214,6 @@ void BrowserPluginGuest::Initialize(
|
| new BrowserPluginMsg_GuestContentWindowReady(instance_id_,
|
| guest_routing_id));
|
|
|
| - if (!params.src.empty()) {
|
| - // params.src will be validated in BrowserPluginGuest::OnNavigateGuest.
|
| - OnNavigateGuest(instance_id_, params.src);
|
| - has_render_view_ = true;
|
| - }
|
| -
|
| WebPreferences prefs = GetWebContents()->GetWebkitPrefs();
|
| prefs.navigate_on_drag_drop = false;
|
| GetWebContents()->GetRenderViewHost()->UpdateWebkitPreferences(prefs);
|
| @@ -232,26 +226,16 @@ void BrowserPluginGuest::Initialize(
|
| guest_rvh->SetInputMethodActive(true);
|
| }
|
|
|
| - // Inform the embedder of the guest's information.
|
| - // We pull the partition information from the site's URL, which is of the form
|
| - // guest://site/{persist}?{partition_name}.
|
| - const GURL& site_url = GetWebContents()->GetSiteInstance()->GetSiteURL();
|
| - BrowserPluginMsg_Attach_ACK_Params ack_params;
|
| - ack_params.storage_partition_id = site_url.query();
|
| - ack_params.persist_storage =
|
| - site_url.path().find("persist") != std::string::npos;
|
| - SendMessageToEmbedder(
|
| - new BrowserPluginMsg_Attach_ACK(instance_id_, ack_params));
|
| + // Inform the embedder of the guest's attachment.
|
| + SendMessageToEmbedder(new BrowserPluginMsg_Attach_ACK(instance_id_));
|
|
|
| - if (delegate_)
|
| - delegate_->DidAttach();
|
| + if (delegate_) {
|
| + delegate_->DidAttach(extra_params);
|
| + has_render_view_ = true;
|
| + }
|
| }
|
|
|
| BrowserPluginGuest::~BrowserPluginGuest() {
|
| - while (!pending_messages_.empty()) {
|
| - delete pending_messages_.front();
|
| - pending_messages_.pop();
|
| - }
|
| }
|
|
|
| // static
|
| @@ -370,7 +354,7 @@ void BrowserPluginGuest::SendMessageToEmbedder(IPC::Message* msg) {
|
| // As a result, we must save all these IPCs until attachment and then
|
| // forward them so that the embedder gets a chance to see and process
|
| // the load events.
|
| - pending_messages_.push(msg);
|
| + pending_messages_.push_back(linked_ptr<IPC::Message>(msg));
|
| return;
|
| }
|
| msg->set_routing_id(embedder_web_contents_->GetRoutingID());
|
| @@ -394,9 +378,9 @@ void BrowserPluginGuest::SendQueuedMessages() {
|
| return;
|
|
|
| while (!pending_messages_.empty()) {
|
| - IPC::Message* message = pending_messages_.front();
|
| - pending_messages_.pop();
|
| - SendMessageToEmbedder(message);
|
| + linked_ptr<IPC::Message> message_ptr = pending_messages_.front();
|
| + pending_messages_.pop_front();
|
| + SendMessageToEmbedder(message_ptr.release());
|
| }
|
| }
|
|
|
| @@ -458,7 +442,6 @@ bool BrowserPluginGuest::ShouldForwardToBrowserPluginGuest(
|
| case BrowserPluginHostMsg_ImeConfirmComposition::ID:
|
| case BrowserPluginHostMsg_ImeSetComposition::ID:
|
| case BrowserPluginHostMsg_LockMouse_ACK::ID:
|
| - case BrowserPluginHostMsg_NavigateGuest::ID:
|
| case BrowserPluginHostMsg_PluginDestroyed::ID:
|
| case BrowserPluginHostMsg_ReclaimCompositorResources::ID:
|
| case BrowserPluginHostMsg_ResizeGuest::ID:
|
| @@ -507,16 +490,11 @@ bool BrowserPluginGuest::OnMessageReceived(const IPC::Message& message) {
|
|
|
| void BrowserPluginGuest::Attach(
|
| WebContentsImpl* embedder_web_contents,
|
| - BrowserPluginHostMsg_Attach_Params params,
|
| + const BrowserPluginHostMsg_Attach_Params& params,
|
| const base::DictionaryValue& extra_params) {
|
| if (attached())
|
| return;
|
|
|
| - // Clear parameters that get inherited from the opener.
|
| - params.storage_partition_id.clear();
|
| - params.persist_storage = false;
|
| - params.src.clear();
|
| -
|
| // If a RenderView has already been created for this new window, then we need
|
| // to initialize the browser-side state now so that the RenderFrameHostManager
|
| // does not create a new RenderView on navigation.
|
| @@ -528,7 +506,7 @@ void BrowserPluginGuest::Attach(
|
| new_view->CreateViewForWidget(web_contents()->GetRenderViewHost());
|
| }
|
|
|
| - Initialize(params, embedder_web_contents);
|
| + Initialize(params, embedder_web_contents, extra_params);
|
|
|
| SendQueuedMessages();
|
|
|
| @@ -701,13 +679,6 @@ void BrowserPluginGuest::OnLockMouseAck(int instance_id, bool succeeded) {
|
| mouse_locked_ = true;
|
| }
|
|
|
| -void BrowserPluginGuest::OnNavigateGuest(int instance_id,
|
| - const std::string& src) {
|
| - if (!delegate_)
|
| - return;
|
| - delegate_->NavigateGuest(src);
|
| -}
|
| -
|
| void BrowserPluginGuest::OnPluginDestroyed(int instance_id) {
|
| Destroy();
|
| }
|
|
|