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

Unified Diff: third_party/WebKit/Source/platform/inspector_protocol/Backend_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/Backend_h.template
diff --git a/third_party/WebKit/Source/platform/inspector_protocol/Dispatcher_h.template b/third_party/WebKit/Source/platform/inspector_protocol/Backend_h.template
similarity index 57%
copy from third_party/WebKit/Source/platform/inspector_protocol/Dispatcher_h.template
copy to third_party/WebKit/Source/platform/inspector_protocol/Backend_h.template
index 2cde7f119801498f1f0de0391381a17d6c546f42..2ab74d485229f4468f9a9a1a6fcb9953e0a20672 100644
--- a/third_party/WebKit/Source/platform/inspector_protocol/Dispatcher_h.template
+++ b/third_party/WebKit/Source/platform/inspector_protocol/Backend_h.template
@@ -13,31 +13,18 @@ namespace blink {
namespace protocol {
class FrontendChannel;
-class DispatcherImplWeakPtr;
+class BackendImplWeakPtr;
-class PLATFORM_EXPORT Dispatcher {
+class PLATFORM_EXPORT Backend {
public:
- static PassOwnPtr<Dispatcher> create(FrontendChannel* frontendChannel);
- virtual ~Dispatcher() { }
-
class PLATFORM_EXPORT CallbackBase {
public:
- CallbackBase(PassOwnPtr<DispatcherImplWeakPtr> backendImpl, int sessionId, int id);
- virtual ~CallbackBase();
- void sendFailure(const ErrorString&);
- void dispose();
-
- protected:
- void sendIfActive(PassOwnPtr<protocol::DictionaryValue> partialMessage, const ErrorString& invocationError);
-
- private:
- OwnPtr<DispatcherImplWeakPtr> m_backendImpl;
- int m_sessionId;
- int m_id;
+ virtual ~CallbackBase() { }
+ virtual void sendFailure(const ErrorString&) = 0;
};
-
{% for domain in api.domains %}
- class PLATFORM_EXPORT {{domain.domain}}CommandHandler {
+
+ class PLATFORM_EXPORT {{domain.domain}} {
public:
{% for command in domain.commands %}
{% if "redirect" in command %}{% continue %}{% endif %}
@@ -45,8 +32,7 @@ public:
{% 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(
+ virtual void sendSuccess(
{%- for parameter in command.returns -%}
{%- if "optional" in parameter -%}
const Maybe<{{resolve_type(parameter).raw_type}}>& {{parameter.name}}
@@ -55,7 +41,7 @@ public:
{%- endif -%}
{%- if not loop.last -%}, {% endif -%}
{%- endfor -%}
- );
+ ) = 0;
};
{% endif %}
virtual void {{command.name}}(ErrorString*
@@ -81,30 +67,9 @@ public:
{% endfor %}
protected:
- virtual ~{{domain.domain}}CommandHandler() { }
+ virtual ~{{domain.domain}}() { }
};
{% endfor %}
-
-{% for domain in api.domains %}
- virtual void registerAgent({{domain.domain | to_title_case}}CommandHandler*) = 0;
-{% endfor %}
-
- virtual void clearFrontend() = 0;
-
- enum CommonErrorCode {
- ParseError = 0,
- InvalidRequest,
- MethodNotFound,
- InvalidParams,
- InternalError,
- ServerError,
- LastEntry,
- };
-
- void reportProtocolError(int sessionId, int callId, CommonErrorCode, const String16& errorMessage) const;
- virtual void reportProtocolError(int sessionId, int callId, CommonErrorCode, const String16& errorMessage, ErrorSupport*) const = 0;
- virtual void dispatch(int sessionId, const String16& message) = 0;
- static bool getCommandName(const String16& message, String16* result);
};
} // namespace protocol

Powered by Google App Engine
This is Rietveld 408576698