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

Side by Side Diff: google_apis/gcm/engine/registration_request.h

Issue 183923006: [GCM] API update to allow only a single sender in registration (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Updates based on CR. Changing how the senders/reg_ids are stored to avoid upgrade to multiple sedne… Created 6 years, 9 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 | Annotate | Revision Log
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 GOOGLE_APIS_GCM_ENGINE_REGISTRATION_REQUEST_H_ 5 #ifndef GOOGLE_APIS_GCM_ENGINE_REGISTRATION_REQUEST_H_
6 #define GOOGLE_APIS_GCM_ENGINE_REGISTRATION_REQUEST_H_ 6 #define GOOGLE_APIS_GCM_ENGINE_REGISTRATION_REQUEST_H_
7 7
8 #include <map>
9 #include <vector>
10
11 #include "base/basictypes.h" 8 #include "base/basictypes.h"
12 #include "base/callback.h" 9 #include "base/callback.h"
13 #include "base/memory/ref_counted.h" 10 #include "base/memory/ref_counted.h"
14 #include "base/memory/scoped_ptr.h" 11 #include "base/memory/scoped_ptr.h"
15 #include "base/memory/weak_ptr.h" 12 #include "base/memory/weak_ptr.h"
16 #include "google_apis/gcm/base/gcm_export.h" 13 #include "google_apis/gcm/base/gcm_export.h"
17 #include "net/base/backoff_entry.h" 14 #include "net/base/backoff_entry.h"
18 #include "net/url_request/url_fetcher_delegate.h" 15 #include "net/url_request/url_fetcher_delegate.h"
19 16
20 namespace net { 17 namespace net {
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 RegistrationCallback; 53 RegistrationCallback;
57 54
58 // Details of the of the Registration Request. Only user's android ID and 55 // Details of the of the Registration Request. Only user's android ID and
59 // its serial number are optional and can be set to 0. All other parameters 56 // its serial number are optional and can be set to 0. All other parameters
60 // have to be specified to successfully complete the call. 57 // have to be specified to successfully complete the call.
61 struct GCM_EXPORT RequestInfo { 58 struct GCM_EXPORT RequestInfo {
62 RequestInfo(uint64 android_id, 59 RequestInfo(uint64 android_id,
63 uint64 security_token, 60 uint64 security_token,
64 const std::string& app_id, 61 const std::string& app_id,
65 const std::string& cert, 62 const std::string& cert,
66 const std::vector<std::string>& sender_ids); 63 const std::string& sender_id);
67 ~RequestInfo(); 64 ~RequestInfo();
68 65
69 // Android ID of the device. 66 // Android ID of the device.
70 uint64 android_id; 67 uint64 android_id;
71 // Security token of the device. 68 // Security token of the device.
72 uint64 security_token; 69 uint64 security_token;
73 // Application ID. 70 // Application ID.
74 std::string app_id; 71 std::string app_id;
75 // Certificate of the application. 72 // Certificate of the application.
76 std::string cert; 73 std::string cert;
77 // List of IDs of senders. Allowed up to 100. 74 // A sender ID the registration is for.
78 std::vector<std::string> sender_ids; 75 std::string sender_id;
79 }; 76 };
80 77
81 RegistrationRequest( 78 RegistrationRequest(
82 const RequestInfo& request_info, 79 const RequestInfo& request_info,
83 const net::BackoffEntry::Policy& backoff_policy, 80 const net::BackoffEntry::Policy& backoff_policy,
84 const RegistrationCallback& callback, 81 const RegistrationCallback& callback,
85 int max_retry_count, 82 int max_retry_count,
86 scoped_refptr<net::URLRequestContextGetter> request_context_getter); 83 scoped_refptr<net::URLRequestContextGetter> request_context_getter);
87 virtual ~RegistrationRequest(); 84 virtual ~RegistrationRequest();
88 85
(...skipping 20 matching lines...) Expand all
109 int retries_left_; 106 int retries_left_;
110 107
111 base::WeakPtrFactory<RegistrationRequest> weak_ptr_factory_; 108 base::WeakPtrFactory<RegistrationRequest> weak_ptr_factory_;
112 109
113 DISALLOW_COPY_AND_ASSIGN(RegistrationRequest); 110 DISALLOW_COPY_AND_ASSIGN(RegistrationRequest);
114 }; 111 };
115 112
116 } // namespace gcm 113 } // namespace gcm
117 114
118 #endif // GOOGLE_APIS_GCM_ENGINE_REGISTRATION_REQUEST_H_ 115 #endif // GOOGLE_APIS_GCM_ENGINE_REGISTRATION_REQUEST_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698