blob: a76ca1085a5ffd6e1f567e637704e11678be49f0 [file] [log] [blame]
// This file is generated
// Copyright (c) 2016 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef {{class_name}}_h
#define {{class_name}}_h
#include "platform/inspector_protocol/Backend.h"
#include "platform/inspector_protocol/TypeBuilder.h"
namespace blink {
namespace protocol {
class FrontendChannel;
class DispatcherImplWeakPtr;
class PLATFORM_EXPORT Dispatcher {
public:
static std::unique_ptr<Dispatcher> create(FrontendChannel* frontendChannel);
virtual ~Dispatcher() { }
{% for domain in api.domains %}
virtual void registerAgent(blink::protocol::{{domain.domain}}::Backend*) = 0;
{% endfor %}
virtual void clearFrontend() = 0;
enum CommonErrorCode {
ParseError = 0,
InvalidRequest,
MethodNotFound,
InvalidParams,
InternalError,
ServerError,
LastEntry,
};
void reportProtocolError(int callId, CommonErrorCode, const String16& errorMessage) const;
virtual void reportProtocolError(int callId, CommonErrorCode, const String16& errorMessage, ErrorSupport*) const = 0;
virtual void dispatch(const String16& message) = 0;
static bool getCommandName(const String16& message, String16* result);
};
} // namespace protocol
} // namespace blink
#endif // !defined({{class_name}}_h)