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

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

Issue 1545973002: Remove the is_loading_ field from WebContentsImpl (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 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 "build/build_config.h" 8 #include "build/build_config.h"
9 #include "content/browser/frame_host/render_frame_host_impl.h" 9 #include "content/browser/frame_host/render_frame_host_impl.h"
10 #include "content/common/frame_messages.h" 10 #include "content/common/frame_messages.h"
(...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after
325 return false; 325 return false;
326 } 326 }
327 327
328 void WebContentsObserverSanityChecker::WebContentsDestroyed() { 328 void WebContentsObserverSanityChecker::WebContentsDestroyed() {
329 CHECK(!web_contents_destroyed_); 329 CHECK(!web_contents_destroyed_);
330 web_contents_destroyed_ = true; 330 web_contents_destroyed_ = true;
331 CHECK(ongoing_navigations_.empty()); 331 CHECK(ongoing_navigations_.empty());
332 CHECK(active_media_players_.empty()); 332 CHECK(active_media_players_.empty());
333 } 333 }
334 334
335 void WebContentsObserverSanityChecker::DidStartLoading() {
336 CHECK(!is_loading_);
337 is_loading_ = true;
338 }
339
340 void WebContentsObserverSanityChecker::DidStopLoading() {
341 CHECK(is_loading_);
342 is_loading_ = false;
343 }
344
335 WebContentsObserverSanityChecker::WebContentsObserverSanityChecker( 345 WebContentsObserverSanityChecker::WebContentsObserverSanityChecker(
336 WebContents* web_contents) 346 WebContents* web_contents)
337 : WebContentsObserver(web_contents), web_contents_destroyed_(false) { 347 : WebContentsObserver(web_contents),
338 } 348 is_loading_(false),
nasko 2016/01/15 01:19:16 What about window.open() with an URL? Does it also
clamy 2016/01/15 16:47:44 I think so. You first create the WebContents then
349 web_contents_destroyed_(false) {}
339 350
340 WebContentsObserverSanityChecker::~WebContentsObserverSanityChecker() { 351 WebContentsObserverSanityChecker::~WebContentsObserverSanityChecker() {
341 CHECK(web_contents_destroyed_); 352 CHECK(web_contents_destroyed_);
342 } 353 }
343 354
344 void WebContentsObserverSanityChecker::AssertRenderFrameExists( 355 void WebContentsObserverSanityChecker::AssertRenderFrameExists(
345 RenderFrameHost* render_frame_host) { 356 RenderFrameHost* render_frame_host) {
346 CHECK(!web_contents_destroyed_); 357 CHECK(!web_contents_destroyed_);
347 GlobalRoutingID routing_pair = GetRoutingPair(render_frame_host); 358 GlobalRoutingID routing_pair = GetRoutingPair(render_frame_host);
348 359
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
400 if (live_routes_.count(entry.first)) 411 if (live_routes_.count(entry.first))
401 return true; 412 return true;
402 if (current_hosts_.count(entry.first)) 413 if (current_hosts_.count(entry.first))
403 return true; 414 return true;
404 } 415 }
405 } 416 }
406 return false; 417 return false;
407 } 418 }
408 419
409 } // namespace content 420 } // namespace content
OLDNEW
« content/test/test_web_contents.cc ('K') | « content/test/web_contents_observer_sanity_checker.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698