| OLD | NEW |
| 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 "url/gurl.h" | 12 #include "url/gurl.h" |
| 12 | 13 |
| 13 namespace net { | 14 namespace net { |
| 14 | 15 |
| 15 std::unique_ptr<base::Value> NetLogURLRequestStartCallback( | 16 std::unique_ptr<base::Value> NetLogURLRequestStartCallback( |
| 16 const GURL* url, | 17 const GURL* url, |
| 17 const std::string* method, | 18 const std::string* method, |
| 18 int load_flags, | 19 int load_flags, |
| 19 RequestPriority priority, | 20 RequestPriority priority, |
| 20 int64_t upload_id, | 21 int64_t upload_id, |
| 21 NetLogCaptureMode /* capture_mode */) { | 22 NetLogCaptureMode /* capture_mode */) { |
| 22 std::unique_ptr<base::DictionaryValue> dict(new base::DictionaryValue()); | 23 std::unique_ptr<base::DictionaryValue> dict(new base::DictionaryValue()); |
| 23 dict->SetString("url", url->possibly_invalid_spec()); | 24 dict->SetString("url", url->possibly_invalid_spec()); |
| 24 dict->SetString("method", *method); | 25 dict->SetString("method", *method); |
| 25 dict->SetInteger("load_flags", load_flags); | 26 dict->SetInteger("load_flags", load_flags); |
| 26 dict->SetString("priority", RequestPriorityToString(priority)); | 27 dict->SetString("priority", RequestPriorityToString(priority)); |
| 27 if (upload_id > -1) | 28 if (upload_id > -1) |
| 28 dict->SetString("upload_id", base::Int64ToString(upload_id)); | 29 dict->SetString("upload_id", base::Int64ToString(upload_id)); |
| 29 return std::move(dict); | 30 return std::move(dict); |
| 30 } | 31 } |
| 31 | 32 |
| 32 } // namespace net | 33 } // namespace net |
| OLD | NEW |