// 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_FETCH_CLIENT_SETTINGS_OBJECT_SNAPSHOT_H_ #define THIRD_PARTY_BLINK_RENDERER_PLATFORM_LOADER_FETCH_FETCH_CLIENT_SETTINGS_OBJECT_SNAPSHOT_H_ #include "services/network/public/mojom/referrer_policy.mojom-blink.h" #include "third_party/blink/public/mojom/security_context/insecure_request_policy.mojom-blink-forward.h" #include "third_party/blink/renderer/platform/loader/fetch/fetch_client_settings_object.h" #include "third_party/blink/renderer/platform/platform_export.h" #include "third_party/blink/renderer/platform/weborigin/kurl.h" #include "third_party/blink/renderer/platform/weborigin/security_origin.h" #include "third_party/blink/renderer/platform/wtf/cross_thread_copier.h" namespace blink { // This class is needed to copy a FetchClientSettingsObjectSnapshot across // threads, because it has some members which cannot be transferred across // threads (SecurityOrigin for example). // There are some rules / restrictions: // - This struct cannot contain an object that cannot be transferred across // threads. // - Non-thread-safe members need explicit copying rather than the copy // constructor or the assignment operator. // - This struct cannot contain any garbage-collected object because this // data can be constructed on a thread which runs without Oilpan. struct CrossThreadFetchClientSettingsObjectData { … }; // This takes a partial snapshot of the execution context's states so that an // instance of this class can be passed to another thread without cross-thread // synchronization. Don't keep this object persistently, instead create a new // instance per each "fetch a module script graph" algorithm: // https://html.spec.whatwg.org/C/#fetch-a-module-script-tree // https://html.spec.whatwg.org/C/#fetch-a-module-worker-script-tree // // This class should be used only for main worker (worklet) script loading. For // other resources, FetchClientSettingsObjectImpl should be used. See the class // level comments on that class. class PLATFORM_EXPORT FetchClientSettingsObjectSnapshot final : public FetchClientSettingsObject { … }; } // namespace blink #endif // THIRD_PARTY_BLINK_RENDERER_PLATFORM_LOADER_FETCH_FETCH_CLIENT_SETTINGS_OBJECT_SNAPSHOT_H_