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

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: Rebase 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 18 matching lines...) Expand all
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();
316 params.never_visible = delegate_->IsNeverVisible(); 317 params.never_visible = delegate_->IsNeverVisible();
318 params.window_was_created_with_opener = window_was_created_with_opener;
317 params.next_page_id = next_page_id; 319 params.next_page_id = next_page_id;
318 GetWebScreenInfo(&params.screen_info); 320 GetWebScreenInfo(&params.screen_info);
319 params.accessibility_mode = accessibility_mode(); 321 params.accessibility_mode = accessibility_mode();
320 322
321 Send(new ViewMsg_New(params)); 323 Send(new ViewMsg_New(params));
322 324
323 // If it's enabled, tell the renderer to set up the Javascript bindings for 325 // If it's enabled, tell the renderer to set up the Javascript bindings for
324 // sending messages back to the browser. 326 // sending messages back to the browser.
325 if (GetProcess()->IsGuest()) 327 if (GetProcess()->IsGuest())
326 DCHECK_EQ(0, enabled_bindings_); 328 DCHECK_EQ(0, enabled_bindings_);
(...skipping 1452 matching lines...) Expand 10 before | Expand all | Expand 10 after
1779 return true; 1781 return true;
1780 } 1782 }
1781 1783
1782 void RenderViewHostImpl::AttachToFrameTree() { 1784 void RenderViewHostImpl::AttachToFrameTree() {
1783 FrameTree* frame_tree = delegate_->GetFrameTree(); 1785 FrameTree* frame_tree = delegate_->GetFrameTree();
1784 1786
1785 frame_tree->ResetForMainFrameSwap(); 1787 frame_tree->ResetForMainFrameSwap();
1786 } 1788 }
1787 1789
1788 } // namespace content 1790 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/renderer_host/render_view_host_impl.h ('k') | content/browser/web_contents/opened_by_dom_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698