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

Side by Side Diff: content/shell/browser/layout_test/layout_test_push_messaging_service.h

Issue 2697793004: Push API: Validate storage before returning cached subscriptions (Closed)
Patch Set: Fix include Created 3 years, 8 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 CONTENT_SHELL_BROWSER_LAYOUT_TEST_LAYOUT_TEST_PUSH_MESSAGING_SERVICE_H_ 5 #ifndef CONTENT_SHELL_BROWSER_LAYOUT_TEST_LAYOUT_TEST_PUSH_MESSAGING_SERVICE_H_
6 #define CONTENT_SHELL_BROWSER_LAYOUT_TEST_LAYOUT_TEST_PUSH_MESSAGING_SERVICE_H_ 6 #define CONTENT_SHELL_BROWSER_LAYOUT_TEST_LAYOUT_TEST_PUSH_MESSAGING_SERVICE_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <map> 10 #include <map>
11 #include <set> 11 #include <set>
12 12
13 #include "base/macros.h" 13 #include "base/macros.h"
14 #include "content/public/browser/push_messaging_service.h" 14 #include "content/public/browser/push_messaging_service.h"
15 #include "content/public/common/push_messaging_status.h" 15 #include "content/public/common/push_messaging_status.h"
16 #include "third_party/WebKit/public/platform/modules/push_messaging/WebPushPermi ssionStatus.h" 16 #include "third_party/WebKit/public/platform/modules/push_messaging/WebPushPermi ssionStatus.h"
17 17
18 namespace content { 18 namespace content {
19 19
20 struct PushSubscriptionOptions; 20 struct PushSubscriptionOptions;
21 21
22 class LayoutTestPushMessagingService : public PushMessagingService { 22 class LayoutTestPushMessagingService : public PushMessagingService {
23 public: 23 public:
24 LayoutTestPushMessagingService(); 24 LayoutTestPushMessagingService();
25 ~LayoutTestPushMessagingService() override; 25 ~LayoutTestPushMessagingService() override;
26 26
27 // PushMessagingService implementation: 27 // PushMessagingService implementation:
28 GURL GetEndpoint(bool standard_protocol) const override; 28 GURL GetEndpoint(bool standard_protocol) const override;
29 void SubscribeFromDocument( 29 void SubscribeFromDocument(const GURL& requesting_origin,
30 const GURL& requesting_origin, 30 int64_t service_worker_registration_id,
31 int64_t service_worker_registration_id, 31 int renderer_id,
32 int renderer_id, 32 int render_frame_id,
33 int render_frame_id, 33 const PushSubscriptionOptions& options,
34 const PushSubscriptionOptions& options, 34 const RegisterCallback& callback) override;
35 const PushMessagingService::RegisterCallback& callback) override; 35 void SubscribeFromWorker(const GURL& requesting_origin,
36 void SubscribeFromWorker( 36 int64_t service_worker_registration_id,
37 const GURL& requesting_origin, 37 const PushSubscriptionOptions& options,
38 int64_t service_worker_registration_id, 38 const RegisterCallback& callback) override;
39 const PushSubscriptionOptions& options, 39 void GetSubscriptionInfo(const GURL& origin,
40 const PushMessagingService::RegisterCallback& callback) override; 40 int64_t service_worker_registration_id,
41 void GetEncryptionInfo( 41 const std::string& sender_id,
42 const GURL& origin, 42 const std::string& subscription_id,
43 int64_t service_worker_registration_id, 43 const SubscriptionInfoCallback& callback) override;
44 const std::string& sender_id,
45 const PushMessagingService::EncryptionInfoCallback& callback) override;
46 blink::WebPushPermissionStatus GetPermissionStatus(const GURL& origin, 44 blink::WebPushPermissionStatus GetPermissionStatus(const GURL& origin,
47 bool user_visible) 45 bool user_visible)
48 override; 46 override;
49 bool SupportNonVisibleMessages() override; 47 bool SupportNonVisibleMessages() override;
50 void Unsubscribe(const GURL& requesting_origin, 48 void Unsubscribe(PushUnregistrationReason reason,
49 const GURL& requesting_origin,
51 int64_t service_worker_registration_id, 50 int64_t service_worker_registration_id,
52 const std::string& sender_id, 51 const std::string& sender_id,
53 const UnregisterCallback& callback) override; 52 const UnregisterCallback& callback) override;
54 void DidDeleteServiceWorkerRegistration( 53 void DidDeleteServiceWorkerRegistration(
55 const GURL& origin, 54 const GURL& origin,
56 int64_t service_worker_registration_id) override; 55 int64_t service_worker_registration_id) override;
57 56
58 private: 57 private:
59 int64_t subscribed_service_worker_registration_; 58 int64_t subscribed_service_worker_registration_;
60 59
61 DISALLOW_COPY_AND_ASSIGN(LayoutTestPushMessagingService); 60 DISALLOW_COPY_AND_ASSIGN(LayoutTestPushMessagingService);
62 }; 61 };
63 62
64 } // namespace content 63 } // namespace content
65 64
66 #endif // CONTENT_SHELL_BROWSER_LAYOUT_TEST_LAYOUT_TEST_PUSH_MESSAGING_SERVICE_ H_ 65 #endif // CONTENT_SHELL_BROWSER_LAYOUT_TEST_LAYOUT_TEST_PUSH_MESSAGING_SERVICE_ H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698