OLD | NEW |
---|---|
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef {{"_".join(config.protocol.namespace)}}_DispatcherBase_h | 5 #ifndef {{"_".join(config.protocol.namespace)}}_DispatcherBase_h |
6 #define {{"_".join(config.protocol.namespace)}}_DispatcherBase_h | 6 #define {{"_".join(config.protocol.namespace)}}_DispatcherBase_h |
7 | 7 |
8 //#include "Collections.h" | 8 //#include "Collections.h" |
9 //#include "ErrorSupport.h" | 9 //#include "ErrorSupport.h" |
10 //#include "Forward.h" | 10 //#include "Forward.h" |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
118 bool fallThroughForNotFound() { return m_fallThroughForNotFound; } | 118 bool fallThroughForNotFound() { return m_fallThroughForNotFound; } |
119 void setFallThroughForNotFound(bool); | 119 void setFallThroughForNotFound(bool); |
120 virtual ~UberDispatcher(); | 120 virtual ~UberDispatcher(); |
121 | 121 |
122 private: | 122 private: |
123 FrontendChannel* m_frontendChannel; | 123 FrontendChannel* m_frontendChannel; |
124 bool m_fallThroughForNotFound; | 124 bool m_fallThroughForNotFound; |
125 protocol::HashMap<String, std::unique_ptr<protocol::DispatcherBase>> m_dispa tchers; | 125 protocol::HashMap<String, std::unique_ptr<protocol::DispatcherBase>> m_dispa tchers; |
126 }; | 126 }; |
127 | 127 |
128 class InternalResponse : public Serializable { | |
129 PROTOCOL_DISALLOW_COPY(InternalResponse); | |
130 public: | |
131 static std::unique_ptr<InternalResponse> createResponse(int callId, std::uni que_ptr<Serializable> params); | |
132 static std::unique_ptr<InternalResponse> createNotification(const String& ty pe, std::unique_ptr<Serializable> params = nullptr); | |
133 | |
134 String serialize(); | |
dgozman
2016/11/22 19:39:24
override
kozy
2016/11/22 21:01:27
Done.
| |
135 | |
136 private: | |
137 InternalResponse(int callId, const String& type, std::unique_ptr<Serializabl e> params); | |
dgozman
2016/11/22 19:39:24
Also need
~InternalResponse() override {}
kozy
2016/11/22 21:01:27
Done.
| |
138 | |
139 int m_callId; | |
140 String m_type; | |
dgozman
2016/11/22 19:39:24
m_notification
kozy
2016/11/22 21:01:27
Done.
| |
141 std::unique_ptr<Serializable> m_params; | |
142 }; | |
143 | |
128 {% for namespace in config.protocol.namespace %} | 144 {% for namespace in config.protocol.namespace %} |
129 } // namespace {{namespace}} | 145 } // namespace {{namespace}} |
130 {% endfor %} | 146 {% endfor %} |
131 | 147 |
132 #endif // !defined({{"_".join(config.protocol.namespace)}}_DispatcherBase_h) | 148 #endif // !defined({{"_".join(config.protocol.namespace)}}_DispatcherBase_h) |
OLD | NEW |