Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef NullExecutionContext_h | |
| 6 #define NullExecutionContext_h | |
| 7 | |
| 8 #include "core/dom/ExecutionContext.h" | |
| 9 #include "core/dom/SecurityContext.h" | |
| 10 #include "core/events/EventQueue.h" | |
| 11 #include "platform/heap/Handle.h" | |
| 12 #include "platform/weborigin/KURL.h" | |
| 13 #include "wtf/RefCounted.h" | |
| 14 | |
| 15 namespace WebCore { | |
| 16 | |
| 17 class NullExecutionContext FINAL : public RefCountedWillBeGarbageCollectedFinali zed<NullExecutionContext>, public SecurityContext, public ExecutionContext { | |
| 18 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(NullExecutionContext); | |
| 19 public: | |
| 20 NullExecutionContext(); | |
| 21 | |
| 22 virtual EventQueue* eventQueue() const OVERRIDE { return m_queue.get(); } | |
| 23 | |
| 24 virtual bool tasksNeedSuspension() OVERRIDE { return m_tasksNeedSuspension; } | |
| 25 void setTasksNeedSuspention(bool flag) { m_tasksNeedSuspension = flag; } | |
|
sof
2014/06/16 14:30:53
Fix the spelling mistake at the same time? :)
tyoshino (SeeGerritForStatus)
2014/06/17 01:55:45
Oh, OK. Done
| |
| 26 | |
| 27 void trace(Visitor* visitor) | |
| 28 { | |
| 29 visitor->trace(m_queue); | |
| 30 ExecutionContext::trace(visitor); | |
| 31 } | |
| 32 | |
| 33 virtual void reportBlockedScriptExecutionToInspector(const String& directive Text) OVERRIDE { } | |
| 34 virtual SecurityContext& securityContext() OVERRIDE { return *this; } | |
| 35 | |
| 36 #if !ENABLE(OILPAN) | |
| 37 using RefCounted<NullExecutionContext>::ref; | |
| 38 using RefCounted<NullExecutionContext>::deref; | |
| 39 | |
| 40 virtual void refExecutionContext() OVERRIDE { ref(); } | |
| 41 virtual void derefExecutionContext() OVERRIDE { deref(); } | |
| 42 #endif | |
| 43 | |
| 44 protected: | |
| 45 virtual const KURL& virtualURL() const OVERRIDE { return m_dummyURL; } | |
| 46 virtual KURL virtualCompleteURL(const String&) const OVERRIDE { return m_dum myURL; } | |
| 47 | |
| 48 private: | |
| 49 bool m_tasksNeedSuspension; | |
| 50 OwnPtrWillBeMember<EventQueue> m_queue; | |
| 51 | |
| 52 KURL m_dummyURL; | |
| 53 }; | |
| 54 | |
| 55 } // namespace WebCore | |
| 56 | |
| 57 #endif // NullExecutionContext_h | |
| OLD | NEW |