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

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

Issue 2178223002: Refactor Worklet class to use ScriptResource (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add tests, DCHECK(frame) Created 4 years, 4 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 MainThreadWorkletGlobalScope_h 5 #ifndef MainThreadWorkletGlobalScope_h
6 #define MainThreadWorkletGlobalScope_h 6 #define MainThreadWorkletGlobalScope_h
7 7
8 #include "core/CoreExport.h" 8 #include "core/CoreExport.h"
9 #include "core/dom/ExecutionContext.h" 9 #include "core/dom/ExecutionContext.h"
10 #include "core/frame/LocalFrameLifecycleObserver.h" 10 #include "core/frame/LocalFrameLifecycleObserver.h"
11 #include "core/workers/WorkletGlobalScope.h" 11 #include "core/workers/WorkletGlobalScope.h"
12 #include "core/workers/WorkletGlobalScopeProxy.h" 12 #include "core/workers/WorkletGlobalScopeProxy.h"
13 13
14 namespace blink { 14 namespace blink {
15 15
16 class ConsoleMessage; 16 class ConsoleMessage;
17 class LocalFrame; 17 class LocalFrame;
18 class ScriptSourceCode;
18 19
19 class CORE_EXPORT MainThreadWorkletGlobalScope : public WorkletGlobalScope, publ ic WorkletGlobalScopeProxy, public LocalFrameLifecycleObserver { 20 class CORE_EXPORT MainThreadWorkletGlobalScope : public WorkletGlobalScope, publ ic WorkletGlobalScopeProxy, public LocalFrameLifecycleObserver {
20 public: 21 public:
21 ~MainThreadWorkletGlobalScope() override; 22 ~MainThreadWorkletGlobalScope() override;
22 bool isMainThreadWorkletGlobalScope() const final { return true; } 23 bool isMainThreadWorkletGlobalScope() const final { return true; }
23 24
24 // WorkletGlobalScopeProxy 25 // WorkletGlobalScopeProxy
25 void evaluateScript(const String& source, const KURL& scriptURL) final; 26 void evaluateScript(const ScriptSourceCode&) final;
ikilpatrick 2016/07/28 00:12:44 I'm not sure we should do this, can a ScriptSource
haraken 2016/07/28 08:52:05 ScriptSourceCode is not transferrable unfortunatel
ikilpatrick 2016/07/28 18:48:41 Gleb and I talked in person, agreed that we'll pas
26 void terminateWorkletGlobalScope() final; 27 void terminateWorkletGlobalScope() final;
27 28
28 using LocalFrameLifecycleObserver::frame; 29 using LocalFrameLifecycleObserver::frame;
29 void addConsoleMessage(ConsoleMessage*) final; 30 void addConsoleMessage(ConsoleMessage*) final;
30 void exceptionThrown(const String& errorMessage, std::unique_ptr<SourceLocat ion>) final; 31 void exceptionThrown(const String& errorMessage, std::unique_ptr<SourceLocat ion>) final;
31 32
32 DEFINE_INLINE_VIRTUAL_TRACE() 33 DEFINE_INLINE_VIRTUAL_TRACE()
33 { 34 {
34 WorkletGlobalScope::trace(visitor); 35 WorkletGlobalScope::trace(visitor);
35 LocalFrameLifecycleObserver::trace(visitor); 36 LocalFrameLifecycleObserver::trace(visitor);
36 } 37 }
37 38
38 protected: 39 protected:
39 MainThreadWorkletGlobalScope(LocalFrame*, const KURL&, const String& userAge nt, PassRefPtr<SecurityOrigin>, v8::Isolate*); 40 MainThreadWorkletGlobalScope(LocalFrame*, const KURL&, const String& userAge nt, PassRefPtr<SecurityOrigin>, v8::Isolate*);
40 }; 41 };
41 42
42 DEFINE_TYPE_CASTS(MainThreadWorkletGlobalScope, ExecutionContext, context, conte xt->isMainThreadWorkletGlobalScope(), context.isMainThreadWorkletGlobalScope()); 43 DEFINE_TYPE_CASTS(MainThreadWorkletGlobalScope, ExecutionContext, context, conte xt->isMainThreadWorkletGlobalScope(), context.isMainThreadWorkletGlobalScope());
43 44
44 } // namespace blink 45 } // namespace blink
45 46
46 #endif // MainThreadWorkletGlobalScope_h 47 #endif // MainThreadWorkletGlobalScope_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698