| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 // TODO(pfeldman): Remove these once JSON is available in | 5 // TODO(pfeldman): Remove these once JSON is available in |
| 6 // WebCore namespace. | 6 // WebCore namespace. |
| 7 | 7 |
| 8 #include "PlatformString.h" | 8 #include "PlatformString.h" |
| 9 #undef LOG | 9 #undef LOG |
| 10 | 10 |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 } | 25 } |
| 26 | 26 |
| 27 // static | 27 // static |
| 28 Value* DevToolsRpc::ParseMessage(const std::string& raw_msg) { | 28 Value* DevToolsRpc::ParseMessage(const std::string& raw_msg) { |
| 29 return JSONReader::Read(raw_msg, false); | 29 return JSONReader::Read(raw_msg, false); |
| 30 } | 30 } |
| 31 | 31 |
| 32 // static | 32 // static |
| 33 std::string DevToolsRpc::Serialize(const Value& value) { | 33 std::string DevToolsRpc::Serialize(const Value& value) { |
| 34 std::string json; | 34 std::string json; |
| 35 JSONWriter::Write(&value, false, &json); | 35 JSONWriter::WriteWithOptionalEscape(&value, false, false, &json); |
| 36 return json; | 36 return json; |
| 37 } | 37 } |
| 38 | 38 |
| 39 // static | 39 // static |
| 40 void DevToolsRpc::GetListValue( | 40 void DevToolsRpc::GetListValue( |
| 41 const ListValue& message, | 41 const ListValue& message, |
| 42 int index, | 42 int index, |
| 43 bool* value) { | 43 bool* value) { |
| 44 message.GetBoolean(index, value); | 44 message.GetBoolean(index, value); |
| 45 } | 45 } |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 96 | 96 |
| 97 // static | 97 // static |
| 98 Value* DevToolsRpc::CreateValue(bool* value) { | 98 Value* DevToolsRpc::CreateValue(bool* value) { |
| 99 return Value::CreateBooleanValue(*value); | 99 return Value::CreateBooleanValue(*value); |
| 100 } | 100 } |
| 101 | 101 |
| 102 // static | 102 // static |
| 103 Value* DevToolsRpc::CreateValue(const Value* value) { | 103 Value* DevToolsRpc::CreateValue(const Value* value) { |
| 104 return value->DeepCopy(); | 104 return value->DeepCopy(); |
| 105 } | 105 } |
| OLD | NEW |