| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/proxy/proxy_resolver_js_bindings.h" | 5 #include "net/proxy/proxy_resolver_js_bindings.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/string_util.h" | 8 #include "base/string_util.h" |
| 9 #include "base/values.h" | 9 #include "base/values.h" |
| 10 #include "net/base/address_list.h" | 10 #include "net/base/address_list.h" |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 public: | 25 public: |
| 26 ErrorNetlogParams(int line_number, | 26 ErrorNetlogParams(int line_number, |
| 27 const string16& message) | 27 const string16& message) |
| 28 : line_number_(line_number), | 28 : line_number_(line_number), |
| 29 message_(message) { | 29 message_(message) { |
| 30 } | 30 } |
| 31 | 31 |
| 32 virtual Value* ToValue() const { | 32 virtual Value* ToValue() const { |
| 33 DictionaryValue* dict = new DictionaryValue(); | 33 DictionaryValue* dict = new DictionaryValue(); |
| 34 dict->SetInteger("line_number", line_number_); | 34 dict->SetInteger("line_number", line_number_); |
| 35 dict->SetStringFromUTF16("message", message_); | 35 dict->SetString("message", message_); |
| 36 return dict; | 36 return dict; |
| 37 } | 37 } |
| 38 | 38 |
| 39 private: | 39 private: |
| 40 const int line_number_; | 40 const int line_number_; |
| 41 const string16 message_; | 41 const string16 message_; |
| 42 | 42 |
| 43 DISALLOW_COPY_AND_ASSIGN(ErrorNetlogParams); | 43 DISALLOW_COPY_AND_ASSIGN(ErrorNetlogParams); |
| 44 }; | 44 }; |
| 45 | 45 |
| 46 // Event parameters for a PAC alert(). | 46 // Event parameters for a PAC alert(). |
| 47 class AlertNetlogParams : public NetLog::EventParameters { | 47 class AlertNetlogParams : public NetLog::EventParameters { |
| 48 public: | 48 public: |
| 49 explicit AlertNetlogParams(const string16& message) : message_(message) { | 49 explicit AlertNetlogParams(const string16& message) : message_(message) { |
| 50 } | 50 } |
| 51 | 51 |
| 52 virtual Value* ToValue() const { | 52 virtual Value* ToValue() const { |
| 53 DictionaryValue* dict = new DictionaryValue(); | 53 DictionaryValue* dict = new DictionaryValue(); |
| 54 dict->SetStringFromUTF16("message", message_); | 54 dict->SetString("message", message_); |
| 55 return dict; | 55 return dict; |
| 56 } | 56 } |
| 57 | 57 |
| 58 private: | 58 private: |
| 59 const string16 message_; | 59 const string16 message_; |
| 60 | 60 |
| 61 DISALLOW_COPY_AND_ASSIGN(AlertNetlogParams); | 61 DISALLOW_COPY_AND_ASSIGN(AlertNetlogParams); |
| 62 }; | 62 }; |
| 63 | 63 |
| 64 // ProxyResolverJSBindings implementation. | 64 // ProxyResolverJSBindings implementation. |
| (...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 291 | 291 |
| 292 } // namespace | 292 } // namespace |
| 293 | 293 |
| 294 // static | 294 // static |
| 295 ProxyResolverJSBindings* ProxyResolverJSBindings::CreateDefault( | 295 ProxyResolverJSBindings* ProxyResolverJSBindings::CreateDefault( |
| 296 HostResolver* host_resolver, NetLog* net_log) { | 296 HostResolver* host_resolver, NetLog* net_log) { |
| 297 return new DefaultJSBindings(host_resolver, net_log); | 297 return new DefaultJSBindings(host_resolver, net_log); |
| 298 } | 298 } |
| 299 | 299 |
| 300 } // namespace net | 300 } // namespace net |
| OLD | NEW |