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

Side by Side Diff: chrome/browser/safe_browsing/mock_permission_report_sender.h

Issue 2365353004: Add Content-Type header to net::ReportSender reports (Closed)
Patch Set: eroman comment Created 4 years, 2 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 | chrome/browser/safe_browsing/mock_permission_report_sender.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 CHROME_BROWSER_SAFE_BROWSING_MOCK_PERMISSION_REPORT_SENDER_H_ 5 #ifndef CHROME_BROWSER_SAFE_BROWSING_MOCK_PERMISSION_REPORT_SENDER_H_
6 #define CHROME_BROWSER_SAFE_BROWSING_MOCK_PERMISSION_REPORT_SENDER_H_ 6 #define CHROME_BROWSER_SAFE_BROWSING_MOCK_PERMISSION_REPORT_SENDER_H_
7 7
8 #include "net/url_request/report_sender.h" 8 #include "net/url_request/report_sender.h"
9 9
10 namespace safe_browsing { 10 namespace safe_browsing {
11 11
12 // A mock ReportSender that keeps track of the last report sent and the number 12 // A mock ReportSender that keeps track of the last report sent and the number
13 // of reports sent. 13 // of reports sent.
14 class MockPermissionReportSender : public net::ReportSender { 14 class MockPermissionReportSender : public net::ReportSender {
15 public: 15 public:
16 MockPermissionReportSender(); 16 MockPermissionReportSender();
17 17
18 ~MockPermissionReportSender() override; 18 ~MockPermissionReportSender() override;
19 19
20 void Send(const GURL& report_uri, const std::string& report) override; 20 void Send(const GURL& report_uri,
21 base::StringPiece content_type,
22 base::StringPiece report) override;
21 23
22 const GURL& latest_report_uri(); 24 const GURL& latest_report_uri();
23 25
24 const std::string& latest_report(); 26 const std::string& latest_report();
25 27
28 const std::string& latest_content_type();
29
26 int GetAndResetNumberOfReportsSent(); 30 int GetAndResetNumberOfReportsSent();
27 31
28 void WaitForReportSent(); 32 void WaitForReportSent();
29 33
30 private: 34 private:
31 GURL latest_report_uri_; 35 GURL latest_report_uri_;
32 std::string latest_report_; 36 std::string latest_report_;
37 std::string latest_content_type_;
33 int number_of_reports_; 38 int number_of_reports_;
34 base::Closure quit_closure_; 39 base::Closure quit_closure_;
35 40
36 void NotifyReportSentOnUIThread(); 41 void NotifyReportSentOnUIThread();
37 42
38 DISALLOW_COPY_AND_ASSIGN(MockPermissionReportSender); 43 DISALLOW_COPY_AND_ASSIGN(MockPermissionReportSender);
39 }; 44 };
40 45
41 } // namespace safe_browsing 46 } // namespace safe_browsing
42 47
43 #endif // CHROME_BROWSER_SAFE_BROWSING_MOCK_PERMISSION_REPORT_SENDER_H_ 48 #endif // CHROME_BROWSER_SAFE_BROWSING_MOCK_PERMISSION_REPORT_SENDER_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/safe_browsing/mock_permission_report_sender.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698