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

Side by Side Diff: content/browser/frame_host/navigation_handle_impl.cc

Issue 2380773002: Prevent tracking metrics for cases such as 204s and downloads. (Closed)
Patch Set: use existing test file Created 4 years, 2 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/browser/frame_host/navigation_handle_impl.h" 5 #include "content/browser/frame_host/navigation_handle_impl.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "content/browser/browsing_data/clear_site_data_throttle.h" 10 #include "content/browser/browsing_data/clear_site_data_throttle.h"
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after
211 } 211 }
212 212
213 bool NavigationHandleImpl::IsSamePage() { 213 bool NavigationHandleImpl::IsSamePage() {
214 DCHECK(state_ == DID_COMMIT || state_ == DID_COMMIT_ERROR_PAGE) 214 DCHECK(state_ == DID_COMMIT || state_ == DID_COMMIT_ERROR_PAGE)
215 << "This accessor should not be called before the navigation has " 215 << "This accessor should not be called before the navigation has "
216 "committed."; 216 "committed.";
217 return is_same_page_; 217 return is_same_page_;
218 } 218 }
219 219
220 const net::HttpResponseHeaders* NavigationHandleImpl::GetResponseHeaders() { 220 const net::HttpResponseHeaders* NavigationHandleImpl::GetResponseHeaders() {
221 DCHECK_GE(state_, WILL_REDIRECT_REQUEST);
222 return response_headers_.get(); 221 return response_headers_.get();
223 } 222 }
224 223
225 bool NavigationHandleImpl::HasCommitted() { 224 bool NavigationHandleImpl::HasCommitted() {
226 return state_ == DID_COMMIT || state_ == DID_COMMIT_ERROR_PAGE; 225 return state_ == DID_COMMIT || state_ == DID_COMMIT_ERROR_PAGE;
227 } 226 }
228 227
229 bool NavigationHandleImpl::IsErrorPage() { 228 bool NavigationHandleImpl::IsErrorPage() {
230 return state_ == DID_COMMIT_ERROR_PAGE; 229 return state_ == DID_COMMIT_ERROR_PAGE;
231 } 230 }
(...skipping 491 matching lines...) Expand 10 before | Expand all | Expand 10 after
723 throttles_to_register.push_back(std::move(clear_site_data_throttle)); 722 throttles_to_register.push_back(std::move(clear_site_data_throttle));
724 723
725 if (throttles_to_register.size() > 0) { 724 if (throttles_to_register.size() > 0) {
726 throttles_.insert(throttles_.begin(), throttles_to_register.begin(), 725 throttles_.insert(throttles_.begin(), throttles_to_register.begin(),
727 throttles_to_register.end()); 726 throttles_to_register.end());
728 throttles_to_register.weak_clear(); 727 throttles_to_register.weak_clear();
729 } 728 }
730 } 729 }
731 730
732 } // namespace content 731 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698