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_H_ | 5 #ifndef COMPONENTS_GCM_DRIVER_GCM_CLIENT_H_ |
6 #define COMPONENTS_GCM_DRIVER_GCM_CLIENT_H_ | 6 #define COMPONENTS_GCM_DRIVER_GCM_CLIENT_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <map> | 10 #include <map> |
11 #include <string> | 11 #include <string> |
12 #include <vector> | 12 #include <vector> |
13 | 13 |
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/scoped_ptr.h" |
16 #include "components/gcm_driver/common/gcm_messages.h" | 16 #include "components/gcm_driver/common/gcm_messages.h" |
| 17 #include "components/gcm_driver/crypto/gcm_encryption_provider.h" |
17 #include "components/gcm_driver/gcm_activity.h" | 18 #include "components/gcm_driver/gcm_activity.h" |
18 #include "components/gcm_driver/registration_info.h" | 19 #include "components/gcm_driver/registration_info.h" |
19 | 20 |
20 template <class T> class scoped_refptr; | 21 template <class T> class scoped_refptr; |
21 | 22 |
22 class GURL; | 23 class GURL; |
23 | 24 |
24 namespace base { | 25 namespace base { |
25 class FilePath; | 26 class FilePath; |
26 class SequencedTaskRunner; | 27 class SequencedTaskRunner; |
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
261 | 262 |
262 // Sends a message to a given receiver. Delegate::OnSendFinished will be | 263 // Sends a message to a given receiver. Delegate::OnSendFinished will be |
263 // called asynchronously upon completion. | 264 // called asynchronously upon completion. |
264 // |app_id|: application ID. | 265 // |app_id|: application ID. |
265 // |receiver_id|: registration ID of the receiver party. | 266 // |receiver_id|: registration ID of the receiver party. |
266 // |message|: message to be sent. | 267 // |message|: message to be sent. |
267 virtual void Send(const std::string& app_id, | 268 virtual void Send(const std::string& app_id, |
268 const std::string& receiver_id, | 269 const std::string& receiver_id, |
269 const OutgoingMessage& message) = 0; | 270 const OutgoingMessage& message) = 0; |
270 | 271 |
| 272 // Records a decryption failure due to |reason| for the |app_id|. |
| 273 virtual void RecordDecryptionFailure( |
| 274 const std::string& app_id, |
| 275 GCMEncryptionProvider::DecryptionFailure reason) = 0; |
| 276 |
271 // Enables or disables internal activity recording. | 277 // Enables or disables internal activity recording. |
272 virtual void SetRecording(bool recording) = 0; | 278 virtual void SetRecording(bool recording) = 0; |
273 | 279 |
274 // Clear all recorded GCM activity logs. | 280 // Clear all recorded GCM activity logs. |
275 virtual void ClearActivityLogs() = 0; | 281 virtual void ClearActivityLogs() = 0; |
276 | 282 |
277 // Gets internal states and statistics. | 283 // Gets internal states and statistics. |
278 virtual GCMStatistics GetStatistics() const = 0; | 284 virtual GCMStatistics GetStatistics() const = 0; |
279 | 285 |
280 // Sets a list of accounts with OAuth2 tokens for the next checkin. | 286 // Sets a list of accounts with OAuth2 tokens for the next checkin. |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
315 // to be set, and allows that component to later revoke the setting. It should | 321 // to be set, and allows that component to later revoke the setting. It should |
316 // be unique. | 322 // be unique. |
317 virtual void AddHeartbeatInterval(const std::string& scope, | 323 virtual void AddHeartbeatInterval(const std::string& scope, |
318 int interval_ms) = 0; | 324 int interval_ms) = 0; |
319 virtual void RemoveHeartbeatInterval(const std::string& scope) = 0; | 325 virtual void RemoveHeartbeatInterval(const std::string& scope) = 0; |
320 }; | 326 }; |
321 | 327 |
322 } // namespace gcm | 328 } // namespace gcm |
323 | 329 |
324 #endif // COMPONENTS_GCM_DRIVER_GCM_CLIENT_H_ | 330 #endif // COMPONENTS_GCM_DRIVER_GCM_CLIENT_H_ |
OLD | NEW |