OLD | NEW |
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 19 matching lines...) Expand all Loading... |
30 | 30 |
31 #ifndef ErrorEvent_h | 31 #ifndef ErrorEvent_h |
32 #define ErrorEvent_h | 32 #define ErrorEvent_h |
33 | 33 |
34 #include "bindings/core/v8/DOMWrapperWorld.h" | 34 #include "bindings/core/v8/DOMWrapperWorld.h" |
35 #include "bindings/core/v8/SourceLocation.h" | 35 #include "bindings/core/v8/SourceLocation.h" |
36 #include "core/events/ErrorEventInit.h" | 36 #include "core/events/ErrorEventInit.h" |
37 #include "core/events/Event.h" | 37 #include "core/events/Event.h" |
38 #include "wtf/RefPtr.h" | 38 #include "wtf/RefPtr.h" |
39 #include "wtf/text/WTFString.h" | 39 #include "wtf/text/WTFString.h" |
| 40 #include <memory> |
40 | 41 |
41 namespace blink { | 42 namespace blink { |
42 | 43 |
43 class ErrorEvent final : public Event { | 44 class ErrorEvent final : public Event { |
44 DEFINE_WRAPPERTYPEINFO(); | 45 DEFINE_WRAPPERTYPEINFO(); |
45 public: | 46 public: |
46 static ErrorEvent* create() | 47 static ErrorEvent* create() |
47 { | 48 { |
48 return new ErrorEvent; | 49 return new ErrorEvent; |
49 } | 50 } |
50 static ErrorEvent* create(const String& message, PassOwnPtr<SourceLocation>
location, DOMWrapperWorld* world) | 51 static ErrorEvent* create(const String& message, std::unique_ptr<SourceLocat
ion> location, DOMWrapperWorld* world) |
51 { | 52 { |
52 return new ErrorEvent(message, std::move(location), world); | 53 return new ErrorEvent(message, std::move(location), world); |
53 } | 54 } |
54 static ErrorEvent* create(const AtomicString& type, const ErrorEventInit& in
itializer) | 55 static ErrorEvent* create(const AtomicString& type, const ErrorEventInit& in
itializer) |
55 { | 56 { |
56 return new ErrorEvent(type, initializer); | 57 return new ErrorEvent(type, initializer); |
57 } | 58 } |
58 static ErrorEvent* createSanitizedError(DOMWrapperWorld* world) | 59 static ErrorEvent* createSanitizedError(DOMWrapperWorld* world) |
59 { | 60 { |
60 return new ErrorEvent("Script error.", SourceLocation::create(String(),
0, 0, nullptr), world); | 61 return new ErrorEvent("Script error.", SourceLocation::create(String(),
0, 0, nullptr), world); |
(...skipping 14 matching lines...) Expand all Loading... |
75 const AtomicString& interfaceName() const override; | 76 const AtomicString& interfaceName() const override; |
76 | 77 |
77 DOMWrapperWorld* world() const { return m_world.get(); } | 78 DOMWrapperWorld* world() const { return m_world.get(); } |
78 | 79 |
79 void setUnsanitizedMessage(const String&); | 80 void setUnsanitizedMessage(const String&); |
80 | 81 |
81 DECLARE_VIRTUAL_TRACE(); | 82 DECLARE_VIRTUAL_TRACE(); |
82 | 83 |
83 private: | 84 private: |
84 ErrorEvent(); | 85 ErrorEvent(); |
85 ErrorEvent(const String& message, PassOwnPtr<SourceLocation>, DOMWrapperWorl
d*); | 86 ErrorEvent(const String& message, std::unique_ptr<SourceLocation>, DOMWrappe
rWorld*); |
86 ErrorEvent(const AtomicString&, const ErrorEventInit&); | 87 ErrorEvent(const AtomicString&, const ErrorEventInit&); |
87 | 88 |
88 String m_unsanitizedMessage; | 89 String m_unsanitizedMessage; |
89 String m_sanitizedMessage; | 90 String m_sanitizedMessage; |
90 OwnPtr<SourceLocation> m_location; | 91 std::unique_ptr<SourceLocation> m_location; |
91 ScriptValue m_error; | 92 ScriptValue m_error; |
92 | 93 |
93 RefPtr<DOMWrapperWorld> m_world; | 94 RefPtr<DOMWrapperWorld> m_world; |
94 }; | 95 }; |
95 | 96 |
96 } // namespace blink | 97 } // namespace blink |
97 | 98 |
98 #endif // ErrorEvent_h | 99 #endif // ErrorEvent_h |
OLD | NEW |