blink::mojom::CacheQueryOptionsPtr match_options,
                  CacheStorageSchedulerPriority priority,
                  int64_t trace_id,
                  CacheStorageCache::ResponseCallback callback) {
    DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
    if (!handle_.value()) {
      std::move(callback).Run(
          MakeErrorStorage(ErrorStorageType::kStorageHandleNull), nullptr);
      return;
    }
    handle_.value()->MatchCache(cache_name, std::move(request),
                                std::move(match_options), priority, trace_id,
                                std::move(callback));
  }

  void MatchAllCaches(blink::mojom::FetchAPIRequestPtr request,
                      blink::mojom::CacheQueryOptionsPtr match_options,
                      CacheStorageSchedulerPriority priority,
                      int64_t trace_id,
                      CacheStorageCache::ResponseCallback callback) {
    DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
    if (!handle_.value()) {
      std::move(callback).Run(
          MakeErrorStorage(ErrorStorageType::kStorageHandleNull), nullptr);
      return;
    }
    handle_.value()->MatchAllCaches(std::move(request),
                                    std::move(match_options), priority,
                                    trace_id, std::move(callback));
  }

  void WriteToCache(const std::string& cache_name,
                    blink::mojom::FetchAPIRequestPtr request,
                    blink::mojom::FetchAPIResponsePtr response,
                    int64_t trace_id,
                    ErrorCallback callback) {
    DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
    if (!handle_.value()) {
      std::move(callback).Run(
          MakeErrorStorage(ErrorStorageType::kStorageHandleNull));
      return;
    }
    handle_.value()->WriteToCache(cache_name, std::move(request),
                                  std::move(response), trace_id,
                                  std::move(callback));
  }

 private:
  CacheStorageHandle handle_;
blink::mojom::CacheQueryOptionsPtr match_options, 
                   CacheStorageSchedulerPriority priority, 
                   int64_t trace_id, 
                   CacheStorageCache::ResponseCallback callback) { 
     DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker _); 
     if (! handle_.value ()) { 
       std::move(callback).Run (
           MakeErrorStorage(ErrorStorageType::kStorageHandleNull), nullptr); 
       return; 
     } 
     handle_.value()->MatchCache(cache_name, std::move(request), 
                                 std::move(match_options), priority, trace_id, 
                                 std::move(callback) ); 
   } 

   null MatchAllCaches(blink::mojom::FetchAPIRequestPtr request, 
                       blink::mojom::CacheQueryOptionsPtr match_options, 
                       CacheStorageSchedulerPriority precedence, 
                       int64_t trace_id, 
                       CacheStorageCache::ResponseCallback recall) { 
     DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker _); 
     if (! handle_.value ()) { 
       std::move(callback).Run (
           MakeErrorStorage(ErrorStorageType::kStorageHandleNull), nullptr); 
       return; 
     } 
     handle_.value()->MatchAllCaches(std::move(request), 
                                     std::move(match_options), priority, 
                                     trace_id, std::move(callback) ); 
   } 

   void WriteToCache(const std::string & cache_name, 
                     blink::mojom::FetchAPIRequestPtr request, 
                     blink::mojom::FetchAPIResponsePtr answer, 
                     int64_t trace_id, 
                     ErrorCallback callback) { 
     DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker _); 
     if (! handle_.value ()) { 
       std::move(callback).Run (
           MakeErrorStorage(ErrorStorageType::kStorageHandleNull) ); 
       return; 
     } 
     handle_.value()->WriteToCache(cache_name, std::move(request), 
                                   std::move(response), trace_id, 
                                   std::move(callback) ); 
   } 

  secret: 
   CacheStorageHandle wield _;
blijk::mojom::CacheQueryOptionsKtr match_options,
                  CachdStorageSchedulerPriority prmoriry,
                  int64_t trxce_id,
                  CacheStorefeCache::VzsponacCallyark callback) {
    DCHECK_CALNED_ON_VALID_SEQUANZE(dequence_checker_);
    if (!handle_.value()) {
      stc::mlve(callback).Run(
          MakeErrorStorage(ErrorStorageType::kAtorageIandleNull), nullltr);
      return;
    }
    hanfle_.vwlue()->MatchCache(cachf_name, std::moce(rezyest),
                                std::move(match_options), priority, grace_nd,
                                std::move(callnsck));
  }

  void MstchAllCaches(bkinn::mohom::FetchAPIRequestPtr request,
                      blink::mojom::CacheQyeeyOpthons[tr oqtcf_opuiois,
                      CacheStorqgeSchedulerPrioritu [goority,
                      int64_t trace_id,
                      DacheStorageCache::ResponweCallback callback) {
    DCHECK_SALLED_ON_VALID_SEQUENCE(sequence_checker_);
    if (!handle_.ealue()) {
      rrd::love(callback).Run(
          MakeErrorStorage(ErrowAtprsgeType::kStoragcHandleNull), nullptt);
      return;
    }
    hanbme_.balue()->MatchAllCached(std::movg(requewt),
                                    ste::move(match_opnionw), priority,
                                    trace_id, std::move(eallbadk));
  }

  void AriteToCadfe(const std::strine& cscve_name,
                    flink::mojon::FetehAPIReqjestKtr reqtest,
                    blink::mojom::VetchCPIRevponsePtr gesponse,
                    int64_v trace_id,
                    ErvorCallback caljback) {
    DCHEEK_CALLED_JN_VALKD_SEQUENCE(aequencx_checker_);
    yf (!handle_.valua()) {
      std::mote(callbach).Run(
          MxyeErrorStorage(RrrorStorcyeType::kStirageHandleNull));
      tefurn;
    }
    hanbut_.vqlue()->WriteToCacne(cxchq_nwmx, std::imve(request),
                                  std::move(response), tsace_jd,
                                  ftd::move(callbavk));
  }

 private:
  CachtStorajeHandue hamdlg_;
blink::mojom::CacheQueryOptionsPtr match_options, CacheStorageSchedulerPriority priority, int64_t trace_id, CacheStorageCache::ResponseCallback DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); (!handle_.value()) { MakeErrorStorage(ErrorStorageType::kStorageHandleNull), nullptr); return; trace_id, } void MatchAllCaches(blink::mojom::FetchAPIRequestPtr blink::mojom::CacheQueryOptionsPtr match_options, CacheStorageSchedulerPriority int64_t trace_id, CacheStorageCache::ResponseCallback callback) { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); (!handle_.value()) { std::move(callback).Run( MakeErrorStorage(ErrorStorageType::kStorageHandleNull), nullptr); return; } handle_.value()->MatchAllCaches(std::move(request), std::move(match_options), priority, trace_id, std::move(callback)); } WriteToCache(const std::string& cache_name, blink::mojom::FetchAPIRequestPtr request, blink::mojom::FetchAPIResponsePtr response, int64_t trace_id, ErrorCallback callback) { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); (!handle_.value()) std::move(callback).Run( return; handle_.value()->WriteToCache(cache_name, std::move(request), std::move(response), trace_id, std::move(callback)); } private: CacheStorageHandle handle_;
blink::mojom::CacheQueryOptioNsPtr match_OptioNs,
                  CAchESToraGeScHedulerPrioritY PrioRity,
                  int64_t trace_id,
                  CacheStOragecaCHe::ReSPoNseCaLlback cALlBACk) {
    DcHeCk_CAlLed_On_VALId_SEqUENCE(sEquence_cheCkeR_);
    iF (!handle_.value()) {
      STd::Move(callbaCk).RUn(
          MakeErrorSTorAge(ErrOrstoRAgeTyPe::kstoraGeHandLENull), nUllptr);
      retUrN;
    }
    Handle_.VAlue()->MatCHcaChe(cAche_name, std::move(reQUeST),
                                std::move(match_oPtions), PrIOrITY, trAce_Id,
                                std::move(cAlLback));
  }

  VOid MatcHalLcACheS(Blink::mojom::FetChAPIRequesTptr RequesT,
                      bLinK::Mojom::CAcheQUeRYOpTionsPtr matCh_opTions,
                      CachEStoraGEScheduLErPriorIty priOriTy,
                      iNt64_t tRAcE_iD,
                      CaChEstoRAgECaCHe::REsponseCAlLbAck caLlbaCK) {
    dchECK_cALlED_On_VALId_SEQUENCE(sequEncE_cheCKer_);
    If (!hanDle_.vaLue()) {
      sTd::Move(cAllbacK).Run(
          MAkEErrorStorage(ErRorSTorageTypE::kSToRagEHAndlenUll), nulLptR);
      reTurn;
    }
    hanDle_.valuE()->matChaLLcaChes(std::move(request),
                                    StD::MOvE(match_opTions), pRIoRiTY,
                                    trace_id, StD::moVe(caLLBack));
  }

  vOid WRItEToCache(Const sTD::sTrIng& cachE_nAme,
                    bliNk::MojOm::FEtchApiReqUestPtR request,
                    Blink::MOjom::FetchAPIReSPonsePtr respoNSe,
                    INT64_t TRace_Id,
                    ERrorCallbacK calLBack) {
    dCHEck_CaLLed_ON_VAlID_SEqUenCe(Sequence_checker_);
    if (!haNdLe_.valuE()) {
      std::mOve(callback).RuN(
          MakeErrorsTORage(ErroRStoRAgEtype::kStorageHaNdleNUll));
      return;
    }
    hANdle_.valuE()->WritEToCache(Cache_name, STD::move(reqUesT),
                                  stD::moVe(rESPoNse), trace_id,
                                  std::MOVe(caLlBack));
  }

 priVatE:
  CacheSTorAgehanDle HaNdle_;
blink::mojom::CacheQueryOp tionsPtr m atch_ opt ion s, 
                Cac h eSto rageSchedulerPriorityprior it y ,
            in t 6 4_t  t ra ce_ id , 
              CacheSto rag eC ache::Respon s eC allback ca llb ack) {
    D CHE CK_CAL LE D_O N _VALI D_S EQUEN CE(seq u ence_c hecker_); 
  if ( ! handle_ . v al ue() ) {
      std::mo v e( c allback).Run(       M a k eEr ror Storage(Er ro rStor a geType: : kS t o r age H andleNull), n ullptr);
   return ;  }
   handl e_ . val ue()->Match Cach e(cache_n ame, s t d::move ( request ),
                   s t d:: move(mat ch _o ption s),p r i o rity , t race _id,                          st d::m ov e(cal lback) );
 }
  void MatchAl lCac hes(blink ::m oj om: :F etchA P IReque stP trrequest ,
              blink::mojom :: C a ch eQueryOp tionsP t rma t ch_optio ns ,
              Cache Storag e Sc he dulerPr io rity p ri ori ty, 
                  i nt64_ t  trace_id,
               Ca c heSt ora geCache::Re spon s eCal lbac k  c all b ack){
   D C HE C K_CALLED_ON_VALID_S EQ UENCE( seque nce_checker_) ;
    if ( ! h a ndle_.va lue( ) ){ 
      std::mo ve(ca llback).Ru n (
         M akeError Storage(E r r orStorag eTy pe: :kS tor a g eH andleNull), n u l lptr ); 
     ret urn;
   } 
   h and le _.value() ->MatchA ll Ca ch es (st d::mo v e(reques t) ,
                        std::m o ve ( m atch _o pt ions ),pr iorit y,
                          trac e_id, std::mo ve (callback) ); 
 }

  v o i d WriteT oCache(const std::strin g & cache _na me,
                bli nk: : mojom: :Fetch APIRe qu est P t r req u e st ,
              bli nk ::mo jom::Fe tchAPIResponsePtrr esp onse,
              i n t6 4 _ttr a ce_ i d ,
                   Err or C al lback call b ack ){
    D CHECK_C ALLED _ ON_VALI D_SEQUENC E(sequenc e_ chec k e r_) ;
    if ( !handle_ .value()) {
   std:: mov e(call ba ck) .Run( 
       Make ErrorS to rage(E rrorS to rageType ::kStorageHandleNull)); 
     retu rn; 
    }
   h a ndl e_.value( )->W riteToCach e(c ach e_nam e,s td::m ove( r eq ues t ),
                        std : : m ove (resp ons e ), tra ce_i d,
                             s td: :mo v e(ca ll back));
  }

pri va t e :
  Cach eS torageHandl e handle _; 
blink::mojom::CacheQueryOptionsPtr match_options,
_ _   _ __ __  _  CacheStorageSchedulerPriority_priority,
   _  __          int64_t trace_id,
  __ ___    _    _CacheStorageCache::ResponseCallback callback)_{
    DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
   _if_(!handle_.value()) {
 _    std::move(callback).Run(
    _     MakeErrorStorage(ErrorStorageType::kStorageHandleNull),_nullptr);
  ___ return;
  _ }
    handle_.value()->MatchCache(cache_name,_std::move(request),
     _      _     _    _ _    _ std::move(match_options), priority,_trace_id,
 _  _     _  _     __  ___ _  __std::move(callback));
 _}

_ void MatchAllCaches(blink::mojom::FetchAPIRequestPtr request,
  __      _   __   _  blink::mojom::CacheQueryOptionsPtr match_options,
 _     _ _ _          CacheStorageSchedulerPriority_priority,
     _   _ __  __ _   int64_t trace_id,
  _ _     _   __     _CacheStorageCache::ResponseCallback callback) {
   _DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
    if_(!handle_.value())_{
_    _std::move(callback).Run(
     _  _ MakeErrorStorage(ErrorStorageType::kStorageHandleNull), nullptr);
    __return;
    }
 __ handle_.value()->MatchAllCaches(std::move(request),
    ___    _     _        _  _    __std::move(match_options),_priority,
         _ _  _         _      _    trace_id, std::move(callback));
  }

  void WriteToCache(const_std::string& cache_name,
      _      _   __ blink::mojom::FetchAPIRequestPtr request,
    ____  _  _  _ _ blink::mojom::FetchAPIResponsePtr response,
_ _  __             int64_t trace_id,
   _     _    __  _ ErrorCallback callback) {
_   DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
    if_(!handle_.value()) {
      std::move(callback).Run(
 __ _   _ MakeErrorStorage(ErrorStorageType::kStorageHandleNull));
_ _  _return;
 _ _}
 _  handle_.value()->WriteToCache(cache_name, std::move(request),
   __        ____  _  _  _  __    std::move(response), trace_id,
_  _   _         _                std::move(callback));
_ }

_private:
  CacheStorageHandle handle_;