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

Side by Side Diff: chrome/browser/safe_browsing/protocol_manager.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 (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 "chrome/browser/safe_browsing/protocol_manager.h" 5 #include "chrome/browser/safe_browsing/protocol_manager.h"
6 6
7 #include "base/environment.h" 7 #include "base/environment.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/memory/scoped_vector.h" 9 #include "base/memory/scoped_vector.h"
10 #include "base/metrics/histogram.h" 10 #include "base/metrics/histogram.h"
11 #include "base/profiler/scoped_profile.h"
11 #include "base/rand_util.h" 12 #include "base/rand_util.h"
12 #include "base/stl_util.h" 13 #include "base/stl_util.h"
13 #include "base/strings/string_util.h" 14 #include "base/strings/string_util.h"
14 #include "base/strings/stringprintf.h" 15 #include "base/strings/stringprintf.h"
15 #include "base/timer/timer.h" 16 #include "base/timer/timer.h"
16 #include "chrome/browser/safe_browsing/protocol_parser.h" 17 #include "chrome/browser/safe_browsing/protocol_parser.h"
17 #include "chrome/common/chrome_version_info.h" 18 #include "chrome/common/chrome_version_info.h"
18 #include "chrome/common/env_vars.h" 19 #include "chrome/common/env_vars.h"
19 #include "google_apis/google_api_keys.h" 20 #include "google_apis/google_api_keys.h"
20 #include "net/base/escape.h" 21 #include "net/base/escape.h"
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after
219 // All SafeBrowsing request responses are handled here. 220 // All SafeBrowsing request responses are handled here.
220 // TODO(paulg): Clarify with the SafeBrowsing team whether a failed parse of a 221 // TODO(paulg): Clarify with the SafeBrowsing team whether a failed parse of a
221 // chunk should retry the download and parse of that chunk (and 222 // chunk should retry the download and parse of that chunk (and
222 // what back off / how many times to try), and if that effects the 223 // what back off / how many times to try), and if that effects the
223 // update back off. For now, a failed parse of the chunk means we 224 // update back off. For now, a failed parse of the chunk means we
224 // drop it. This isn't so bad because the next UPDATE_REQUEST we 225 // drop it. This isn't so bad because the next UPDATE_REQUEST we
225 // do will report all the chunks we have. If that chunk is still 226 // do will report all the chunks we have. If that chunk is still
226 // required, the SafeBrowsing servers will tell us to get it again. 227 // required, the SafeBrowsing servers will tell us to get it again.
227 void SafeBrowsingProtocolManager::OnURLFetchComplete( 228 void SafeBrowsingProtocolManager::OnURLFetchComplete(
228 const net::URLFetcher* source) { 229 const net::URLFetcher* source) {
230 // TODO(vadimt): Remove ScopedProfile below once crbug.com/422577 is fixed.
231 tracked_objects::ScopedProfile tracking_profile(
232 FROM_HERE_WITH_EXPLICIT_FUNCTION(
233 "422577 SafeBrowsingProtocolManager::OnURLFetchComplete"));
234
229 DCHECK(CalledOnValidThread()); 235 DCHECK(CalledOnValidThread());
230 scoped_ptr<const net::URLFetcher> fetcher; 236 scoped_ptr<const net::URLFetcher> fetcher;
231 237
232 HashRequests::iterator it = hash_requests_.find(source); 238 HashRequests::iterator it = hash_requests_.find(source);
233 if (it != hash_requests_.end()) { 239 if (it != hash_requests_.end()) {
234 // GetHash response. 240 // GetHash response.
235 fetcher.reset(it->first); 241 fetcher.reset(it->first);
236 const FullHashDetails& details = it->second; 242 const FullHashDetails& details = it->second;
237 std::vector<SBFullHashResult> full_hashes; 243 std::vector<SBFullHashResult> full_hashes;
238 base::TimeDelta cache_lifetime; 244 base::TimeDelta cache_lifetime;
(...skipping 531 matching lines...) Expand 10 before | Expand all | Expand 10 after
770 FullHashCallback callback, bool is_download) 776 FullHashCallback callback, bool is_download)
771 : callback(callback), 777 : callback(callback),
772 is_download(is_download) { 778 is_download(is_download) {
773 } 779 }
774 780
775 SafeBrowsingProtocolManager::FullHashDetails::~FullHashDetails() { 781 SafeBrowsingProtocolManager::FullHashDetails::~FullHashDetails() {
776 } 782 }
777 783
778 SafeBrowsingProtocolManagerDelegate::~SafeBrowsingProtocolManagerDelegate() { 784 SafeBrowsingProtocolManagerDelegate::~SafeBrowsingProtocolManagerDelegate() {
779 } 785 }
OLDNEW
« no previous file with comments | « chrome/browser/safe_browsing/client_side_detection_service.cc ('k') | components/captive_portal/captive_portal_detector.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698