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

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

Issue 212703005: Preserve Page::openedByDOM state across process swaps. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: creis comments. Created 6 years, 8 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 257 matching lines...) Expand 10 before | Expand all | Expand 10 after
268 return delegate_; 268 return delegate_;
269 } 269 }
270 270
271 SiteInstance* RenderViewHostImpl::GetSiteInstance() const { 271 SiteInstance* RenderViewHostImpl::GetSiteInstance() const {
272 return instance_.get(); 272 return instance_.get();
273 } 273 }
274 274
275 bool RenderViewHostImpl::CreateRenderView( 275 bool RenderViewHostImpl::CreateRenderView(
276 const base::string16& frame_name, 276 const base::string16& frame_name,
277 int opener_route_id, 277 int opener_route_id,
278 int32 max_page_id) { 278 int32 max_page_id,
279 bool window_was_created_with_opener) {
279 TRACE_EVENT0("renderer_host", "RenderViewHostImpl::CreateRenderView"); 280 TRACE_EVENT0("renderer_host", "RenderViewHostImpl::CreateRenderView");
280 DCHECK(!IsRenderViewLive()) << "Creating view twice"; 281 DCHECK(!IsRenderViewLive()) << "Creating view twice";
281 282
282 // The process may (if we're sharing a process with another host that already 283 // The process may (if we're sharing a process with another host that already
283 // initialized it) or may not (we have our own process or the old process 284 // initialized it) or may not (we have our own process or the old process
284 // crashed) have been initialized. Calling Init multiple times will be 285 // crashed) have been initialized. Calling Init multiple times will be
285 // ignored, so this is safe. 286 // ignored, so this is safe.
286 if (!GetProcess()->Init()) 287 if (!GetProcess()->Init())
287 return false; 288 return false;
288 DCHECK(GetProcess()->HasConnection()); 289 DCHECK(GetProcess()->HasConnection());
(...skipping 17 matching lines...) Expand all
306 params.view_id = GetRoutingID(); 307 params.view_id = GetRoutingID();
307 params.main_frame_routing_id = main_frame_routing_id_; 308 params.main_frame_routing_id = main_frame_routing_id_;
308 params.surface_id = surface_id(); 309 params.surface_id = surface_id();
309 params.session_storage_namespace_id = 310 params.session_storage_namespace_id =
310 delegate_->GetSessionStorageNamespace(instance_)->id(); 311 delegate_->GetSessionStorageNamespace(instance_)->id();
311 params.frame_name = frame_name; 312 params.frame_name = frame_name;
312 // Ensure the RenderView sets its opener correctly. 313 // Ensure the RenderView sets its opener correctly.
313 params.opener_route_id = opener_route_id; 314 params.opener_route_id = opener_route_id;
314 params.swapped_out = !IsRVHStateActive(rvh_state_); 315 params.swapped_out = !IsRVHStateActive(rvh_state_);
315 params.hidden = is_hidden(); 316 params.hidden = is_hidden();
317 params.window_was_created_with_opener = window_was_created_with_opener;
316 params.next_page_id = next_page_id; 318 params.next_page_id = next_page_id;
317 GetWebScreenInfo(&params.screen_info); 319 GetWebScreenInfo(&params.screen_info);
318 params.accessibility_mode = accessibility_mode(); 320 params.accessibility_mode = accessibility_mode();
319 321
320 Send(new ViewMsg_New(params)); 322 Send(new ViewMsg_New(params));
321 323
322 // If it's enabled, tell the renderer to set up the Javascript bindings for 324 // If it's enabled, tell the renderer to set up the Javascript bindings for
323 // sending messages back to the browser. 325 // sending messages back to the browser.
324 if (GetProcess()->IsGuest()) 326 if (GetProcess()->IsGuest())
325 DCHECK_EQ(0, enabled_bindings_); 327 DCHECK_EQ(0, enabled_bindings_);
(...skipping 1553 matching lines...) Expand 10 before | Expand all | Expand 10 after
1879 return true; 1881 return true;
1880 } 1882 }
1881 1883
1882 void RenderViewHostImpl::AttachToFrameTree() { 1884 void RenderViewHostImpl::AttachToFrameTree() {
1883 FrameTree* frame_tree = delegate_->GetFrameTree(); 1885 FrameTree* frame_tree = delegate_->GetFrameTree();
1884 1886
1885 frame_tree->ResetForMainFrameSwap(); 1887 frame_tree->ResetForMainFrameSwap();
1886 } 1888 }
1887 1889
1888 } // namespace content 1890 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698