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

Unified Diff: third_party/WebKit/Source/core/workers/AbstractGlobalScope.h

Issue 1535943005: Initial implementation of bindings and basic classes for worklets. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix memory leak. Created 5 years 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/AbstractGlobalScope.h
diff --git a/third_party/WebKit/Source/core/workers/AbstractGlobalScope.h b/third_party/WebKit/Source/core/workers/AbstractGlobalScope.h
new file mode 100644
index 0000000000000000000000000000000000000000..5dd8099f824878995cb662fb2dedaf8881ef6ad2
--- /dev/null
+++ b/third_party/WebKit/Source/core/workers/AbstractGlobalScope.h
@@ -0,0 +1,58 @@
+// Copyright 2015 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.
+
+#ifndef AbstractGlobalScope_h
+#define AbstractGlobalScope_h
+
+#include "core/dom/ExecutionContext.h"
+#include "core/dom/SecurityContext.h"
+#include "platform/heap/Handle.h"
+
+namespace blink {
+
+class GlobalScopeScriptController;
+
+class CORE_EXPORT AbstractGlobalScope : public SecurityContext, public ExecutionContext {
+ WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(AbstractGlobalScope);
+public:
+ ~AbstractGlobalScope() override;
+
+ bool isAbstractGlobalScope() const final { return true; }
+
+ // ExecutionContext
+ void disableEval(const String& errorMessage) final;
+ String userAgent() const final { return m_userAgent; }
+ bool isSecureContext(String& errorMessage, const SecureContextCheck = StandardSecureContextCheck) const final;
+
+ virtual ExecutionContext* executionContext() const = 0;
+ virtual GlobalScopeScriptController* script() = 0;
+ virtual v8::Isolate* isolate() const = 0;
+ virtual void didStopRunLoop() = 0;
+
+ using SecurityContext::securityOrigin;
+ using SecurityContext::contentSecurityPolicy;
+
+ DEFINE_INLINE_TRACE() {
+ ExecutionContext::trace(visitor);
+ SecurityContext::trace(visitor);
+ }
+
+protected:
+ AbstractGlobalScope(const KURL&, const String& userAgent);
+
+private:
+ void didUpdateSecurityOrigin() final { }
+
+ const KURL& virtualURL() const final { return m_url; }
+ KURL virtualCompleteURL(const String&) const final;
+
+ KURL m_url;
+ String m_userAgent;
+};
+
+DEFINE_TYPE_CASTS(AbstractGlobalScope, ExecutionContext, value, value->isAbstractGlobalScope(), value.isAbstractGlobalScope());
+
+} // namespace blink
+
+#endif // AbstractGlobalScope_h

Powered by Google App Engine
This is Rietveld 408576698