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

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

Issue 2675293003: Push API: Don't wait for network when unsubscribing (Closed)
Patch Set: Address peter's review comments 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 LAST_RESULT = UNKNOWN_ERROR
72 }; 76 };
73 77
74 enum ChromePlatform { 78 enum ChromePlatform {
75 PLATFORM_WIN, 79 PLATFORM_WIN,
76 PLATFORM_MAC, 80 PLATFORM_MAC,
77 PLATFORM_LINUX, 81 PLATFORM_LINUX,
78 PLATFORM_CROS, 82 PLATFORM_CROS,
79 PLATFORM_IOS, 83 PLATFORM_IOS,
80 PLATFORM_ANDROID, 84 PLATFORM_ANDROID,
81 PLATFORM_UNKNOWN 85 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 332 // to be set, and allows that component to later revoke the setting. It should
329 // be unique. 333 // be unique.
330 virtual void AddHeartbeatInterval(const std::string& scope, 334 virtual void AddHeartbeatInterval(const std::string& scope,
331 int interval_ms) = 0; 335 int interval_ms) = 0;
332 virtual void RemoveHeartbeatInterval(const std::string& scope) = 0; 336 virtual void RemoveHeartbeatInterval(const std::string& scope) = 0;
333 }; 337 };
334 338
335 } // namespace gcm 339 } // namespace gcm
336 340
337 #endif // COMPONENTS_GCM_DRIVER_GCM_CLIENT_H_ 341 #endif // COMPONENTS_GCM_DRIVER_GCM_CLIENT_H_
OLDNEW
« no previous file with comments | « chrome/browser/push_messaging/push_messaging_service_impl.cc ('k') | components/gcm_driver/gcm_client_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698