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

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

Issue 769273004: Push API: Merge the FromDocument and FromWorker registration methods (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@threading
Patch Set: from_document -> FromDocument 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 ac79e937ad8240f1d8006d979aaf8f5551feaf7d..60ea948ad1dd0a435b869c20a0b1d41f3cf3d411 100644
--- a/content/browser/push_messaging/push_messaging_message_filter.h
+++ b/content/browser/push_messaging/push_messaging_message_filter.h
@@ -27,6 +27,18 @@ class PushMessagingMessageFilter : public BrowserMessageFilter {
ServiceWorkerContextWrapper* service_worker_context);
private:
+ struct RegisterData {
+ RegisterData();
+ RegisterData(const RegisterData& other) = default;
+ bool FromDocument() const;
+ int request_id;
+ GURL requesting_origin;
+ int64 service_worker_registration_id;
+ // The following two members should only be read if FromDocument() is true.
+ int render_frame_id;
+ bool user_visible_only;
+ };
+
~PushMessagingMessageFilter() override;
// BrowserMessageFilter implementation.
@@ -50,17 +62,8 @@ class PushMessagingMessageFilter : public BrowserMessageFilter {
void OnGetPermissionStatus(int request_id,
int64 service_worker_registration_id);
- void RegisterFromDocumentOnUI(int render_frame_id,
- int request_id,
- const std::string& sender_id,
- bool user_visible_only,
- const GURL& requesting_origin,
- int64 service_worker_registration_id);
-
- void RegisterFromWorkerOnUI(int request_id,
- const std::string& sender_id,
- const GURL& requesting_origin,
- int64 service_worker_registration_id);
+ void RegisterOnUI(const RegisterData& data,
+ const std::string& sender_id);
// TODO(mvanouwerkerk): Delete once the Push API flows through platform.
// https://crbug.com/389194
@@ -70,14 +73,14 @@ class PushMessagingMessageFilter : public BrowserMessageFilter {
void GetPermissionStatusOnUI(const GURL& requesting_origin, int request_id);
- void DidRegisterFromDocument(int render_frame_id,
- int request_id,
- const std::string& push_registration_id,
- PushRegistrationStatus status);
+ void DidRegister(const RegisterData& data,
+ const std::string& push_registration_id,
+ PushRegistrationStatus status);
- void DidRegisterFromWorker(int request_id,
- const std::string& push_registration_id,
- PushRegistrationStatus status);
+ void SendRegisterError(const RegisterData& data,
+ PushRegistrationStatus status);
+ void SendRegisterSuccess(const RegisterData& data,
+ const std::string& push_registration_id);
PushMessagingService* service();
« 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