// third_party/blink/public/mojom/remote_objects/remote_objects.mojom-test-utils.h is auto generated by mojom_bindings_generator.py, do not edit

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

#ifndef THIRD_PARTY_BLINK_PUBLIC_MOJOM_REMOTE_OBJECTS_REMOTE_OBJECTS_MOJOM_TEST_UTILS_H_
#define THIRD_PARTY_BLINK_PUBLIC_MOJOM_REMOTE_OBJECTS_REMOTE_OBJECTS_MOJOM_TEST_UTILS_H_

#include "third_party/blink/public/mojom/remote_objects/remote_objects.mojom.h"
#include "third_party/blink/public/common/common_export.h"


namespace blink::mojom {


class BLINK_COMMON_EXPORT RemoteObjectHostInterceptorForTesting : public RemoteObjectHost {
  virtual RemoteObjectHost* GetForwardingInterface() = 0;
  void GetObject(int32_t object_id, ::mojo::PendingReceiver<RemoteObject> receiver) override;
  void AcquireObject(int32_t object_id) override;
  void ReleaseObject(int32_t object_id) override;
};
class BLINK_COMMON_EXPORT RemoteObjectHostAsyncWaiter {
 public:
  explicit RemoteObjectHostAsyncWaiter(RemoteObjectHost* proxy);

  RemoteObjectHostAsyncWaiter(const RemoteObjectHostAsyncWaiter&) = delete;
  RemoteObjectHostAsyncWaiter& operator=(const RemoteObjectHostAsyncWaiter&) = delete;

  ~RemoteObjectHostAsyncWaiter();

 private:
  RemoteObjectHost* const proxy_;
};


class BLINK_COMMON_EXPORT RemoteObjectInterceptorForTesting : public RemoteObject {
  virtual RemoteObject* GetForwardingInterface() = 0;
  void HasMethod(const std::string& name, HasMethodCallback callback) override;
  void GetMethods(GetMethodsCallback callback) override;
  void InvokeMethod(const std::string& name, std::vector<RemoteInvocationArgumentPtr> arguments, InvokeMethodCallback callback) override;
  void NotifyReleasedObject() override;
};
class BLINK_COMMON_EXPORT RemoteObjectAsyncWaiter {
 public:
  explicit RemoteObjectAsyncWaiter(RemoteObject* proxy);

  RemoteObjectAsyncWaiter(const RemoteObjectAsyncWaiter&) = delete;
  RemoteObjectAsyncWaiter& operator=(const RemoteObjectAsyncWaiter&) = delete;

  ~RemoteObjectAsyncWaiter();
  void HasMethod(
      const std::string& name, bool* out_method_exists);
  bool HasMethod(const std::string& name);
  void GetMethods(
      std::vector<std::string>* out_method_names);
  std::vector<std::string> GetMethods();
  void InvokeMethod(
      const std::string& name, std::vector<RemoteInvocationArgumentPtr> arguments, RemoteInvocationResultPtr* out_result);
  RemoteInvocationResultPtr InvokeMethod(const std::string& name, std::vector<RemoteInvocationArgumentPtr> arguments);

 private:
  RemoteObject* const proxy_;
};


class BLINK_COMMON_EXPORT RemoteObjectGatewayFactoryInterceptorForTesting : public RemoteObjectGatewayFactory {
  virtual RemoteObjectGatewayFactory* GetForwardingInterface() = 0;
  void CreateRemoteObjectGateway(::mojo::PendingRemote<RemoteObjectHost> host, ::mojo::PendingReceiver<RemoteObjectGateway> gateway) override;
};
class BLINK_COMMON_EXPORT RemoteObjectGatewayFactoryAsyncWaiter {
 public:
  explicit RemoteObjectGatewayFactoryAsyncWaiter(RemoteObjectGatewayFactory* proxy);

  RemoteObjectGatewayFactoryAsyncWaiter(const RemoteObjectGatewayFactoryAsyncWaiter&) = delete;
  RemoteObjectGatewayFactoryAsyncWaiter& operator=(const RemoteObjectGatewayFactoryAsyncWaiter&) = delete;

  ~RemoteObjectGatewayFactoryAsyncWaiter();

 private:
  RemoteObjectGatewayFactory* const proxy_;
};


class BLINK_COMMON_EXPORT RemoteObjectGatewayInterceptorForTesting : public RemoteObjectGateway {
  virtual RemoteObjectGateway* GetForwardingInterface() = 0;
  void AddNamedObject(const std::string& name, int32_t object_id) override;
  void RemoveNamedObject(const std::string& name) override;
};
class BLINK_COMMON_EXPORT RemoteObjectGatewayAsyncWaiter {
 public:
  explicit RemoteObjectGatewayAsyncWaiter(RemoteObjectGateway* proxy);

  RemoteObjectGatewayAsyncWaiter(const RemoteObjectGatewayAsyncWaiter&) = delete;
  RemoteObjectGatewayAsyncWaiter& operator=(const RemoteObjectGatewayAsyncWaiter&) = delete;

  ~RemoteObjectGatewayAsyncWaiter();

 private:
  RemoteObjectGateway* const proxy_;
};




}  // blink::mojom

#endif  // THIRD_PARTY_BLINK_PUBLIC_MOJOM_REMOTE_OBJECTS_REMOTE_OBJECTS_MOJOM_TEST_UTILS_H_