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

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

Issue 2178223002: Refactor Worklet class to use ScriptResource (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: synced to the head 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 #include "core/workers/MainThreadWorkletGlobalScope.h" 5 #include "core/workers/MainThreadWorkletGlobalScope.h"
6 6
7 #include "bindings/core/v8/ScriptSourceCode.h" 7 #include "bindings/core/v8/ScriptSourceCode.h"
8 #include "bindings/core/v8/WorkerOrWorkletScriptController.h" 8 #include "bindings/core/v8/WorkerOrWorkletScriptController.h"
9 #include "core/frame/FrameConsole.h" 9 #include "core/frame/FrameConsole.h"
10 #include "core/inspector/MainThreadDebugger.h" 10 #include "core/inspector/MainThreadDebugger.h"
11 11
12 namespace blink { 12 namespace blink {
13 13
14 MainThreadWorkletGlobalScope::MainThreadWorkletGlobalScope(LocalFrame* frame, co nst KURL& url, const String& userAgent, PassRefPtr<SecurityOrigin> securityOrigi n, v8::Isolate* isolate) 14 MainThreadWorkletGlobalScope::MainThreadWorkletGlobalScope(LocalFrame* frame, co nst KURL& url, const String& userAgent, PassRefPtr<SecurityOrigin> securityOrigi n, v8::Isolate* isolate)
15 : WorkletGlobalScope(url, userAgent, securityOrigin, isolate) 15 : WorkletGlobalScope(url, userAgent, securityOrigin, isolate)
16 , LocalFrameLifecycleObserver(frame) 16 , LocalFrameLifecycleObserver(frame)
17 { 17 {
18 } 18 }
19 19
20 MainThreadWorkletGlobalScope::~MainThreadWorkletGlobalScope() 20 MainThreadWorkletGlobalScope::~MainThreadWorkletGlobalScope()
21 { 21 {
22 } 22 }
23 23
24 void MainThreadWorkletGlobalScope::evaluateScript(const String& source, const KU RL& scriptURL) 24 void MainThreadWorkletGlobalScope::evaluateScript(const ScriptSourceCode& script SourceCode)
25 { 25 {
26 scriptController()->evaluate(ScriptSourceCode(source, scriptURL)); 26 scriptController()->evaluate(scriptSourceCode);
27 } 27 }
28 28
29 void MainThreadWorkletGlobalScope::terminateWorkletGlobalScope() 29 void MainThreadWorkletGlobalScope::terminateWorkletGlobalScope()
30 { 30 {
31 dispose(); 31 dispose();
32 } 32 }
33 33
34 void MainThreadWorkletGlobalScope::addConsoleMessage(ConsoleMessage* consoleMess age) 34 void MainThreadWorkletGlobalScope::addConsoleMessage(ConsoleMessage* consoleMess age)
35 { 35 {
36 frame()->console().addMessage(consoleMessage); 36 frame()->console().addMessage(consoleMessage);
37 } 37 }
38 38
39 void MainThreadWorkletGlobalScope::exceptionThrown(ErrorEvent* event) 39 void MainThreadWorkletGlobalScope::exceptionThrown(ErrorEvent* event)
40 { 40 {
41 MainThreadDebugger::instance()->exceptionThrown(this, event); 41 MainThreadDebugger::instance()->exceptionThrown(this, event);
42 } 42 }
43 43
44 } // namespace blink 44 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698