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

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

Issue 2012753003: DevTools: consolidate protocol generators for front-end, backend and type builder. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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_cpp.template
diff --git a/third_party/WebKit/Source/platform/inspector_protocol/Frontend_cpp.template b/third_party/WebKit/Source/platform/inspector_protocol/Frontend_cpp.template
deleted file mode 100644
index f32601f6e17c8ad6df7fd964b2372a5e09e01e67..0000000000000000000000000000000000000000
--- a/third_party/WebKit/Source/platform/inspector_protocol/Frontend_cpp.template
+++ /dev/null
@@ -1,58 +0,0 @@
-// This file is generated
-
-// Copyright (c) 2016 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "platform/inspector_protocol/{{class_name}}.h"
-
-#include "platform/inspector_protocol/String16.h"
-
-namespace blink {
-namespace protocol {
-
-Frontend::Frontend(FrontendChannel* frontendChannel)
- : m_frontendChannel(frontendChannel)
-{% for domain in api.domains %}
- , m_{{domain.domain | lower}}(frontendChannel)
-{% endfor %}
-{
-}
-{% for domain in api.domains %}
-
-{{domain.domain}}::Frontend* {{domain.domain}}::Frontend::from(protocol::Frontend* frontend)
-{
- return &(frontend->m_{{domain.domain | lower}});
-}
- {% for event in domain.events %}
- {% if "handlers" in event and not ("renderer" in event["handlers"]) %}{% continue %}{% endif %}
-
-void {{domain.domain}}::Frontend::{{event.name}}(
- {%- for parameter in event.parameters %}
- {% if "optional" in parameter -%}
- const Maybe<{{resolve_type(parameter).raw_type}}>&
- {%- else -%}
- {{resolve_type(parameter).pass_type}}
- {%- endif %} {{parameter.name}}{%- if not loop.last -%}, {% endif -%}
- {% endfor -%})
-{
- std::unique_ptr<protocol::DictionaryValue> jsonMessage = DictionaryValue::create();
- jsonMessage->setString("method", "{{domain.domain}}.{{event.name}}");
- std::unique_ptr<protocol::DictionaryValue> paramsObject = DictionaryValue::create();
- {% for parameter in event.parameters %}
- {% if "optional" in parameter %}
- if ({{parameter.name}}.isJust())
- paramsObject->setValue("{{parameter.name}}", toValue({{parameter.name}}.fromJust()));
- {% else %}
- paramsObject->setValue("{{parameter.name}}", toValue({{resolve_type(parameter).to_raw_type % parameter.name}}));
- {% endif %}
- {% endfor %}
- jsonMessage->setObject("params", std::move(paramsObject));
- if (m_frontendChannel)
- m_frontendChannel->sendProtocolNotification(jsonMessage->toJSONString());
-}
- {% endfor %}
-{% endfor %}
-
-} // namespace protocol
-} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698