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

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

Issue 11276050: Add upload identifier to URLRequest::Start net log event. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Fix unit test Created 8 years, 1 month 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
« no previous file with comments | « net/url_request/url_request_netlog_params.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/url_request_netlog_params.h" 5 #include "net/url_request/url_request_netlog_params.h"
6 6
7 #include "base/string_number_conversions.h"
7 #include "base/values.h" 8 #include "base/values.h"
8 #include "googleurl/src/gurl.h" 9 #include "googleurl/src/gurl.h"
9 10
10 namespace net { 11 namespace net {
11 12
12 Value* NetLogURLRequestStartCallback(const GURL* url, 13 Value* NetLogURLRequestStartCallback(const GURL* url,
13 const std::string* method, 14 const std::string* method,
14 int load_flags, 15 int load_flags,
15 RequestPriority priority, 16 RequestPriority priority,
17 int64 upload_id,
16 NetLog::LogLevel /* log_level */) { 18 NetLog::LogLevel /* log_level */) {
17 DictionaryValue* dict = new DictionaryValue(); 19 DictionaryValue* dict = new DictionaryValue();
18 dict->SetString("url", url->possibly_invalid_spec()); 20 dict->SetString("url", url->possibly_invalid_spec());
19 dict->SetString("method", *method); 21 dict->SetString("method", *method);
20 dict->SetInteger("load_flags", load_flags); 22 dict->SetInteger("load_flags", load_flags);
21 dict->SetInteger("priority", static_cast<int>(priority)); 23 dict->SetInteger("priority", static_cast<int>(priority));
24 if (upload_id > -1)
25 dict->SetString("upload_id", base::Int64ToString(upload_id));
22 return dict; 26 return dict;
23 } 27 }
24 28
25 bool StartEventLoadFlagsFromEventParams(const Value* event_params, 29 bool StartEventLoadFlagsFromEventParams(const Value* event_params,
26 int* load_flags) { 30 int* load_flags) {
27 const DictionaryValue* dict; 31 const DictionaryValue* dict;
28 if (!event_params->GetAsDictionary(&dict) || 32 if (!event_params->GetAsDictionary(&dict) ||
29 !dict->GetInteger("load_flags", load_flags)) { 33 !dict->GetInteger("load_flags", load_flags)) {
30 *load_flags = 0; 34 *load_flags = 0;
31 return false; 35 return false;
32 } 36 }
33 return true; 37 return true;
34 } 38 }
35 39
36 } // namespace net 40 } // namespace net
OLDNEW
« no previous file with comments | « net/url_request/url_request_netlog_params.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698