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

Unified Diff: third_party/WebKit/Source/platform/inspector_protocol/Array_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/Array_h.template
diff --git a/third_party/WebKit/Source/platform/inspector_protocol/Array_h.template b/third_party/WebKit/Source/platform/inspector_protocol/Array_h.template
index 40abb2d467c161e382ce460c3a95f311ca8c87bd..dd9d3eb72f63b87548c53d62ebd53bf95c541b7d 100644
--- a/third_party/WebKit/Source/platform/inspector_protocol/Array_h.template
+++ b/third_party/WebKit/Source/platform/inspector_protocol/Array_h.template
@@ -2,19 +2,18 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef Array_h
-#define Array_h
+#ifndef {{"_".join(config.protocol.namespace)}}_Array_h
+#define {{"_".join(config.protocol.namespace)}}_Array_h
//#include "ErrorSupport.h"
//#include "Platform.h"
-//#include "String16.h"
+//#include "String.h"
//#include "ValueConversions.h"
//#include "Values.h"
-#include <vector>
-
-namespace blink {
-namespace protocol {
+{% for namespace in config.protocol.namespace %}
+namespace {{namespace}} {
+{% endfor %}
template<typename T>
class Array {
@@ -34,7 +33,7 @@ public:
std::unique_ptr<Array<T>> result(new Array<T>());
errors->push();
for (size_t i = 0; i < array->size(); ++i) {
- errors->setName(String16::fromInteger(i));
+ errors->setName(StringUtil::fromInteger(i));
std::unique_ptr<T> item = ValueConversions<T>::parse(array->at(i), errors);
result->m_vector.push_back(std::move(item));
}
@@ -89,7 +88,7 @@ public:
errors->push();
std::unique_ptr<Array<T>> result(new Array<T>());
for (size_t i = 0; i < array->size(); ++i) {
- errors->setName(String16::fromInteger(i));
+ errors->setName(StringUtil::fromInteger(i));
T item = ValueConversions<T>::parse(array->at(i), errors);
result->m_vector.push_back(item);
}
@@ -126,13 +125,13 @@ private:
std::vector<T> m_vector;
};
-template<> class Array<InspectorProtocolConvenienceStringType> : public ArrayBase<InspectorProtocolConvenienceStringType> {};
-template<> class Array<String16> : public ArrayBase<String16> {};
+template<> class Array<String> : public ArrayBase<String> {};
template<> class Array<int> : public ArrayBase<int> {};
template<> class Array<double> : public ArrayBase<double> {};
template<> class Array<bool> : public ArrayBase<bool> {};
-} // namespace platform
-} // namespace blink
+{% for namespace in config.protocol.namespace %}
+} // namespace {{namespace}}
+{% endfor %}
-#endif // !defined(Array_h)
+#endif // !defined({{"_".join(config.protocol.namespace)}}_Array_h)

Powered by Google App Engine
This is Rietveld 408576698