| 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 PassOwnPtr<Dispatcher> create(FrontendChannel* frontendChannel); | 21 static PassOwnPtr<Dispatcher> create(FrontendChannel* frontendChannel); |
| 22 virtual ~Dispatcher() { } | 22 virtual ~Dispatcher() { } |
| 23 | 23 |
| 24 class PLATFORM_EXPORT CallbackBase { | 24 class PLATFORM_EXPORT CallbackBase { |
| 25 public: | 25 public: |
| 26 CallbackBase(PassOwnPtr<DispatcherImplWeakPtr> backendImpl, int sessionI
d, int id); | 26 CallbackBase(PassOwnPtr<DispatcherImplWeakPtr> backendImpl, int callId); |
| 27 virtual ~CallbackBase(); | 27 virtual ~CallbackBase(); |
| 28 void sendFailure(const ErrorString&); | 28 void sendFailure(const ErrorString&); |
| 29 void dispose(); | 29 void dispose(); |
| 30 | 30 |
| 31 protected: | 31 protected: |
| 32 void sendIfActive(PassOwnPtr<protocol::DictionaryValue> partialMessage,
const ErrorString& invocationError); | 32 void sendIfActive(PassOwnPtr<protocol::DictionaryValue> partialMessage,
const ErrorString& invocationError); |
| 33 | 33 |
| 34 private: | 34 private: |
| 35 OwnPtr<DispatcherImplWeakPtr> m_backendImpl; | 35 OwnPtr<DispatcherImplWeakPtr> m_backendImpl; |
| 36 int m_sessionId; | 36 int m_callId; |
| 37 int m_id; | |
| 38 }; | 37 }; |
| 39 | 38 |
| 40 {% for domain in api.domains %} | 39 {% for domain in api.domains %} |
| 41 virtual void registerAgent(blink::protocol::Backend::{{domain.domain}}*) = 0
; | 40 virtual void registerAgent(blink::protocol::Backend::{{domain.domain}}*) = 0
; |
| 42 {% endfor %} | 41 {% endfor %} |
| 43 | 42 |
| 44 virtual void clearFrontend() = 0; | 43 virtual void clearFrontend() = 0; |
| 45 | 44 |
| 46 enum CommonErrorCode { | 45 enum CommonErrorCode { |
| 47 ParseError = 0, | 46 ParseError = 0, |
| 48 InvalidRequest, | 47 InvalidRequest, |
| 49 MethodNotFound, | 48 MethodNotFound, |
| 50 InvalidParams, | 49 InvalidParams, |
| 51 InternalError, | 50 InternalError, |
| 52 ServerError, | 51 ServerError, |
| 53 LastEntry, | 52 LastEntry, |
| 54 }; | 53 }; |
| 55 | 54 |
| 56 void reportProtocolError(int sessionId, int callId, CommonErrorCode, const S
tring16& errorMessage) const; | 55 void reportProtocolError(int callId, CommonErrorCode, const String16& errorM
essage) const; |
| 57 virtual void reportProtocolError(int sessionId, int callId, CommonErrorCode,
const String16& errorMessage, ErrorSupport*) const = 0; | 56 virtual void reportProtocolError(int callId, CommonErrorCode, const String16
& errorMessage, ErrorSupport*) const = 0; |
| 58 virtual void dispatch(int sessionId, const String16& message) = 0; | 57 virtual void dispatch(const String16& message) = 0; |
| 59 static bool getCommandName(const String16& message, String16* result); | 58 static bool getCommandName(const String16& message, String16* result); |
| 60 }; | 59 }; |
| 61 | 60 |
| 62 } // namespace protocol | 61 } // namespace protocol |
| 63 } // namespace blink | 62 } // namespace blink |
| 64 | 63 |
| 65 #endif // !defined({{class_name}}_h) | 64 #endif // !defined({{class_name}}_h) |
| OLD | NEW |