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

Unified Diff: net/http/http_stream_parser.cc

Issue 1135373002: Updated NetLog::ParametersCallback & all related calbacks returning value as scoped_ptr<base::Value… Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/http/http_stream_factory_impl_job.cc ('k') | net/log/net_log.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/http/http_stream_parser.cc
diff --git a/net/http/http_stream_parser.cc b/net/http/http_stream_parser.cc
index 23208877a0f1b2d423206f556d5a55a545f32937..47a51c23b5d5c0067435c466d737fe9e43cae368 100644
--- a/net/http/http_stream_parser.cc
+++ b/net/http/http_stream_parser.cc
@@ -74,16 +74,16 @@ bool HeadersContainMultipleCopiesOfField(const HttpResponseHeaders& headers,
return false;
}
-base::Value* NetLogSendRequestBodyCallback(
+scoped_ptr<base::Value> NetLogSendRequestBodyCallback(
uint64 length,
bool is_chunked,
bool did_merge,
NetLogCaptureMode /* capture_mode */) {
- base::DictionaryValue* dict = new base::DictionaryValue();
+ scoped_ptr<base::DictionaryValue> dict(new base::DictionaryValue());
dict->SetInteger("length", static_cast<int>(length));
dict->SetBoolean("is_chunked", is_chunked);
dict->SetBoolean("did_merge", did_merge);
- return dict;
+ return dict.Pass();
}
// Returns true if |error_code| is an error for which we give the server a
@@ -294,12 +294,11 @@ int HttpStreamParser::SendRequest(const std::string& request_line,
request_headers_->SetOffset(0);
did_merge = true;
- net_log_.AddEvent(
- NetLog::TYPE_HTTP_TRANSACTION_SEND_REQUEST_BODY,
- base::Bind(&NetLogSendRequestBodyCallback,
- request_->upload_data_stream->size(),
- false, /* not chunked */
- true /* merged */));
+ net_log_.AddEvent(NetLog::TYPE_HTTP_TRANSACTION_SEND_REQUEST_BODY,
+ base::Bind(NetLogSendRequestBodyCallback,
+ request_->upload_data_stream->size(),
+ false, /* not chunked */
+ true /* merged */));
}
if (!did_merge) {
@@ -481,12 +480,11 @@ int HttpStreamParser::DoSendHeadersComplete(int result) {
// !IsEOF() indicates that the body wasn't merged.
(request_->upload_data_stream->size() > 0 &&
!request_->upload_data_stream->IsEOF()))) {
- net_log_.AddEvent(
- NetLog::TYPE_HTTP_TRANSACTION_SEND_REQUEST_BODY,
- base::Bind(&NetLogSendRequestBodyCallback,
- request_->upload_data_stream->size(),
- request_->upload_data_stream->is_chunked(),
- false /* not merged */));
+ net_log_.AddEvent(NetLog::TYPE_HTTP_TRANSACTION_SEND_REQUEST_BODY,
+ base::Bind(NetLogSendRequestBodyCallback,
+ request_->upload_data_stream->size(),
+ request_->upload_data_stream->is_chunked(),
+ false /* not merged */));
io_state_ = STATE_SEND_BODY;
return OK;
}
« no previous file with comments | « net/http/http_stream_factory_impl_job.cc ('k') | net/log/net_log.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698