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

Side by Side Diff: Source/modules/notifications/Notification.h

Issue 234823003: Oilpan: Enable Oilpan in modules/notifications (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 8 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 | « no previous file | Source/modules/notifications/Notification.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) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 #include "wtf/OwnPtr.h" 42 #include "wtf/OwnPtr.h"
43 #include "wtf/PassRefPtr.h" 43 #include "wtf/PassRefPtr.h"
44 #include "wtf/RefCounted.h" 44 #include "wtf/RefCounted.h"
45 45
46 namespace WebCore { 46 namespace WebCore {
47 47
48 class Dictionary; 48 class Dictionary;
49 class ExecutionContext; 49 class ExecutionContext;
50 class NotificationPermissionCallback; 50 class NotificationPermissionCallback;
51 51
52 class Notification : public RefCountedWillBeRefCountedGarbageCollected<Notificat ion>, public ScriptWrappable, public ActiveDOMObject, public EventTargetWithInli neData { 52 class Notification : public RefCountedGarbageCollected<Notification>, public Scr iptWrappable, public ActiveDOMObject, public EventTargetWithInlineData {
53 DEFINE_EVENT_TARGET_REFCOUNTING(RefCountedWillBeRefCountedGarbageCollected<N otification>); 53 DEFINE_EVENT_TARGET_REFCOUNTING(RefCountedGarbageCollected<Notification>);
54 54
55 public: 55 public:
56 static PassRefPtrWillBeRawPtr<Notification> create(ExecutionContext*, const String& title, const Dictionary& options); 56 static Notification* create(ExecutionContext*, const String& title, const Di ctionary& options);
57 57
58 virtual ~Notification(); 58 virtual ~Notification();
59 59
60 void close(); 60 void close();
61 61
62 DEFINE_ATTRIBUTE_EVENT_LISTENER(click); 62 DEFINE_ATTRIBUTE_EVENT_LISTENER(click);
63 DEFINE_ATTRIBUTE_EVENT_LISTENER(show); 63 DEFINE_ATTRIBUTE_EVENT_LISTENER(show);
64 DEFINE_ATTRIBUTE_EVENT_LISTENER(error); 64 DEFINE_ATTRIBUTE_EVENT_LISTENER(error);
65 DEFINE_ATTRIBUTE_EVENT_LISTENER(close); 65 DEFINE_ATTRIBUTE_EVENT_LISTENER(close);
66 66
(...skipping 18 matching lines...) Expand all
85 85
86 // EventTarget interface. 86 // EventTarget interface.
87 virtual ExecutionContext* executionContext() const OVERRIDE FINAL { return A ctiveDOMObject::executionContext(); } 87 virtual ExecutionContext* executionContext() const OVERRIDE FINAL { return A ctiveDOMObject::executionContext(); }
88 virtual bool dispatchEvent(PassRefPtrWillBeRawPtr<Event>) OVERRIDE FINAL; 88 virtual bool dispatchEvent(PassRefPtrWillBeRawPtr<Event>) OVERRIDE FINAL;
89 virtual const AtomicString& interfaceName() const OVERRIDE; 89 virtual const AtomicString& interfaceName() const OVERRIDE;
90 90
91 // ActiveDOMObject interface. 91 // ActiveDOMObject interface.
92 virtual void stop() OVERRIDE; 92 virtual void stop() OVERRIDE;
93 virtual bool hasPendingActivity() const OVERRIDE; 93 virtual bool hasPendingActivity() const OVERRIDE;
94 94
95 // RefCountedWillBeRefCountedGarbageCollected<Notification> interface.
96 void trace(Visitor*) { } 95 void trace(Visitor*) { }
97 96
98 private: 97 private:
99 Notification(const String& title, ExecutionContext*, NotificationClient*); 98 Notification(const String& title, ExecutionContext*, NotificationClient*);
100 99
101 // Calling show() may start asynchronous operation. If this object has 100 // Calling show() may start asynchronous operation. If this object has
102 // a V8 wrapper, hasPendingActivity() prevents the wrapper from being 101 // a V8 wrapper, hasPendingActivity() prevents the wrapper from being
103 // collected while m_state is Showing, and so this instance stays alive 102 // collected while m_state is Showing, and so this instance stays alive
104 // until the operation completes. Otherwise, you need to hold a ref on this 103 // until the operation completes. Otherwise, you need to hold a ref on this
105 // instance until the operation completes. 104 // instance until the operation completes.
(...skipping 23 matching lines...) Expand all
129 NotificationState m_state; 128 NotificationState m_state;
130 129
131 NotificationClient* m_client; 130 NotificationClient* m_client;
132 131
133 OwnPtr<AsyncMethodRunner<Notification> > m_asyncRunner; 132 OwnPtr<AsyncMethodRunner<Notification> > m_asyncRunner;
134 }; 133 };
135 134
136 } // namespace WebCore 135 } // namespace WebCore
137 136
138 #endif // Notification_h 137 #endif // Notification_h
OLDNEW
« no previous file with comments | « no previous file | Source/modules/notifications/Notification.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698