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

Side by Side Diff: Source/core/testing/NullExecutionContext.h

Issue 1136883003: Expose Document::isPrivilegedContext from WebDocument (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 7 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 unified diff | Download patch
« no previous file with comments | « Source/core/dom/ExecutionContext.h ('k') | Source/core/testing/NullExecutionContext.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "core/dom/ExecutionContext.h" 8 #include "core/dom/ExecutionContext.h"
9 #include "core/dom/SecurityContext.h" 9 #include "core/dom/SecurityContext.h"
10 #include "core/events/EventQueue.h" 10 #include "core/events/EventQueue.h"
(...skipping 16 matching lines...) Expand all
27 virtual void postTask(const WebTraceLocation&, PassOwnPtr<ExecutionContextTa sk>) override; 27 virtual void postTask(const WebTraceLocation&, PassOwnPtr<ExecutionContextTa sk>) override;
28 28
29 virtual EventTarget* errorEventTarget() override { return nullptr; } 29 virtual EventTarget* errorEventTarget() override { return nullptr; }
30 virtual EventQueue* eventQueue() const override { return m_queue.get(); } 30 virtual EventQueue* eventQueue() const override { return m_queue.get(); }
31 31
32 virtual bool tasksNeedSuspension() override { return m_tasksNeedSuspension; } 32 virtual bool tasksNeedSuspension() override { return m_tasksNeedSuspension; }
33 void setTasksNeedSuspension(bool flag) { m_tasksNeedSuspension = flag; } 33 void setTasksNeedSuspension(bool flag) { m_tasksNeedSuspension = flag; }
34 34
35 virtual void reportBlockedScriptExecutionToInspector(const String& directive Text) override { } 35 virtual void reportBlockedScriptExecutionToInspector(const String& directive Text) override { }
36 virtual void didUpdateSecurityOrigin() override { } 36 virtual void didUpdateSecurityOrigin() override { }
37 virtual SecurityContext& securityContext() override { return *this; } 37 virtual const SecurityContext& securityContext() const override { return *th is; }
38 virtual DOMTimerCoordinator* timers() override { return nullptr; } 38 virtual DOMTimerCoordinator* timers() override { return nullptr; }
39 39
40 double timerAlignmentInterval() const; 40 double timerAlignmentInterval() const;
41 41
42 virtual void addConsoleMessage(PassRefPtrWillBeRawPtr<ConsoleMessage>) overr ide { } 42 virtual void addConsoleMessage(PassRefPtrWillBeRawPtr<ConsoleMessage>) overr ide { }
43 virtual void logExceptionToConsole(const String& errorMessage, int scriptId, const String& sourceURL, int lineNumber, int columnNumber, PassRefPtrWillBeRawP tr<ScriptCallStack>) override { } 43 virtual void logExceptionToConsole(const String& errorMessage, int scriptId, const String& sourceURL, int lineNumber, int columnNumber, PassRefPtrWillBeRawP tr<ScriptCallStack>) override { }
44 44
45 bool isPrivilegedContext(String& errorMessage, const PrivilegeContextCheck = StandardPrivilegeCheck); 45 bool isPrivilegedContext(String& errorMessage, const PrivilegeContextCheck = StandardPrivilegeCheck) const override;
46 46
47 DEFINE_INLINE_TRACE() 47 DEFINE_INLINE_TRACE()
48 { 48 {
49 visitor->trace(m_queue); 49 visitor->trace(m_queue);
50 ExecutionContext::trace(visitor); 50 ExecutionContext::trace(visitor);
51 } 51 }
52 52
53 #if !ENABLE(OILPAN) 53 #if !ENABLE(OILPAN)
54 using RefCounted<NullExecutionContext>::ref; 54 using RefCounted<NullExecutionContext>::ref;
55 using RefCounted<NullExecutionContext>::deref; 55 using RefCounted<NullExecutionContext>::deref;
56 56
57 virtual void refExecutionContext() override { ref(); } 57 virtual void refExecutionContext() override { ref(); }
58 virtual void derefExecutionContext() override { deref(); } 58 virtual void derefExecutionContext() override { deref(); }
59 #endif 59 #endif
60 60
61 protected: 61 protected:
62 virtual const KURL& virtualURL() const override { return m_dummyURL; } 62 virtual const KURL& virtualURL() const override { return m_dummyURL; }
63 virtual KURL virtualCompleteURL(const String&) const override { return m_dum myURL; } 63 virtual KURL virtualCompleteURL(const String&) const override { return m_dum myURL; }
64 64
65 private: 65 private:
66 bool m_tasksNeedSuspension; 66 bool m_tasksNeedSuspension;
67 OwnPtrWillBeMember<EventQueue> m_queue; 67 OwnPtrWillBeMember<EventQueue> m_queue;
68 68
69 KURL m_dummyURL; 69 KURL m_dummyURL;
70 }; 70 };
71 71
72 } // namespace blink 72 } // namespace blink
73 73
74 #endif // NullExecutionContext_h 74 #endif // NullExecutionContext_h
OLDNEW
« no previous file with comments | « Source/core/dom/ExecutionContext.h ('k') | Source/core/testing/NullExecutionContext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698