Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(139)

Side by Side Diff: webkit/glue/devtools/devtools_rpc.cc

Issue 115397: DevTools: Introduce lightweight version of JSON serialization. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « base/json_writer.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « base/json_writer.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698