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

Side by Side Diff: content/browser/renderer_host/render_view_host_impl.cc

Issue 281663002: Create RenderFrameProxyHost at time of swap-out instead of commit. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Ready for review Created 6 years, 7 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 unified diff | Download patch | Annotate | Revision Log
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/renderer_host/render_view_host_impl.h" 5 #include "content/browser/renderer_host/render_view_host_impl.h"
6 6
7 #include <set> 7 #include <set>
8 #include <string> 8 #include <string>
9 #include <utility> 9 #include <utility>
10 #include <vector> 10 #include <vector>
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after
256 return delegate_; 256 return delegate_;
257 } 257 }
258 258
259 SiteInstance* RenderViewHostImpl::GetSiteInstance() const { 259 SiteInstance* RenderViewHostImpl::GetSiteInstance() const {
260 return instance_.get(); 260 return instance_.get();
261 } 261 }
262 262
263 bool RenderViewHostImpl::CreateRenderView( 263 bool RenderViewHostImpl::CreateRenderView(
264 const base::string16& frame_name, 264 const base::string16& frame_name,
265 int opener_route_id, 265 int opener_route_id,
266 int proxy_routing_id,
266 int32 max_page_id, 267 int32 max_page_id,
267 bool window_was_created_with_opener) { 268 bool window_was_created_with_opener) {
268 TRACE_EVENT0("renderer_host", "RenderViewHostImpl::CreateRenderView"); 269 TRACE_EVENT0("renderer_host", "RenderViewHostImpl::CreateRenderView");
269 DCHECK(!IsRenderViewLive()) << "Creating view twice"; 270 DCHECK(!IsRenderViewLive()) << "Creating view twice";
270 271
271 // The process may (if we're sharing a process with another host that already 272 // The process may (if we're sharing a process with another host that already
272 // initialized it) or may not (we have our own process or the old process 273 // initialized it) or may not (we have our own process or the old process
273 // crashed) have been initialized. Calling Init multiple times will be 274 // crashed) have been initialized. Calling Init multiple times will be
274 // ignored, so this is safe. 275 // ignored, so this is safe.
275 if (!GetProcess()->Init()) 276 if (!GetProcess()->Init())
(...skipping 11 matching lines...) Expand all
287 int32 next_page_id = 1; 288 int32 next_page_id = 1;
288 if (max_page_id > -1) 289 if (max_page_id > -1)
289 next_page_id = max_page_id + 1; 290 next_page_id = max_page_id + 1;
290 291
291 ViewMsg_New_Params params; 292 ViewMsg_New_Params params;
292 params.renderer_preferences = 293 params.renderer_preferences =
293 delegate_->GetRendererPrefs(GetProcess()->GetBrowserContext()); 294 delegate_->GetRendererPrefs(GetProcess()->GetBrowserContext());
294 params.web_preferences = delegate_->GetWebkitPrefs(); 295 params.web_preferences = delegate_->GetWebkitPrefs();
295 params.view_id = GetRoutingID(); 296 params.view_id = GetRoutingID();
296 params.main_frame_routing_id = main_frame_routing_id_; 297 params.main_frame_routing_id = main_frame_routing_id_;
298 params.proxy_routing_id = proxy_routing_id;
297 params.surface_id = surface_id(); 299 params.surface_id = surface_id();
298 params.session_storage_namespace_id = 300 params.session_storage_namespace_id =
299 delegate_->GetSessionStorageNamespace(instance_)->id(); 301 delegate_->GetSessionStorageNamespace(instance_)->id();
300 params.frame_name = frame_name; 302 params.frame_name = frame_name;
301 // Ensure the RenderView sets its opener correctly. 303 // Ensure the RenderView sets its opener correctly.
302 params.opener_route_id = opener_route_id; 304 params.opener_route_id = opener_route_id;
303 params.swapped_out = !IsRVHStateActive(rvh_state_); 305 params.swapped_out = !IsRVHStateActive(rvh_state_);
304 params.hidden = is_hidden(); 306 params.hidden = is_hidden();
305 params.never_visible = delegate_->IsNeverVisible(); 307 params.never_visible = delegate_->IsNeverVisible();
306 params.window_was_created_with_opener = window_was_created_with_opener; 308 params.window_was_created_with_opener = window_was_created_with_opener;
(...skipping 1386 matching lines...) Expand 10 before | Expand all | Expand 10 after
1693 return true; 1695 return true;
1694 } 1696 }
1695 1697
1696 void RenderViewHostImpl::AttachToFrameTree() { 1698 void RenderViewHostImpl::AttachToFrameTree() {
1697 FrameTree* frame_tree = delegate_->GetFrameTree(); 1699 FrameTree* frame_tree = delegate_->GetFrameTree();
1698 1700
1699 frame_tree->ResetForMainFrameSwap(); 1701 frame_tree->ResetForMainFrameSwap();
1700 } 1702 }
1701 1703
1702 } // namespace content 1704 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698