OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/base/sdch_net_log_params.h" | 5 #include "net/base/sdch_net_log_params.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/values.h" | 9 #include "base/values.h" |
10 #include "net/base/net_errors.h" | 10 #include "net/base/net_errors.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> NetLogSdchResourceProblemCallback( | 16 std::unique_ptr<base::Value> NetLogSdchResourceProblemCallback( |
16 SdchProblemCode problem, | 17 SdchProblemCode problem, |
17 NetLogCaptureMode capture_mode) { | 18 NetLogCaptureMode capture_mode) { |
18 std::unique_ptr<base::DictionaryValue> dict(new base::DictionaryValue()); | 19 std::unique_ptr<base::DictionaryValue> dict(new base::DictionaryValue()); |
19 dict->SetInteger("sdch_problem_code", problem); | 20 dict->SetInteger("sdch_problem_code", problem); |
20 dict->SetInteger("net_error", ERR_FAILED); | 21 dict->SetInteger("net_error", ERR_FAILED); |
21 return std::move(dict); | 22 return std::move(dict); |
22 } | 23 } |
23 | 24 |
24 std::unique_ptr<base::Value> NetLogSdchDictionaryFetchProblemCallback( | 25 std::unique_ptr<base::Value> NetLogSdchDictionaryFetchProblemCallback( |
25 SdchProblemCode problem, | 26 SdchProblemCode problem, |
26 const GURL& url, | 27 const GURL& url, |
27 bool is_error, | 28 bool is_error, |
28 NetLogCaptureMode capture_mode) { | 29 NetLogCaptureMode capture_mode) { |
29 std::unique_ptr<base::DictionaryValue> dict(new base::DictionaryValue()); | 30 std::unique_ptr<base::DictionaryValue> dict(new base::DictionaryValue()); |
30 dict->SetInteger("sdch_problem_code", problem); | 31 dict->SetInteger("sdch_problem_code", problem); |
31 dict->SetString("dictionary_url", url.spec()); | 32 dict->SetString("dictionary_url", url.spec()); |
32 if (is_error) | 33 if (is_error) |
33 dict->SetInteger("net_error", ERR_FAILED); | 34 dict->SetInteger("net_error", ERR_FAILED); |
34 return std::move(dict); | 35 return std::move(dict); |
35 } | 36 } |
36 | 37 |
37 } // namespace net | 38 } // namespace net |
OLD | NEW |