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

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

Issue 1159143008: Fix wrong initialization of renderer_initiated_creation parameter. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fixing after rebase Created 5 years, 6 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/web_contents_observer_sanity_checker.h" 5 #include "content/test/web_contents_observer_sanity_checker.h"
6 6
7 #include "base/strings/stringprintf.h" 7 #include "base/strings/stringprintf.h"
8 #include "content/browser/frame_host/render_frame_host_impl.h"
8 #include "content/common/frame_messages.h" 9 #include "content/common/frame_messages.h"
9 #include "content/public/browser/render_frame_host.h" 10 #include "content/public/browser/render_frame_host.h"
10 #include "content/public/browser/render_process_host.h" 11 #include "content/public/browser/render_process_host.h"
11 #include "content/public/browser/site_instance.h" 12 #include "content/public/browser/site_instance.h"
12 #include "content/public/browser/web_contents.h" 13 #include "content/public/browser/web_contents.h"
13 #include "content/public/browser/web_contents_observer.h" 14 #include "content/public/browser/web_contents_observer.h"
14 15
15 namespace content { 16 namespace content {
16 17
17 namespace { 18 namespace {
(...skipping 17 matching lines...) Expand all
35 std::pair<int, int> routing_pair = 36 std::pair<int, int> routing_pair =
36 std::make_pair(render_frame_host->GetProcess()->GetID(), 37 std::make_pair(render_frame_host->GetProcess()->GetID(),
37 render_frame_host->GetRoutingID()); 38 render_frame_host->GetRoutingID());
38 bool frame_exists = !live_routes_.insert(routing_pair).second; 39 bool frame_exists = !live_routes_.insert(routing_pair).second;
39 deleted_routes_.erase(routing_pair); 40 deleted_routes_.erase(routing_pair);
40 41
41 if (frame_exists) { 42 if (frame_exists) {
42 CHECK(false) << "RenderFrameCreated called more than once for routing pair:" 43 CHECK(false) << "RenderFrameCreated called more than once for routing pair:"
43 << Format(render_frame_host); 44 << Format(render_frame_host);
44 } 45 }
46
47 CHECK(render_frame_host->GetProcess()->HasConnection());
ncarter (slow) 2015/06/05 21:47:50 << "RenderFrameCreated was called for a RenderFram
lfg 2015/06/05 22:07:07 Done.
48 CHECK(static_cast<RenderFrameHostImpl*>(render_frame_host)
49 ->IsRenderFrameLive());
ncarter (slow) 2015/06/05 21:47:50 << "RenderFrameCreated called on for a RenderFrame
lfg 2015/06/05 22:07:07 Done.
45 } 50 }
46 51
47 void WebContentsObserverSanityChecker::RenderFrameDeleted( 52 void WebContentsObserverSanityChecker::RenderFrameDeleted(
48 RenderFrameHost* render_frame_host) { 53 RenderFrameHost* render_frame_host) {
49 CHECK(!web_contents_destroyed_); 54 CHECK(!web_contents_destroyed_);
50 std::pair<int, int> routing_pair = 55 std::pair<int, int> routing_pair =
51 std::make_pair(render_frame_host->GetProcess()->GetID(), 56 std::make_pair(render_frame_host->GetProcess()->GetID(),
52 render_frame_host->GetRoutingID()); 57 render_frame_host->GetRoutingID());
53 bool was_live = !!live_routes_.erase(routing_pair); 58 bool was_live = !!live_routes_.erase(routing_pair);
54 bool was_dead_already = !deleted_routes_.insert(routing_pair).second; 59 bool was_dead_already = !deleted_routes_.insert(routing_pair).second;
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after
248 253
249 std::string WebContentsObserverSanityChecker::Format( 254 std::string WebContentsObserverSanityChecker::Format(
250 RenderFrameHost* render_frame_host) { 255 RenderFrameHost* render_frame_host) {
251 return base::StringPrintf( 256 return base::StringPrintf(
252 "(%d, %d -> %s)", render_frame_host->GetProcess()->GetID(), 257 "(%d, %d -> %s)", render_frame_host->GetProcess()->GetID(),
253 render_frame_host->GetRoutingID(), 258 render_frame_host->GetRoutingID(),
254 render_frame_host->GetSiteInstance()->GetSiteURL().spec().c_str()); 259 render_frame_host->GetSiteInstance()->GetSiteURL().spec().c_str());
255 } 260 }
256 261
257 } // namespace content 262 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698