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

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

Issue 1701313002: Partial implementation of subscription restrictions. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added exception failure return and updated more tests Created 4 years, 9 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 #ifndef PushManager_h 5 #ifndef PushManager_h
6 #define PushManager_h 6 #define PushManager_h
7 7
8 #include "bindings/core/v8/ScriptWrappable.h" 8 #include "bindings/core/v8/ScriptWrappable.h"
9 #include "bindings/modules/v8/UnionTypesModules.h"
9 #include "platform/heap/Handle.h" 10 #include "platform/heap/Handle.h"
10 11
11 namespace blink { 12 namespace blink {
12 13
13 class PushSubscriptionOptions; 14 class PushSubscriptionOptions;
14 class ScriptPromise; 15 class ScriptPromise;
15 class ScriptState; 16 class ScriptState;
16 class ServiceWorkerRegistration; 17 class ServiceWorkerRegistration;
18 struct WebPushSubscriptionOptions;
17 19
18 class PushManager final : public GarbageCollected<PushManager>, public ScriptWra ppable { 20 class PushManager final : public GarbageCollected<PushManager>, public ScriptWra ppable {
19 DEFINE_WRAPPERTYPEINFO(); 21 DEFINE_WRAPPERTYPEINFO();
20 public: 22 public:
21 static PushManager* create(ServiceWorkerRegistration* registration) 23 static PushManager* create(ServiceWorkerRegistration* registration)
22 { 24 {
23 return new PushManager(registration); 25 return new PushManager(registration);
24 } 26 }
25 27
26 ScriptPromise subscribe(ScriptState*, const PushSubscriptionOptions&); 28 ScriptPromise subscribe(ScriptState*, const PushSubscriptionOptions&,
29 ExceptionState&);
Peter Beverloo 2016/02/26 16:02:33 nit: forward declare
harkness 2016/02/26 17:12:04 Done.
27 ScriptPromise getSubscription(ScriptState*); 30 ScriptPromise getSubscription(ScriptState*);
28 ScriptPromise permissionState(ScriptState*, const PushSubscriptionOptions&); 31 ScriptPromise permissionState(ScriptState*, const PushSubscriptionOptions&,
32 ExceptionState&);
29 33
30 DECLARE_TRACE(); 34 DECLARE_TRACE();
31 35
36 static WebPushSubscriptionOptions toWebPushSubscriptionOptions(
37 const PushSubscriptionOptions&, ExceptionState&);
38
32 private: 39 private:
40 static String toString(const ArrayBufferOrArrayBufferView& applicationServer Key,
Peter Beverloo 2016/02/26 16:02:33 nit 1: this should be internal to PushManager.cpp.
harkness 2016/02/26 17:12:04 Done.
41 ExceptionState&);
33 explicit PushManager(ServiceWorkerRegistration*); 42 explicit PushManager(ServiceWorkerRegistration*);
34 43
35 Member<ServiceWorkerRegistration> m_registration; 44 Member<ServiceWorkerRegistration> m_registration;
36 }; 45 };
37 46
38 } // namespace blink 47 } // namespace blink
39 48
40 #endif // PushManager_h 49 #endif // PushManager_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698