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

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

Issue 1931843002: Ship Web Push subscription restrictions (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 months 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 77548ea0cb7ac3f1adf2c7ac16edf946eec95683..49b2567a5e689cb82ffa5cfd837085b67a867f49 100644
--- a/content/browser/push_messaging/push_messaging_message_filter.h
+++ b/content/browser/push_messaging/push_messaging_message_filter.h
@@ -18,8 +18,6 @@
#include "content/public/common/push_messaging_status.h"
#include "url/gurl.h"
-class GURL;
-
namespace content {
class PushMessagingService;
@@ -143,8 +141,14 @@ class PushMessagingMessageFilter : public BrowserMessageFilter {
void OnGetSubscription(int request_id,
int64_t service_worker_registration_id);
+ void DidGetSenderInfo(int request_id,
+ int64_t service_worker_registration_id,
+ const std::string& sender_info,
+ ServiceWorkerStatusCode status);
+
void DidGetSubscription(int request_id,
int64_t service_worker_registration_id,
+ bool uses_standard_protocol,
const std::string& push_subscription_id,
ServiceWorkerStatusCode status);
@@ -165,13 +169,23 @@ class PushMessagingMessageFilter : public BrowserMessageFilter {
// Called via PostTask from UI thread.
void SendIPC(std::unique_ptr<IPC::Message> message);
+ // Helper methods on either thread -------------------------------------------
+
+ // Creates an endpoint for |subscription_id| with either the default protocol,
+ // or the standardized Web Push Protocol, depending on |standard_protocol|.
+ GURL CreateEndpoint(bool standard_protocol,
+ const std::string& subscription_id) const;
+
// Inner core of this message filter which lives on the UI thread.
std::unique_ptr<Core, BrowserThread::DeleteOnUIThread> ui_core_;
scoped_refptr<ServiceWorkerContextWrapper> service_worker_context_;
- // Empty if no PushMessagingService was available when constructed.
- GURL push_endpoint_base_;
+ // Whether the PushMessagingService was available when constructed.
+ bool service_available_;
+
+ GURL default_endpoint_;
+ GURL web_push_protocol_endpoint_;
base::WeakPtrFactory<PushMessagingMessageFilter> weak_factory_io_to_io_;

Powered by Google App Engine
This is Rietveld 408576698