OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "chrome/browser/safe_browsing/mock_permission_report_sender.h" |
| 6 |
| 7 namespace safe_browsing { |
| 8 |
| 9 MockPermissionReportSender::MockPermissionReportSender() |
| 10 : net::ReportSender(nullptr, DO_NOT_SEND_COOKIES) { |
| 11 number_of_reports_ = 0; |
| 12 } |
| 13 |
| 14 MockPermissionReportSender::~MockPermissionReportSender() {} |
| 15 |
| 16 void MockPermissionReportSender::Send(const GURL& report_uri, |
| 17 const std::string& report) { |
| 18 latest_report_uri_ = report_uri; |
| 19 latest_report_ = report; |
| 20 number_of_reports_++; |
| 21 } |
| 22 |
| 23 const GURL& MockPermissionReportSender::latest_report_uri() { |
| 24 return latest_report_uri_; |
| 25 } |
| 26 |
| 27 const std::string& MockPermissionReportSender::latest_report() { |
| 28 return latest_report_; |
| 29 } |
| 30 |
| 31 int MockPermissionReportSender::GetAndResetNumberOfReportsSent() { |
| 32 int new_reports = number_of_reports_; |
| 33 number_of_reports_ = 0; |
| 34 return new_reports; |
| 35 } |
| 36 |
| 37 } // namespace safe_browsing |
OLD | NEW |