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

Unified Diff: third_party/inspector_protocol/lib/DispatcherBase_h.template

Issue 2500093002: [DevTools] Move IO and Tracing to new generator. (Closed)
Patch Set: works 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
Index: third_party/inspector_protocol/lib/DispatcherBase_h.template
diff --git a/third_party/inspector_protocol/lib/DispatcherBase_h.template b/third_party/inspector_protocol/lib/DispatcherBase_h.template
index 4fb89efafe9706c333fd786392db0f3ddc5b01f6..902676ba769872a957ec27931b45f103d58eafb4 100644
--- a/third_party/inspector_protocol/lib/DispatcherBase_h.template
+++ b/third_party/inspector_protocol/lib/DispatcherBase_h.template
@@ -67,16 +67,18 @@ public:
class {{config.lib.export_macro}} Callback {
public:
- Callback(std::unique_ptr<WeakPtr> backendImpl, int callId);
+ Callback(std::unique_ptr<WeakPtr> backendImpl, int callId, int callbackId);
virtual ~Callback();
void dispose();
protected:
void sendIfActive(std::unique_ptr<protocol::DictionaryValue> partialMessage, const DispatchResponse& response);
+ void fallThroughIfActive();
private:
std::unique_ptr<WeakPtr> m_backendImpl;
int m_callId;
+ int m_callbackId;
};
explicit DispatcherBase(FrontendChannel*);
@@ -94,22 +96,31 @@ public:
std::unique_ptr<WeakPtr> weakPtr();
+ int nextCallbackId();
+ void markFallThrough(int callbackId);
+ bool lastCallbackFallThrough() { return m_lastCallbackFallThrough; }
+
private:
FrontendChannel* m_frontendChannel;
protocol::HashSet<WeakPtr*> m_weakPtrs;
+ int m_lastCallbackId;
+ bool m_lastCallbackFallThrough;
};
class {{config.lib.export_macro}} UberDispatcher {
PROTOCOL_DISALLOW_COPY(UberDispatcher);
public:
explicit UberDispatcher(FrontendChannel*);
+ UberDispatcher(FrontendChannel*, bool fallThroughForNotFound);
void registerBackend(const String& name, std::unique_ptr<protocol::DispatcherBase>);
DispatchResponse::Status dispatch(std::unique_ptr<Value> message);
FrontendChannel* channel() { return m_frontendChannel; }
+ bool fallThroughForNotFound() { return m_fallThroughForNotFound; }
virtual ~UberDispatcher();
private:
FrontendChannel* m_frontendChannel;
+ bool m_fallThroughForNotFound;
protocol::HashMap<String, std::unique_ptr<protocol::DispatcherBase>> m_dispatchers;
};

Powered by Google App Engine
This is Rietveld 408576698