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/weborigin/KURL.h" | 9 #include "platform/weborigin/KURL.h" |
10 #include "public/platform/WebURLRequest.h" | 10 #include "public/platform/WebURLRequest.h" |
11 | 11 |
12 namespace blink { | 12 namespace blink { |
13 | 13 |
14 class ScriptSourceCode; | 14 class ScriptSourceCode; |
15 class WorkletPendingTasks; | 15 class WorkletPendingTasks; |
16 | 16 |
17 // Abstracts communication from (Main/Threaded)Worklet on the main thread to | 17 // Abstracts communication from (Main/Threaded)Worklet on the main thread to |
18 // (Main/Threaded)WorkletGlobalScope so that Worklet class doesn't have to care | 18 // (Main/Threaded)WorkletGlobalScope so that Worklet class doesn't have to care |
19 // about the thread WorkletGlobalScope runs on. | 19 // about the thread WorkletGlobalScope runs on. |
20 class CORE_EXPORT WorkletGlobalScopeProxy { | 20 class CORE_EXPORT WorkletGlobalScopeProxy { |
21 public: | 21 public: |
22 virtual ~WorkletGlobalScopeProxy() {} | 22 virtual ~WorkletGlobalScopeProxy() {} |
23 | 23 |
24 // Runs the "fetch and invoke a worklet script" algorithm: | 24 // Runs the "fetch and invoke a worklet script" algorithm: |
25 // https://drafts.css-houdini.org/worklets/#fetch-and-invoke-a-worklet-script | 25 // https://drafts.css-houdini.org/worklets/#fetch-and-invoke-a-worklet-script |
26 virtual void FetchAndInvokeScript(const KURL& module_url_record, | 26 virtual void FetchAndInvokeScript(const KURL& module_url_record, |
27 WebURLRequest::FetchCredentialsMode, | 27 WebURLRequest::FetchCredentialsMode, |
28 WorkletPendingTasks*) {} | 28 WorkletPendingTasks*) = 0; |
29 | 29 |
30 // Evaluates the given script source code. This should be called only for | 30 // Evaluates the given script source code. This should be called only for |
31 // threaded worklets that still use classic script loading. | 31 // threaded worklets that still use classic script loading. |
32 virtual void EvaluateScript(const ScriptSourceCode&) = 0; | 32 virtual void EvaluateScript(const ScriptSourceCode&) = 0; |
33 | 33 |
34 // Terminates the worklet global scope from the main thread. | 34 // Terminates the worklet global scope from the main thread. |
35 virtual void TerminateWorkletGlobalScope() = 0; | 35 virtual void TerminateWorkletGlobalScope() = 0; |
36 }; | 36 }; |
37 | 37 |
38 } // namespace blink | 38 } // namespace blink |
39 | 39 |
40 #endif // WorkletGlobalScopeProxy_h | 40 #endif // WorkletGlobalScopeProxy_h |
OLD | NEW |