OLD | NEW |
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 299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
310 active_media_players_.end(), id), | 310 active_media_players_.end(), id), |
311 active_media_players_.end()); | 311 active_media_players_.end()); |
312 } | 312 } |
313 | 313 |
314 bool WebContentsObserverSanityChecker::OnMessageReceived( | 314 bool WebContentsObserverSanityChecker::OnMessageReceived( |
315 const IPC::Message& message, | 315 const IPC::Message& message, |
316 RenderFrameHost* render_frame_host) { | 316 RenderFrameHost* render_frame_host) { |
317 // FrameHostMsg_RenderProcessGone is special internal IPC message that | 317 // FrameHostMsg_RenderProcessGone is special internal IPC message that |
318 // should not be leaking outside of RenderFrameHost. | 318 // should not be leaking outside of RenderFrameHost. |
319 CHECK(message.type() != FrameHostMsg_RenderProcessGone::ID); | 319 CHECK(message.type() != FrameHostMsg_RenderProcessGone::ID); |
| 320 CHECK(render_frame_host->IsRenderFrameLive()); |
320 | 321 |
321 #if !defined(OS_MACOSX) | |
322 // TODO(avi): Disabled because of http://crbug.com/445054 | |
323 AssertRenderFrameExists(render_frame_host); | 322 AssertRenderFrameExists(render_frame_host); |
324 #endif | |
325 return false; | 323 return false; |
326 } | 324 } |
327 | 325 |
328 void WebContentsObserverSanityChecker::WebContentsDestroyed() { | 326 void WebContentsObserverSanityChecker::WebContentsDestroyed() { |
329 CHECK(!web_contents_destroyed_); | 327 CHECK(!web_contents_destroyed_); |
330 web_contents_destroyed_ = true; | 328 web_contents_destroyed_ = true; |
331 CHECK(ongoing_navigations_.empty()); | 329 CHECK(ongoing_navigations_.empty()); |
332 CHECK(active_media_players_.empty()); | 330 CHECK(active_media_players_.empty()); |
333 } | 331 } |
334 | 332 |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
400 if (live_routes_.count(entry.first)) | 398 if (live_routes_.count(entry.first)) |
401 return true; | 399 return true; |
402 if (current_hosts_.count(entry.first)) | 400 if (current_hosts_.count(entry.first)) |
403 return true; | 401 return true; |
404 } | 402 } |
405 } | 403 } |
406 return false; | 404 return false; |
407 } | 405 } |
408 | 406 |
409 } // namespace content | 407 } // namespace content |
OLD | NEW |