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

Unified Diff: net/url_request/certificate_report_sender.cc

Issue 1267383002: Allow preloaded pins to contain report URIs; remove special-case reporting (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: delete more code: CertificateErrorReporter::SendPinningViolationReport() Created 5 years, 4 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/url_request/certificate_report_sender.cc
diff --git a/net/url_request/certificate_report_sender.cc b/net/url_request/certificate_report_sender.cc
index fd5d11c163da3570ad916b32ef3876e3408fe28a..350050ff201d10e56bb2b33e23c2d7a3201b92fc 100644
--- a/net/url_request/certificate_report_sender.cc
+++ b/net/url_request/certificate_report_sender.cc
@@ -28,7 +28,16 @@ CertificateReportSender::~CertificateReportSender() {
void CertificateReportSender::Send(const GURL& report_uri,
const std::string& report) {
scoped_ptr<URLRequest> url_request =
- CreateURLRequest(request_context_, report_uri);
+ request_context_->CreateRequest(report_uri, DEFAULT_PRIORITY, this);
+
+ int load_flags =
+ LOAD_BYPASS_CACHE | LOAD_DISABLE_CACHE | LOAD_DO_NOT_SEND_AUTH_DATA;
+ if (cookies_preference_ != SEND_COOKIES) {
+ load_flags =
agl 2015/08/07 23:10:01 this can use the |= operator.
estark 2015/08/10 05:34:26 Done.
+ load_flags | LOAD_DO_NOT_SEND_COOKIES | LOAD_DO_NOT_SAVE_COOKIES;
+ }
+ url_request->SetLoadFlags(load_flags);
+
url_request->set_method("POST");
scoped_ptr<UploadElementReader> reader(
@@ -56,19 +65,4 @@ void CertificateReportSender::OnReadCompleted(URLRequest* request,
NOTREACHED();
}
-scoped_ptr<URLRequest> CertificateReportSender::CreateURLRequest(
- URLRequestContext* context,
- const GURL& report_uri) {
- scoped_ptr<URLRequest> request =
- context->CreateRequest(report_uri, DEFAULT_PRIORITY, this);
- int load_flags =
- LOAD_BYPASS_CACHE | LOAD_DISABLE_CACHE | LOAD_DO_NOT_SEND_AUTH_DATA;
- if (cookies_preference_ != SEND_COOKIES) {
- load_flags =
- load_flags | LOAD_DO_NOT_SEND_COOKIES | LOAD_DO_NOT_SAVE_COOKIES;
- }
- request->SetLoadFlags(load_flags);
- return request.Pass();
-}
-
} // namespace net

Powered by Google App Engine
This is Rietveld 408576698