diff --git a/blink/renderer/bindings/core/v8/worker_or_worklet_script_controller.cc b/blink/renderer/bindings/core/v8/worker_or_worklet_script_controller.cc index 5103c2860f57..41f631967ed3 100644 --- a/blink/renderer/bindings/core/v8/worker_or_worklet_script_controller.cc +++ b/blink/renderer/bindings/core/v8/worker_or_worklet_script_controller.cc @@ -329,20 +329,10 @@ ScriptEvaluationResult WorkerOrWorkletScriptController::EvaluateAndReturnValue( // Use default ReferrerScriptInfo here, as // - A work{er,let} script doesn't have a nonce, and // - a work{er,let} script is always "not parser inserted". - // TODO(crbug/1114988): After crbug/1114988 is fixed, this can be the - // default ScriptFetchOptions(). Currently the default ScriptFetchOptions() - // is not used because it has CredentialsMode::kOmit. - // TODO(crbug/1114989): Plumb this from ClassicScript. - ScriptFetchOptions script_fetch_options( - String(), IntegrityMetadataSet(), String(), - ParserDisposition::kNotParserInserted, - network::mojom::CredentialsMode::kSameOrigin, - network::mojom::ReferrerPolicy::kDefault, - mojom::blink::FetchImportanceMode::kImportanceAuto); - + // TODO(crbug/1114989): Plumb ScriptFetchOptions from ClassicScript. ScriptEvaluationResult result = V8ScriptRunner::CompileAndRunScript( isolate_, script_state_, global_scope_, source_code, base_url, - sanitize_script_errors, script_fetch_options, v8_cache_options, + sanitize_script_errors, ScriptFetchOptions(), v8_cache_options, std::move(rethrow_errors)); if (result.GetResultType() == ScriptEvaluationResult::ResultType::kAborted) diff --git a/blink/renderer/platform/loader/fetch/script_fetch_options.h b/blink/renderer/platform/loader/fetch/script_fetch_options.h index 41ea4c6c93e9..13a4cbd2c6fb 100644 --- a/blink/renderer/platform/loader/fetch/script_fetch_options.h +++ b/blink/renderer/platform/loader/fetch/script_fetch_options.h @@ -32,14 +32,11 @@ class PLATFORM_EXPORT ScriptFetchOptions final { // https://html.spec.whatwg.org/C/#default-classic-script-fetch-options // "The default classic script fetch options are a script fetch options whose // cryptographic nonce is the empty string, integrity metadata is the empty - // string, parser metadata is "not-parser-inserted", and credentials mode - // is "omit"." [spec text] - // TODO(domfarolino): Update this to use probably "include" or "same-origin" - // credentials mode, once spec decision is made at - // https://github.com/whatwg/html/pull/3656. + // string, parser metadata is "not-parser-inserted", credentials mode is + // "same-origin", and referrer policy is the empty string." [spec text] ScriptFetchOptions() : parser_state_(ParserDisposition::kNotParserInserted), - credentials_mode_(network::mojom::CredentialsMode::kOmit), + credentials_mode_(network::mojom::CredentialsMode::kSameOrigin), referrer_policy_(network::mojom::ReferrerPolicy::kDefault), importance_(mojom::FetchImportanceMode::kImportanceAuto) {}