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

Side by Side Diff: content/browser/web_contents/web_contents_impl.cc

Issue 2521793003: Fix WebContentsDelegate::ShouldCreateWebContents implementations. (Closed)
Patch Set: Rename in MaybeCreateBackgroundContents Created 4 years 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/browser/web_contents/web_contents_impl.h" 5 #include "content/browser/web_contents/web_contents_impl.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <cmath> 9 #include <cmath>
10 #include <utility> 10 #include <utility>
(...skipping 2048 matching lines...) Expand 10 before | Expand all | Expand 10 after
2059 StoragePartition* partition = BrowserContext::GetStoragePartition( 2059 StoragePartition* partition = BrowserContext::GetStoragePartition(
2060 GetBrowserContext(), site_instance.get()); 2060 GetBrowserContext(), site_instance.get());
2061 DOMStorageContextWrapper* dom_storage_context = 2061 DOMStorageContextWrapper* dom_storage_context =
2062 static_cast<DOMStorageContextWrapper*>(partition->GetDOMStorageContext()); 2062 static_cast<DOMStorageContextWrapper*>(partition->GetDOMStorageContext());
2063 SessionStorageNamespaceImpl* session_storage_namespace_impl = 2063 SessionStorageNamespaceImpl* session_storage_namespace_impl =
2064 static_cast<SessionStorageNamespaceImpl*>(session_storage_namespace); 2064 static_cast<SessionStorageNamespaceImpl*>(session_storage_namespace);
2065 CHECK(session_storage_namespace_impl->IsFromContext(dom_storage_context)); 2065 CHECK(session_storage_namespace_impl->IsFromContext(dom_storage_context));
2066 2066
2067 if (delegate_ && 2067 if (delegate_ &&
2068 !delegate_->ShouldCreateWebContents( 2068 !delegate_->ShouldCreateWebContents(
2069 this, route_id, main_frame_route_id, main_frame_widget_route_id, 2069 this, source_site_instance, route_id, main_frame_route_id,
2070 params.window_container_type, params.frame_name, params.target_url, 2070 main_frame_widget_route_id, params.window_container_type,
2071 partition_id, session_storage_namespace)) { 2071 params.opener_url, params.frame_name, params.target_url, partition_id,
2072 session_storage_namespace)) {
2072 if (route_id != MSG_ROUTING_NONE && 2073 if (route_id != MSG_ROUTING_NONE &&
2073 !RenderViewHost::FromID(render_process_id, route_id)) { 2074 !RenderViewHost::FromID(render_process_id, route_id)) {
2074 // If the embedder didn't create a WebContents for this route, we need to 2075 // If the embedder didn't create a WebContents for this route, we need to
2075 // delete the RenderView that had already been created. 2076 // delete the RenderView that had already been created.
2076 Send(new ViewMsg_Close(route_id)); 2077 Send(new ViewMsg_Close(route_id));
2077 } 2078 }
2078 // Note: even though we're not creating a WebContents here, it could have 2079 // Note: even though we're not creating a WebContents here, it could have
2079 // been created by the embedder so ensure that the RenderFrameHost is 2080 // been created by the embedder so ensure that the RenderFrameHost is
2080 // properly initialized. 2081 // properly initialized.
2081 // It's safe to only target the frame because the render process will not 2082 // It's safe to only target the frame because the render process will not
(...skipping 3196 matching lines...) Expand 10 before | Expand all | Expand 10 after
5278 dialog_manager_ = dialog_manager; 5279 dialog_manager_ = dialog_manager;
5279 } 5280 }
5280 5281
5281 void WebContentsImpl::RemoveBindingSet(const std::string& interface_name) { 5282 void WebContentsImpl::RemoveBindingSet(const std::string& interface_name) {
5282 auto it = binding_sets_.find(interface_name); 5283 auto it = binding_sets_.find(interface_name);
5283 if (it != binding_sets_.end()) 5284 if (it != binding_sets_.end())
5284 binding_sets_.erase(it); 5285 binding_sets_.erase(it);
5285 } 5286 }
5286 5287
5287 } // namespace content 5288 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698