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

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

Issue 2579933002: Add logging for ResourceScheduler events. (Closed)
Patch Set: DCHECK to make sure that all async starts have defined triggers. Created 3 years, 11 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
« no previous file with comments | « net/url_request/url_request_netlog_params.h ('k') | net/url_request/url_request_unittest.cc » ('j') | 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 <utility> 7 #include <utility>
8 8
9 #include "base/strings/string_number_conversions.h" 9 #include "base/strings/string_number_conversions.h"
10 #include "base/values.h" 10 #include "base/values.h"
11 #include "net/log/net_log_capture_mode.h" 11 #include "net/log/net_log_capture_mode.h"
12 #include "url/gurl.h" 12 #include "url/gurl.h"
13 13
14 namespace net { 14 namespace net {
15 15
16 std::unique_ptr<base::Value> NetLogURLRequestConstructorCallback(
17 const GURL* url,
18 RequestPriority priority,
19 NetLogCaptureMode /* capture_mode */) {
20 std::unique_ptr<base::DictionaryValue> dict(new base::DictionaryValue());
21 dict->SetString("url", url->possibly_invalid_spec());
22 dict->SetString("priority", RequestPriorityToString(priority));
23 return std::move(dict);
24 }
25
16 std::unique_ptr<base::Value> NetLogURLRequestStartCallback( 26 std::unique_ptr<base::Value> NetLogURLRequestStartCallback(
17 const GURL* url, 27 const GURL* url,
18 const std::string* method, 28 const std::string* method,
19 int load_flags, 29 int load_flags,
20 RequestPriority priority,
21 int64_t upload_id, 30 int64_t upload_id,
22 NetLogCaptureMode /* capture_mode */) { 31 NetLogCaptureMode /* capture_mode */) {
23 std::unique_ptr<base::DictionaryValue> dict(new base::DictionaryValue()); 32 std::unique_ptr<base::DictionaryValue> dict(new base::DictionaryValue());
24 dict->SetString("url", url->possibly_invalid_spec()); 33 dict->SetString("url", url->possibly_invalid_spec());
25 dict->SetString("method", *method); 34 dict->SetString("method", *method);
26 dict->SetInteger("load_flags", load_flags); 35 dict->SetInteger("load_flags", load_flags);
27 dict->SetString("priority", RequestPriorityToString(priority));
28 if (upload_id > -1) 36 if (upload_id > -1)
29 dict->SetString("upload_id", base::Int64ToString(upload_id)); 37 dict->SetString("upload_id", base::Int64ToString(upload_id));
30 return std::move(dict); 38 return std::move(dict);
31 } 39 }
32 40
33 } // namespace net 41 } // namespace net
OLDNEW
« no previous file with comments | « net/url_request/url_request_netlog_params.h ('k') | net/url_request/url_request_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698