Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1338)

Side by Side Diff: third_party/WebKit/Source/core/workers/Worklet.h

Issue 2939773005: [POC] Implement "module responses map" concept (Closed)
Patch Set: rebase Created 3 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/WorkletGlobalScopeProxy.h" 11 #include "core/workers/WorkletGlobalScopeProxy.h"
12 #include "core/workers/WorkletModuleResponsesMap.h"
12 #include "core/workers/WorkletOptions.h" 13 #include "core/workers/WorkletOptions.h"
13 #include "platform/bindings/ScriptWrappable.h" 14 #include "platform/bindings/ScriptWrappable.h"
14 #include "platform/heap/Handle.h" 15 #include "platform/heap/Handle.h"
15 16
16 namespace blink { 17 namespace blink {
17 18
18 class LocalFrame; 19 class LocalFrame;
19 class ScriptPromiseResolver; 20 class ScriptPromiseResolver;
20 21
21 // This is the base implementation of Worklet interface defined in the spec: 22 // This is the base implementation of Worklet interface defined in the spec:
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 // necessary. CreateGlobalScope() will be called in that case. Each worklet 65 // necessary. CreateGlobalScope() will be called in that case. Each worklet
65 // can define how to pool global scopes here. 66 // can define how to pool global scopes here.
66 virtual bool NeedsToCreateGlobalScope() = 0; 67 virtual bool NeedsToCreateGlobalScope() = 0;
67 virtual WorkletGlobalScopeProxy* CreateGlobalScope() = 0; 68 virtual WorkletGlobalScopeProxy* CreateGlobalScope() = 0;
68 69
69 // "A Worklet has a list of the worklet's WorkletGlobalScopes. Initially this 70 // "A Worklet has a list of the worklet's WorkletGlobalScopes. Initially this
70 // list is empty; it is populated when the user agent chooses to create its 71 // list is empty; it is populated when the user agent chooses to create its
71 // WorkletGlobalScope." 72 // WorkletGlobalScope."
72 // https://drafts.css-houdini.org/worklets/#worklet-section 73 // https://drafts.css-houdini.org/worklets/#worklet-section
73 HeapHashSet<Member<WorkletGlobalScopeProxy>> proxies_; 74 HeapHashSet<Member<WorkletGlobalScopeProxy>> proxies_;
75
76 // "A Worklet has a module responses map. This is a ordered map of module URLs
77 // to values that are a fetch responses. The map's entries are ordered based
78 // on their insertion order. Access to this map should be thread-safe."
79 // https://drafts.css-houdini.org/worklets/#module-responses-map
80 Member<WorkletModuleResponsesMap> module_responses_map_;
74 }; 81 };
75 82
76 } // namespace blink 83 } // namespace blink
77 84
78 #endif // Worklet_h 85 #endif // Worklet_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698