chromium/tools/json_schema_compiler/test/idl_function_types.idl

// Copyright 2014 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

// Tests function and callback types in various places in IDL.

namespace idl_function_types {
  callback MyCallback = void(long x);
  callback MyUnionCallback = void ((long or DOMString) x);
  callback MyOptionalUnionCallback = void (optional (long or DOMString) x);

  interface Functions {
    static void whatever(MyCallback[] callbacks);
    static void blah(MyUnionCallback callback);
    static void badabish(MyOptionalUnionCallback callback);
    static void union_params((long or DOMString) x);
    [doesNotSupportPromises="Test"]
    static void non_promise_supporting(MyCallback callback);
    [doesNotSupportPromises="Test"]
    static void non_promise_supporting_with_params(
        long z, (long or DOMString) y, MyCallback callback);
  };
};