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

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

Issue 2008183002: DevTools: generate frontend and backend interfaces under domains. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: review comment addressed Created 4 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/platform/inspector_protocol/Frontend_h.template
diff --git a/third_party/WebKit/Source/platform/inspector_protocol/Frontend_h.template b/third_party/WebKit/Source/platform/inspector_protocol/Frontend_h.template
index b116ed5929fb6b2cd735e76de9e9a9fb61d5ce73..c29e8e8d9e77f71a9c0cfc32b24f4a2de2b27d7f 100644
--- a/third_party/WebKit/Source/platform/inspector_protocol/Frontend_h.template
+++ b/third_party/WebKit/Source/platform/inspector_protocol/Frontend_h.template
@@ -7,47 +7,54 @@
#ifndef {{class_name}}_h
#define {{class_name}}_h
-
#include "platform/inspector_protocol/FrontendChannel.h"
#include "platform/inspector_protocol/TypeBuilder.h"
namespace blink {
namespace protocol {
-class PLATFORM_EXPORT Frontend {
-public:
- Frontend(FrontendChannel*);
- FrontendChannel* channel() { return m_frontendChannel; }
+class PLATFORM_EXPORT Frontend;
{% for domain in api.domains %}
- class PLATFORM_EXPORT {{domain.domain}} {
- public:
- static {{domain.domain}}* from(Frontend* frontend) { return &(frontend->m_{{domain.domain | lower}}) ;}
- {{domain.domain}}(FrontendChannel* frontendChannel) : m_frontendChannel(frontendChannel) { }
+namespace {{domain.domain}} {
+
+class PLATFORM_EXPORT Frontend {
+public:
+ static Frontend* from(protocol::Frontend* frontend);
+ Frontend(FrontendChannel* frontendChannel) : m_frontendChannel(frontendChannel) { }
{% for event in domain.events %}
{% if "handlers" in event and not ("renderer" in event["handlers"]) %}{% continue %}{% endif %}
- void {{event.name}}(
+ void {{event.name}}(
{%- for parameter in event.parameters -%}
{%- if "optional" in parameter -%}
- const Maybe<{{resolve_type(parameter).raw_type}}>& {{parameter.name}} = Maybe<{{resolve_type(parameter).raw_type}}>()
+ const Maybe<{{resolve_type(parameter).raw_type}}>& {{parameter.name}} = Maybe<{{resolve_type(parameter).raw_type}}>()
{%- else -%}
- {{resolve_type(parameter).pass_type}} {{parameter.name}}
+ {{resolve_type(parameter).pass_type}} {{parameter.name}}
{%- endif -%}{%- if not loop.last -%}, {% endif -%}
{%- endfor -%}
- );
+ );
{% endfor %}
- void flush() { m_frontendChannel->flushProtocolNotifications(); }
- private:
- FrontendChannel* m_frontendChannel;
- };
+ void flush() { m_frontendChannel->flushProtocolNotifications(); }
+private:
+ FrontendChannel* m_frontendChannel;
+};
+
+} // namespace {{domain.domain}}
{% endfor %}
+class PLATFORM_EXPORT Frontend {
+public:
+ Frontend(FrontendChannel*);
+ FrontendChannel* channel() { return m_frontendChannel; }
+
private:
FrontendChannel* m_frontendChannel;
+
+public:
{% for domain in api.domains %}
- {{domain.domain}} m_{{domain.domain | lower}};
+ {{domain.domain}}::Frontend m_{{domain.domain | lower}};
{% endfor %}
};

Powered by Google App Engine
This is Rietveld 408576698