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

Side by Side Diff: chrome/browser/net/chrome_network_delegate.cc

Issue 1279543002: Support needed to measure user and service traffic in Chrome. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@NewHistogram
Patch Set: Addressing reviewer's comments but the ones related to making component Created 5 years, 3 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/net/chrome_network_delegate.h" 5 #include "chrome/browser/net/chrome_network_delegate.h"
6 6
7 #include <stdlib.h> 7 #include <stdlib.h>
8 8
9 #include <vector> 9 #include <vector>
10 10
(...skipping 469 matching lines...) Expand 10 before | Expand all | Expand 10 after
480 #if defined(ENABLE_TASK_MANAGER) 480 #if defined(ENABLE_TASK_MANAGER)
481 // This is not completely accurate, but as a first approximation ignore 481 // This is not completely accurate, but as a first approximation ignore
482 // requests that are served from the cache. See bug 330931 for more info. 482 // requests that are served from the cache. See bug 330931 for more info.
483 if (!request.was_cached()) 483 if (!request.was_cached())
484 TaskManager::GetInstance()->model()->NotifyBytesRead(request, bytes_read); 484 TaskManager::GetInstance()->model()->NotifyBytesRead(request, bytes_read);
485 #endif // defined(ENABLE_TASK_MANAGER) 485 #endif // defined(ENABLE_TASK_MANAGER)
486 } 486 }
487 487
488 void ChromeNetworkDelegate::OnCompleted(net::URLRequest* request, 488 void ChromeNetworkDelegate::OnCompleted(net::URLRequest* request,
489 bool started) { 489 bool started) {
490 data_use_measurement_.ReportDataUseUMA(request);
490 RecordNetworkErrorHistograms(request); 491 RecordNetworkErrorHistograms(request);
491 if (started) { 492 if (started) {
492 // Only call in for requests that were started, to obey the precondition 493 // Only call in for requests that were started, to obey the precondition
493 // that RecordCacheStateStats can only be called on requests for which 494 // that RecordCacheStateStats can only be called on requests for which
494 // OnResponseStarted was called. 495 // OnResponseStarted was called.
495 RecordCacheStateStats(request); 496 RecordCacheStateStats(request);
496 } 497 }
497 498
498 if (request->status().status() == net::URLRequestStatus::SUCCESS) { 499 if (request->status().status() == net::URLRequestStatus::SUCCESS) {
499 #if defined(OS_ANDROID) 500 #if defined(OS_ANDROID)
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after
683 return experimental_web_platform_features_enabled_; 684 return experimental_web_platform_features_enabled_;
684 } 685 }
685 686
686 bool ChromeNetworkDelegate::OnCancelURLRequestWithPolicyViolatingReferrerHeader( 687 bool ChromeNetworkDelegate::OnCancelURLRequestWithPolicyViolatingReferrerHeader(
687 const net::URLRequest& request, 688 const net::URLRequest& request,
688 const GURL& target_url, 689 const GURL& target_url,
689 const GURL& referrer_url) const { 690 const GURL& referrer_url) const {
690 ReportInvalidReferrerSend(target_url, referrer_url); 691 ReportInvalidReferrerSend(target_url, referrer_url);
691 return true; 692 return true;
692 } 693 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698