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

Side by Side Diff: third_party/WebKit/Source/core/events/ErrorEvent.h

Issue 2080623002: Revert "Remove OwnPtr from Blink." (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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
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 19 matching lines...) Expand all
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>
41 40
42 namespace blink { 41 namespace blink {
43 42
44 class ErrorEvent final : public Event { 43 class ErrorEvent final : public Event {
45 DEFINE_WRAPPERTYPEINFO(); 44 DEFINE_WRAPPERTYPEINFO();
46 public: 45 public:
47 static ErrorEvent* create() 46 static ErrorEvent* create()
48 { 47 {
49 return new ErrorEvent; 48 return new ErrorEvent;
50 } 49 }
51 static ErrorEvent* create(const String& message, std::unique_ptr<SourceLocat ion> location, DOMWrapperWorld* world) 50 static ErrorEvent* create(const String& message, PassOwnPtr<SourceLocation> location, DOMWrapperWorld* world)
52 { 51 {
53 return new ErrorEvent(message, std::move(location), world); 52 return new ErrorEvent(message, std::move(location), world);
54 } 53 }
55 static ErrorEvent* create(const AtomicString& type, const ErrorEventInit& in itializer) 54 static ErrorEvent* create(const AtomicString& type, const ErrorEventInit& in itializer)
56 { 55 {
57 return new ErrorEvent(type, initializer); 56 return new ErrorEvent(type, initializer);
58 } 57 }
59 static ErrorEvent* createSanitizedError(DOMWrapperWorld* world) 58 static ErrorEvent* createSanitizedError(DOMWrapperWorld* world)
60 { 59 {
61 return new ErrorEvent("Script error.", SourceLocation::create(String(), 0, 0, nullptr), world); 60 return new ErrorEvent("Script error.", SourceLocation::create(String(), 0, 0, nullptr), world);
(...skipping 14 matching lines...) Expand all
76 const AtomicString& interfaceName() const override; 75 const AtomicString& interfaceName() const override;
77 76
78 DOMWrapperWorld* world() const { return m_world.get(); } 77 DOMWrapperWorld* world() const { return m_world.get(); }
79 78
80 void setUnsanitizedMessage(const String&); 79 void setUnsanitizedMessage(const String&);
81 80
82 DECLARE_VIRTUAL_TRACE(); 81 DECLARE_VIRTUAL_TRACE();
83 82
84 private: 83 private:
85 ErrorEvent(); 84 ErrorEvent();
86 ErrorEvent(const String& message, std::unique_ptr<SourceLocation>, DOMWrappe rWorld*); 85 ErrorEvent(const String& message, PassOwnPtr<SourceLocation>, DOMWrapperWorl d*);
87 ErrorEvent(const AtomicString&, const ErrorEventInit&); 86 ErrorEvent(const AtomicString&, const ErrorEventInit&);
88 87
89 String m_unsanitizedMessage; 88 String m_unsanitizedMessage;
90 String m_sanitizedMessage; 89 String m_sanitizedMessage;
91 std::unique_ptr<SourceLocation> m_location; 90 OwnPtr<SourceLocation> m_location;
92 ScriptValue m_error; 91 ScriptValue m_error;
93 92
94 RefPtr<DOMWrapperWorld> m_world; 93 RefPtr<DOMWrapperWorld> m_world;
95 }; 94 };
96 95
97 } // namespace blink 96 } // namespace blink
98 97
99 #endif // ErrorEvent_h 98 #endif // ErrorEvent_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698