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

Side by Side Diff: third_party/WebKit/Source/core/events/EventFactory.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) 2011 Google, Inc. All Rights Reserved. 2 * Copyright (C) 2011 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
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 EventFactory_h 26 #ifndef EventFactory_h
27 #define EventFactory_h 27 #define EventFactory_h
28 28
29 #include "platform/heap/Handle.h" 29 #include "platform/heap/Handle.h"
30 #include "wtf/Allocator.h" 30 #include "wtf/Allocator.h"
31 #include "wtf/PassRefPtr.h" 31 #include "wtf/PassRefPtr.h"
32 #include "wtf/PtrUtil.h"
33 #include "wtf/text/AtomicString.h" 32 #include "wtf/text/AtomicString.h"
34 #include <memory>
35 33
36 namespace blink { 34 namespace blink {
37 35
38 class Event; 36 class Event;
39 class ExecutionContext; 37 class ExecutionContext;
40 38
41 class EventFactoryBase { 39 class EventFactoryBase {
42 USING_FAST_MALLOC(EventFactoryBase); 40 USING_FAST_MALLOC(EventFactoryBase);
43 public: 41 public:
44 virtual Event* create(ExecutionContext*, const String& eventType) = 0; 42 virtual Event* create(ExecutionContext*, const String& eventType) = 0;
45 virtual ~EventFactoryBase() { } 43 virtual ~EventFactoryBase() { }
46 44
47 protected: 45 protected:
48 EventFactoryBase() { } 46 EventFactoryBase() { }
49 }; 47 };
50 48
51 class EventFactory final : public EventFactoryBase { 49 class EventFactory final : public EventFactoryBase {
52 public: 50 public:
53 static std::unique_ptr<EventFactory> create() 51 static PassOwnPtr<EventFactory> create()
54 { 52 {
55 return wrapUnique(new EventFactory()); 53 return adoptPtr(new EventFactory());
56 } 54 }
57 55
58 Event* create(ExecutionContext*, const String& eventType) override; 56 Event* create(ExecutionContext*, const String& eventType) override;
59 }; 57 };
60 58
61 } // namespace blink 59 } // namespace blink
62 60
63 #endif 61 #endif
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/events/ErrorEvent.cpp ('k') | third_party/WebKit/Source/core/events/EventListenerMap.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698