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

Side by Side Diff: content/test/test_render_frame_host.cc

Issue 1534933002: Don't process messages sent to dead routing ids. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove Init call. Created 4 years, 11 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/test/test_render_frame_host.h" 5 #include "content/test/test_render_frame_host.h"
6 6
7 #include "content/browser/frame_host/frame_tree.h" 7 #include "content/browser/frame_host/frame_tree.h"
8 #include "content/browser/frame_host/navigation_handle_impl.h" 8 #include "content/browser/frame_host/navigation_handle_impl.h"
9 #include "content/browser/frame_host/navigation_request.h" 9 #include "content/browser/frame_host/navigation_request.h"
10 #include "content/browser/frame_host/navigator.h" 10 #include "content/browser/frame_host/navigator.h"
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 return static_cast<TestRenderViewHost*>( 68 return static_cast<TestRenderViewHost*>(
69 RenderFrameHostImpl::GetRenderViewHost()); 69 RenderFrameHostImpl::GetRenderViewHost());
70 } 70 }
71 71
72 MockRenderProcessHost* TestRenderFrameHost::GetProcess() { 72 MockRenderProcessHost* TestRenderFrameHost::GetProcess() {
73 return static_cast<MockRenderProcessHost*>(RenderFrameHostImpl::GetProcess()); 73 return static_cast<MockRenderProcessHost*>(RenderFrameHostImpl::GetProcess());
74 } 74 }
75 75
76 void TestRenderFrameHost::InitializeRenderFrameIfNeeded() { 76 void TestRenderFrameHost::InitializeRenderFrameIfNeeded() {
77 if (!render_view_host()->IsRenderViewLive()) { 77 if (!render_view_host()->IsRenderViewLive()) {
78 render_view_host()->GetProcess()->Init();
nasko 2016/01/21 17:50:19 Why do we need to call through render_view_host()?
ncarter (slow) 2016/01/26 23:08:21 Sure, but this is here to prevent a DCHECK failure
78 RenderViewHostTester::For(render_view_host())->CreateTestRenderView( 79 RenderViewHostTester::For(render_view_host())->CreateTestRenderView(
79 base::string16(), MSG_ROUTING_NONE, MSG_ROUTING_NONE, -1, false); 80 base::string16(), MSG_ROUTING_NONE, MSG_ROUTING_NONE, -1, false);
80 } 81 }
81 } 82 }
82 83
83 TestRenderFrameHost* TestRenderFrameHost::AppendChild( 84 TestRenderFrameHost* TestRenderFrameHost::AppendChild(
84 const std::string& frame_name) { 85 const std::string& frame_name) {
85 OnCreateChildFrame(GetProcess()->GetNextRoutingID(), 86 OnCreateChildFrame(GetProcess()->GetNextRoutingID(),
86 blink::WebTreeScopeType::Document, frame_name, 87 blink::WebTreeScopeType::Document, frame_name,
87 blink::WebSandboxFlags::None, 88 blink::WebSandboxFlags::None,
(...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after
404 // cleared during DidFailProvisionalLoad). 405 // cleared during DidFailProvisionalLoad).
405 int page_id = entry ? entry->GetPageID() : -1; 406 int page_id = entry ? entry->GetPageID() : -1;
406 if (page_id == -1) { 407 if (page_id == -1) {
407 WebContentsImpl* web_contents = static_cast<WebContentsImpl*>(delegate()); 408 WebContentsImpl* web_contents = static_cast<WebContentsImpl*>(delegate());
408 page_id = web_contents->GetMaxPageIDForSiteInstance(GetSiteInstance()) + 1; 409 page_id = web_contents->GetMaxPageIDForSiteInstance(GetSiteInstance()) + 1;
409 } 410 }
410 return page_id; 411 return page_id;
411 } 412 }
412 413
413 } // namespace content 414 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/web_contents/web_contents_impl_unittest.cc ('k') | content/test/web_contents_observer_sanity_checker.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698