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

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

Issue 2866183003: Syntax and coverage checking added to Network Traffic Annotations. (Closed)
Patch Set: Protobuf build updated. Created 3 years, 7 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 <stddef.h> 7 #include <stddef.h>
8 #include <stdlib.h> 8 #include <stdlib.h>
9 9
10 #include <vector> 10 #include <vector>
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after
208 allowed_domains_for_apps->Init(prefs::kAllowedDomainsForApps, pref_service); 208 allowed_domains_for_apps->Init(prefs::kAllowedDomainsForApps, pref_service);
209 allowed_domains_for_apps->MoveToThread( 209 allowed_domains_for_apps->MoveToThread(
210 BrowserThread::GetTaskRunnerForThread(BrowserThread::IO)); 210 BrowserThread::GetTaskRunnerForThread(BrowserThread::IO));
211 } 211 }
212 } 212 }
213 213
214 int ChromeNetworkDelegate::OnBeforeURLRequest( 214 int ChromeNetworkDelegate::OnBeforeURLRequest(
215 net::URLRequest* request, 215 net::URLRequest* request,
216 const net::CompletionCallback& callback, 216 const net::CompletionCallback& callback,
217 GURL* new_url) { 217 GURL* new_url) {
218 #if defined(_DEBUG) || defined(DCHECK_ALWAYS_ON)
219 network_traffic_annotation_checker_.CheckAnnotation(
220 request->traffic_annotation());
221 #endif
218 // TODO(mmenke): Remove ScopedTracker below once crbug.com/456327 is fixed. 222 // TODO(mmenke): Remove ScopedTracker below once crbug.com/456327 is fixed.
219 tracked_objects::ScopedTracker tracking_profile1( 223 tracked_objects::ScopedTracker tracking_profile1(
220 FROM_HERE_WITH_EXPLICIT_FUNCTION( 224 FROM_HERE_WITH_EXPLICIT_FUNCTION(
221 "456327 URLRequest::ChromeNetworkDelegate::OnBeforeURLRequest")); 225 "456327 URLRequest::ChromeNetworkDelegate::OnBeforeURLRequest"));
222 226
223 // TODO(joaodasilva): This prevents extensions from seeing URLs that are 227 // TODO(joaodasilva): This prevents extensions from seeing URLs that are
224 // blocked. However, an extension might redirect the request to another URL, 228 // blocked. However, an extension might redirect the request to another URL,
225 // which is not blocked. 229 // which is not blocked.
226 230
227 const ResourceRequestInfo* info = ResourceRequestInfo::ForRequest(request); 231 const ResourceRequestInfo* info = ResourceRequestInfo::ForRequest(request);
(...skipping 326 matching lines...) Expand 10 before | Expand all | Expand 10 after
554 if (!data_use_aggregator_) 558 if (!data_use_aggregator_)
555 return; 559 return;
556 560
557 if (is_data_usage_off_the_record_) { 561 if (is_data_usage_off_the_record_) {
558 data_use_aggregator_->ReportOffTheRecordDataUse(tx_bytes, rx_bytes); 562 data_use_aggregator_->ReportOffTheRecordDataUse(tx_bytes, rx_bytes);
559 return; 563 return;
560 } 564 }
561 565
562 data_use_aggregator_->ReportDataUse(request, tx_bytes, rx_bytes); 566 data_use_aggregator_->ReportDataUse(request, tx_bytes, rx_bytes);
563 } 567 }
OLDNEW
« no previous file with comments | « chrome/browser/net/chrome_network_delegate.h ('k') | chrome/browser/net/traffic_annotation/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698