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

Side by Side Diff: third_party/inspector_protocol/lib/Values_cpp.template

Issue 2523583005: Roll third_party/inspector_protocol to 4ad35c45aca9834b67ec2cb152c816ea1b7ceb48 (Closed)
Patch Set: added default implementation Created 4 years, 1 month 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
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 "Values.h" 5 //#include "Values.h"
6 6
7 {% for namespace in config.protocol.namespace %} 7 {% for namespace in config.protocol.namespace %}
8 namespace {{namespace}} { 8 namespace {{namespace}} {
9 {% endfor %} 9 {% endfor %}
10 10
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 bool Value::asString(String*) const 86 bool Value::asString(String*) const
87 { 87 {
88 return false; 88 return false;
89 } 89 }
90 90
91 bool Value::asSerialized(String*) const 91 bool Value::asSerialized(String*) const
92 { 92 {
93 return false; 93 return false;
94 } 94 }
95 95
96 String Value::toJSONString() const
97 {
98 StringBuilder result;
99 StringUtil::builderReserve(result, 512);
100 writeJSON(&result);
101 return result.toString();
102 }
103
104 void Value::writeJSON(StringBuilder* output) const 96 void Value::writeJSON(StringBuilder* output) const
105 { 97 {
106 DCHECK(m_type == TypeNull); 98 DCHECK(m_type == TypeNull);
107 output->append(nullValueString, 4); 99 output->append(nullValueString, 4);
108 } 100 }
109 101
110 std::unique_ptr<Value> Value::clone() const 102 std::unique_ptr<Value> Value::clone() const
111 { 103 {
112 return Value::null(); 104 return Value::null();
113 } 105 }
114 106
107 String Value::serialize()
108 {
109 StringBuilder result;
110 StringUtil::builderReserve(result, 512);
111 writeJSON(&result);
112 return result.toString();
113 }
114
115 bool FundamentalValue::asBoolean(bool* output) const 115 bool FundamentalValue::asBoolean(bool* output) const
116 { 116 {
117 if (type() != TypeBoolean) 117 if (type() != TypeBoolean)
118 return false; 118 return false;
119 *output = m_boolValue; 119 *output = m_boolValue;
120 return true; 120 return true;
121 } 121 }
122 122
123 bool FundamentalValue::asDouble(double* output) const 123 bool FundamentalValue::asDouble(double* output) const
124 { 124 {
(...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after
398 398
399 protocol::Value* ListValue::at(size_t index) 399 protocol::Value* ListValue::at(size_t index)
400 { 400 {
401 DCHECK_LT(index, m_data.size()); 401 DCHECK_LT(index, m_data.size());
402 return m_data[index].get(); 402 return m_data[index].get();
403 } 403 }
404 404
405 {% for namespace in config.protocol.namespace %} 405 {% for namespace in config.protocol.namespace %}
406 } // namespace {{namespace}} 406 } // namespace {{namespace}}
407 {% endfor %} 407 {% endfor %}
OLDNEW
« no previous file with comments | « third_party/inspector_protocol/lib/ValueConversions_h.template ('k') | third_party/inspector_protocol/lib/Values_h.template » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698