OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_INSTANCE_ID_INSTANCE_ID_H_ | 5 #ifndef COMPONENTS_GCM_DRIVER_INSTANCE_ID_INSTANCE_ID_H_ |
6 #define COMPONENTS_GCM_DRIVER_INSTANCE_ID_INSTANCE_ID_H_ | 6 #define COMPONENTS_GCM_DRIVER_INSTANCE_ID_INSTANCE_ID_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 12 matching lines...) Expand all Loading... |
23 // Instance ID is managed by the InstanceIdDriver. | 23 // Instance ID is managed by the InstanceIdDriver. |
24 class InstanceID { | 24 class InstanceID { |
25 public: | 25 public: |
26 enum Result { | 26 enum Result { |
27 // Successful operation. | 27 // Successful operation. |
28 SUCCESS, | 28 SUCCESS, |
29 // Invalid parameter. | 29 // Invalid parameter. |
30 INVALID_PARAMETER, | 30 INVALID_PARAMETER, |
31 // Instance ID is disabled. | 31 // Instance ID is disabled. |
32 DISABLED, | 32 DISABLED, |
| 33 // Previous asynchronous operation is still pending to finish. |
| 34 ASYNC_OPERATION_PENDING, |
33 // Network socket error. | 35 // Network socket error. |
34 NETWORK_ERROR, | 36 NETWORK_ERROR, |
35 // Problem at the server. | 37 // Problem at the server. |
36 SERVER_ERROR, | 38 SERVER_ERROR, |
37 // Other errors. | 39 // Other errors. |
38 UNKNOWN_ERROR | 40 UNKNOWN_ERROR |
39 }; | 41 }; |
40 | 42 |
41 // Asynchronous callbacks. | 43 // Asynchronous callbacks. |
42 typedef base::Callback<void(const std::string& app_id, | 44 typedef base::Callback<void(const std::string& app_id, |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
110 private: | 112 private: |
111 std::string app_id_; | 113 std::string app_id_; |
112 TokenRefreshCallback token_refresh_callback_; | 114 TokenRefreshCallback token_refresh_callback_; |
113 | 115 |
114 DISALLOW_COPY_AND_ASSIGN(InstanceID); | 116 DISALLOW_COPY_AND_ASSIGN(InstanceID); |
115 }; | 117 }; |
116 | 118 |
117 } // namespace instance_id | 119 } // namespace instance_id |
118 | 120 |
119 #endif // COMPONENTS_GCM_DRIVER_INSTANCE_ID_INSTANCE_ID_H_ | 121 #endif // COMPONENTS_GCM_DRIVER_INSTANCE_ID_INSTANCE_ID_H_ |
OLD | NEW |