OLD | NEW |
---|---|
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 NET_URL_REQUEST_REPORT_SENDER_H_ | 5 #ifndef NET_URL_REQUEST_REPORT_SENDER_H_ |
6 #define NET_URL_REQUEST_REPORT_SENDER_H_ | 6 #define NET_URL_REQUEST_REPORT_SENDER_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <memory> | 9 #include <memory> |
10 #include <string> | 10 #include <string> |
(...skipping 12 matching lines...) Expand all Loading... | |
23 | 23 |
24 // ReportSender asynchronously sends serialized reports to a URI. | 24 // ReportSender asynchronously sends serialized reports to a URI. |
25 // It takes serialized reports as a sequence of bytes so as to be agnostic to | 25 // It takes serialized reports as a sequence of bytes so as to be agnostic to |
26 // the format of the report being sent (JSON, protobuf, etc.) and the particular | 26 // the format of the report being sent (JSON, protobuf, etc.) and the particular |
27 // data that it contains. Multiple reports can be in-flight at once. This class | 27 // data that it contains. Multiple reports can be in-flight at once. This class |
28 // owns inflight requests and cleans them up when necessary. | 28 // owns inflight requests and cleans them up when necessary. |
29 class NET_EXPORT ReportSender | 29 class NET_EXPORT ReportSender |
30 : public URLRequest::Delegate, | 30 : public URLRequest::Delegate, |
31 public TransportSecurityState::ReportSenderInterface { | 31 public TransportSecurityState::ReportSenderInterface { |
32 public: | 32 public: |
33 using SuccessCallback = base::Callback<void()>; | 33 using SuccessCallback = base::Callback<void(int /* response_code */)>; |
eroman
2017/04/25 21:02:39
Please document the expectations.
- what is the r
meacer
2017/04/25 22:19:07
Yes, that's the current semantics of the success c
eroman
2017/04/25 22:41:55
My understanding of this bug is that right now the
meacer
2017/04/25 22:54:54
I might have misunderstood your original suggestio
| |
34 using ErrorCallback = base::Callback<void(const GURL&, int)>; | 34 using ErrorCallback = base::Callback<void(const GURL&, int /* net_error */)>; |
35 | 35 |
36 // Represents whether or not to send cookies along with reports. | 36 // Represents whether or not to send cookies along with reports. |
37 enum CookiesPreference { SEND_COOKIES, DO_NOT_SEND_COOKIES }; | 37 enum CookiesPreference { SEND_COOKIES, DO_NOT_SEND_COOKIES }; |
38 | 38 |
39 // Constructs a ReportSender that sends reports with the | 39 // Constructs a ReportSender that sends reports with the |
40 // given |request_context| and includes or excludes cookies based on | 40 // given |request_context| and includes or excludes cookies based on |
41 // |cookies_preference|. |request_context| must outlive the | 41 // |cookies_preference|. |request_context| must outlive the |
42 // ReportSender. | 42 // ReportSender. |
43 ReportSender(URLRequestContext* request_context, | 43 ReportSender(URLRequestContext* request_context, |
44 CookiesPreference cookies_preference); | 44 CookiesPreference cookies_preference); |
(...skipping 17 matching lines...) Expand all Loading... | |
62 CookiesPreference cookies_preference_; | 62 CookiesPreference cookies_preference_; |
63 | 63 |
64 std::map<URLRequest*, std::unique_ptr<URLRequest>> inflight_requests_; | 64 std::map<URLRequest*, std::unique_ptr<URLRequest>> inflight_requests_; |
65 | 65 |
66 DISALLOW_COPY_AND_ASSIGN(ReportSender); | 66 DISALLOW_COPY_AND_ASSIGN(ReportSender); |
67 }; | 67 }; |
68 | 68 |
69 } // namespace net | 69 } // namespace net |
70 | 70 |
71 #endif // NET_URL_REQUEST_REPORT_SENDER_H_ | 71 #endif // NET_URL_REQUEST_REPORT_SENDER_H_ |
OLD | NEW |