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

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

Issue 1130233003: Reject the permissionState promise with NotSupported Exception (1/3) (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 7 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 "config.h" 5 #include "config.h"
6 #include "modules/push_messaging/PushManager.h" 6 #include "modules/push_messaging/PushManager.h"
7 7
8 #include "bindings/core/v8/CallbackPromiseAdapter.h" 8 #include "bindings/core/v8/CallbackPromiseAdapter.h"
9 #include "bindings/core/v8/ScriptPromise.h" 9 #include "bindings/core/v8/ScriptPromise.h"
10 #include "bindings/core/v8/ScriptPromiseResolver.h" 10 #include "bindings/core/v8/ScriptPromiseResolver.h"
(...skipping 23 matching lines...) Expand all
34 WebPushProvider* webPushProvider = Platform::current()->pushProvider(); 34 WebPushProvider* webPushProvider = Platform::current()->pushProvider();
35 ASSERT(webPushProvider); 35 ASSERT(webPushProvider);
36 return webPushProvider; 36 return webPushProvider;
37 } 37 }
38 38
39 WebPushSubscriptionOptions toWebPushSubscriptionOptions(const PushSubscriptionOp tions& options) 39 WebPushSubscriptionOptions toWebPushSubscriptionOptions(const PushSubscriptionOp tions& options)
40 { 40 {
41 WebPushSubscriptionOptions webOptions; 41 WebPushSubscriptionOptions webOptions;
42 webOptions.userVisibleOnly = options.userVisibleOnly(); 42 webOptions.userVisibleOnly = options.userVisibleOnly();
43 43
44 // Backfill userVisible since it's still used by the chrome layer.
45 webOptions.userVisible = options.userVisibleOnly();
44 return webOptions; 46 return webOptions;
45 } 47 }
46 48
47 } // namespace 49 } // namespace
48 50
49 PushManager::PushManager(ServiceWorkerRegistration* registration) 51 PushManager::PushManager(ServiceWorkerRegistration* registration)
50 : m_registration(registration) 52 : m_registration(registration)
51 { 53 {
52 ASSERT(registration); 54 ASSERT(registration);
53 } 55 }
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 pushProvider()->getPermissionStatus(m_registration->webRegistration(), toWeb PushSubscriptionOptions(options), new PushPermissionStatusCallbacks(resolver)); 102 pushProvider()->getPermissionStatus(m_registration->webRegistration(), toWeb PushSubscriptionOptions(options), new PushPermissionStatusCallbacks(resolver));
101 return promise; 103 return promise;
102 } 104 }
103 105
104 DEFINE_TRACE(PushManager) 106 DEFINE_TRACE(PushManager)
105 { 107 {
106 visitor->trace(m_registration); 108 visitor->trace(m_registration);
107 } 109 }
108 110
109 } // namespace blink 111 } // namespace blink
OLDNEW
« no previous file with comments | « Source/modules/push_messaging/PushError.cpp ('k') | Source/modules/push_messaging/PushPermissionStatusCallbacks.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698