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

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: Rebase 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
« no previous file with comments | « no previous file | content/browser/push_messaging/push_messaging_message_filter.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 85134e37bf68013e1370f685c5f58bc0cec53253..6414cc16555da0033eb0e395d5972e6caa748f2d 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,9 +78,20 @@ class PushMessagingMessageFilter : public BrowserMessageFilter {
const std::string& push_registration_id,
PushRegistrationStatus status);
+ void PersistRegistrationOnIO(const RegisterData& data,
+ const GURL& push_endpoint,
+ const std::string& push_registration_id);
+
+ void DidPersistRegistrationOnIO(
+ const RegisterData& data,
+ const GURL& push_endpoint,
+ const std::string& push_registration_id,
+ ServiceWorkerStatusCode service_worker_status);
+
void SendRegisterError(const RegisterData& data,
PushRegistrationStatus status);
void SendRegisterSuccess(const RegisterData& data,
+ const GURL& push_endpoint,
const std::string& push_registration_id);
// Returns a push messaging service. The embedder owns the service, and is
@@ -93,9 +105,12 @@ 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
- // lifetime of this messaging filter.
+ // Should only be used for asynchronous calls on the IO thread with external
+ // dependencies that might outlive this class e.g. ServiceWorkerStorage.
+ base::WeakPtrFactory<PushMessagingMessageFilter> weak_factory_io_to_io_;
+
+ // TODO(johnme): Remove this, it seems unsafe since this class 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);
« no previous file with comments | « no previous file | content/browser/push_messaging/push_messaging_message_filter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698