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

Side by Side Diff: Source/core/dom/ErrorEvent.h

Issue 20351002: Add 'error' parameter to 'window.onerror' handlers. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rework^2. Created 7 years, 4 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
« no previous file with comments | « Source/bindings/v8/custom/V8ErrorEventCustom.cpp ('k') | Source/core/dom/ErrorEvent.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 /* 1 /*
2 * Copyright (C) 2009 Google Inc. All rights reserved. 2 * Copyright (C) 2009 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 13 matching lines...) Expand all
24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 */ 29 */
30 30
31 #ifndef ErrorEvent_h 31 #ifndef ErrorEvent_h
32 #define ErrorEvent_h 32 #define ErrorEvent_h
33 33
34 #include "bindings/v8/ScriptValue.h"
35 #include "bindings/v8/SerializedScriptValue.h"
34 #include "core/dom/Event.h" 36 #include "core/dom/Event.h"
37 #include "wtf/RefPtr.h"
35 #include "wtf/text/WTFString.h" 38 #include "wtf/text/WTFString.h"
36 39
37 namespace WebCore { 40 namespace WebCore {
38 41
39 struct ErrorEventInit : public EventInit { 42 struct ErrorEventInit : public EventInit {
40 ErrorEventInit(); 43 ErrorEventInit();
41 44
42 String message; 45 String message;
43 String filename; 46 String filename;
44 unsigned lineno; 47 unsigned lineno;
45 unsigned colno; 48 unsigned colno;
49 ScriptValue error;
adamk 2013/07/30 17:55:41 Is this doing anything other than satisfying the c
46 }; 50 };
47 51
48 class ErrorEvent : public Event { 52 class ErrorEvent : public Event {
49 public: 53 public:
50 static PassRefPtr<ErrorEvent> create() 54 static PassRefPtr<ErrorEvent> create()
51 { 55 {
52 return adoptRef(new ErrorEvent); 56 return adoptRef(new ErrorEvent);
53 } 57 }
54 static PassRefPtr<ErrorEvent> create(const String& message, const String& fi leName, unsigned lineNumber, unsigned columnNumber) 58 static PassRefPtr<ErrorEvent> create(const String& message, const String& fi leName, unsigned lineNumber, unsigned columnNumber)
55 { 59 {
56 return adoptRef(new ErrorEvent(message, fileName, lineNumber, columnNumb er)); 60 return adoptRef(new ErrorEvent(message, fileName, lineNumber, columnNumb er));
57 } 61 }
58 static PassRefPtr<ErrorEvent> create(const AtomicString& type, const ErrorEv entInit& initializer) 62 static PassRefPtr<ErrorEvent> create(const AtomicString& type, const ErrorEv entInit& initializer)
59 { 63 {
60 return adoptRef(new ErrorEvent(type, initializer)); 64 return adoptRef(new ErrorEvent(type, initializer));
61 } 65 }
66 static PassRefPtr<ErrorEvent> createSanitizedError()
67 {
68 return adoptRef(new ErrorEvent("Script error.", String(), 0, 0));
69 }
62 virtual ~ErrorEvent(); 70 virtual ~ErrorEvent();
63 71
64 const String& message() const { return m_message; } 72 const String& message() const { return m_message; }
65 const String& filename() const { return m_fileName; } 73 const String& filename() const { return m_fileName; }
66 unsigned lineno() const { return m_lineNumber; } 74 unsigned lineno() const { return m_lineNumber; }
67 unsigned colno() const { return m_columnNumber; } 75 unsigned colno() const { return m_columnNumber; }
68 76
77 void setSerializedError(PassRefPtr<SerializedScriptValue>) { }
78
69 virtual const AtomicString& interfaceName() const; 79 virtual const AtomicString& interfaceName() const;
70 80
71 private: 81 private:
72 ErrorEvent(); 82 ErrorEvent();
73 ErrorEvent(const String& message, const String& fileName, unsigned lineNumbe r, unsigned columnNumber); 83 ErrorEvent(const String& message, const String& fileName, unsigned lineNumbe r, unsigned columnNumber);
74 ErrorEvent(const AtomicString&, const ErrorEventInit&); 84 ErrorEvent(const AtomicString&, const ErrorEventInit&);
75 85
86
76 String m_message; 87 String m_message;
77 String m_fileName; 88 String m_fileName;
78 unsigned m_lineNumber; 89 unsigned m_lineNumber;
79 unsigned m_columnNumber; 90 unsigned m_columnNumber;
80 }; 91 };
81 92
82 } // namespace WebCore 93 } // namespace WebCore
83 94
84 #endif // ErrorEvent_h 95 #endif // ErrorEvent_h
OLDNEW
« no previous file with comments | « Source/bindings/v8/custom/V8ErrorEventCustom.cpp ('k') | Source/core/dom/ErrorEvent.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698