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

Side by Side Diff: components/data_use_measurement/content/content_url_request_classifier.h

Issue 2756373003: Record the data use of service worker initiated requests (Closed)
Patch Set: Fix unittest Created 3 years, 9 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
« no previous file with comments | « no previous file | components/data_use_measurement/content/content_url_request_classifier.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 #ifndef COMPONENTS_DATA_USE_MEASUREMENT_CONTENT_CONTENT_URL_REQUEST_CLASSIFIER_H _ 5 #ifndef COMPONENTS_DATA_USE_MEASUREMENT_CONTENT_CONTENT_URL_REQUEST_CLASSIFIER_H _
6 #define COMPONENTS_DATA_USE_MEASUREMENT_CONTENT_CONTENT_URL_REQUEST_CLASSIFIER_H _ 6 #define COMPONENTS_DATA_USE_MEASUREMENT_CONTENT_CONTENT_URL_REQUEST_CLASSIFIER_H _
7 7
8 #include "components/data_use_measurement/core/url_request_classifier.h" 8 #include "components/data_use_measurement/core/url_request_classifier.h"
9 9
10 namespace net { 10 namespace net {
11 class URLRequest; 11 class URLRequest;
12 } 12 }
13 13
14 namespace data_use_measurement { 14 namespace data_use_measurement {
15 15
16 // Returns true if the URLRequest |request| is initiated by user traffic. 16 // Returns true if the URLRequest |request| is initiated by user traffic.
17 bool IsUserRequest(const net::URLRequest& request); 17 bool IsUserRequest(const net::URLRequest& request);
18 18
19 class ContentURLRequestClassifier : public URLRequestClassifier { 19 class ContentURLRequestClassifier : public URLRequestClassifier {
20 public: 20 public:
21 bool IsUserRequest(const net::URLRequest& request) const override; 21 bool IsUserRequest(const net::URLRequest& request) const override;
22 22
23 bool IsServiceWorkerRequest(const net::URLRequest& request) const override;
24
23 DataUseUserData::DataUseContentType GetContentType( 25 DataUseUserData::DataUseContentType GetContentType(
24 const net::URLRequest& request, 26 const net::URLRequest& request,
25 const net::HttpResponseHeaders& response_headers) const override; 27 const net::HttpResponseHeaders& response_headers) const override;
26 }; 28 };
27 29
28 } // namespace data_use_measurement 30 } // namespace data_use_measurement
29 31
30 #endif // COMPONENTS_DATA_USE_MEASUREMENT_CONTENT_CONTENT_URL_REQUEST_CLASSIFIE R_H_ 32 #endif // COMPONENTS_DATA_USE_MEASUREMENT_CONTENT_CONTENT_URL_REQUEST_CLASSIFIE R_H_
OLDNEW
« no previous file with comments | « no previous file | components/data_use_measurement/content/content_url_request_classifier.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698