| 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 #ifndef CONTENT_TEST_WEB_CONTENTS_OBSERVER_SANITY_CHECKER_H_ | 5 #ifndef CONTENT_TEST_WEB_CONTENTS_OBSERVER_SANITY_CHECKER_H_ |
| 6 #define CONTENT_TEST_WEB_CONTENTS_OBSERVER_SANITY_CHECKER_H_ | 6 #define CONTENT_TEST_WEB_CONTENTS_OBSERVER_SANITY_CHECKER_H_ |
| 7 | 7 |
| 8 #include <set> | 8 #include <set> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 81 RenderFrameHost* source_render_frame_host, | 81 RenderFrameHost* source_render_frame_host, |
| 82 const GURL& url, | 82 const GURL& url, |
| 83 const Referrer& referrer, | 83 const Referrer& referrer, |
| 84 WindowOpenDisposition disposition, | 84 WindowOpenDisposition disposition, |
| 85 ui::PageTransition transition) override; | 85 ui::PageTransition transition) override; |
| 86 void MediaStartedPlaying(const MediaPlayerId& id) override; | 86 void MediaStartedPlaying(const MediaPlayerId& id) override; |
| 87 void MediaStoppedPlaying(const MediaPlayerId& id) override; | 87 void MediaStoppedPlaying(const MediaPlayerId& id) override; |
| 88 bool OnMessageReceived(const IPC::Message& message, | 88 bool OnMessageReceived(const IPC::Message& message, |
| 89 RenderFrameHost* render_frame_host) override; | 89 RenderFrameHost* render_frame_host) override; |
| 90 void WebContentsDestroyed() override; | 90 void WebContentsDestroyed() override; |
| 91 void DidStartLoading() override; |
| 92 void DidStopLoading() override; |
| 91 | 93 |
| 92 private: | 94 private: |
| 93 explicit WebContentsObserverSanityChecker(WebContents* web_contents); | 95 explicit WebContentsObserverSanityChecker(WebContents* web_contents); |
| 94 ~WebContentsObserverSanityChecker() override; | 96 ~WebContentsObserverSanityChecker() override; |
| 95 | 97 |
| 96 std::string Format(RenderFrameHost* render_frame_host); | 98 std::string Format(RenderFrameHost* render_frame_host); |
| 97 void AssertRenderFrameExists(RenderFrameHost* render_frame_host); | 99 void AssertRenderFrameExists(RenderFrameHost* render_frame_host); |
| 98 void AssertMainFrameExists(); | 100 void AssertMainFrameExists(); |
| 99 | 101 |
| 100 bool NavigationIsOngoing(NavigationHandle* navigation_handle); | 102 bool NavigationIsOngoing(NavigationHandle* navigation_handle); |
| 101 | 103 |
| 102 void EnsureStableParentValue(RenderFrameHost* render_frame_host); | 104 void EnsureStableParentValue(RenderFrameHost* render_frame_host); |
| 103 bool HasAnyChildren(RenderFrameHost* render_frame_host); | 105 bool HasAnyChildren(RenderFrameHost* render_frame_host); |
| 104 | 106 |
| 105 std::set<GlobalRoutingID> current_hosts_; | 107 std::set<GlobalRoutingID> current_hosts_; |
| 106 std::set<GlobalRoutingID> live_routes_; | 108 std::set<GlobalRoutingID> live_routes_; |
| 107 std::set<GlobalRoutingID> deleted_routes_; | 109 std::set<GlobalRoutingID> deleted_routes_; |
| 108 | 110 |
| 109 std::set<NavigationHandle*> ongoing_navigations_; | 111 std::set<NavigationHandle*> ongoing_navigations_; |
| 110 std::vector<MediaPlayerId> active_media_players_; | 112 std::vector<MediaPlayerId> active_media_players_; |
| 111 | 113 |
| 112 // Remembers parents to make sure RenderFrameHost::GetParent() never changes. | 114 // Remembers parents to make sure RenderFrameHost::GetParent() never changes. |
| 113 std::map<GlobalRoutingID, GlobalRoutingID> parent_ids_; | 115 std::map<GlobalRoutingID, GlobalRoutingID> parent_ids_; |
| 114 | 116 |
| 117 bool is_loading_; |
| 118 |
| 115 bool web_contents_destroyed_; | 119 bool web_contents_destroyed_; |
| 116 | 120 |
| 117 DISALLOW_COPY_AND_ASSIGN(WebContentsObserverSanityChecker); | 121 DISALLOW_COPY_AND_ASSIGN(WebContentsObserverSanityChecker); |
| 118 }; | 122 }; |
| 119 | 123 |
| 120 } // namespace content | 124 } // namespace content |
| 121 | 125 |
| 122 #endif // CONTENT_TEST_WEB_CONTENTS_OBSERVER_SANITY_CHECKER_H_ | 126 #endif // CONTENT_TEST_WEB_CONTENTS_OBSERVER_SANITY_CHECKER_H_ |
| OLD | NEW |