// Copyright 2018 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_RENDERER_PLATFORM_LOADER_FETCH_RESOURCE_FETCHER_PROPERTIES_H_ #define THIRD_PARTY_BLINK_RENDERER_PLATFORM_LOADER_FETCH_RESOURCE_FETCHER_PROPERTIES_H_ #include "third_party/blink/public/mojom/service_worker/controller_service_worker_mode.mojom-blink.h" #include "third_party/blink/renderer/platform/heap/garbage_collected.h" #include "third_party/blink/renderer/platform/heap/member.h" #include "third_party/blink/renderer/platform/loader/fetch/loader_freeze_mode.h" #include "third_party/blink/renderer/platform/loader/fetch/url_loader/url_loader.h" #include "third_party/blink/renderer/platform/platform_export.h" #include "third_party/blink/renderer/platform/scheduler/public/frame_status.h" #include "third_party/blink/renderer/platform/weborigin/kurl.h" #include "third_party/blink/renderer/platform/weborigin/security_origin.h" namespace blink { class FetchClientSettingsObject; // ResourceFetcherProperties consists of properties of the global context (e.g., // Frame, Worker) necessary to fetch resources. FetchClientSettingsObject // implementing https://html.spec.whatwg.org/C/webappapis.html#settings-object // is one such example. // // This class consists of pure virtual getters. Do not put operations. Do not // put getters for a specific request such as // GetCachePolicy(const ResourceRequest&, ResourceType). Do not put a function // with default implementation. // // Storing a non-null ResourceFetcherProperties in an object that can be valid // after the associated ResourceFetcher is detached is dangerous. Use // DetachedResourceFetcherProperties below. // // The distinction between FetchClientSettingsObject and // ResourceFetcherProperties is sometimes ambiguous. Put a property in // FetchClientSettingsObject when the property is clearly defined in the spec. // Otherwise, put it to this class. class PLATFORM_EXPORT ResourceFetcherProperties : public GarbageCollected<ResourceFetcherProperties> { … }; // A delegating ResourceFetcherProperties subclass which can be retained // even when the associated ResourceFetcher is detached. class PLATFORM_EXPORT DetachableResourceFetcherProperties final : public ResourceFetcherProperties { … }; } // namespace blink #endif // THIRD_PARTY_BLINK_RENDERER_PLATFORM_LOADER_FETCH_RESOURCE_FETCHER_PROPERTIES_H_