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

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

Issue 2159633002: [DevTools] Generate public versions of protocol classes to be exposed in v8_inspector/public. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: works Created 4 years, 5 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/TypeBuilder_h.template
diff --git a/third_party/WebKit/Source/platform/inspector_protocol/TypeBuilder_h.template b/third_party/WebKit/Source/platform/inspector_protocol/TypeBuilder_h.template
index 05ca81d3a5714ec58b7e9b6a00e712f5b93364bf..ed83430a62db794add717bd5dac235fdf751241d 100644
--- a/third_party/WebKit/Source/platform/inspector_protocol/TypeBuilder_h.template
+++ b/third_party/WebKit/Source/platform/inspector_protocol/TypeBuilder_h.template
@@ -26,6 +26,9 @@
{% for name in domain.dependencies %}
#include "{{output_package}}/{{name}}.h"
pfeldman 2016/07/22 18:02:40 It should be clear that we explicitly import publi
dgozman 2016/07/22 21:21:19 Done.
{% endfor %}
+{% if domain["has_exports"] %}
+#include "{{exported_package}}/{{domain.domain}}.h"
+{% endif %}
namespace blink {
namespace protocol {
@@ -53,7 +56,7 @@ namespace {{type.id}}Enum {
{% for literal in type.enum %}
{{export_macro}} extern const char* {{ literal | dash_to_camelcase}};
{% endfor %}
-} // {{type.id}}Enum
+} // namespace {{type.id}}Enum
{% endif %}
{% endfor %}
{% for command in join_arrays(domain, ["commands", "events"]) %}
@@ -77,7 +80,8 @@ namespace {{param.name | to_title_case}}Enum {
{% set type_def = type_definition(domain.domain + "." + type.id)%}
// {{type.description}}
-class {{export_macro}} {{type.id}} {
+class {{export_macro}} {{type.id}} {% if type.exported %}: public Exported::{{type.id}} {% endif %}{
+ PROTOCOL_DISALLOW_COPY({{type.id}});
public:
static std::unique_ptr<{{type.id}}> parse(protocol::Value* value, ErrorSupport* errors);
@@ -103,6 +107,9 @@ public:
std::unique_ptr<protocol::DictionaryValue> serialize() const;
std::unique_ptr<{{type.id}}> clone() const;
+ {% if type.exported %}
+ String16 toJSONString() const override;
+ {% endif %}
template<int STATE>
class {{type.id}}Builder {

Powered by Google App Engine
This is Rietveld 408576698