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

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

Issue 1810843002: DevTools: split protocol Dispatcher into Backend interface and the dispatcher itself. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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/Dispatcher_h.template
diff --git a/third_party/WebKit/Source/platform/inspector_protocol/Dispatcher_h.template b/third_party/WebKit/Source/platform/inspector_protocol/Dispatcher_h.template
index 2cde7f119801498f1f0de0391381a17d6c546f42..d0c7797dfb60bea76ad437872c99afdc47c0dd4d 100644
--- a/third_party/WebKit/Source/platform/inspector_protocol/Dispatcher_h.template
+++ b/third_party/WebKit/Source/platform/inspector_protocol/Dispatcher_h.template
@@ -7,6 +7,7 @@
#ifndef {{class_name}}_h
#define {{class_name}}_h
+#include "platform/inspector_protocol/Backend.h"
#include "platform/inspector_protocol/TypeBuilder.h"
namespace blink {
@@ -37,56 +38,7 @@ public:
};
{% for domain in api.domains %}
- class PLATFORM_EXPORT {{domain.domain}}CommandHandler {
- public:
- {% for command in domain.commands %}
- {% if "redirect" in command %}{% continue %}{% endif %}
- {% if ("handlers" in command) and not ("renderer" in command["handlers"]) %}{% continue %}{% endif %}
- {% if "async" in command %}
- class PLATFORM_EXPORT {{command.name | to_title_case}}Callback : public CallbackBase {
- public:
- {{command.name | to_title_case}}Callback(PassOwnPtr<DispatcherImplWeakPtr>, int sessionId, int id);
- void sendSuccess(
- {%- for parameter in command.returns -%}
- {%- if "optional" in parameter -%}
- const Maybe<{{resolve_type(parameter).raw_type}}>& {{parameter.name}}
- {%- else -%}
- {{resolve_type(parameter).pass_type}} {{parameter.name}}
- {%- endif -%}
- {%- if not loop.last -%}, {% endif -%}
- {%- endfor -%}
- );
- };
- {% endif %}
- virtual void {{command.name}}(ErrorString*
- {%- for parameter in command.parameters -%}
- {%- if "optional" in parameter -%}
- , const Maybe<{{resolve_type(parameter).raw_type}}>& in_{{parameter.name}}
- {%- else -%}
- , {{resolve_type(parameter).pass_type}} in_{{parameter.name}}
- {%- endif -%}
- {%- endfor -%}
- {%- if "async" in command -%}
- , PassOwnPtr<{{command.name | to_title_case}}Callback> callback
- {%- else -%}
- {%- for parameter in command.returns -%}
- {%- if "optional" in parameter -%}
- , Maybe<{{resolve_type(parameter).raw_type}}>* out_{{parameter.name}}
- {%- else -%}
- , {{resolve_type(parameter).type}}* out_{{parameter.name}}
- {%- endif -%}
- {%- endfor -%}
- {%- endif -%}
- ) = 0;
- {% endfor %}
-
- protected:
- virtual ~{{domain.domain}}CommandHandler() { }
- };
-{% endfor %}
-
-{% for domain in api.domains %}
- virtual void registerAgent({{domain.domain | to_title_case}}CommandHandler*) = 0;
+ virtual void registerAgent(blink::protocol::Backend::{{domain.domain}}*) = 0;
{% endfor %}
virtual void clearFrontend() = 0;

Powered by Google App Engine
This is Rietveld 408576698