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 WorkletGlobalScopeProxy_h | 5 #ifndef WorkletGlobalScopeProxy_h |
6 #define WorkletGlobalScopeProxy_h | 6 #define WorkletGlobalScopeProxy_h |
7 | 7 |
8 #include "core/CoreExport.h" | 8 #include "core/CoreExport.h" |
9 #include "platform/WebTaskRunner.h" | 9 #include "platform/WebTaskRunner.h" |
10 #include "platform/heap/GarbageCollected.h" | 10 #include "platform/heap/GarbageCollected.h" |
11 #include "platform/weborigin/KURL.h" | 11 #include "platform/weborigin/KURL.h" |
12 #include "public/platform/WebURLRequest.h" | 12 #include "public/platform/WebURLRequest.h" |
13 | 13 |
14 namespace blink { | 14 namespace blink { |
15 | 15 |
| 16 class WorkletModuleResponsesMap; |
16 class WorkletPendingTasks; | 17 class WorkletPendingTasks; |
17 | 18 |
18 // Abstracts communication from (Main/Threaded)Worklet on the main thread to | 19 // Abstracts communication from (Main/Threaded)Worklet on the main thread to |
19 // (Main/Threaded)WorkletGlobalScope so that Worklet class doesn't have to care | 20 // (Main/Threaded)WorkletGlobalScope so that Worklet class doesn't have to care |
20 // about the thread WorkletGlobalScope runs on. | 21 // about the thread WorkletGlobalScope runs on. |
21 class CORE_EXPORT WorkletGlobalScopeProxy : public GarbageCollectedMixin { | 22 class CORE_EXPORT WorkletGlobalScopeProxy : public GarbageCollectedMixin { |
22 public: | 23 public: |
23 virtual ~WorkletGlobalScopeProxy() {} | 24 virtual ~WorkletGlobalScopeProxy() {} |
24 | 25 |
25 // Runs the "fetch and invoke a worklet script" algorithm: | 26 // Runs the "fetch and invoke a worklet script" algorithm: |
26 // https://drafts.css-houdini.org/worklets/#fetch-and-invoke-a-worklet-script | 27 // https://drafts.css-houdini.org/worklets/#fetch-and-invoke-a-worklet-script |
27 virtual void FetchAndInvokeScript( | 28 virtual void FetchAndInvokeScript( |
28 const KURL& module_url_record, | 29 const KURL& module_url_record, |
| 30 WorkletModuleResponsesMap*, |
29 WebURLRequest::FetchCredentialsMode, | 31 WebURLRequest::FetchCredentialsMode, |
30 RefPtr<WebTaskRunner> outside_settings_task_runner, | 32 RefPtr<WebTaskRunner> outside_settings_task_runner, |
31 WorkletPendingTasks*) = 0; | 33 WorkletPendingTasks*) = 0; |
32 | 34 |
33 // Notifies that the Worklet object is destroyed. This should be called in the | 35 // Notifies that the Worklet object is destroyed. This should be called in the |
34 // destructor of the Worklet object. This may call | 36 // destructor of the Worklet object. This may call |
35 // ThreadedMessagingProxy::ParentObjectDestroyed() and cause deletion of | 37 // ThreadedMessagingProxy::ParentObjectDestroyed() and cause deletion of |
36 // |this|. See comments on ParentObjectDestroyed() for details. | 38 // |this|. See comments on ParentObjectDestroyed() for details. |
37 virtual void WorkletObjectDestroyed() = 0; | 39 virtual void WorkletObjectDestroyed() = 0; |
38 | 40 |
39 // Terminates the worklet global scope from the main thread. | 41 // Terminates the worklet global scope from the main thread. |
40 virtual void TerminateWorkletGlobalScope() = 0; | 42 virtual void TerminateWorkletGlobalScope() = 0; |
41 }; | 43 }; |
42 | 44 |
43 } // namespace blink | 45 } // namespace blink |
44 | 46 |
45 #endif // WorkletGlobalScopeProxy_h | 47 #endif // WorkletGlobalScopeProxy_h |
OLD | NEW |