| Index: third_party/WebKit/Source/modules/notifications/Notification.h
|
| diff --git a/third_party/WebKit/Source/modules/notifications/Notification.h b/third_party/WebKit/Source/modules/notifications/Notification.h
|
| index 771751f9a274416ccb3d084cb7db7dfc70229534..e3e0b628dab804689b65fa9979f03b04573123e7 100644
|
| --- a/third_party/WebKit/Source/modules/notifications/Notification.h
|
| +++ b/third_party/WebKit/Source/modules/notifications/Notification.h
|
| @@ -54,6 +54,7 @@ class ExecutionContext;
|
| class NotificationAction;
|
| class NotificationOptions;
|
| class NotificationPermissionCallback;
|
| +class NotificationResourcesLoader;
|
| class ScriptState;
|
|
|
| class MODULES_EXPORT Notification final : public EventTargetWithInlineData, public ActiveScriptWrappable, public ActiveDOMObject, public WebNotificationDelegate {
|
| @@ -124,14 +125,17 @@ protected:
|
| private:
|
| Notification(ExecutionContext*, const WebNotificationData&);
|
|
|
| - void scheduleShow();
|
| + // Schedules an asynchronous call to |prepareShow|, allowing the constructor
|
| + // to return so that events can be fired on the notification object.
|
| + void schedulePrepareShow();
|
|
|
| - // Calling show() may start asynchronous operation. If this object has
|
| - // a V8 wrapper, hasPendingActivity() prevents the wrapper from being
|
| - // collected while m_state is Showing, and so this instance stays alive
|
| - // until the operation completes. Otherwise, you need to hold a ref on this
|
| - // instance until the operation completes.
|
| - void show();
|
| + // Checks permission and loads any necessary resources (this may be async)
|
| + // before showing the notification.
|
| + void prepareShow();
|
| +
|
| + // Shows the notification, using the resources loaded by the
|
| + // NotificationResourcesLoader.
|
| + void didLoadResources(NotificationResourcesLoader*);
|
|
|
| void setPersistentId(int64_t persistentId) { m_persistentId = persistentId; }
|
|
|
| @@ -158,7 +162,9 @@ private:
|
|
|
| NotificationState m_state;
|
|
|
| - Member<AsyncMethodRunner<Notification>> m_asyncRunner;
|
| + Member<AsyncMethodRunner<Notification>> m_prepareShowMethodRunner;
|
| +
|
| + Member<NotificationResourcesLoader> m_loader;
|
| };
|
|
|
| } // namespace blink
|
|
|