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

Unified Diff: third_party/WebKit/Source/core/workers/MainThreadWorkletGlobalScope.cpp

Issue 2029163002: Worklets - Change inheritance heirarchy of WorkletGlobalScope (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase. Created 4 years, 6 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/workers/MainThreadWorkletGlobalScope.cpp
diff --git a/third_party/WebKit/Source/core/workers/MainThreadWorkletGlobalScope.cpp b/third_party/WebKit/Source/core/workers/MainThreadWorkletGlobalScope.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..6d858ae8c3a9fbb6154c774be0f0abc40d9e4c0b
--- /dev/null
+++ b/third_party/WebKit/Source/core/workers/MainThreadWorkletGlobalScope.cpp
@@ -0,0 +1,38 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "core/workers/MainThreadWorkletGlobalScope.h"
+
+#include "bindings/core/v8/ScriptSourceCode.h"
+#include "bindings/core/v8/WorkerOrWorkletScriptController.h"
+#include "core/frame/FrameConsole.h"
+
+namespace blink {
+
+MainThreadWorkletGlobalScope::MainThreadWorkletGlobalScope(LocalFrame* frame, const KURL& url, const String& userAgent, PassRefPtr<SecurityOrigin> securityOrigin, v8::Isolate* isolate)
+ : WorkletGlobalScope(url, userAgent, securityOrigin, isolate)
+ , LocalFrameLifecycleObserver(frame)
+{
+}
+
+MainThreadWorkletGlobalScope::~MainThreadWorkletGlobalScope()
+{
+}
+
+void MainThreadWorkletGlobalScope::evaluateScript(const String& source, const KURL& scriptURL)
+{
+ scriptController()->evaluate(ScriptSourceCode(source, scriptURL));
+}
+
+void MainThreadWorkletGlobalScope::terminateWorkletGlobalScope()
+{
+ dispose();
+}
+
+void MainThreadWorkletGlobalScope::addConsoleMessage(ConsoleMessage* consoleMessage)
+{
+ frame()->console().addMessage(consoleMessage);
+}
+
+} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698