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& no
tification, std::unique_ptr<Serializable> params = nullptr); |
| 133 |
| 134 String serialize() override; |
| 135 |
| 136 ~InternalResponse() override {} |
| 137 |
| 138 private: |
| 139 InternalResponse(int callId, const String& notification, std::unique_ptr<Ser
ializable> params); |
| 140 |
| 141 int m_callId; |
| 142 String m_notification; |
| 143 std::unique_ptr<Serializable> m_params; |
| 144 }; |
| 145 |
| 146 class InternalRawNotification : public Serializable { |
| 147 public: |
| 148 static std::unique_ptr<InternalRawNotification> create(const String& notific
ation) |
| 149 { |
| 150 return std::unique_ptr<InternalRawNotification>(new InternalRawNotificat
ion(notification)); |
| 151 } |
| 152 ~InternalRawNotification() override {} |
| 153 |
| 154 String serialize() override |
| 155 { |
| 156 return m_notification; |
| 157 } |
| 158 |
| 159 private: |
| 160 explicit InternalRawNotification(const String& notification) |
| 161 : m_notification(notification) |
| 162 { |
| 163 } |
| 164 |
| 165 String m_notification; |
| 166 }; |
| 167 |
128 {% for namespace in config.protocol.namespace %} | 168 {% for namespace in config.protocol.namespace %} |
129 } // namespace {{namespace}} | 169 } // namespace {{namespace}} |
130 {% endfor %} | 170 {% endfor %} |
131 | 171 |
132 #endif // !defined({{"_".join(config.protocol.namespace)}}_DispatcherBase_h) | 172 #endif // !defined({{"_".join(config.protocol.namespace)}}_DispatcherBase_h) |
OLD | NEW |