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 |