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 #ifndef Worklet_h | 5 #ifndef Worklet_h |
6 #define Worklet_h | 6 #define Worklet_h |
7 | 7 |
8 #include "bindings/core/v8/ScriptPromise.h" | 8 #include "bindings/core/v8/ScriptPromise.h" |
9 #include "core/CoreExport.h" | 9 #include "core/CoreExport.h" |
10 #include "core/dom/ContextLifecycleObserver.h" | 10 #include "core/dom/ContextLifecycleObserver.h" |
11 #include "core/workers/WorkletOptions.h" | 11 #include "core/workers/WorkletOptions.h" |
12 #include "platform/bindings/ScriptWrappable.h" | 12 #include "platform/bindings/ScriptWrappable.h" |
13 #include "platform/heap/Handle.h" | 13 #include "platform/heap/Handle.h" |
| 14 #include "public/platform/WebURLRequest.h" |
14 | 15 |
15 namespace blink { | 16 namespace blink { |
16 | 17 |
17 class LocalFrame; | 18 class LocalFrame; |
18 class ScriptPromiseResolver; | 19 class ScriptPromiseResolver; |
19 | 20 |
20 // This is the base implementation of Worklet interface defined in the spec: | 21 // This is the base implementation of Worklet interface defined in the spec: |
21 // https://drafts.css-houdini.org/worklets/#worklet | 22 // https://drafts.css-houdini.org/worklets/#worklet |
22 // Although some worklets run off the main thread, this must be created and | 23 // Although some worklets run off the main thread, this must be created and |
23 // destroyed on the main thread. | 24 // destroyed on the main thread. |
(...skipping 12 matching lines...) Expand all Loading... |
36 virtual ScriptPromise addModule(ScriptState*, | 37 virtual ScriptPromise addModule(ScriptState*, |
37 const String& module_url, | 38 const String& module_url, |
38 const WorkletOptions&); | 39 const WorkletOptions&); |
39 | 40 |
40 DECLARE_VIRTUAL_TRACE(); | 41 DECLARE_VIRTUAL_TRACE(); |
41 | 42 |
42 protected: | 43 protected: |
43 // The Worklet inherits the url and userAgent from the frame->document(). | 44 // The Worklet inherits the url and userAgent from the frame->document(). |
44 explicit Worklet(LocalFrame*); | 45 explicit Worklet(LocalFrame*); |
45 | 46 |
| 47 WebURLRequest::FetchCredentialsMode ParseCredentialsOption( |
| 48 const String& credentials_option); |
| 49 |
46 private: | 50 private: |
47 virtual void FetchAndInvokeScript(const KURL& module_url_record, | 51 virtual void FetchAndInvokeScript(const KURL& module_url_record, |
48 const WorkletOptions&, | 52 const WorkletOptions&, |
49 ScriptPromiseResolver*) = 0; | 53 ScriptPromiseResolver*) = 0; |
50 }; | 54 }; |
51 | 55 |
52 } // namespace blink | 56 } // namespace blink |
53 | 57 |
54 #endif // Worklet_h | 58 #endif // Worklet_h |
OLD | NEW |