| 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 "base/values.h" | 7 #include "base/values.h" |
| 8 #include "net/base/net_errors.h" | 8 #include "net/base/net_errors.h" |
| 9 #include "url/gurl.h" | 9 #include "url/gurl.h" |
| 10 | 10 |
| 11 namespace net { | 11 namespace net { |
| 12 | 12 |
| 13 base::Value* NetLogSdchResourceProblemCallback(SdchProblemCode problem, | 13 scoped_ptr<base::Value> NetLogSdchResourceProblemCallback( |
| 14 NetLogCaptureMode capture_mode) { | 14 SdchProblemCode problem, |
| 15 base::DictionaryValue* dict = new base::DictionaryValue(); | 15 NetLogCaptureMode capture_mode) { |
| 16 scoped_ptr<base::DictionaryValue> dict(new base::DictionaryValue()); |
| 16 dict->SetInteger("sdch_problem_code", problem); | 17 dict->SetInteger("sdch_problem_code", problem); |
| 17 dict->SetInteger("net_error", ERR_FAILED); | 18 dict->SetInteger("net_error", ERR_FAILED); |
| 18 return dict; | 19 return dict.Pass(); |
| 19 } | 20 } |
| 20 | 21 |
| 21 base::Value* NetLogSdchDictionaryFetchProblemCallback( | 22 scoped_ptr<base::Value> NetLogSdchDictionaryFetchProblemCallback( |
| 22 SdchProblemCode problem, | 23 SdchProblemCode problem, |
| 23 const GURL& url, | 24 const GURL& url, |
| 24 bool is_error, | 25 bool is_error, |
| 25 NetLogCaptureMode capture_mode) { | 26 NetLogCaptureMode capture_mode) { |
| 26 base::DictionaryValue* dict = new base::DictionaryValue(); | 27 scoped_ptr<base::DictionaryValue> dict(new base::DictionaryValue()); |
| 27 dict->SetInteger("sdch_problem_code", problem); | 28 dict->SetInteger("sdch_problem_code", problem); |
| 28 dict->SetString("dictionary_url", url.spec()); | 29 dict->SetString("dictionary_url", url.spec()); |
| 29 if (is_error) | 30 if (is_error) |
| 30 dict->SetInteger("net_error", ERR_FAILED); | 31 dict->SetInteger("net_error", ERR_FAILED); |
| 31 return dict; | 32 return dict.Pass(); |
| 32 } | 33 } |
| 33 | 34 |
| 34 } // namespace net | 35 } // namespace net |
| OLD | NEW |