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

Side by Side Diff: chrome/browser/net/chrome_extensions_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: Fix few formatting issues. Created 5 years, 4 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 "chrome/browser/net/chrome_extensions_network_delegate.h" 5 #include "chrome/browser/net/chrome_extensions_network_delegate.h"
6 6
7 #include "net/base/net_errors.h" 7 #include "net/base/net_errors.h"
8 8
9 #if defined(ENABLE_EXTENSIONS) 9 #if defined(ENABLE_EXTENSIONS)
10 #include "chrome/browser/browser_process.h" 10 #include "chrome/browser/browser_process.h"
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 if (!info) 64 if (!info)
65 return; 65 return;
66 66
67 if (status == REQUEST_STARTED && request->url_chain().size() > 1) { 67 if (status == REQUEST_STARTED && request->url_chain().size() > 1) {
68 // It's a redirect, this request has already been counted. 68 // It's a redirect, this request has already been counted.
69 return; 69 return;
70 } 70 }
71 71
72 int process_id, render_frame_id; 72 int process_id, render_frame_id;
73 if (info->GetAssociatedRenderFrame(&process_id, &render_frame_id)) { 73 if (info->GetAssociatedRenderFrame(&process_id, &render_frame_id)) {
74 // By checking negative process_id, it is tested that a real request is
75 // processing or it is in test mode. In test mode it is not needed to post
76 // this task and it causes errors.
77 if (process_id < 0)
78 return;
74 BrowserThread::PostTask( 79 BrowserThread::PostTask(
75 BrowserThread::UI, FROM_HERE, 80 BrowserThread::UI, FROM_HERE,
76 base::Bind(&NotifyEPMRequestStatus, status, profile_id, 81 base::Bind(&NotifyEPMRequestStatus, status, profile_id,
77 request->identifier(), process_id, render_frame_id)); 82 request->identifier(), process_id, render_frame_id));
78 } 83 }
79 } 84 }
80 85
81 class ChromeExtensionsNetworkDelegateImpl 86 class ChromeExtensionsNetworkDelegateImpl
82 : public ChromeExtensionsNetworkDelegate { 87 : public ChromeExtensionsNetworkDelegate {
83 public: 88 public:
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after
346 } 351 }
347 352
348 net::NetworkDelegate::AuthRequiredResponse 353 net::NetworkDelegate::AuthRequiredResponse
349 ChromeExtensionsNetworkDelegate::OnAuthRequired( 354 ChromeExtensionsNetworkDelegate::OnAuthRequired(
350 net::URLRequest* request, 355 net::URLRequest* request,
351 const net::AuthChallengeInfo& auth_info, 356 const net::AuthChallengeInfo& auth_info,
352 const AuthCallback& callback, 357 const AuthCallback& callback,
353 net::AuthCredentials* credentials) { 358 net::AuthCredentials* credentials) {
354 return net::NetworkDelegate::AUTH_REQUIRED_RESPONSE_NO_ACTION; 359 return net::NetworkDelegate::AUTH_REQUIRED_RESPONSE_NO_ACTION;
355 } 360 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/net/chrome_network_delegate.h » ('j') | chrome/browser/net/chrome_network_delegate.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698