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

Unified Diff: third_party/WebKit/Source/platform/inspector_protocol/ValueConversions_h.template

Issue 2251343003: [DevTools] Generate separate copies of inspector_protocol. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/platform/inspector_protocol/ValueConversions_h.template
diff --git a/third_party/WebKit/Source/platform/inspector_protocol/ValueConversions_h.template b/third_party/WebKit/Source/platform/inspector_protocol/ValueConversions_h.template
index 3b7eaa4f79d58f6a9ca56c25bca8d3f48dc75518..c5e81a206241d7611ff60159d6c5e83dba87aeeb 100644
--- a/third_party/WebKit/Source/platform/inspector_protocol/ValueConversions_h.template
+++ b/third_party/WebKit/Source/platform/inspector_protocol/ValueConversions_h.template
@@ -2,16 +2,17 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef ValueConversions_h
-#define ValueConversions_h
+#ifndef {{"_".join(config.protocol.namespace)}}_ValueConversions_h
+#define {{"_".join(config.protocol.namespace)}}_ValueConversions_h
//#include "ErrorSupport.h"
//#include "Platform.h"
-//#include "String16.h"
+//#include "String.h"
//#include "Values.h"
-namespace blink {
-namespace protocol {
+{% for namespace in config.protocol.namespace %}
+namespace {{namespace}} {
+{% endfor %}
template<typename T>
struct ValueConversions {
@@ -83,34 +84,17 @@ struct ValueConversions<double> {
};
template<>
-struct ValueConversions<InspectorProtocolConvenienceStringType> {
- static InspectorProtocolConvenienceStringType parse(protocol::Value* value, ErrorSupport* errors)
+struct ValueConversions<String> {
+ static String parse(protocol::Value* value, ErrorSupport* errors)
{
- String16 result;
+ String result;
bool success = value ? value->asString(&result) : false;
if (!success)
errors->addError("string value expected");
return result;
}
- static std::unique_ptr<protocol::Value> serialize(const InspectorProtocolConvenienceStringType& value)
- {
- return StringValue::create(value);
- }
-};
-
-template<>
-struct ValueConversions<String16> {
- static String16 parse(protocol::Value* value, ErrorSupport* errors)
- {
- String16 result;
- bool success = value ? value->asString(&result) : false;
- if (!success)
- errors->addError("string value expected");
- return result;
- }
-
- static std::unique_ptr<protocol::Value> serialize(const String16& value)
+ static std::unique_ptr<protocol::Value> serialize(const String& value)
{
return StringValue::create(value);
}
@@ -181,7 +165,8 @@ struct ValueConversions<ListValue> {
}
};
-} // namespace platform
-} // namespace blink
+{% for namespace in config.protocol.namespace %}
+} // namespace {{namespace}}
+{% endfor %}
-#endif // !defined(ValueConversions_h)
+#endif // !defined({{"_".join(config.protocol.namespace)}}_ValueConversions_h)

Powered by Google App Engine
This is Rietveld 408576698