| OLD | NEW |
| 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_PERMISSION_REPORTER_H_ | 5 #ifndef CHROME_BROWSER_SAFE_BROWSING_PERMISSION_REPORTER_H_ |
| 6 #define CHROME_BROWSER_SAFE_BROWSING_PERMISSION_REPORTER_H_ | 6 #define CHROME_BROWSER_SAFE_BROWSING_PERMISSION_REPORTER_H_ |
| 7 | 7 |
| 8 #include <queue> | 8 #include <queue> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <unordered_map> | 10 #include <unordered_map> |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 // The permission report includes |origin| as the origin of | 51 // The permission report includes |origin| as the origin of |
| 52 // the site requesting permission, |permission| as the type of permission | 52 // the site requesting permission, |permission| as the type of permission |
| 53 // requested, and |action| as the action taken. The report will be serialized | 53 // requested, and |action| as the action taken. The report will be serialized |
| 54 // using protobuf defined in | 54 // using protobuf defined in |
| 55 // //src/chrome/common/safe_browsing/permission_report.proto | 55 // //src/chrome/common/safe_browsing/permission_report.proto |
| 56 void SendReport(const GURL& origin, | 56 void SendReport(const GURL& origin, |
| 57 content::PermissionType permission, | 57 content::PermissionType permission, |
| 58 PermissionAction action); | 58 PermissionAction action); |
| 59 | 59 |
| 60 private: | 60 private: |
| 61 friend class PermissionReporterBrowserTest; |
| 61 friend class PermissionReporterTest; | 62 friend class PermissionReporterTest; |
| 62 | 63 |
| 63 // Used by tests. This constructor allows tests to have access to the | 64 // Used by tests. This constructor allows tests to have access to the |
| 64 // ReportSender and use a test Clock. | 65 // ReportSender and use a test Clock. |
| 65 PermissionReporter(std::unique_ptr<net::ReportSender> report_sender, | 66 PermissionReporter(std::unique_ptr<net::ReportSender> report_sender, |
| 66 std::unique_ptr<base::Clock> clock); | 67 std::unique_ptr<base::Clock> clock); |
| 67 | 68 |
| 68 // Builds and serializes a permission report with |origin| as the origin of | 69 // Builds and serializes a permission report with |origin| as the origin of |
| 69 // the site requesting permission, |permission| as the type of permission | 70 // the site requesting permission, |permission| as the type of permission |
| 70 // requested, and |action| as the action taken. The serialized report is | 71 // requested, and |action| as the action taken. The serialized report is |
| (...skipping 20 matching lines...) Expand all Loading... |
| 91 report_logs_; | 92 report_logs_; |
| 92 | 93 |
| 93 std::unique_ptr<base::Clock> clock_; | 94 std::unique_ptr<base::Clock> clock_; |
| 94 | 95 |
| 95 DISALLOW_COPY_AND_ASSIGN(PermissionReporter); | 96 DISALLOW_COPY_AND_ASSIGN(PermissionReporter); |
| 96 }; | 97 }; |
| 97 | 98 |
| 98 } // namespace safe_browsing | 99 } // namespace safe_browsing |
| 99 | 100 |
| 100 #endif // CHROME_BROWSER_SAFE_BROWSING_PERMISSION_REPORTER_H_ | 101 #endif // CHROME_BROWSER_SAFE_BROWSING_PERMISSION_REPORTER_H_ |
| OLD | NEW |