diff options
author | harkness <harkness@chromium.org> | 2016-03-21 04:58:17 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-03-21 11:59:32 +0000 |
commit | 35c378e23dccd1bf2ad7da30bc93ffbb152859ea (patch) | |
tree | 08acce4f3b9f8529e1d6ed263ed7f6aa97011698 /content/shell/browser | |
parent | 3bdd60d1af1e6f30b1323e6e3ab3946b170f7444 (diff) | |
download | chromium_src-35c378e23dccd1bf2ad7da30bc93ffbb152859ea.zip chromium_src-35c378e23dccd1bf2ad7da30bc93ffbb152859ea.tar.gz chromium_src-35c378e23dccd1bf2ad7da30bc93ffbb152859ea.tar.bz2 |
Implementation of subscription restrictions.
Currently, chrome requires that app developers provide a "sender_id" tag in the
manifest. This id is generated by the developer console and is not standard
for all browsers.
In the future, the app developer will be able to specify a public key for their
service, which will be registered with the push service and which the push
service can use to validate app services requesting to send messages.
This is a reland of CL https://codereview.chromium.org/1701313002. The only diff is content/renderer/push_messaging/push_messaging_dispatcher.cc where the request_id is set inside the return.
BUG=583753
TBR=avi,mkwst
Cr-Commit-Position: refs/heads/master@{#379045}
Review URL: https://codereview.chromium.org/1801113003
Cr-Commit-Position: refs/heads/master@{#382268}
Diffstat (limited to 'content/shell/browser')
-rw-r--r-- | content/shell/browser/layout_test/layout_test_push_messaging_service.cc | 11 | ||||
-rw-r--r-- | content/shell/browser/layout_test/layout_test_push_messaging_service.h | 8 |
2 files changed, 9 insertions, 10 deletions
diff --git a/content/shell/browser/layout_test/layout_test_push_messaging_service.cc b/content/shell/browser/layout_test/layout_test_push_messaging_service.cc index 11554e9..c346a08 100644 --- a/content/shell/browser/layout_test/layout_test_push_messaging_service.cc +++ b/content/shell/browser/layout_test/layout_test_push_messaging_service.cc @@ -8,6 +8,7 @@ #include "base/logging.h" #include "base/macros.h" #include "content/public/browser/permission_type.h" +#include "content/public/common/push_subscription_options.h" #include "content/shell/browser/layout_test/layout_test_browser_context.h" #include "content/shell/browser/layout_test/layout_test_content_browser_client.h" #include "content/shell/browser/layout_test/layout_test_permission_manager.h" @@ -67,22 +68,20 @@ GURL LayoutTestPushMessagingService::GetPushEndpoint() { void LayoutTestPushMessagingService::SubscribeFromDocument( const GURL& requesting_origin, int64_t service_worker_registration_id, - const std::string& sender_id, int renderer_id, int render_frame_id, - bool user_visible, + const PushSubscriptionOptions& options, const PushMessagingService::RegisterCallback& callback) { SubscribeFromWorker(requesting_origin, service_worker_registration_id, - sender_id, user_visible, callback); + options, callback); } void LayoutTestPushMessagingService::SubscribeFromWorker( const GURL& requesting_origin, int64_t service_worker_registration_id, - const std::string& sender_id, - bool user_visible, + const PushSubscriptionOptions& options, const PushMessagingService::RegisterCallback& callback) { - if (GetPermissionStatus(requesting_origin, user_visible) == + if (GetPermissionStatus(requesting_origin, options.user_visible_only) == blink::WebPushPermissionStatusGranted) { std::vector<uint8_t> p256dh( kTestP256Key, kTestP256Key + arraysize(kTestP256Key)); diff --git a/content/shell/browser/layout_test/layout_test_push_messaging_service.h b/content/shell/browser/layout_test/layout_test_push_messaging_service.h index eb5e7e4..5e5a7a48 100644 --- a/content/shell/browser/layout_test/layout_test_push_messaging_service.h +++ b/content/shell/browser/layout_test/layout_test_push_messaging_service.h @@ -17,6 +17,8 @@ namespace content { +struct PushSubscriptionOptions; + class LayoutTestPushMessagingService : public PushMessagingService { public: LayoutTestPushMessagingService(); @@ -27,16 +29,14 @@ class LayoutTestPushMessagingService : public PushMessagingService { void SubscribeFromDocument( const GURL& requesting_origin, int64_t service_worker_registration_id, - const std::string& sender_id, int renderer_id, int render_frame_id, - bool user_visible, + const PushSubscriptionOptions& options, const PushMessagingService::RegisterCallback& callback) override; void SubscribeFromWorker( const GURL& requesting_origin, int64_t service_worker_registration_id, - const std::string& sender_id, - bool user_visible, + const PushSubscriptionOptions& options, const PushMessagingService::RegisterCallback& callback) override; void GetEncryptionInfo( const GURL& origin, |