diff options
author | fsamuel@chromium.org <fsamuel@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-06-29 21:06:54 +0000 |
---|---|---|
committer | fsamuel@chromium.org <fsamuel@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-06-29 21:06:54 +0000 |
commit | 738f57aacade9291769daf8be80a08e3b508ca57 (patch) | |
tree | 1fad4ce0127b3538b3252763e3b120a6e33146c9 /content/browser/browser_plugin/browser_plugin_embedder.cc | |
parent | 045af40b931762bae677c5a5ec5868cf912c24ac (diff) | |
download | chromium_src-738f57aacade9291769daf8be80a08e3b508ca57.zip chromium_src-738f57aacade9291769daf8be80a08e3b508ca57.tar.gz chromium_src-738f57aacade9291769daf8be80a08e3b508ca57.tar.bz2 |
Decouple GuestView creation from attachment.
This enables attaching the GuestView earlier on prior to loading resources.
Loading events that occur prior to attachment
are queued until attachment and then sent to the embedder on attachment.
This CL also moves loadstop from content to chrome. Existing tests exercise the need for queuing.
BUG=166165
Test=WebViewTest.Shim (newwindow tests)
Review URL: https://chromiumcodereview.appspot.com/17624004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@209345 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/browser/browser_plugin/browser_plugin_embedder.cc')
-rw-r--r-- | content/browser/browser_plugin/browser_plugin_embedder.cc | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/content/browser/browser_plugin/browser_plugin_embedder.cc b/content/browser/browser_plugin/browser_plugin_embedder.cc index 4f4fb3a..8f4d3fd 100644 --- a/content/browser/browser_plugin/browser_plugin_embedder.cc +++ b/content/browser/browser_plugin/browser_plugin_embedder.cc @@ -179,25 +179,31 @@ void BrowserPluginEmbedder::OnAttach( if (guest) { + // There is an implicit order expectation here: + // 1. The content embedder is made aware of the attachment. + // 2. BrowserPluginGuest::Attach is called. + // 3. The content embedder issues queued events if any that happened + // prior to attachment. GetContentClient()->browser()->GuestWebContentsAttached( guest->GetWebContents(), web_contents(), params.browser_plugin_instance_id, extra_params); - guest->Attach(static_cast<WebContentsImpl*>(web_contents()), params); return; } + scoped_ptr<base::DictionaryValue> copy_extra_params(extra_params.DeepCopy()); guest = GetBrowserPluginGuestManager()->CreateGuest( - web_contents()->GetSiteInstance(), instance_id, params); + web_contents()->GetSiteInstance(), + instance_id, params, + copy_extra_params.Pass()); if (guest) { GetContentClient()->browser()->GuestWebContentsAttached( guest->GetWebContents(), web_contents(), params.browser_plugin_instance_id, extra_params); - guest->Initialize(static_cast<WebContentsImpl*>(web_contents()), params); } } |