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

Side by Side Diff: components/google/core/browser/google_url_tracker.cc

Issue 648873003: Adding instrumentation to locate the source of jankiness. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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 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 "components/google/core/browser/google_url_tracker.h" 5 #include "components/google/core/browser/google_url_tracker.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/prefs/pref_service.h" 9 #include "base/prefs/pref_service.h"
10 #include "base/profiler/scoped_profile.h"
10 #include "base/strings/string_util.h" 11 #include "base/strings/string_util.h"
11 #include "components/google/core/browser/google_pref_names.h" 12 #include "components/google/core/browser/google_pref_names.h"
12 #include "components/google/core/browser/google_switches.h" 13 #include "components/google/core/browser/google_switches.h"
13 #include "components/google/core/browser/google_url_tracker_infobar_delegate.h" 14 #include "components/google/core/browser/google_url_tracker_infobar_delegate.h"
14 #include "components/google/core/browser/google_url_tracker_navigation_helper.h" 15 #include "components/google/core/browser/google_url_tracker_navigation_helper.h"
15 #include "components/google/core/browser/google_util.h" 16 #include "components/google/core/browser/google_util.h"
16 #include "components/infobars/core/infobar.h" 17 #include "components/infobars/core/infobar.h"
17 #include "components/infobars/core/infobar_manager.h" 18 #include "components/infobars/core/infobar_manager.h"
18 #include "net/base/load_flags.h" 19 #include "net/base/load_flags.h"
19 #include "net/base/net_util.h" 20 #include "net/base/net_util.h"
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 } 100 }
100 101
101 void GoogleURLTracker::CancelGoogleURL() { 102 void GoogleURLTracker::CancelGoogleURL() {
102 client_->GetPrefs()->SetString(prefs::kLastPromptedGoogleURL, 103 client_->GetPrefs()->SetString(prefs::kLastPromptedGoogleURL,
103 fetched_google_url_.spec()); 104 fetched_google_url_.spec());
104 need_to_prompt_ = false; 105 need_to_prompt_ = false;
105 CloseAllEntries(false); 106 CloseAllEntries(false);
106 } 107 }
107 108
108 void GoogleURLTracker::OnURLFetchComplete(const net::URLFetcher* source) { 109 void GoogleURLTracker::OnURLFetchComplete(const net::URLFetcher* source) {
110 // TODO(vadimt): Remove ScopedProfile below once crbug.com/422577 is fixed.
111 tracked_objects::ScopedProfile tracking_profile(
112 FROM_HERE_WITH_EXPLICIT_FUNCTION(
113 "422577 GoogleURLTracker::OnURLFetchComplete"));
114
109 // Delete the fetcher on this function's exit. 115 // Delete the fetcher on this function's exit.
110 scoped_ptr<net::URLFetcher> clean_up_fetcher(fetcher_.release()); 116 scoped_ptr<net::URLFetcher> clean_up_fetcher(fetcher_.release());
111 117
112 // Don't update the URL if the request didn't succeed. 118 // Don't update the URL if the request didn't succeed.
113 if (!source->GetStatus().is_success() || (source->GetResponseCode() != 200)) { 119 if (!source->GetStatus().is_success() || (source->GetResponseCode() != 200)) {
114 already_fetched_ = false; 120 already_fetched_ = false;
115 return; 121 return;
116 } 122 }
117 123
118 // See if the response data was valid. It should be 124 // See if the response data was valid. It should be
(...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after
406 } 412 }
407 if (client_->IsListeningForNavigationStart()) { 413 if (client_->IsListeningForNavigationStart()) {
408 DCHECK(!search_committed_); 414 DCHECK(!search_committed_);
409 client_->SetListeningForNavigationStart(false); 415 client_->SetListeningForNavigationStart(false);
410 } 416 }
411 } 417 }
412 418
413 void GoogleURLTracker::NotifyGoogleURLUpdated() { 419 void GoogleURLTracker::NotifyGoogleURLUpdated() {
414 callback_list_.Notify(); 420 callback_list_.Notify();
415 } 421 }
OLDNEW
« no previous file with comments | « components/captive_portal/captive_portal_detector.cc ('k') | components/invalidation/gcm_network_channel.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698