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

Side by Side Diff: content/public/browser/push_messaging_service.h

Issue 2387483002: Push API: Refactor and fix unsubscribe API (Closed)
Patch Set: Added enum reuse comments Created 4 years, 2 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_PUBLIC_BROWSER_PUSH_MESSAGING_SERVICE_H_ 5 #ifndef CONTENT_PUBLIC_BROWSER_PUSH_MESSAGING_SERVICE_H_
6 #define CONTENT_PUBLIC_BROWSER_PUSH_MESSAGING_SERVICE_H_ 6 #define CONTENT_PUBLIC_BROWSER_PUSH_MESSAGING_SERVICE_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 virtual bool SupportNonVisibleMessages() = 0; 96 virtual bool SupportNonVisibleMessages() = 0;
97 97
98 protected: 98 protected:
99 static void GetSenderId(BrowserContext* browser_context, 99 static void GetSenderId(BrowserContext* browser_context,
100 const GURL& origin, 100 const GURL& origin,
101 int64_t service_worker_registration_id, 101 int64_t service_worker_registration_id,
102 const StringCallback& callback); 102 const StringCallback& callback);
103 103
104 // Clear the push subscription id stored in the service worker with the given 104 // Clear the push subscription id stored in the service worker with the given
105 // |service_worker_registration_id| for the given |origin|. 105 // |service_worker_registration_id| for the given |origin|.
106 static void ClearPushSubscriptionID(BrowserContext* browser_context, 106 static void ClearPushSubscriptionId(BrowserContext* browser_context,
107 const GURL& origin, 107 const GURL& origin,
108 int64_t service_worker_registration_id, 108 int64_t service_worker_registration_id,
109 const base::Closure& callback); 109 const base::Closure& callback);
110 110
111 // Stores a push subscription in the service worker for the given |origin|. 111 // Stores a push subscription in the service worker for the given |origin|.
112 // Must only be used by tests. 112 // Must only be used by tests.
113 static void StorePushSubscriptionForTesting( 113 static void StorePushSubscriptionForTesting(
114 BrowserContext* browser_context, 114 BrowserContext* browser_context,
115 const GURL& origin, 115 const GURL& origin,
116 int64_t service_worker_registration_id, 116 int64_t service_worker_registration_id,
117 const std::string& subscription_id, 117 const std::string& subscription_id,
118 const std::string& sender_id, 118 const std::string& sender_id,
119 const base::Closure& callback); 119 const base::Closure& callback);
120 }; 120 };
121 121
122 } // namespace content 122 } // namespace content
123 123
124 #endif // CONTENT_PUBLIC_BROWSER_PUSH_MESSAGING_SERVICE_H_ 124 #endif // CONTENT_PUBLIC_BROWSER_PUSH_MESSAGING_SERVICE_H_
OLDNEW
« no previous file with comments | « content/browser/push_messaging/push_messaging_message_filter.cc ('k') | content/public/browser/push_messaging_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698