diff options
author | fsamuel@chromium.org <fsamuel@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-05-01 00:16:23 +0000 |
---|---|---|
committer | fsamuel@chromium.org <fsamuel@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-05-01 00:16:23 +0000 |
commit | 4b4ed5882820d2293ec5d30d8eb7518ac5b360ed (patch) | |
tree | fbc1a1ee800c25c9d3989e848693788f1ec29b9a /content/browser/browser_plugin/browser_plugin_guest.cc | |
parent | 6283b7dd6f0bba809ff53a776db275fe886a392b (diff) | |
download | chromium_src-4b4ed5882820d2293ec5d30d8eb7518ac5b360ed.zip chromium_src-4b4ed5882820d2293ec5d30d8eb7518ac5b360ed.tar.gz chromium_src-4b4ed5882820d2293ec5d30d8eb7518ac5b360ed.tar.bz2 |
Browser Plugin: Unify Attach IPC
BrowserPluginHostMsg_CreateGuest, and BrowserPluginHostMsg_Attach are two very similar IPCs that served slightly different purposes.
CreateGuest was used to create a new guest renderer.
Attach was used to attach to an existing (unattached) guest renderer.
We might, in the future, wish to expose this as an internal API to enable shims to use BrowserPlugin as their underlying infrastructure.
By unifying the two operations and adding additional security checks in BrowserPluginGuestManager, we reduce the likelihood of abuse for this API and fully define its behavior.
BUG=166165
Review URL: https://chromiumcodereview.appspot.com/14327007
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@197526 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/browser/browser_plugin/browser_plugin_guest.cc')
-rw-r--r-- | content/browser/browser_plugin/browser_plugin_guest.cc | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/content/browser/browser_plugin/browser_plugin_guest.cc b/content/browser/browser_plugin/browser_plugin_guest.cc index 8627e1e..18a25c0 100644 --- a/content/browser/browser_plugin/browser_plugin_guest.cc +++ b/content/browser/browser_plugin/browser_plugin_guest.cc @@ -224,7 +224,7 @@ bool BrowserPluginGuest::OnMessageReceivedFromEmbedder( void BrowserPluginGuest::Initialize( WebContentsImpl* embedder_web_contents, - const BrowserPluginHostMsg_CreateGuest_Params& params) { + const BrowserPluginHostMsg_Attach_Params& params) { focused_ = params.focused; guest_visible_ = params.visible; if (!params.name.empty()) @@ -743,7 +743,15 @@ bool BrowserPluginGuest::OnMessageReceived(const IPC::Message& message) { void BrowserPluginGuest::Attach( WebContentsImpl* embedder_web_contents, - BrowserPluginHostMsg_CreateGuest_Params params) { + BrowserPluginHostMsg_Attach_Params params) { + if (attached()) + return; + + // Clear parameters that get inherited from the opener. + params.storage_partition_id.clear(); + params.persist_storage = false; + params.src.clear(); + const std::string target_url = opener()->pending_new_windows_[this]; if (!GetWebContents()->opener()) { // For guests that have a suppressed opener, we navigate now. |