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

Side by Side Diff: net/url_request/report_sender.cc

Issue 2648713002: Add response code to the success callback of ReportSender (Closed)
Patch Set: Remove response code from error callback Created 3 years, 7 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 unified diff | Download patch
OLDNEW
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 #include "net/url_request/report_sender.h" 5 #include "net/url_request/report_sender.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "net/base/elements_upload_data_stream.h" 9 #include "net/base/elements_upload_data_stream.h"
10 #include "net/base/load_flags.h" 10 #include "net/base/load_flags.h"
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 DCHECK_NE(ERR_IO_PENDING, net_error); 86 DCHECK_NE(ERR_IO_PENDING, net_error);
87 87
88 CallbackInfo* callback_info = 88 CallbackInfo* callback_info =
89 static_cast<CallbackInfo*>(request->GetUserData(&kUserDataKey)); 89 static_cast<CallbackInfo*>(request->GetUserData(&kUserDataKey));
90 DCHECK(callback_info); 90 DCHECK(callback_info);
91 if (net_error != OK) { 91 if (net_error != OK) {
92 DVLOG(1) << "Failed to send report for " << request->url().host(); 92 DVLOG(1) << "Failed to send report for " << request->url().host();
93 if (!callback_info->error_callback().is_null()) 93 if (!callback_info->error_callback().is_null())
94 callback_info->error_callback().Run(request->url(), net_error); 94 callback_info->error_callback().Run(request->url(), net_error);
95 } else if (!callback_info->success_callback().is_null()) { 95 } else if (!callback_info->success_callback().is_null()) {
96 callback_info->success_callback().Run(); 96 callback_info->success_callback().Run(request->GetResponseCode());
97 } 97 }
98 98
99 CHECK_GT(inflight_requests_.erase(request), 0u); 99 CHECK_GT(inflight_requests_.erase(request), 0u);
100 } 100 }
101 101
102 void ReportSender::OnReadCompleted(URLRequest* request, int bytes_read) { 102 void ReportSender::OnReadCompleted(URLRequest* request, int bytes_read) {
103 NOTREACHED(); 103 NOTREACHED();
104 } 104 }
105 105
106 } // namespace net 106 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698