blob: 72a99a1f48c5095de2743a37c6f0f8e6dbeddade [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 {
using ErrorString = String;
class PLATFORM_EXPORT Frontend {
public:
Frontend(FrontendChannel*);
FrontendChannel* channel() { return m_frontendChannel; }
{% for domain in api.domains %}
class PLATFORM_EXPORT {{domain.domain}} {
public:
static {{domain.domain}}* from(Frontend* frontend) { return &(frontend->m_{{domain.domain | lower}}) ;}
{{domain.domain}}(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->flush(); }
private:
FrontendChannel* m_frontendChannel;
};
{% endfor %}
private:
FrontendChannel* m_frontendChannel;
{% for domain in api.domains %}
{{domain.domain}} m_{{domain.domain | lower}};
{% endfor %}
};
} // namespace protocol
} // namespace blink
#endif // !defined({{class_name}}_h)