OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2012 Google Inc. All Rights Reserved. | 2 * Copyright (C) 2012 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 | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 11 matching lines...) Expand all Loading... |
22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
24 */ | 24 */ |
25 | 25 |
26 #ifndef DOMError_h | 26 #ifndef DOMError_h |
27 #define DOMError_h | 27 #define DOMError_h |
28 | 28 |
29 #include "bindings/v8/ScriptWrappable.h" | 29 #include "bindings/v8/ScriptWrappable.h" |
30 #include "core/dom/DOMException.h" | 30 #include "core/dom/DOMException.h" |
31 #include "core/dom/ExceptionCode.h" | 31 #include "core/dom/ExceptionCode.h" |
| 32 #include "heap/Handle.h" |
32 #include "wtf/PassRefPtr.h" | 33 #include "wtf/PassRefPtr.h" |
33 #include "wtf/RefCounted.h" | 34 #include "wtf/RefCounted.h" |
34 #include "wtf/text/WTFString.h" | 35 #include "wtf/text/WTFString.h" |
35 | 36 |
36 namespace WebCore { | 37 namespace WebCore { |
37 | 38 |
38 class DOMError : public RefCounted<DOMError>, public ScriptWrappable { | 39 class DOMError : public RefCountedWillBeGarbageCollectedFinalized<DOMError>, pub
lic ScriptWrappable { |
39 public: | 40 public: |
40 static PassRefPtr<DOMError> create(const String& name) | 41 static PassRefPtrWillBeRawPtr<DOMError> create(const String& name) |
41 { | 42 { |
42 return adoptRef(new DOMError(name)); | 43 return adoptRefWillBeNoop(new DOMError(name)); |
43 } | 44 } |
44 static PassRefPtr<DOMError> create(const String& name, const String& message
) | 45 static PassRefPtrWillBeRawPtr<DOMError> create(const String& name, const Str
ing& message) |
45 { | 46 { |
46 return adoptRef(new DOMError(name, message)); | 47 return adoptRefWillBeNoop(new DOMError(name, message)); |
47 } | 48 } |
48 | 49 |
49 static PassRefPtr<DOMError> create(ExceptionCode ec) | 50 static PassRefPtrWillBeRawPtr<DOMError> create(ExceptionCode ec) |
50 { | 51 { |
51 return adoptRef(new DOMError(DOMException::getErrorName(ec), DOMExceptio
n::getErrorMessage(ec))); | 52 return adoptRefWillBeNoop(new DOMError(DOMException::getErrorName(ec), D
OMException::getErrorMessage(ec))); |
52 } | 53 } |
53 | 54 |
54 static PassRefPtr<DOMError> create(ExceptionCode ec, const String& message) | 55 static PassRefPtrWillBeRawPtr<DOMError> create(ExceptionCode ec, const Strin
g& message) |
55 { | 56 { |
56 return adoptRef(new DOMError(DOMException::getErrorName(ec), message)); | 57 return adoptRefWillBeNoop(new DOMError(DOMException::getErrorName(ec), m
essage)); |
57 } | 58 } |
58 | 59 |
59 const String& name() const { return m_name; } | 60 const String& name() const { return m_name; } |
60 const String& message() const { return m_message; } | 61 const String& message() const { return m_message; } |
61 | 62 |
| 63 void trace(Visitor*) { } |
| 64 |
62 protected: | 65 protected: |
63 explicit DOMError(const String& name); | 66 explicit DOMError(const String& name); |
64 DOMError(const String& name, const String& message); | 67 DOMError(const String& name, const String& message); |
65 | 68 |
66 private: | 69 private: |
67 const String m_name; | 70 const String m_name; |
68 const String m_message; | 71 const String m_message; |
69 }; | 72 }; |
70 | 73 |
71 } // namespace WebCore | 74 } // namespace WebCore |
72 | 75 |
73 #endif // DOMError_h | 76 #endif // DOMError_h |
OLD | NEW |