OLD | NEW |
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 <set> | 9 #include <set> |
10 #include <vector> | 10 #include <vector> |
11 | 11 |
12 #include "base/callback.h" | 12 #include "base/callback.h" |
13 #include "base/compiler_specific.h" | 13 #include "base/compiler_specific.h" |
14 #include "base/gtest_prod_util.h" | 14 #include "base/gtest_prod_util.h" |
| 15 #include "base/macros.h" |
15 #include "base/memory/scoped_ptr.h" | 16 #include "base/memory/scoped_ptr.h" |
16 #include "base/memory/weak_ptr.h" | 17 #include "base/memory/weak_ptr.h" |
17 #include "chrome/browser/background/background_trigger.h" | 18 #include "chrome/browser/background/background_trigger.h" |
18 #include "components/content_settings/core/browser/content_settings_observer.h" | 19 #include "components/content_settings/core/browser/content_settings_observer.h" |
19 #include "components/content_settings/core/common/content_settings.h" | 20 #include "components/content_settings/core/common/content_settings.h" |
20 #include "components/gcm_driver/common/gcm_messages.h" | 21 #include "components/gcm_driver/common/gcm_messages.h" |
21 #include "components/gcm_driver/gcm_app_handler.h" | 22 #include "components/gcm_driver/gcm_app_handler.h" |
22 #include "components/gcm_driver/gcm_client.h" | 23 #include "components/gcm_driver/gcm_client.h" |
23 #include "components/keyed_service/core/keyed_service.h" | 24 #include "components/keyed_service/core/keyed_service.h" |
24 #include "content/public/browser/push_messaging_service.h" | 25 #include "content/public/browser/push_messaging_service.h" |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
121 FRIEND_TEST_ALL_PREFIXES(PushMessagingServiceTest, PayloadEncryptionTest); | 122 FRIEND_TEST_ALL_PREFIXES(PushMessagingServiceTest, PayloadEncryptionTest); |
122 | 123 |
123 // A subscription is pending until it has succeeded or failed. | 124 // A subscription is pending until it has succeeded or failed. |
124 void IncreasePushSubscriptionCount(int add, bool is_pending); | 125 void IncreasePushSubscriptionCount(int add, bool is_pending); |
125 void DecreasePushSubscriptionCount(int subtract, bool was_pending); | 126 void DecreasePushSubscriptionCount(int subtract, bool was_pending); |
126 | 127 |
127 // OnMessage methods --------------------------------------------------------- | 128 // OnMessage methods --------------------------------------------------------- |
128 | 129 |
129 void DeliverMessageCallback(const std::string& app_id, | 130 void DeliverMessageCallback(const std::string& app_id, |
130 const GURL& requesting_origin, | 131 const GURL& requesting_origin, |
131 int64 service_worker_registration_id, | 132 int64_t service_worker_registration_id, |
132 const gcm::IncomingMessage& message, | 133 const gcm::IncomingMessage& message, |
133 const base::Closure& message_handled_closure, | 134 const base::Closure& message_handled_closure, |
134 content::PushDeliveryStatus status); | 135 content::PushDeliveryStatus status); |
135 | 136 |
136 void DidHandleMessage(const std::string& app_id, | 137 void DidHandleMessage(const std::string& app_id, |
137 const base::Closure& completion_closure); | 138 const base::Closure& completion_closure); |
138 | 139 |
139 // Subscribe methods --------------------------------------------------------- | 140 // Subscribe methods --------------------------------------------------------- |
140 | 141 |
141 void SubscribeEnd( | 142 void SubscribeEnd( |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
238 MessageDispatchedCallback message_dispatched_callback_for_testing_; | 239 MessageDispatchedCallback message_dispatched_callback_for_testing_; |
239 | 240 |
240 scoped_ptr<PushMessagingServiceObserver> push_messaging_service_observer_; | 241 scoped_ptr<PushMessagingServiceObserver> push_messaging_service_observer_; |
241 | 242 |
242 base::WeakPtrFactory<PushMessagingServiceImpl> weak_factory_; | 243 base::WeakPtrFactory<PushMessagingServiceImpl> weak_factory_; |
243 | 244 |
244 DISALLOW_COPY_AND_ASSIGN(PushMessagingServiceImpl); | 245 DISALLOW_COPY_AND_ASSIGN(PushMessagingServiceImpl); |
245 }; | 246 }; |
246 | 247 |
247 #endif // CHROME_BROWSER_PUSH_MESSAGING_PUSH_MESSAGING_SERVICE_IMPL_H_ | 248 #endif // CHROME_BROWSER_PUSH_MESSAGING_PUSH_MESSAGING_SERVICE_IMPL_H_ |
OLD | NEW |