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

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

Issue 625943002: Catch uncaught promise rejections from V8 and log to console. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: addressed Created 6 years, 2 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 | Annotate | Revision Log
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 19 matching lines...) Expand all
30 virtual bool tasksNeedSuspension() OVERRIDE { return m_tasksNeedSuspension; } 30 virtual bool tasksNeedSuspension() OVERRIDE { return m_tasksNeedSuspension; }
31 void setTasksNeedSuspension(bool flag) { m_tasksNeedSuspension = flag; } 31 void setTasksNeedSuspension(bool flag) { m_tasksNeedSuspension = flag; }
32 32
33 virtual void reportBlockedScriptExecutionToInspector(const String& directive Text) OVERRIDE { } 33 virtual void reportBlockedScriptExecutionToInspector(const String& directive Text) OVERRIDE { }
34 virtual void didUpdateSecurityOrigin() OVERRIDE { } 34 virtual void didUpdateSecurityOrigin() OVERRIDE { }
35 virtual SecurityContext& securityContext() OVERRIDE { return *this; } 35 virtual SecurityContext& securityContext() OVERRIDE { return *this; }
36 36
37 double timerAlignmentInterval() const; 37 double timerAlignmentInterval() const;
38 38
39 virtual void addConsoleMessage(PassRefPtrWillBeRawPtr<ConsoleMessage>) OVERR IDE { } 39 virtual void addConsoleMessage(PassRefPtrWillBeRawPtr<ConsoleMessage>) OVERR IDE { }
40 virtual void logExceptionToConsole(const String& errorMessage, int scriptId, const String& sourceURL, int lineNumber, int columnNumber, PassRefPtrWillBeRawP tr<ScriptCallStack>) OVERRIDE { } 40 virtual void logExceptionToConsole(const String& errorMessage, int scriptId, const String& sourceURL, int lineNumber, int columnNumber, PassRefPtrWillBeRawP tr<ScriptCallStack>, PassRefPtrWillBeRawPtr<ScriptArguments>) OVERRIDE { }
41 41
42 void trace(Visitor* visitor) 42 void trace(Visitor* visitor)
43 { 43 {
44 visitor->trace(m_queue); 44 visitor->trace(m_queue);
45 ExecutionContext::trace(visitor); 45 ExecutionContext::trace(visitor);
46 } 46 }
47 47
48 #if !ENABLE(OILPAN) 48 #if !ENABLE(OILPAN)
49 using RefCounted<NullExecutionContext>::ref; 49 using RefCounted<NullExecutionContext>::ref;
50 using RefCounted<NullExecutionContext>::deref; 50 using RefCounted<NullExecutionContext>::deref;
51 51
52 virtual void refExecutionContext() OVERRIDE { ref(); } 52 virtual void refExecutionContext() OVERRIDE { ref(); }
53 virtual void derefExecutionContext() OVERRIDE { deref(); } 53 virtual void derefExecutionContext() OVERRIDE { deref(); }
54 #endif 54 #endif
55 55
56 protected: 56 protected:
57 virtual const KURL& virtualURL() const OVERRIDE { return m_dummyURL; } 57 virtual const KURL& virtualURL() const OVERRIDE { return m_dummyURL; }
58 virtual KURL virtualCompleteURL(const String&) const OVERRIDE { return m_dum myURL; } 58 virtual KURL virtualCompleteURL(const String&) const OVERRIDE { return m_dum myURL; }
59 59
60 private: 60 private:
61 bool m_tasksNeedSuspension; 61 bool m_tasksNeedSuspension;
62 OwnPtrWillBeMember<EventQueue> m_queue; 62 OwnPtrWillBeMember<EventQueue> m_queue;
63 63
64 KURL m_dummyURL; 64 KURL m_dummyURL;
65 }; 65 };
66 66
67 } // namespace blink 67 } // namespace blink
68 68
69 #endif // NullExecutionContext_h 69 #endif // NullExecutionContext_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698