Chromium Code Reviews| Index: google_apis/gcm/engine/registration_request.h |
| diff --git a/google_apis/gcm/engine/registration_request.h b/google_apis/gcm/engine/registration_request.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..fcea447cdb50fc858b9e0ad22e9f3ee209a3eb18 |
| --- /dev/null |
| +++ b/google_apis/gcm/engine/registration_request.h |
| @@ -0,0 +1,71 @@ |
| +// Copyright (c) 2014 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef GOOGLE_APIS_GCM_ENGINE_REGISTRATION_REQUEST_H_ |
| +#define GOOGLE_APIS_GCM_ENGINE_REGISTRATION_REQUEST_H_ |
| + |
| +#include <map> |
| +#include <vector> |
| + |
| +#include "base/basictypes.h" |
| +#include "base/callback.h" |
| +#include "google_apis/gcm/base/gcm_export.h" |
| +#include "net/url_request/url_fetcher_delegate.h" |
| + |
| +namespace net { |
| +class URLRequestContextGetter; |
| +} |
| + |
| +namespace gcm { |
| + |
| +class GCM_EXPORT RegistrationRequest : public net::URLFetcherDelegate { |
| + public: |
| + // Callback completing the registration request. |
| + typedef base::Callback<void(const std::string& registration_id)> |
| + RegistrationCallback; |
| + |
| + RegistrationRequest( |
| + const RegistrationCallback& callback, |
| + uint64 android_id, |
|
Nicolas Zea
2014/01/10 19:45:12
this list of params is getting pretty long, encaps
fgorski
2014/01/10 22:46:58
Done.
|
| + uint64 security_token, |
| + uint64 user_android_id, |
| + int64 user_serial_number, |
| + const std::string& package_id, |
| + const std::string& cert, |
| + const std::vector<std::string>& sender_ids, |
| + const std::map<std::string, std::string>& extras, |
| + scoped_refptr<net::URLRequestContextGetter> request_context_getter); |
| + virtual ~RegistrationRequest(); |
| + |
| + void Start(); |
| + |
| + // URLFetcherDelegate implementation. |
| + virtual void OnURLFetchComplete(const net::URLFetcher* source) OVERRIDE; |
| + |
| + private: |
| + RegistrationCallback callback_; |
| + // Android ID of the device. |
| + uint64 android_id_; |
| + // Security token of the device. |
| + uint64 security_token_; |
| + // Application ID. |
| + std::string package_id_; |
| + // List of IDs of senders. Allowed up to 100. |
| + std::vector<std::string> sender_ids_; |
| + // Certificate of the application. |
| + std::string cert_; |
| + // Serial number of the user. |
| + int64 user_serial_number_; |
| + // Android ID the user. |
| + uint64 user_android_id_; |
| + |
| + scoped_refptr<net::URLRequestContextGetter> request_context_getter_; |
| + scoped_ptr<net::URLFetcher> url_fetcher_; |
|
jianli
2014/01/10 20:17:43
nit: better to add explicit includes for scoped_re
fgorski
2014/01/10 22:46:58
Done.
|
| + |
| + DISALLOW_COPY_AND_ASSIGN(RegistrationRequest); |
| +}; |
| + |
| +} // namespace gcm |
| + |
| +#endif // GOOGLE_APIS_GCM_ENGINE_REGISTRATION_REQUEST_H_ |