| 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 COMPONENTS_GCM_DRIVER_GCM_CLIENT_IMPL_H_ | 5 #ifndef COMPONENTS_GCM_DRIVER_GCM_CLIENT_IMPL_H_ |
| 6 #define COMPONENTS_GCM_DRIVER_GCM_CLIENT_IMPL_H_ | 6 #define COMPONENTS_GCM_DRIVER_GCM_CLIENT_IMPL_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <map> | 10 #include <map> |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 | 44 |
| 45 namespace net { | 45 namespace net { |
| 46 class HttpNetworkSession; | 46 class HttpNetworkSession; |
| 47 } // namespace net | 47 } // namespace net |
| 48 | 48 |
| 49 namespace gcm { | 49 namespace gcm { |
| 50 | 50 |
| 51 class CheckinRequest; | 51 class CheckinRequest; |
| 52 class ConnectionFactory; | 52 class ConnectionFactory; |
| 53 class GCMClientImplTest; | 53 class GCMClientImplTest; |
| 54 enum class GCMMessageStatus; |
| 54 | 55 |
| 55 // Helper class for building GCM internals. Allows tests to inject fake versions | 56 // Helper class for building GCM internals. Allows tests to inject fake versions |
| 56 // as necessary. | 57 // as necessary. |
| 57 class GCMInternalsBuilder { | 58 class GCMInternalsBuilder { |
| 58 public: | 59 public: |
| 59 GCMInternalsBuilder(); | 60 GCMInternalsBuilder(); |
| 60 virtual ~GCMInternalsBuilder(); | 61 virtual ~GCMInternalsBuilder(); |
| 61 | 62 |
| 62 virtual std::unique_ptr<base::Clock> BuildClock(); | 63 virtual std::unique_ptr<base::Clock> BuildClock(); |
| 63 virtual std::unique_ptr<MCSClient> BuildMCSClient( | 64 virtual std::unique_ptr<MCSClient> BuildMCSClient( |
| (...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 316 | 317 |
| 317 // Is there any standalone app being registered for GCM? | 318 // Is there any standalone app being registered for GCM? |
| 318 bool HasStandaloneRegisteredApp() const; | 319 bool HasStandaloneRegisteredApp() const; |
| 319 | 320 |
| 320 // Destroys the store when it is not needed. | 321 // Destroys the store when it is not needed. |
| 321 void DestroyStoreWhenNotNeeded(); | 322 void DestroyStoreWhenNotNeeded(); |
| 322 | 323 |
| 323 // Reset all cahced values. | 324 // Reset all cahced values. |
| 324 void ResetCache(); | 325 void ResetCache(); |
| 325 | 326 |
| 327 // Send a message to GCM with information about the final status of a |
| 328 // previously received message. This can be run as a result of a callback |
| 329 // being executed from an AppHandler. |
| 330 void SendMessageReceipt(const std::string& message_id, |
| 331 const std::string& app_id, |
| 332 GCMMessageStatus status); |
| 333 |
| 326 // Builder for the GCM internals (mcs client, etc.). | 334 // Builder for the GCM internals (mcs client, etc.). |
| 327 std::unique_ptr<GCMInternalsBuilder> internals_builder_; | 335 std::unique_ptr<GCMInternalsBuilder> internals_builder_; |
| 328 | 336 |
| 329 // Recorder that logs GCM activities. | 337 // Recorder that logs GCM activities. |
| 330 GCMStatsRecorderImpl recorder_; | 338 GCMStatsRecorderImpl recorder_; |
| 331 | 339 |
| 332 // State of the GCM Client Implementation. | 340 // State of the GCM Client Implementation. |
| 333 State state_; | 341 State state_; |
| 334 | 342 |
| 335 GCMClient::Delegate* delegate_; | 343 GCMClient::Delegate* delegate_; |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 401 | 409 |
| 402 // Factory for creating references in callbacks. | 410 // Factory for creating references in callbacks. |
| 403 base::WeakPtrFactory<GCMClientImpl> weak_ptr_factory_; | 411 base::WeakPtrFactory<GCMClientImpl> weak_ptr_factory_; |
| 404 | 412 |
| 405 DISALLOW_COPY_AND_ASSIGN(GCMClientImpl); | 413 DISALLOW_COPY_AND_ASSIGN(GCMClientImpl); |
| 406 }; | 414 }; |
| 407 | 415 |
| 408 } // namespace gcm | 416 } // namespace gcm |
| 409 | 417 |
| 410 #endif // COMPONENTS_GCM_DRIVER_GCM_CLIENT_IMPL_H_ | 418 #endif // COMPONENTS_GCM_DRIVER_GCM_CLIENT_IMPL_H_ |
| OLD | NEW |