| 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_DRIVER_DESKTOP_H_ | 5 #ifndef COMPONENTS_GCM_DRIVER_GCM_DRIVER_DESKTOP_H_ |
| 6 #define COMPONENTS_GCM_DRIVER_GCM_DRIVER_DESKTOP_H_ | 6 #define COMPONENTS_GCM_DRIVER_GCM_DRIVER_DESKTOP_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 bool gcm_enabled() const { return gcm_enabled_; } | 88 bool gcm_enabled() const { return gcm_enabled_; } |
| 89 GCMChannelStatusSyncer* gcm_channel_status_syncer_for_testing() { | 89 GCMChannelStatusSyncer* gcm_channel_status_syncer_for_testing() { |
| 90 return gcm_channel_status_syncer_.get(); | 90 return gcm_channel_status_syncer_.get(); |
| 91 } | 91 } |
| 92 | 92 |
| 93 protected: | 93 protected: |
| 94 // GCMDriver implementation: | 94 // GCMDriver implementation: |
| 95 GCMClient::Result EnsureStarted(GCMClient::StartMode start_mode) override; | 95 GCMClient::Result EnsureStarted(GCMClient::StartMode start_mode) override; |
| 96 void RegisterImpl(const std::string& app_id, | 96 void RegisterImpl(const std::string& app_id, |
| 97 const std::vector<std::string>& sender_ids) override; | 97 const std::vector<std::string>& sender_ids) override; |
| 98 void UnregisterImpl(const std::string& app_id) override; | 98 void UnregisterImpl(const std::string& app_id, |
| 99 const std::vector<std::string>& sender_ids) override; |
| 99 void SendImpl(const std::string& app_id, | 100 void SendImpl(const std::string& app_id, |
| 100 const std::string& receiver_id, | 101 const std::string& receiver_id, |
| 101 const GCMClient::OutgoingMessage& message) override; | 102 const GCMClient::OutgoingMessage& message) override; |
| 102 | 103 |
| 103 private: | 104 private: |
| 104 class IOWorker; | 105 class IOWorker; |
| 105 | 106 |
| 106 // Stops the GCM service. It can be restarted by calling EnsureStarted again. | 107 // Stops the GCM service. It can be restarted by calling EnsureStarted again. |
| 107 void Stop(); | 108 void Stop(); |
| 108 | 109 |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 174 | 175 |
| 175 // Used to pass a weak pointer to the IO worker. | 176 // Used to pass a weak pointer to the IO worker. |
| 176 base::WeakPtrFactory<GCMDriverDesktop> weak_ptr_factory_; | 177 base::WeakPtrFactory<GCMDriverDesktop> weak_ptr_factory_; |
| 177 | 178 |
| 178 DISALLOW_COPY_AND_ASSIGN(GCMDriverDesktop); | 179 DISALLOW_COPY_AND_ASSIGN(GCMDriverDesktop); |
| 179 }; | 180 }; |
| 180 | 181 |
| 181 } // namespace gcm | 182 } // namespace gcm |
| 182 | 183 |
| 183 #endif // COMPONENTS_GCM_DRIVER_GCM_DRIVER_DESKTOP_H_ | 184 #endif // COMPONENTS_GCM_DRIVER_GCM_DRIVER_DESKTOP_H_ |
| OLD | NEW |