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_REGISTRATION_INFO_H_ | 5 #ifndef COMPONENTS_GCM_DRIVER_REGISTRATION_INFO_H_ |
6 #define COMPONENTS_GCM_DRIVER_REGISTRATION_INFO_H_ | 6 #define COMPONENTS_GCM_DRIVER_REGISTRATION_INFO_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <memory> | 9 #include <memory> |
10 #include <string> | 10 #include <string> |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
97 | 97 |
98 // Entity that is authorized to access resources associated with the Instance | 98 // Entity that is authorized to access resources associated with the Instance |
99 // ID. It can be another Instance ID or a project ID assigned by the Google | 99 // ID. It can be another Instance ID or a project ID assigned by the Google |
100 // API Console. | 100 // API Console. |
101 std::string authorized_entity; | 101 std::string authorized_entity; |
102 | 102 |
103 // Authorized actions that the authorized entity can take. | 103 // Authorized actions that the authorized entity can take. |
104 // E.g. for sending GCM messages, 'GCM' scope should be used. | 104 // E.g. for sending GCM messages, 'GCM' scope should be used. |
105 std::string scope; | 105 std::string scope; |
106 | 106 |
107 // Whether to send |app_id| to GCM as the "subtype" field (supported on all | |
108 // platforms) or as the "category" field (not supported on Android, since | |
109 // Google Play Services always sends the app package name as "category"). | |
110 bool use_subtype; | |
111 | |
107 // Allows including a small number of string key/value pairs that will be | 112 // Allows including a small number of string key/value pairs that will be |
108 // associated with the token and may be used in processing the request. | 113 // associated with the token and may be used in processing the request. These |
114 // are not serialized/deserialized! | |
Peter Beverloo
2016/07/22 12:17:04
s/!/\./
johnme
2016/07/26 17:11:56
Done.
Peter Beverloo
2016/07/28 12:34:09
No you didn't?
johnme
2016/08/04 17:47:13
Blargh. Forgot to hit save :(
| |
109 std::map<std::string, std::string> options; | 115 std::map<std::string, std::string> options; |
110 }; | 116 }; |
111 | 117 |
112 struct RegistrationInfoComparer { | 118 struct RegistrationInfoComparer { |
113 bool operator()(const linked_ptr<RegistrationInfo>& a, | 119 bool operator()(const linked_ptr<RegistrationInfo>& a, |
114 const linked_ptr<RegistrationInfo>& b) const; | 120 const linked_ptr<RegistrationInfo>& b) const; |
115 }; | 121 }; |
116 | 122 |
117 // Collection of registration info. | 123 // Collection of registration info. |
118 // Map from RegistrationInfo instance to registration ID. | 124 // Map from RegistrationInfo instance to registration ID. |
119 typedef std::map<linked_ptr<RegistrationInfo>, | 125 typedef std::map<linked_ptr<RegistrationInfo>, |
120 std::string, | 126 std::string, |
121 RegistrationInfoComparer> RegistrationInfoMap; | 127 RegistrationInfoComparer> RegistrationInfoMap; |
122 | 128 |
123 // Returns true if a GCM registration for |app_id| exists in |map|. | 129 // Returns true if a GCM registration for |app_id| exists in |map|. |
124 bool ExistsGCMRegistrationInMap(const RegistrationInfoMap& map, | 130 bool ExistsGCMRegistrationInMap(const RegistrationInfoMap& map, |
125 const std::string& app_id); | 131 const std::string& app_id); |
126 | 132 |
127 } // namespace gcm | 133 } // namespace gcm |
128 | 134 |
129 #endif // COMPONENTS_GCM_DRIVER_REGISTRATION_INFO_H_ | 135 #endif // COMPONENTS_GCM_DRIVER_REGISTRATION_INFO_H_ |
OLD | NEW |