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

Side by Side Diff: components/gcm_driver/gcm_client.h

Issue 2675293003: Push API: Don't wait for network when unsubscribing (Closed)
Patch Set: Created 3 years, 10 months 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 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>
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 // and GCM store will be loaded. Then GCM connection may or may not be 44 // and GCM store will be loaded. Then GCM connection may or may not be
45 // initiated depending on this enum value. 45 // initiated depending on this enum value.
46 enum StartMode { 46 enum StartMode {
47 // GCM should be started only when it is being actually used. If no 47 // GCM should be started only when it is being actually used. If no
48 // registration record is found, GCM will not kick off. 48 // registration record is found, GCM will not kick off.
49 DELAYED_START, 49 DELAYED_START,
50 // GCM should be started immediately. 50 // GCM should be started immediately.
51 IMMEDIATE_START 51 IMMEDIATE_START
52 }; 52 };
53 53
54 // Used for UMA. Can add enum values, but never renumber or delete and reuse.
54 enum Result { 55 enum Result {
55 // Successful operation. 56 // Successful operation.
56 SUCCESS, 57 SUCCESS,
57 // Invalid parameter. 58 // Invalid parameter.
58 INVALID_PARAMETER, 59 INVALID_PARAMETER,
59 // GCM is disabled. 60 // GCM is disabled.
60 GCM_DISABLED, 61 GCM_DISABLED,
61 // Previous asynchronous operation is still pending to finish. Certain 62 // Previous asynchronous operation is still pending to finish. Certain
62 // operation, like register, is only allowed one at a time. 63 // operation, like register, is only allowed one at a time.
63 ASYNC_OPERATION_PENDING, 64 ASYNC_OPERATION_PENDING,
64 // Network socket error. 65 // Network socket error.
65 NETWORK_ERROR, 66 NETWORK_ERROR,
66 // Problem at the server. 67 // Problem at the server.
67 SERVER_ERROR, 68 SERVER_ERROR,
68 // Exceeded the specified TTL during message sending. 69 // Exceeded the specified TTL during message sending.
69 TTL_EXCEEDED, 70 TTL_EXCEEDED,
70 // Other errors. 71 // Other errors.
71 UNKNOWN_ERROR 72 UNKNOWN_ERROR,
73
74 // Used for UMA. Keep LAST_RESULT up to date and sync with histograms.xml.
75
Peter Beverloo 2017/02/07 18:11:08 micro nit: no newline
johnme 2017/02/08 14:14:36 Done.
76 LAST_RESULT = UNKNOWN_ERROR
72 }; 77 };
73 78
74 enum ChromePlatform { 79 enum ChromePlatform {
75 PLATFORM_WIN, 80 PLATFORM_WIN,
76 PLATFORM_MAC, 81 PLATFORM_MAC,
77 PLATFORM_LINUX, 82 PLATFORM_LINUX,
78 PLATFORM_CROS, 83 PLATFORM_CROS,
79 PLATFORM_IOS, 84 PLATFORM_IOS,
80 PLATFORM_ANDROID, 85 PLATFORM_ANDROID,
81 PLATFORM_UNKNOWN 86 PLATFORM_UNKNOWN
(...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after
328 // to be set, and allows that component to later revoke the setting. It should 333 // to be set, and allows that component to later revoke the setting. It should
329 // be unique. 334 // be unique.
330 virtual void AddHeartbeatInterval(const std::string& scope, 335 virtual void AddHeartbeatInterval(const std::string& scope,
331 int interval_ms) = 0; 336 int interval_ms) = 0;
332 virtual void RemoveHeartbeatInterval(const std::string& scope) = 0; 337 virtual void RemoveHeartbeatInterval(const std::string& scope) = 0;
333 }; 338 };
334 339
335 } // namespace gcm 340 } // namespace gcm
336 341
337 #endif // COMPONENTS_GCM_DRIVER_GCM_CLIENT_H_ 342 #endif // COMPONENTS_GCM_DRIVER_GCM_CLIENT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698