Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1451)

Unified Diff: content/browser/web_contents/web_contents_impl.cc

Issue 336283002: Remove GuestWebContentsCreated (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@simplify_creation
Patch Set: Fixed lifetime Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/browser/web_contents/web_contents_impl.cc
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
index 9f6ead2c45afab29758b3f8eebdc4f99dd38a2de..07f6c9029ab2991cc0e3c1c92c193f3e0b6d031c 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -438,17 +438,12 @@ WebContentsImpl* WebContentsImpl::CreateWithOpener(
WebContentsImpl* new_contents = new WebContentsImpl(
params.browser_context, params.opener_suppressed ? NULL : opener);
- if (params.guest_instance_id) {
- scoped_ptr<base::DictionaryValue> extra_params;
- if (params.guest_extra_params)
- extra_params.reset(params.guest_extra_params->DeepCopy());
+ if (params.guest_delegate) {
// This makes |new_contents| act as a guest.
// For more info, see comment above class BrowserPluginGuest.
- BrowserPluginGuest::Create(params.guest_instance_id,
- params.site_instance,
+ BrowserPluginGuest::Create(params.guest_delegate->GetGuestInstanceID(),
new_contents,
- extra_params.Pass(),
- opener ? opener->GetBrowserPluginGuest() : NULL);
+ params.guest_delegate);
// We are instantiating a WebContents for browser plugin. Set its subframe
// bit to true.
new_contents->is_subframe_ = true;
@@ -1422,15 +1417,16 @@ void WebContentsImpl::CreateNewWindow(
if (params.disposition == NEW_BACKGROUND_TAB)
create_params.initially_hidden = true;
+ WebContentsImpl* new_contents = NULL;
if (!is_guest) {
create_params.context = view_->GetNativeView();
create_params.initial_size = GetContainerBounds().size();
- } else {
- create_params.guest_instance_id =
- GetBrowserContext()->GetGuestManager()->GetNextInstanceID();
+ new_contents = static_cast<WebContentsImpl*>(
+ WebContents::Create(create_params));
+ } else {
+ new_contents = GetBrowserPluginGuest()->CreateNewGuestWindow(
+ &create_params);
lazyboy 2014/06/17 23:46:46 |create_params| being a (mutable) pointer to Creat
Fady Samuel 2014/06/18 21:08:34 Done.
}
- WebContentsImpl* new_contents = static_cast<WebContentsImpl*>(
- WebContents::Create(create_params));
new_contents->GetController().SetSessionStorageNamespace(
lazyboy 2014/06/17 23:46:46 DCHECK(new_contents)
Fady Samuel 2014/06/18 21:08:34 Unnecessary. We will always segfault here.
partition_id,
session_storage_namespace);

Powered by Google App Engine
This is Rietveld 408576698