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

Unified Diff: net/http/transport_security_state.h

Issue 2648713002: Add response code to the success callback of ReportSender (Closed)
Patch Set: Move http_response_code to error callback Created 3 years, 8 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 side-by-side diff with in-line comments
Download patch
Index: net/http/transport_security_state.h
diff --git a/net/http/transport_security_state.h b/net/http/transport_security_state.h
index 5974f27288cb449410d963a159bec6c347f834cd..ced314e7396d0b588412727d5d21eafa27fab150 100644
--- a/net/http/transport_security_state.h
+++ b/net/http/transport_security_state.h
@@ -284,14 +284,19 @@ class NET_EXPORT TransportSecurityState
// Sends the given serialized |report| to |report_uri| with
// Content-Type header as specified in
// |content_type|. |content_type| should be non-empty.
- // |report_id| could be any non-negative integer. It's passed back to the
- // error or success callbacks.
- virtual void Send(
- const GURL& report_uri,
- base::StringPiece content_type,
- base::StringPiece report,
- const base::Callback<void()>& success_callback,
- const base::Callback<void(const GURL&, int)>& error_callback) = 0;
+ // |success_callback| is called iff an HTTP 200 response is received.
+ // |error_callback| is called in all other cases. Error callback's
+ // |net_error| can be net::OK if the upload was successful but the server
+ // returned a non-HTTP 200 |http_response_code|. In all other cases,
+ // error callback's |http_response_code| is zero.
eroman 2017/04/26 22:52:28 I suggest making it default to -1 instead (as that
meacer 2017/04/27 00:56:42 Done.
+ virtual void Send(const GURL& report_uri,
+ base::StringPiece content_type,
+ base::StringPiece report,
+ const base::Callback<void()>& success_callback,
+ const base::Callback<void(const GURL&,
+ int /* net_error */,
+ int /* http_response_code */)>&
+ error_callback) = 0;
protected:
virtual ~ReportSenderInterface() {}

Powered by Google App Engine
This is Rietveld 408576698