OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "core/workers/Worklet.h" | 5 #include "core/workers/Worklet.h" |
6 | 6 |
7 #include "bindings/core/v8/ScriptPromiseResolver.h" | 7 #include "bindings/core/v8/ScriptPromiseResolver.h" |
8 #include "core/dom/DOMException.h" | 8 #include "core/dom/DOMException.h" |
9 #include "core/dom/Document.h" | 9 #include "core/dom/Document.h" |
10 #include "core/dom/TaskRunnerHelper.h" | 10 #include "core/dom/TaskRunnerHelper.h" |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 // |kUnspecedLoading| is used here because this is a part of script module | 55 // |kUnspecedLoading| is used here because this is a part of script module |
56 // loading. | 56 // loading. |
57 TaskRunnerHelper::Get(TaskType::kUnspecedLoading, script_state) | 57 TaskRunnerHelper::Get(TaskType::kUnspecedLoading, script_state) |
58 ->PostTask( | 58 ->PostTask( |
59 BLINK_FROM_HERE, | 59 BLINK_FROM_HERE, |
60 WTF::Bind(&Worklet::FetchAndInvokeScript, WrapPersistent(this), | 60 WTF::Bind(&Worklet::FetchAndInvokeScript, WrapPersistent(this), |
61 module_url_record, options, WrapPersistent(resolver))); | 61 module_url_record, options, WrapPersistent(resolver))); |
62 return promise; | 62 return promise; |
63 } | 63 } |
64 | 64 |
| 65 WebURLRequest::FetchCredentialsMode Worklet::ParseCredentialsOption( |
| 66 const String& credentials_option) { |
| 67 if (credentials_option == "omit") |
| 68 return WebURLRequest::kFetchCredentialsModeOmit; |
| 69 if (credentials_option == "same-origin") |
| 70 return WebURLRequest::kFetchCredentialsModeSameOrigin; |
| 71 if (credentials_option == "include") |
| 72 return WebURLRequest::kFetchCredentialsModeInclude; |
| 73 NOTREACHED(); |
| 74 return WebURLRequest::kFetchCredentialsModeOmit; |
| 75 } |
| 76 |
65 DEFINE_TRACE(Worklet) { | 77 DEFINE_TRACE(Worklet) { |
66 ContextLifecycleObserver::Trace(visitor); | 78 ContextLifecycleObserver::Trace(visitor); |
67 } | 79 } |
68 | 80 |
69 } // namespace blink | 81 } // namespace blink |
OLD | NEW |