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

Side by Side Diff: third_party/WebKit/Source/modules/push_messaging/PushManager.cpp

Issue 1701313002: Partial implementation of subscription restrictions. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "modules/push_messaging/PushManager.h" 5 #include "modules/push_messaging/PushManager.h"
6 6
7 #include "bindings/core/v8/ScriptPromise.h" 7 #include "bindings/core/v8/ScriptPromise.h"
8 #include "bindings/core/v8/ScriptPromiseResolver.h" 8 #include "bindings/core/v8/ScriptPromiseResolver.h"
9 #include "bindings/core/v8/ScriptState.h" 9 #include "bindings/core/v8/ScriptState.h"
10 #include "core/dom/DOMException.h" 10 #include "core/dom/DOMException.h"
(...skipping 20 matching lines...) Expand all
31 { 31 {
32 WebPushProvider* webPushProvider = Platform::current()->pushProvider(); 32 WebPushProvider* webPushProvider = Platform::current()->pushProvider();
33 ASSERT(webPushProvider); 33 ASSERT(webPushProvider);
34 return webPushProvider; 34 return webPushProvider;
35 } 35 }
36 36
37 WebPushSubscriptionOptions toWebPushSubscriptionOptions(const PushSubscriptionOp tions& options) 37 WebPushSubscriptionOptions toWebPushSubscriptionOptions(const PushSubscriptionOp tions& options)
38 { 38 {
39 WebPushSubscriptionOptions webOptions; 39 WebPushSubscriptionOptions webOptions;
40 webOptions.userVisibleOnly = options.userVisibleOnly(); 40 webOptions.userVisibleOnly = options.userVisibleOnly();
41 if (options.hasAppServicePublicKey() && options.appServicePublicKey())
42 webOptions.applicationServerKey = WTF::String(static_cast<const char*>(o ptions.appServicePublicKey()->data()));
Peter Beverloo 2016/02/17 16:15:36 This isn't safe because the |applicationServerKey|
harkness 2016/02/18 10:45:15 Done.
41 return webOptions; 43 return webOptions;
42 } 44 }
43 45
44 } // namespace 46 } // namespace
45 47
46 PushManager::PushManager(ServiceWorkerRegistration* registration) 48 PushManager::PushManager(ServiceWorkerRegistration* registration)
47 : m_registration(registration) 49 : m_registration(registration)
48 { 50 {
49 ASSERT(registration); 51 ASSERT(registration);
50 } 52 }
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 pushProvider()->getPermissionStatus(m_registration->webRegistration(), toWeb PushSubscriptionOptions(options), new PushPermissionStatusCallbacks(resolver)); 97 pushProvider()->getPermissionStatus(m_registration->webRegistration(), toWeb PushSubscriptionOptions(options), new PushPermissionStatusCallbacks(resolver));
96 return promise; 98 return promise;
97 } 99 }
98 100
99 DEFINE_TRACE(PushManager) 101 DEFINE_TRACE(PushManager)
100 { 102 {
101 visitor->trace(m_registration); 103 visitor->trace(m_registration);
102 } 104 }
103 105
104 } // namespace blink 106 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698