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

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

Issue 1241613004: Rework dispatchEvent so it is consistent for isTrusted support. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Work around MSVC optimization bug Created 5 years, 5 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) 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 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 KURL iconURL() const { return m_iconUrl; } 98 KURL iconURL() const { return m_iconUrl; }
99 SerializedScriptValue* serializedData() const { return m_serializedData.get( ); } 99 SerializedScriptValue* serializedData() const { return m_serializedData.get( ); }
100 100
101 static String permissionString(WebNotificationPermission); 101 static String permissionString(WebNotificationPermission);
102 static String permission(ExecutionContext*); 102 static String permission(ExecutionContext*);
103 static WebNotificationPermission checkPermission(ExecutionContext*); 103 static WebNotificationPermission checkPermission(ExecutionContext*);
104 static void requestPermission(ExecutionContext*, NotificationPermissionCallb ack* = nullptr); 104 static void requestPermission(ExecutionContext*, NotificationPermissionCallb ack* = nullptr);
105 105
106 // EventTarget interface. 106 // EventTarget interface.
107 ExecutionContext* executionContext() const final { return ActiveDOMObject::e xecutionContext(); } 107 ExecutionContext* executionContext() const final { return ActiveDOMObject::e xecutionContext(); }
108 bool dispatchEvent(PassRefPtrWillBeRawPtr<Event>) final;
109 const AtomicString& interfaceName() const override; 108 const AtomicString& interfaceName() const override;
110 109
111 // ActiveDOMObject interface. 110 // ActiveDOMObject interface.
112 void stop() override; 111 void stop() override;
113 bool hasPendingActivity() const override; 112 bool hasPendingActivity() const override;
114 113
115 DECLARE_VIRTUAL_TRACE(); 114 DECLARE_VIRTUAL_TRACE();
116 115
116 protected:
117 // EventTarget interface.
118 bool dispatchEventInternal(PassRefPtrWillBeRawPtr<Event>) final;
119
117 private: 120 private:
118 Notification(const String& title, ExecutionContext*); 121 Notification(const String& title, ExecutionContext*);
119 122
120 void scheduleShow(); 123 void scheduleShow();
121 124
122 // Calling show() may start asynchronous operation. If this object has 125 // Calling show() may start asynchronous operation. If this object has
123 // a V8 wrapper, hasPendingActivity() prevents the wrapper from being 126 // a V8 wrapper, hasPendingActivity() prevents the wrapper from being
124 // collected while m_state is Showing, and so this instance stays alive 127 // collected while m_state is Showing, and so this instance stays alive
125 // until the operation completes. Otherwise, you need to hold a ref on this 128 // until the operation completes. Otherwise, you need to hold a ref on this
126 // instance until the operation completes. 129 // instance until the operation completes.
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
166 void setState(NotificationState state) { m_state = state; } 169 void setState(NotificationState state) { m_state = state; }
167 170
168 NotificationState m_state; 171 NotificationState m_state;
169 172
170 AsyncMethodRunner<Notification> m_asyncRunner; 173 AsyncMethodRunner<Notification> m_asyncRunner;
171 }; 174 };
172 175
173 } // namespace blink 176 } // namespace blink
174 177
175 #endif // Notification_h 178 #endif // Notification_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698