1// Copyright 2017 The Chromium Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5/* DO NOT EDIT. Generated from {{module.path}} */
6
7{%- if variant -%}
8{%-   set variant_path = "%s-%s"|format(module.path, variant) -%}
9{%- else -%}
10{%-   set variant_path = module.path -%}
11{%- endif %}
12
13{%- set header_guard = "%s_IMPL_INTERFACE_H_"|format(
14        variant_path|upper|replace("/","_")|replace(".","_")|
15            replace("-", "_")) %}
16
17{%- import "module_macros.tmpl" as module_macros %}
18
19#ifndef {{header_guard}}
20#define {{header_guard}}
21
22#include <string>
23#include <vector>
24
25#include "base/macros.h"
26#include "{{variant_path}}_c.h"
27
28{# Interface Stubs #}
29{%  for interface in interfaces %}
30{%- set interface_name = interface|get_name_for_kind %}
31struct {{interface_name}} {
32  {{interface_name}}() = default;
33  virtual ~{{interface_name}}() = default;
34
35  void set_client_context(Cronet_ClientContext client_context) {
36    client_context_ = client_context;
37  }
38  Cronet_ClientContext client_context() const { return client_context_; }
39
40{% for method in interface.methods %}
41{%-  if method.response_parameters and method.sync %}
42{%-   for param in method.response_parameters %}
43virtual {{param.kind|c_wrapper_type}}
44{%-   endfor -%}
45{%-  else %}
46virtual void
47{%- endif %}
48   {{method.name}}({{module_macros.declare_c_params("", method.parameters)}}) = 0;
49{%- endfor %}
50 private:
51  Cronet_ClientContext client_context_ = nullptr;
52
53  DISALLOW_COPY_AND_ASSIGN({{interface_name}});
54};
55
56{% endfor %}
57#endif  // {{header_guard}}
58
59