// services/network/public/mojom/network_context_client.mojom-blink.h is auto generated by mojom_bindings_generator.py, do not edit

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

#ifndef SERVICES_NETWORK_PUBLIC_MOJOM_NETWORK_CONTEXT_CLIENT_MOJOM_BLINK_H_
#define SERVICES_NETWORK_PUBLIC_MOJOM_NETWORK_CONTEXT_CLIENT_MOJOM_BLINK_H_

#include <stdint.h>

#include <limits>
#include <optional>
#include <type_traits>
#include <utility>
#include "mojo/public/cpp/bindings/clone_traits.h"
#include "mojo/public/cpp/bindings/equals_traits.h"
#include "mojo/public/cpp/bindings/struct_ptr.h"
#include "mojo/public/cpp/bindings/struct_traits.h"
#include "mojo/public/cpp/bindings/union_traits.h"

#include "third_party/perfetto/include/perfetto/tracing/traced_value_forward.h"

#include "services/network/public/mojom/network_context_client.mojom-features.h"  // IWYU pragma: export
#include "services/network/public/mojom/network_context_client.mojom-shared.h"  // IWYU pragma: export
#include "services/network/public/mojom/network_context_client.mojom-blink-forward.h"  // IWYU pragma: export
#include "mojo/public/mojom/base/file.mojom-blink.h"
#include "mojo/public/mojom/base/file_path.mojom-blink.h"
#include "services/network/public/mojom/originating_process_id.mojom-blink-forward.h"
#include "url/mojom/origin.mojom-blink.h"
#include "url/mojom/url.mojom-blink.h"

#include "mojo/public/cpp/bindings/lib/wtf_clone_equals_util.h"
#include "mojo/public/cpp/bindings/lib/wtf_hash_util.h"
#include "third_party/blink/renderer/platform/wtf/hash_functions.h"
#include "third_party/blink/renderer/platform/wtf/text/wtf_string.h"

#include "mojo/public/cpp/bindings/lib/control_message_handler.h"
#include "mojo/public/cpp/bindings/raw_ptr_impl_ref_traits.h"


#include "third_party/blink/public/platform/web_common.h"
#if !BLINK_MOJO_IMPL && !INSIDE_BLINK
#error "File must only be imported inside blink"
#endif




namespace network::mojom::blink {

class NetworkContextClientProxy;

template <typename ImplRefTraits>
class NetworkContextClientStub;

class NetworkContextClientRequestValidator;
class NetworkContextClientResponseValidator;


class BLINK_PLATFORM_EXPORT NetworkContextClient
    : public NetworkContextClientInterfaceBase {
 public:
  using IPCStableHashFunction = uint32_t(*)();
  static constexpr const char* Name_ = "network.mojom.NetworkContextClient";
  static IPCStableHashFunction MessageToMethodInfo_(mojo::Message& message);
  static const char* MessageToMethodName_(mojo::Message& message);
  static constexpr uint32_t Version_ = 0;
  static constexpr bool PassesAssociatedKinds_ = false;
  static constexpr bool HasUninterruptableMethods_ = false;

  using Base_ = NetworkContextClientInterfaceBase;
  using Proxy_ = NetworkContextClientProxy;

  template <typename ImplRefTraits>
  using Stub_ = NetworkContextClientStub<ImplRefTraits>;

  using RequestValidator_ = NetworkContextClientRequestValidator;
  using ResponseValidator_ = NetworkContextClientResponseValidator;
  enum MethodMinVersions : uint32_t {
    kOnFileUploadRequestedMinVersion = 0,
    kOnCanSendReportingReportsMinVersion = 0,
    kOnCanSendDomainReliabilityUploadMinVersion = 0,
    kOnGenerateHttpNegotiateAuthTokenMinVersion = 0,
    kOnCanSendSCTAuditingReportMinVersion = 0,
    kOnNewSCTAuditingReportSentMinVersion = 0,
  };

// crbug.com/1340245 - this causes binary size bloat on Fuchsia, and we're OK
// with not having this data in traces there.
#if !BUILDFLAG(IS_FUCHSIA)
  struct OnFileUploadRequested_Sym {
    NOINLINE static uint32_t IPCStableHash();
  };
  struct OnCanSendReportingReports_Sym {
    NOINLINE static uint32_t IPCStableHash();
  };
  struct OnCanSendDomainReliabilityUpload_Sym {
    NOINLINE static uint32_t IPCStableHash();
  };
  struct OnGenerateHttpNegotiateAuthToken_Sym {
    NOINLINE static uint32_t IPCStableHash();
  };
  struct OnCanSendSCTAuditingReport_Sym {
    NOINLINE static uint32_t IPCStableHash();
  };
  struct OnNewSCTAuditingReportSent_Sym {
    NOINLINE static uint32_t IPCStableHash();
  };
#endif // !BUILDFLAG(IS_FUCHSIA)
  virtual ~NetworkContextClient() = default;

  using OnFileUploadRequestedCallback = base::OnceCallback<void(int32_t, ::blink::Vector<::base::File>)>;
  using OnFileUploadRequestedMojoCallback = base::OnceCallback<void(int32_t, ::blink::Vector<::base::File>)>;

  virtual void OnFileUploadRequested(::network::mojom::blink::OriginatingProcessIdPtr process_id, bool async, const ::blink::Vector<::base::FilePath>& file_paths, const ::blink::KURL& destination_url, OnFileUploadRequestedCallback callback) = 0;

  using OnCanSendReportingReportsCallback = base::OnceCallback<void(const ::blink::Vector<::scoped_refptr<const ::blink::SecurityOrigin>>&)>;
  using OnCanSendReportingReportsMojoCallback = base::OnceCallback<void(const ::blink::Vector<::scoped_refptr<const ::blink::SecurityOrigin>>&)>;

  virtual void OnCanSendReportingReports(const ::blink::Vector<::scoped_refptr<const ::blink::SecurityOrigin>>& origins, OnCanSendReportingReportsCallback callback) = 0;

  using OnCanSendDomainReliabilityUploadCallback = base::OnceCallback<void(bool)>;
  using OnCanSendDomainReliabilityUploadMojoCallback = base::OnceCallback<void(bool)>;

  virtual void OnCanSendDomainReliabilityUpload(const ::scoped_refptr<const ::blink::SecurityOrigin>& origin, OnCanSendDomainReliabilityUploadCallback callback) = 0;

  using OnGenerateHttpNegotiateAuthTokenCallback = base::OnceCallback<void(int32_t, const ::blink::String&)>;
  using OnGenerateHttpNegotiateAuthTokenMojoCallback = base::OnceCallback<void(int32_t, const ::blink::String&)>;

  virtual void OnGenerateHttpNegotiateAuthToken(const ::blink::String& server_auth_token, bool can_delegate, const ::blink::String& auth_negotiate_android_account_type, const ::blink::String& spn, OnGenerateHttpNegotiateAuthTokenCallback callback) = 0;

  using OnCanSendSCTAuditingReportCallback = base::OnceCallback<void(bool)>;
  using OnCanSendSCTAuditingReportMojoCallback = base::OnceCallback<void(bool)>;

  virtual void OnCanSendSCTAuditingReport(OnCanSendSCTAuditingReportCallback callback) = 0;

  virtual void OnNewSCTAuditingReportSent() = 0;
};



class BLINK_PLATFORM_EXPORT NetworkContextClientProxy
    : public NetworkContextClient {
 public:
  using InterfaceType = NetworkContextClient;

  explicit NetworkContextClientProxy(mojo::MessageReceiverWithResponder* receiver);
  
  void OnFileUploadRequested(::network::mojom::blink::OriginatingProcessIdPtr process_id, bool async, const ::blink::Vector<::base::FilePath>& file_paths, const ::blink::KURL& destination_url, OnFileUploadRequestedCallback callback) final;
  
  void OnCanSendReportingReports(const ::blink::Vector<::scoped_refptr<const ::blink::SecurityOrigin>>& origins, OnCanSendReportingReportsCallback callback) final;
  
  void OnCanSendDomainReliabilityUpload(const ::scoped_refptr<const ::blink::SecurityOrigin>& origin, OnCanSendDomainReliabilityUploadCallback callback) final;
  
  void OnGenerateHttpNegotiateAuthToken(const ::blink::String& server_auth_token, bool can_delegate, const ::blink::String& auth_negotiate_android_account_type, const ::blink::String& spn, OnGenerateHttpNegotiateAuthTokenCallback callback) final;
  
  void OnCanSendSCTAuditingReport(OnCanSendSCTAuditingReportCallback callback) final;
  
  void OnNewSCTAuditingReportSent() final;

 private:
  mojo::MessageReceiverWithResponder* receiver_;
};
class BLINK_PLATFORM_EXPORT NetworkContextClientStubDispatch {
 public:
  static bool Accept(NetworkContextClient* impl, mojo::Message* message);
  static bool AcceptWithResponder(
      NetworkContextClient* impl,
      mojo::Message* message,
      std::unique_ptr<mojo::MessageReceiverWithStatus> responder);
};

template <typename ImplRefTraits =
              mojo::RawPtrImplRefTraits<NetworkContextClient>>
class NetworkContextClientStub
    : public mojo::MessageReceiverWithResponderStatus {
 public:
  using ImplPointerType = typename ImplRefTraits::PointerType;

  NetworkContextClientStub() = default;
  ~NetworkContextClientStub() override = default;

  void set_sink(ImplPointerType sink) { sink_ = std::move(sink); }
  ImplPointerType& sink() { return sink_; }

  bool Accept(mojo::Message* message) override {
    if (ImplRefTraits::IsNull(sink_))
      return false;
    return NetworkContextClientStubDispatch::Accept(
        ImplRefTraits::GetRawPointer(&sink_), message);
  }

  bool AcceptWithResponder(
      mojo::Message* message,
      std::unique_ptr<mojo::MessageReceiverWithStatus> responder) override {
    if (ImplRefTraits::IsNull(sink_))
      return false;
    return NetworkContextClientStubDispatch::AcceptWithResponder(
        ImplRefTraits::GetRawPointer(&sink_), message, std::move(responder));
  }

 private:
  ImplPointerType sink_;
};
class BLINK_PLATFORM_EXPORT NetworkContextClientRequestValidator : public mojo::MessageReceiver {
 public:
  bool Accept(mojo::Message* message) override;
};
class BLINK_PLATFORM_EXPORT NetworkContextClientResponseValidator : public mojo::MessageReceiver {
 public:
  bool Accept(mojo::Message* message) override;
};





}  // network::mojom::blink

namespace mojo {

}  // namespace mojo

#endif  // SERVICES_NETWORK_PUBLIC_MOJOM_NETWORK_CONTEXT_CLIENT_MOJOM_BLINK_H_