OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "core/workers/MainThreadWorkletGlobalScope.h" |
| 6 |
| 7 #include "bindings/core/v8/ScriptSourceCode.h" |
| 8 #include "bindings/core/v8/WorkerOrWorkletScriptController.h" |
| 9 #include "core/frame/FrameConsole.h" |
| 10 |
| 11 namespace blink { |
| 12 |
| 13 MainThreadWorkletGlobalScope::MainThreadWorkletGlobalScope(LocalFrame* frame, co
nst KURL& url, const String& userAgent, PassRefPtr<SecurityOrigin> securityOrigi
n, v8::Isolate* isolate) |
| 14 : WorkletGlobalScope(url, userAgent, securityOrigin, isolate) |
| 15 , LocalFrameLifecycleObserver(frame) |
| 16 { |
| 17 } |
| 18 |
| 19 MainThreadWorkletGlobalScope::~MainThreadWorkletGlobalScope() |
| 20 { |
| 21 } |
| 22 |
| 23 void MainThreadWorkletGlobalScope::evaluateScript(const String& source, const KU
RL& scriptURL) |
| 24 { |
| 25 scriptController()->evaluate(ScriptSourceCode(source, scriptURL)); |
| 26 } |
| 27 |
| 28 void MainThreadWorkletGlobalScope::terminateWorkletGlobalScope() |
| 29 { |
| 30 dispose(); |
| 31 } |
| 32 |
| 33 void MainThreadWorkletGlobalScope::addConsoleMessage(ConsoleMessage* consoleMess
age) |
| 34 { |
| 35 frame()->console().addMessage(consoleMessage); |
| 36 } |
| 37 |
| 38 } // namespace blink |
OLD | NEW |