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

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

Issue 1421483005: Reland: Remove DCHECK_IMPLIES/CHECK_IMPLIES. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month 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
« no previous file with comments | « content/test/test_web_contents.cc ('k') | gpu/command_buffer/service/mailbox_manager_sync.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/browser/frame_host/render_frame_host_impl.h"
9 #include "content/common/frame_messages.h" 9 #include "content/common/frame_messages.h"
10 #include "content/public/browser/navigation_handle.h" 10 #include "content/public/browser/navigation_handle.h"
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
150 CHECK(!navigation_handle->HasCommitted()); 150 CHECK(!navigation_handle->HasCommitted());
151 CHECK(navigation_handle->GetRenderFrameHost()); 151 CHECK(navigation_handle->GetRenderFrameHost());
152 CHECK_EQ(navigation_handle->GetWebContents(), web_contents()); 152 CHECK_EQ(navigation_handle->GetWebContents(), web_contents());
153 CHECK(navigation_handle->GetRenderFrameHost() != nullptr); 153 CHECK(navigation_handle->GetRenderFrameHost() != nullptr);
154 } 154 }
155 155
156 void WebContentsObserverSanityChecker::DidFinishNavigation( 156 void WebContentsObserverSanityChecker::DidFinishNavigation(
157 NavigationHandle* navigation_handle) { 157 NavigationHandle* navigation_handle) {
158 CHECK(NavigationIsOngoing(navigation_handle)); 158 CHECK(NavigationIsOngoing(navigation_handle));
159 159
160 CHECK_IMPLIES( 160 CHECK(!(navigation_handle->HasCommitted() &&
161 navigation_handle->HasCommitted() && !navigation_handle->IsErrorPage(), 161 !navigation_handle->IsErrorPage()) ||
162 navigation_handle->GetNetErrorCode() == net::OK); 162 navigation_handle->GetNetErrorCode() == net::OK);
163 CHECK_IMPLIES( 163 CHECK(!(navigation_handle->HasCommitted() &&
164 navigation_handle->HasCommitted() && navigation_handle->IsErrorPage(), 164 navigation_handle->IsErrorPage()) ||
165 navigation_handle->GetNetErrorCode() != net::OK); 165 navigation_handle->GetNetErrorCode() != net::OK);
166 CHECK_EQ(navigation_handle->GetWebContents(), web_contents()); 166 CHECK_EQ(navigation_handle->GetWebContents(), web_contents());
167 167
168 CHECK_IMPLIES(navigation_handle->HasCommitted(), 168 CHECK(!navigation_handle->HasCommitted() ||
169 navigation_handle->GetRenderFrameHost() != nullptr); 169 navigation_handle->GetRenderFrameHost() != nullptr);
170 170
171 ongoing_navigations_.erase(navigation_handle); 171 ongoing_navigations_.erase(navigation_handle);
172 } 172 }
173 173
174 void WebContentsObserverSanityChecker::DidStartProvisionalLoadForFrame( 174 void WebContentsObserverSanityChecker::DidStartProvisionalLoadForFrame(
175 RenderFrameHost* render_frame_host, 175 RenderFrameHost* render_frame_host,
176 const GURL& validated_url, 176 const GURL& validated_url,
177 bool is_error_page, 177 bool is_error_page,
178 bool is_iframe_srcdoc) { 178 bool is_iframe_srcdoc) {
179 AssertRenderFrameExists(render_frame_host); 179 AssertRenderFrameExists(render_frame_host);
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
319 render_frame_host->GetSiteInstance()->GetSiteURL().spec().c_str()); 319 render_frame_host->GetSiteInstance()->GetSiteURL().spec().c_str());
320 } 320 }
321 321
322 bool WebContentsObserverSanityChecker::NavigationIsOngoing( 322 bool WebContentsObserverSanityChecker::NavigationIsOngoing(
323 NavigationHandle* navigation_handle) { 323 NavigationHandle* navigation_handle) {
324 auto it = ongoing_navigations_.find(navigation_handle); 324 auto it = ongoing_navigations_.find(navigation_handle);
325 return it != ongoing_navigations_.end(); 325 return it != ongoing_navigations_.end();
326 } 326 }
327 327
328 } // namespace content 328 } // namespace content
OLDNEW
« no previous file with comments | « content/test/test_web_contents.cc ('k') | gpu/command_buffer/service/mailbox_manager_sync.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698