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

Side by Side Diff: components/domain_reliability/uploader.h

Issue 2538313002: Fix data usage tracking for domain reliability service (Closed)
Patch Set: Rebased 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
« no previous file with comments | « components/domain_reliability/DEPS ('k') | components/domain_reliability/uploader.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 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 #ifndef COMPONENTS_DOMAIN_RELIABILITY_UPLOADER_H_ 5 #ifndef COMPONENTS_DOMAIN_RELIABILITY_UPLOADER_H_
6 #define COMPONENTS_DOMAIN_RELIABILITY_UPLOADER_H_ 6 #define COMPONENTS_DOMAIN_RELIABILITY_UPLOADER_H_
7 7
8 #include <map> 8 #include <map>
9 #include <memory> 9 #include <memory>
10 10
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 virtual ~DomainReliabilityUploader(); 48 virtual ~DomainReliabilityUploader();
49 49
50 // Creates an uploader that uses the given |url_request_context_getter| to 50 // Creates an uploader that uses the given |url_request_context_getter| to
51 // get a URLRequestContext to use for uploads. (See test_util.h for a mock 51 // get a URLRequestContext to use for uploads. (See test_util.h for a mock
52 // version.) 52 // version.)
53 static std::unique_ptr<DomainReliabilityUploader> Create( 53 static std::unique_ptr<DomainReliabilityUploader> Create(
54 MockableTime* time, 54 MockableTime* time,
55 const scoped_refptr<net::URLRequestContextGetter>& 55 const scoped_refptr<net::URLRequestContextGetter>&
56 url_request_context_getter); 56 url_request_context_getter);
57 57
58 // Returns true if the request originated from domain reliability uploader.
59 static bool OriginatedFromDomainReliability(const net::URLRequest& request);
60
58 // Uploads |report_json| to |upload_url| and calls |callback| when the upload 61 // Uploads |report_json| to |upload_url| and calls |callback| when the upload
59 // has either completed or failed. 62 // has either completed or failed.
60 virtual void UploadReport(const std::string& report_json, 63 virtual void UploadReport(const std::string& report_json,
61 int max_beacon_depth, 64 int max_beacon_depth,
62 const GURL& upload_url, 65 const GURL& upload_url,
63 const UploadCallback& callback) = 0; 66 const UploadCallback& callback) = 0;
64 67
65 virtual void set_discard_uploads(bool discard_uploads) = 0; 68 virtual void set_discard_uploads(bool discard_uploads) = 0;
66 69
67 static int GetURLRequestUploadDepth(const net::URLRequest& request); 70 static int GetURLRequestUploadDepth(const net::URLRequest& request);
68 }; 71 };
69 72
70 } // namespace domain_reliability 73 } // namespace domain_reliability
71 74
72 #endif // COMPONENTS_DOMAIN_RELIABILITY_UPLOADER_H_ 75 #endif // COMPONENTS_DOMAIN_RELIABILITY_UPLOADER_H_
OLDNEW
« no previous file with comments | « components/domain_reliability/DEPS ('k') | components/domain_reliability/uploader.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698