#ifndef CONTENT_BROWSER_BACKGROUND_FETCH_BACKGROUND_FETCH_REQUEST_MATCH_PARAMS_H_
#define CONTENT_BROWSER_BACKGROUND_FETCH_BACKGROUND_FETCH_REQUEST_MATCH_PARAMS_H_
#include "content/common/content_export.h"
#include "third_party/blink/public/mojom/cache_storage/cache_storage.mojom.h"
namespace content {
class CONTENT_EXPORT BackgroundFetchRequestMatchParams {
public:
BackgroundFetchRequestMatchParams();
BackgroundFetchRequestMatchParams(
blink::mojom::FetchAPIRequestPtr request_to_match,
blink::mojom::CacheQueryOptionsPtr cache_query_options,
bool match_all);
BackgroundFetchRequestMatchParams(const BackgroundFetchRequestMatchParams&) =
delete;
BackgroundFetchRequestMatchParams& operator=(
const BackgroundFetchRequestMatchParams&) = delete;
~BackgroundFetchRequestMatchParams();
bool FilterByRequest() const { return !request_to_match_.is_null(); }
const blink::mojom::FetchAPIRequestPtr& request_to_match() const {
DCHECK(request_to_match_);
return request_to_match_;
}
const blink::mojom::CacheQueryOptionsPtr& cache_query_options() const {
return cache_query_options_;
}
blink::mojom::CacheQueryOptionsPtr cloned_cache_query_options() const {
if (!cache_query_options_)
return nullptr;
return cache_query_options_->Clone();
}
bool match_all() const { return match_all_; }
private:
blink::mojom::FetchAPIRequestPtr request_to_match_;
blink::mojom::CacheQueryOptionsPtr cache_query_options_;
bool match_all_ = false;
};
}
#endif