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

Unified Diff: lib/DispatcherBase_h.template

Issue 2526603002: [inspector_protocol] Introduce protocol::Serializable (Closed)
Patch Set: minor fix Created 4 years, 1 month 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
« no previous file with comments | « lib/DispatcherBase_cpp.template ('k') | lib/FrontendChannel_h.template » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/DispatcherBase_h.template
diff --git a/lib/DispatcherBase_h.template b/lib/DispatcherBase_h.template
index 9838637c59340ed91dbcc0aad51b7697cf5373bf..3a6069b6494b43955f0b3753150101a8020ef7f9 100644
--- a/lib/DispatcherBase_h.template
+++ b/lib/DispatcherBase_h.template
@@ -125,6 +125,46 @@ private:
protocol::HashMap<String, std::unique_ptr<protocol::DispatcherBase>> m_dispatchers;
};
+class InternalResponse : public Serializable {
+ PROTOCOL_DISALLOW_COPY(InternalResponse);
+public:
+ static std::unique_ptr<InternalResponse> createResponse(int callId, std::unique_ptr<Serializable> params);
+ static std::unique_ptr<InternalResponse> createNotification(const String& notification, std::unique_ptr<Serializable> params = nullptr);
+
+ String serialize() override;
+
+ ~InternalResponse() override {}
+
+private:
+ InternalResponse(int callId, const String& notification, std::unique_ptr<Serializable> params);
+
+ int m_callId;
+ String m_notification;
+ std::unique_ptr<Serializable> m_params;
+};
+
+class InternalRawNotification : public Serializable {
+public:
+ static std::unique_ptr<InternalRawNotification> create(const String& notification)
+ {
+ return std::unique_ptr<InternalRawNotification>(new InternalRawNotification(notification));
+ }
+ ~InternalRawNotification() override {}
+
+ String serialize() override
+ {
+ return m_notification;
+ }
+
+private:
+ explicit InternalRawNotification(const String& notification)
+ : m_notification(notification)
+ {
+ }
+
+ String m_notification;
+};
+
{% for namespace in config.protocol.namespace %}
} // namespace {{namespace}}
{% endfor %}
« no previous file with comments | « lib/DispatcherBase_cpp.template ('k') | lib/FrontendChannel_h.template » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698