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

Side by Side Diff: google_apis/gcm/engine/mcs_client.h

Issue 641943002: components: Introduce AlarmTimer class and use it for GCM heartbeat (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix build error in mcs_probe Created 6 years, 1 month 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 GOOGLE_APIS_GCM_ENGINE_MCS_CLIENT_H_ 5 #ifndef GOOGLE_APIS_GCM_ENGINE_MCS_CLIENT_H_
6 #define GOOGLE_APIS_GCM_ENGINE_MCS_CLIENT_H_ 6 #define GOOGLE_APIS_GCM_ENGINE_MCS_CLIENT_H_
7 7
8 #include <deque> 8 #include <deque>
9 #include <map> 9 #include <map>
10 #include <string> 10 #include <string>
11 #include <vector> 11 #include <vector>
12 12
13 #include "base/files/file_path.h" 13 #include "base/files/file_path.h"
14 #include "base/memory/linked_ptr.h" 14 #include "base/memory/linked_ptr.h"
15 #include "base/memory/scoped_ptr.h"
15 #include "base/memory/weak_ptr.h" 16 #include "base/memory/weak_ptr.h"
16 #include "google_apis/gcm/base/gcm_export.h" 17 #include "google_apis/gcm/base/gcm_export.h"
17 #include "google_apis/gcm/base/mcs_message.h" 18 #include "google_apis/gcm/base/mcs_message.h"
18 #include "google_apis/gcm/engine/connection_handler.h" 19 #include "google_apis/gcm/engine/connection_handler.h"
19 #include "google_apis/gcm/engine/gcm_store.h" 20 #include "google_apis/gcm/engine/gcm_store.h"
20 #include "google_apis/gcm/engine/heartbeat_manager.h" 21 #include "google_apis/gcm/engine/heartbeat_manager.h"
21 22
22 namespace base { 23 namespace base {
23 class Clock; 24 class Clock;
25 class Timer;
24 } // namespace base 26 } // namespace base
25 27
26 namespace google { 28 namespace google {
27 namespace protobuf { 29 namespace protobuf {
28 class MessageLite; 30 class MessageLite;
29 } // namespace protobuf 31 } // namespace protobuf
30 } // namespace google 32 } // namespace google
31 33
32 namespace mcs_proto { 34 namespace mcs_proto {
33 class LoginRequest; 35 class LoginRequest;
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 typedef base::Callback< 93 typedef base::Callback<
92 void(int64 user_serial_number, 94 void(int64 user_serial_number,
93 const std::string& app_id, 95 const std::string& app_id,
94 const std::string& message_id, 96 const std::string& message_id,
95 MessageSendStatus status)> OnMessageSentCallback; 97 MessageSendStatus status)> OnMessageSentCallback;
96 98
97 MCSClient(const std::string& version_string, 99 MCSClient(const std::string& version_string,
98 base::Clock* clock, 100 base::Clock* clock,
99 ConnectionFactory* connection_factory, 101 ConnectionFactory* connection_factory,
100 GCMStore* gcm_store, 102 GCMStore* gcm_store,
101 GCMStatsRecorder* recorder); 103 GCMStatsRecorder* recorder,
104 scoped_ptr<base::Timer> heartbeat_timer);
102 virtual ~MCSClient(); 105 virtual ~MCSClient();
103 106
104 // Initialize the client. Will load any previous id/token information as well 107 // Initialize the client. Will load any previous id/token information as well
105 // as unacknowledged message information from the GCM storage, if it exists, 108 // as unacknowledged message information from the GCM storage, if it exists,
106 // passing the id/token information back via |initialization_callback| along 109 // passing the id/token information back via |initialization_callback| along
107 // with a |success == true| result. If no GCM information is present (and 110 // with a |success == true| result. If no GCM information is present (and
108 // this is therefore a fresh client), a clean GCM store will be created and 111 // this is therefore a fresh client), a clean GCM store will be created and
109 // values of 0 will be returned via |initialization_callback| with 112 // values of 0 will be returned via |initialization_callback| with
110 // |success == true|. 113 // |success == true|.
111 /// If an error loading the GCM store is encountered, 114 /// If an error loading the GCM store is encountered,
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
278 GCMStatsRecorder* recorder_; 281 GCMStatsRecorder* recorder_;
279 282
280 base::WeakPtrFactory<MCSClient> weak_ptr_factory_; 283 base::WeakPtrFactory<MCSClient> weak_ptr_factory_;
281 284
282 DISALLOW_COPY_AND_ASSIGN(MCSClient); 285 DISALLOW_COPY_AND_ASSIGN(MCSClient);
283 }; 286 };
284 287
285 } // namespace gcm 288 } // namespace gcm
286 289
287 #endif // GOOGLE_APIS_GCM_ENGINE_MCS_CLIENT_H_ 290 #endif // GOOGLE_APIS_GCM_ENGINE_MCS_CLIENT_H_
OLDNEW
« no previous file with comments | « google_apis/gcm/engine/heartbeat_manager_unittest.cc ('k') | google_apis/gcm/engine/mcs_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698