Index: content/child/push_messaging/push_provider.h |
diff --git a/content/child/push_messaging/push_provider.h b/content/child/push_messaging/push_provider.h |
index 0c81d60a47608071e59c8d6d67a4edc81e61d058..e1c8ca586fa62ba793ae65d8fef688d4db4b9924 100644 |
--- a/content/child/push_messaging/push_provider.h |
+++ b/content/child/push_messaging/push_provider.h |
@@ -11,6 +11,7 @@ |
#include "base/memory/ref_counted.h" |
#include "content/child/push_messaging/push_dispatcher.h" |
#include "content/child/worker_task_runner.h" |
+#include "third_party/WebKit/public/platform/WebPushError.h" |
#include "third_party/WebKit/public/platform/WebPushProvider.h" |
class GURL; |
@@ -34,10 +35,12 @@ class PushProvider : public blink::WebPushProvider, |
void OnWorkerRunLoopStopped() override; |
// blink::WebPushProvider implementation. |
- void registerPushMessaging(blink::WebServiceWorkerRegistration*, |
- blink::WebPushRegistrationCallbacks*) override; |
- void getPermissionStatus(blink::WebServiceWorkerRegistration*, |
- blink::WebPushPermissionStatusCallbacks*) override; |
+ virtual void registerPushMessaging(blink::WebServiceWorkerRegistration*, |
+ blink::WebPushRegistrationCallbacks*); |
+ virtual void unregister(blink::WebServiceWorkerRegistration*, |
+ blink::WebPushUnregisterCallbacks*); |
+ virtual void getPermissionStatus(blink::WebServiceWorkerRegistration*, |
+ blink::WebPushPermissionStatusCallbacks*); |
// Called by the PushDispatcher. |
bool OnMessageReceived(const IPC::Message& message); |
@@ -51,6 +54,10 @@ class PushProvider : public blink::WebPushProvider, |
const GURL& endpoint, |
const std::string& registration_id); |
void OnRegisterFromWorkerError(int request_id, PushRegistrationStatus status); |
+ void OnUnregisterSuccess(int request_id, bool did_unregister); |
+ void OnUnregisterError(int request_id, |
+ blink::WebPushError::ErrorType error_type, |
+ const std::string& error_message); |
void OnGetPermissionStatusSuccess(int request_id, |
blink::WebPushPermissionStatus status); |
void OnGetPermissionStatusError(int request_id); |
@@ -68,6 +75,11 @@ class PushProvider : public blink::WebPushProvider, |
IDMap<blink::WebPushPermissionStatusCallbacks, IDMapOwnPointer> |
permission_status_callbacks_; |
+ // Stores the unregistration callbacks with their request ids. This class owns |
+ // the callbacks. |
+ IDMap<blink::WebPushUnregisterCallbacks, IDMapOwnPointer> |
+ unregister_callbacks_; |
+ |
DISALLOW_COPY_AND_ASSIGN(PushProvider); |
}; |