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

Side by Side Diff: chrome/browser/push_messaging/push_messaging_service_impl.h

Issue 2697793004: Push API: Validate storage before returning cached subscriptions (Closed)
Patch Set: Comment out PUSH_GETREGISTRATION_STATUS_PUBLIC_KEY_UNAVAILABLE Created 3 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 #ifndef CHROME_BROWSER_PUSH_MESSAGING_PUSH_MESSAGING_SERVICE_IMPL_H_ 5 #ifndef CHROME_BROWSER_PUSH_MESSAGING_PUSH_MESSAGING_SERVICE_IMPL_H_
6 #define CHROME_BROWSER_PUSH_MESSAGING_PUSH_MESSAGING_SERVICE_IMPL_H_ 6 #define CHROME_BROWSER_PUSH_MESSAGING_PUSH_MESSAGING_SERVICE_IMPL_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 #include <memory> 9 #include <memory>
10 #include <set> 10 #include <set>
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 void SubscribeFromDocument(const GURL& requesting_origin, 75 void SubscribeFromDocument(const GURL& requesting_origin,
76 int64_t service_worker_registration_id, 76 int64_t service_worker_registration_id,
77 int renderer_id, 77 int renderer_id,
78 int render_frame_id, 78 int render_frame_id,
79 const content::PushSubscriptionOptions& options, 79 const content::PushSubscriptionOptions& options,
80 const RegisterCallback& callback) override; 80 const RegisterCallback& callback) override;
81 void SubscribeFromWorker(const GURL& requesting_origin, 81 void SubscribeFromWorker(const GURL& requesting_origin,
82 int64_t service_worker_registration_id, 82 int64_t service_worker_registration_id,
83 const content::PushSubscriptionOptions& options, 83 const content::PushSubscriptionOptions& options,
84 const RegisterCallback& callback) override; 84 const RegisterCallback& callback) override;
85 void GetEncryptionInfo(const GURL& origin, 85 void GetSubscriptionInfo(const GURL& origin,
86 int64_t service_worker_registration_id, 86 int64_t service_worker_registration_id,
87 const std::string& sender_id, 87 const std::string& sender_id,
88 const EncryptionInfoCallback& callback) override; 88 const std::string& subscription_id,
89 void Unsubscribe(const GURL& requesting_origin, 89 const SubscriptionInfoCallback& callback) override;
90 void Unsubscribe(content::PushUnregistrationReason reason,
91 const GURL& requesting_origin,
90 int64_t service_worker_registration_id, 92 int64_t service_worker_registration_id,
91 const std::string& sender_id, 93 const std::string& sender_id,
92 const UnregisterCallback&) override; 94 const UnregisterCallback&) override;
93 blink::WebPushPermissionStatus GetPermissionStatus( 95 blink::WebPushPermissionStatus GetPermissionStatus(
94 const GURL& origin, 96 const GURL& origin,
95 bool user_visible) override; 97 bool user_visible) override;
96 bool SupportNonVisibleMessages() override; 98 bool SupportNonVisibleMessages() override;
97 void DidDeleteServiceWorkerRegistration( 99 void DidDeleteServiceWorkerRegistration(
98 const GURL& origin, 100 const GURL& origin,
99 int64_t service_worker_registration_id) override; 101 int64_t service_worker_registration_id) override;
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
162 const std::string& subscription_id, 164 const std::string& subscription_id,
163 instance_id::InstanceID::Result result); 165 instance_id::InstanceID::Result result);
164 166
165 void DidSubscribeWithEncryptionInfo( 167 void DidSubscribeWithEncryptionInfo(
166 const PushMessagingAppIdentifier& app_identifier, 168 const PushMessagingAppIdentifier& app_identifier,
167 const RegisterCallback& callback, 169 const RegisterCallback& callback,
168 const std::string& subscription_id, 170 const std::string& subscription_id,
169 const std::string& p256dh, 171 const std::string& p256dh,
170 const std::string& auth_secret); 172 const std::string& auth_secret);
171 173
172 // GetEncryptionInfo method -------------------------------------------------- 174 // GetSubscriptionInfo method
175 // --------------------------------------------------
Peter Beverloo 2017/03/20 23:50:13 nit: did clang-format do this? It's now inconsiste
johnme 2017/03/30 18:36:38 Done.
173 176
174 void DidGetEncryptionInfo(const EncryptionInfoCallback& callback, 177 void DidValidateSubscription(const std::string& app_id,
178 const std::string& sender_id,
179 const SubscriptionInfoCallback& callback,
180 bool is_valid);
181
182 void DidGetEncryptionInfo(const SubscriptionInfoCallback& callback,
175 const std::string& p256dh, 183 const std::string& p256dh,
176 const std::string& auth_secret) const; 184 const std::string& auth_secret) const;
177 185
178 // Unsubscribe methods ------------------------------------------------------- 186 // Unsubscribe methods -------------------------------------------------------
179 187
180 // |origin|, |service_worker_registration_id| and |app_id| should be provided 188 // |origin|, |service_worker_registration_id| and |app_id| should be provided
181 // whenever they can be obtained. It's valid for |origin| to be empty and 189 // whenever they can be obtained. It's valid for |origin| to be empty and
182 // |service_worker_registration_id| to be kInvalidServiceWorkerRegistrationId, 190 // |service_worker_registration_id| to be kInvalidServiceWorkerRegistrationId,
183 // or for app_id to be empty, but not both at once. 191 // or for app_id to be empty, but not both at once.
184 void UnsubscribeInternal(content::PushUnregistrationReason reason, 192 void UnsubscribeInternal(content::PushUnregistrationReason reason,
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
270 // we can finish processing them without being interrupted. 278 // we can finish processing them without being interrupted.
271 std::unique_ptr<ScopedKeepAlive> in_flight_keep_alive_; 279 std::unique_ptr<ScopedKeepAlive> in_flight_keep_alive_;
272 #endif 280 #endif
273 281
274 base::WeakPtrFactory<PushMessagingServiceImpl> weak_factory_; 282 base::WeakPtrFactory<PushMessagingServiceImpl> weak_factory_;
275 283
276 DISALLOW_COPY_AND_ASSIGN(PushMessagingServiceImpl); 284 DISALLOW_COPY_AND_ASSIGN(PushMessagingServiceImpl);
277 }; 285 };
278 286
279 #endif // CHROME_BROWSER_PUSH_MESSAGING_PUSH_MESSAGING_SERVICE_IMPL_H_ 287 #endif // CHROME_BROWSER_PUSH_MESSAGING_PUSH_MESSAGING_SERVICE_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698