// third_party/blink/public/mojom/loader/code_cache.mojom-blink-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_LOADER_CODE_CACHE_MOJOM_BLINK_TEST_UTILS_H_
#define THIRD_PARTY_BLINK_PUBLIC_MOJOM_LOADER_CODE_CACHE_MOJOM_BLINK_TEST_UTILS_H_

#include "third_party/blink/public/mojom/loader/code_cache.mojom-blink.h"
#include "third_party/blink/renderer/platform/platform_export.h"


namespace blink::mojom::blink {


class PLATFORM_EXPORT CodeCacheHostInterceptorForTesting : public CodeCacheHost {
  virtual CodeCacheHost* GetForwardingInterface() = 0;
  void GetPendingBackend(CodeCacheType cache_type, GetPendingBackendCallback callback) override;
  void DidGenerateCacheableMetadata(CodeCacheType cache_type, const ::blink::KURL& url, ::base::Time expected_response_time, ::mojo_base::BigBuffer data) override;
  void DidGenerateSourceKeyedCacheableMetadata(const ::blink::Vector<uint8_t>& script_hash, ::mojo_base::BigBuffer data) override;
  void FetchCachedCode(CodeCacheType cache_type, const ::blink::KURL& url, FetchCachedCodeCallback callback) override;
  void ClearCodeCacheEntry(CodeCacheType cache_type, const ::blink::KURL& url) override;
  void DidGenerateCacheableMetadataInCacheStorage(const ::blink::KURL& url, ::base::Time expected_response_time, ::mojo_base::BigBuffer data, const ::blink::String& cache_storage_cache_name) override;
};
class PLATFORM_EXPORT CodeCacheHostAsyncWaiter {
 public:
  explicit CodeCacheHostAsyncWaiter(CodeCacheHost* proxy);

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

  ~CodeCacheHostAsyncWaiter();
  void GetPendingBackend(
      CodeCacheType cache_type, std::optional<::persistent_cache::PendingBackend>* out_pending_backend);
  std::optional<::persistent_cache::PendingBackend> GetPendingBackend(CodeCacheType cache_type);
  void FetchCachedCode(
      CodeCacheType cache_type, const ::blink::KURL& url, ::base::Time* out_response_time, ::mojo_base::BigBuffer* out_data);
  

 private:
  CodeCacheHost* const proxy_;
};




}  // blink::mojom::blink

#endif  // THIRD_PARTY_BLINK_PUBLIC_MOJOM_LOADER_CODE_CACHE_MOJOM_BLINK_TEST_UTILS_H_