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

Side by Side Diff: components/captive_portal/captive_portal_detector.cc

Issue 686963002: Switching profiler instrumentations from ScopedProfile to ScopedTracker (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "components/captive_portal/captive_portal_detector.h" 5 #include "components/captive_portal/captive_portal_detector.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/profiler/scoped_profile.h" 8 #include "base/profiler/scoped_tracker.h"
9 #include "base/strings/string_number_conversions.h" 9 #include "base/strings/string_number_conversions.h"
10 #include "net/base/load_flags.h" 10 #include "net/base/load_flags.h"
11 #include "net/http/http_response_headers.h" 11 #include "net/http/http_response_headers.h"
12 #include "net/url_request/url_request_status.h" 12 #include "net/url_request/url_request_status.h"
13 13
14 namespace captive_portal { 14 namespace captive_portal {
15 15
16 const char CaptivePortalDetector::kDefaultURL[] = 16 const char CaptivePortalDetector::kDefaultURL[] =
17 "http://www.gstatic.com/generate_204"; 17 "http://www.gstatic.com/generate_204";
18 18
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 net::LOAD_DO_NOT_SEND_AUTH_DATA); 51 net::LOAD_DO_NOT_SEND_AUTH_DATA);
52 url_fetcher_->Start(); 52 url_fetcher_->Start();
53 } 53 }
54 54
55 void CaptivePortalDetector::Cancel() { 55 void CaptivePortalDetector::Cancel() {
56 url_fetcher_.reset(); 56 url_fetcher_.reset();
57 detection_callback_.Reset(); 57 detection_callback_.Reset();
58 } 58 }
59 59
60 void CaptivePortalDetector::OnURLFetchComplete(const net::URLFetcher* source) { 60 void CaptivePortalDetector::OnURLFetchComplete(const net::URLFetcher* source) {
61 // TODO(vadimt): Remove ScopedProfile below once crbug.com/422577 is fixed. 61 // TODO(vadimt): Remove ScopedTracker below once crbug.com/422577 is fixed.
62 tracked_objects::ScopedProfile tracking_profile( 62 tracked_objects::ScopedTracker tracking_profile(
63 FROM_HERE_WITH_EXPLICIT_FUNCTION( 63 FROM_HERE_WITH_EXPLICIT_FUNCTION(
64 "422577 CaptivePortalDetector::OnURLFetchComplete")); 64 "422577 CaptivePortalDetector::OnURLFetchComplete"));
65 65
66 DCHECK(CalledOnValidThread()); 66 DCHECK(CalledOnValidThread());
67 DCHECK(FetchingURL()); 67 DCHECK(FetchingURL());
68 DCHECK_EQ(url_fetcher_.get(), source); 68 DCHECK_EQ(url_fetcher_.get(), source);
69 DCHECK(!detection_callback_.is_null()); 69 DCHECK(!detection_callback_.is_null());
70 70
71 Results results; 71 Results results;
72 GetCaptivePortalResultFromResponse(url_fetcher_.get(), &results); 72 GetCaptivePortalResultFromResponse(url_fetcher_.get(), &results);
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
145 return base::Time::Now(); 145 return base::Time::Now();
146 else 146 else
147 return time_for_testing_; 147 return time_for_testing_;
148 } 148 }
149 149
150 bool CaptivePortalDetector::FetchingURL() const { 150 bool CaptivePortalDetector::FetchingURL() const {
151 return url_fetcher_.get() != NULL; 151 return url_fetcher_.get() != NULL;
152 } 152 }
153 153
154 } // namespace captive_portal 154 } // namespace captive_portal
OLDNEW
« no previous file with comments | « components/autofill/core/browser/personal_data_manager.cc ('k') | components/google/core/browser/google_url_tracker.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698