blob: c29e8e8d9e77f71a9c0cfc32b24f4a2de2b27d7f [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/FrontendChannel.h"
#include "platform/inspector_protocol/TypeBuilder.h"
namespace blink {
namespace protocol {
class PLATFORM_EXPORT Frontend;
{% for domain in api.domains %}
namespace {{domain.domain}} {
class PLATFORM_EXPORT Frontend {
public:
static Frontend* from(protocol::Frontend* frontend);
Frontend(FrontendChannel* frontendChannel) : m_frontendChannel(frontendChannel) { }
{% for event in domain.events %}
{% if "handlers" in event and not ("renderer" in event["handlers"]) %}{% continue %}{% endif %}
void {{event.name}}(
{%- for parameter in event.parameters -%}
{%- if "optional" in parameter -%}
const Maybe<{{resolve_type(parameter).raw_type}}>& {{parameter.name}} = Maybe<{{resolve_type(parameter).raw_type}}>()
{%- else -%}
{{resolve_type(parameter).pass_type}} {{parameter.name}}
{%- endif -%}{%- if not loop.last -%}, {% endif -%}
{%- endfor -%}
);
{% endfor %}
void flush() { m_frontendChannel->flushProtocolNotifications(); }
private:
FrontendChannel* m_frontendChannel;
};
} // namespace {{domain.domain}}
{% endfor %}
class PLATFORM_EXPORT Frontend {
public:
Frontend(FrontendChannel*);
FrontendChannel* channel() { return m_frontendChannel; }
private:
FrontendChannel* m_frontendChannel;
public:
{% for domain in api.domains %}
{{domain.domain}}::Frontend m_{{domain.domain | lower}};
{% endfor %}
};
} // namespace protocol
} // namespace blink
#endif // !defined({{class_name}}_h)