| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #ifndef NullExecutionContext_h | 5 #ifndef NullExecutionContext_h |
| 6 #define NullExecutionContext_h | 6 #define NullExecutionContext_h |
| 7 | 7 |
| 8 #include "bindings/core/v8/ScriptCallStack.h" | |
| 9 #include "core/dom/ExecutionContext.h" | 8 #include "core/dom/ExecutionContext.h" |
| 10 #include "core/dom/SecurityContext.h" | 9 #include "core/dom/SecurityContext.h" |
| 11 #include "core/events/EventQueue.h" | 10 #include "core/events/EventQueue.h" |
| 12 #include "core/inspector/ConsoleMessage.h" | 11 #include "core/inspector/ConsoleMessage.h" |
| 13 #include "platform/heap/Handle.h" | 12 #include "platform/heap/Handle.h" |
| 14 #include "platform/weborigin/KURL.h" | 13 #include "platform/weborigin/KURL.h" |
| 15 | 14 |
| 16 namespace blink { | 15 namespace blink { |
| 17 | 16 |
| 18 class NullExecutionContext final : public GarbageCollectedFinalized<NullExecutio
nContext>, public SecurityContext, public ExecutionContext { | 17 class NullExecutionContext final : public GarbageCollectedFinalized<NullExecutio
nContext>, public SecurityContext, public ExecutionContext { |
| (...skipping 11 matching lines...) Expand all Loading... |
| 30 | 29 |
| 31 bool tasksNeedSuspension() override { return m_tasksNeedSuspension; } | 30 bool tasksNeedSuspension() override { return m_tasksNeedSuspension; } |
| 32 void setTasksNeedSuspension(bool flag) { m_tasksNeedSuspension = flag; } | 31 void setTasksNeedSuspension(bool flag) { m_tasksNeedSuspension = flag; } |
| 33 | 32 |
| 34 void reportBlockedScriptExecutionToInspector(const String& directiveText) ov
erride { } | 33 void reportBlockedScriptExecutionToInspector(const String& directiveText) ov
erride { } |
| 35 void didUpdateSecurityOrigin() override { } | 34 void didUpdateSecurityOrigin() override { } |
| 36 SecurityContext& securityContext() override { return *this; } | 35 SecurityContext& securityContext() override { return *this; } |
| 37 DOMTimerCoordinator* timers() override { return nullptr; } | 36 DOMTimerCoordinator* timers() override { return nullptr; } |
| 38 | 37 |
| 39 void addConsoleMessage(ConsoleMessage*) override { } | 38 void addConsoleMessage(ConsoleMessage*) override { } |
| 40 void logExceptionToConsole(const String& errorMessage, int scriptId, const S
tring& sourceURL, int lineNumber, int columnNumber, PassRefPtr<ScriptCallStack>)
override { } | 39 void logExceptionToConsole(const String& errorMessage, PassOwnPtr<SourceLoca
tion>) override { } |
| 41 | 40 |
| 42 void setIsSecureContext(bool); | 41 void setIsSecureContext(bool); |
| 43 bool isSecureContext(String& errorMessage, const SecureContextCheck = Standa
rdSecureContextCheck) const override; | 42 bool isSecureContext(String& errorMessage, const SecureContextCheck = Standa
rdSecureContextCheck) const override; |
| 44 | 43 |
| 45 DEFINE_INLINE_TRACE() | 44 DEFINE_INLINE_TRACE() |
| 46 { | 45 { |
| 47 visitor->trace(m_queue); | 46 visitor->trace(m_queue); |
| 48 SecurityContext::trace(visitor); | 47 SecurityContext::trace(visitor); |
| 49 ExecutionContext::trace(visitor); | 48 ExecutionContext::trace(visitor); |
| 50 } | 49 } |
| 51 | 50 |
| 52 protected: | 51 protected: |
| 53 const KURL& virtualURL() const override { return m_dummyURL; } | 52 const KURL& virtualURL() const override { return m_dummyURL; } |
| 54 KURL virtualCompleteURL(const String&) const override { return m_dummyURL; } | 53 KURL virtualCompleteURL(const String&) const override { return m_dummyURL; } |
| 55 | 54 |
| 56 private: | 55 private: |
| 57 bool m_tasksNeedSuspension; | 56 bool m_tasksNeedSuspension; |
| 58 bool m_isSecureContext; | 57 bool m_isSecureContext; |
| 59 Member<EventQueue> m_queue; | 58 Member<EventQueue> m_queue; |
| 60 | 59 |
| 61 KURL m_dummyURL; | 60 KURL m_dummyURL; |
| 62 }; | 61 }; |
| 63 | 62 |
| 64 } // namespace blink | 63 } // namespace blink |
| 65 | 64 |
| 66 #endif // NullExecutionContext_h | 65 #endif // NullExecutionContext_h |
| OLD | NEW |