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

Unified Diff: content/browser/push_messaging/push_messaging_message_filter.h

Issue 758403003: Push API: Store push registration IDs for GetRegistration etc (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@endpoint
Patch Set: Fix comment Created 6 years 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 side-by-side diff with in-line comments
Download patch
Index: content/browser/push_messaging/push_messaging_message_filter.h
diff --git a/content/browser/push_messaging/push_messaging_message_filter.h b/content/browser/push_messaging/push_messaging_message_filter.h
index 60ea948ad1dd0a435b869c20a0b1d41f3cf3d411..c879776b0189fb3a8c3ea948069f2fc32f9c20d3 100644
--- a/content/browser/push_messaging/push_messaging_message_filter.h
+++ b/content/browser/push_messaging/push_messaging_message_filter.h
@@ -9,6 +9,7 @@
#include "base/memory/ref_counted.h"
#include "base/memory/weak_ptr.h"
+#include "content/common/service_worker/service_worker_status_code.h"
#include "content/public/browser/browser_message_filter.h"
#include "content/public/common/push_messaging_status.h"
#include "url/gurl.h"
@@ -77,6 +78,13 @@ class PushMessagingMessageFilter : public BrowserMessageFilter {
const std::string& push_registration_id,
PushRegistrationStatus status);
+ void DoPersistRegistration(const RegisterData& data,
+ const std::string& push_registration_id);
+
+ void DidPersistRegistration(const RegisterData& data,
+ const std::string& push_registration_id,
+ ServiceWorkerStatusCode service_worker_status);
+
void SendRegisterError(const RegisterData& data,
PushRegistrationStatus status);
void SendRegisterSuccess(const RegisterData& data,
@@ -90,9 +98,13 @@ class PushMessagingMessageFilter : public BrowserMessageFilter {
// Owned by the content embedder's browsing context.
PushMessagingService* service_;
- // Should only be used for asynchronous calls to the PushMessagingService on
- // the UI thread, which may have external dependencies that supersede the
+ // Should only be used for asynchronous calls to ServiceWorkerStorage on the
+ // IO thread, which may have external dependencies that supersede the
// lifetime of this messaging filter.
+ base::WeakPtrFactory<PushMessagingMessageFilter> weak_factory_io_to_io_;
+
+ // TODO(johnme): Remove this, it seems unsafe since this could be destroyed
+ // on the IO thread while the callback runs on the UI thread.
base::WeakPtrFactory<PushMessagingMessageFilter> weak_factory_ui_to_ui_;
DISALLOW_COPY_AND_ASSIGN(PushMessagingMessageFilter);

Powered by Google App Engine
This is Rietveld 408576698