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

Side by Side Diff: components/data_use_measurement/core/url_request_classifier.h

Issue 2595503002: Record the data use by content type (Closed)
Patch Set: Add enum Created 4 years 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 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_CORE_URL_REQUEST_CLASSIFIER_H_ 5 #ifndef COMPONENTS_DATA_USE_MEASUREMENT_CORE_URL_REQUEST_CLASSIFIER_H_
6 #define COMPONENTS_DATA_USE_MEASUREMENT_CORE_URL_REQUEST_CLASSIFIER_H_ 6 #define COMPONENTS_DATA_USE_MEASUREMENT_CORE_URL_REQUEST_CLASSIFIER_H_
7 7
8 #include "components/data_use_measurement/core/data_use_user_data.h"
9
8 namespace net { 10 namespace net {
11 class HttpResponseHeaders;
9 class URLRequest; 12 class URLRequest;
10 } 13 }
11 14
12 namespace data_use_measurement { 15 namespace data_use_measurement {
13 16
14 // Interface for a classifier that can classify URL requests. 17 // Interface for a classifier that can classify URL requests.
15 class URLRequestClassifier { 18 class URLRequestClassifier {
16 public: 19 public:
17 virtual ~URLRequestClassifier() {} 20 virtual ~URLRequestClassifier() {}
18 21
19 // Returns true if the URLRequest |request| is initiated by user traffic. 22 // Returns true if the URLRequest |request| is initiated by user traffic.
20 virtual bool IsUserRequest(const net::URLRequest& request) const = 0; 23 virtual bool IsUserRequest(const net::URLRequest& request) const = 0;
24
25 // Returns the content type of the URL request.
26 virtual DataUseUserData::ContentType GetContentType(
27 const net::URLRequest& request,
28 const net::HttpResponseHeaders& response_headers) const = 0;
21 }; 29 };
22 30
23 } // namespace data_use_measurement 31 } // namespace data_use_measurement
24 32
25 #endif // COMPONENTS_DATA_USE_MEASUREMENT_CORE_URL_REQUEST_CLASSIFIER_H_ 33 #endif // COMPONENTS_DATA_USE_MEASUREMENT_CORE_URL_REQUEST_CLASSIFIER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698