| OLD | NEW |
| 1 // This file is generated | 1 // This file is generated |
| 2 | 2 |
| 3 // Copyright (c) 2016 The Chromium Authors. All rights reserved. | 3 // Copyright (c) 2016 The Chromium Authors. All rights reserved. |
| 4 // Use of this source code is governed by a BSD-style license that can be | 4 // Use of this source code is governed by a BSD-style license that can be |
| 5 // found in the LICENSE file. | 5 // found in the LICENSE file. |
| 6 | 6 |
| 7 #ifndef {{class_name}}_h | 7 #ifndef {{class_name}}_h |
| 8 #define {{class_name}}_h | 8 #define {{class_name}}_h |
| 9 | 9 |
| 10 #include "platform/inspector_protocol/Backend.h" | 10 #include "platform/inspector_protocol/Backend.h" |
| 11 #include "platform/inspector_protocol/TypeBuilder.h" | 11 #include "platform/inspector_protocol/TypeBuilder.h" |
| 12 | 12 |
| 13 namespace blink { | 13 namespace blink { |
| 14 namespace protocol { | 14 namespace protocol { |
| 15 | 15 |
| 16 class FrontendChannel; | 16 class FrontendChannel; |
| 17 class DispatcherImplWeakPtr; | 17 class DispatcherImplWeakPtr; |
| 18 | 18 |
| 19 class PLATFORM_EXPORT Dispatcher { | 19 class PLATFORM_EXPORT Dispatcher { |
| 20 public: | 20 public: |
| 21 static std::unique_ptr<Dispatcher> create(FrontendChannel* frontendChannel); | 21 static std::unique_ptr<Dispatcher> create(FrontendChannel* frontendChannel); |
| 22 virtual ~Dispatcher() { } | 22 virtual ~Dispatcher() { } |
| 23 | 23 |
| 24 class PLATFORM_EXPORT CallbackBase { | |
| 25 public: | |
| 26 CallbackBase(std::unique_ptr<DispatcherImplWeakPtr> backendImpl, int cal
lId); | |
| 27 virtual ~CallbackBase(); | |
| 28 void sendFailure(const ErrorString&); | |
| 29 void dispose(); | |
| 30 | |
| 31 protected: | |
| 32 void sendIfActive(std::unique_ptr<protocol::DictionaryValue> partialMess
age, const ErrorString& invocationError); | |
| 33 | |
| 34 private: | |
| 35 std::unique_ptr<DispatcherImplWeakPtr> m_backendImpl; | |
| 36 int m_callId; | |
| 37 }; | |
| 38 | |
| 39 {% for domain in api.domains %} | 24 {% for domain in api.domains %} |
| 40 virtual void registerAgent(blink::protocol::Backend::{{domain.domain}}*) = 0
; | 25 virtual void registerAgent(blink::protocol::{{domain.domain}}::Backend*) = 0
; |
| 41 {% endfor %} | 26 {% endfor %} |
| 42 | 27 |
| 43 virtual void clearFrontend() = 0; | 28 virtual void clearFrontend() = 0; |
| 44 | 29 |
| 45 enum CommonErrorCode { | 30 enum CommonErrorCode { |
| 46 ParseError = 0, | 31 ParseError = 0, |
| 47 InvalidRequest, | 32 InvalidRequest, |
| 48 MethodNotFound, | 33 MethodNotFound, |
| 49 InvalidParams, | 34 InvalidParams, |
| 50 InternalError, | 35 InternalError, |
| 51 ServerError, | 36 ServerError, |
| 52 LastEntry, | 37 LastEntry, |
| 53 }; | 38 }; |
| 54 | 39 |
| 55 void reportProtocolError(int callId, CommonErrorCode, const String16& errorM
essage) const; | 40 void reportProtocolError(int callId, CommonErrorCode, const String16& errorM
essage) const; |
| 56 virtual void reportProtocolError(int callId, CommonErrorCode, const String16
& errorMessage, ErrorSupport*) const = 0; | 41 virtual void reportProtocolError(int callId, CommonErrorCode, const String16
& errorMessage, ErrorSupport*) const = 0; |
| 57 virtual void dispatch(const String16& message) = 0; | 42 virtual void dispatch(const String16& message) = 0; |
| 58 static bool getCommandName(const String16& message, String16* result); | 43 static bool getCommandName(const String16& message, String16* result); |
| 59 }; | 44 }; |
| 60 | 45 |
| 61 } // namespace protocol | 46 } // namespace protocol |
| 62 } // namespace blink | 47 } // namespace blink |
| 63 | 48 |
| 64 #endif // !defined({{class_name}}_h) | 49 #endif // !defined({{class_name}}_h) |
| OLD | NEW |