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

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

Issue 1137463003: Support getting and deleting token for Instance ID. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix trybots Created 5 years, 7 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
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef GOOGLE_APIS_GCM_ENGINE_INSTANCE_ID_GET_TOKEN_REQUEST_H_
6 #define GOOGLE_APIS_GCM_ENGINE_INSTANCE_ID_GET_TOKEN_REQUEST_H_
7
8 #include <map>
9 #include <string>
10
11 #include "google_apis/gcm/engine/registration_request.h"
12
13 namespace gcm {
14
15 // Used to obtain a token based on Instance ID.
16 class GCM_EXPORT InstanceIDGetTokenRequest : public RegistrationRequest {
17 public:
18 // Additional info for GetToken requests of InstanceID.
19 struct GCM_EXPORT ExtraRequestInfo {
20 ExtraRequestInfo(const std::string& instance_id,
21 const std::string& authorized_entity,
22 const std::string& scope,
23 int gcm_version,
24 const std::map<std::string, std::string>& options);
25 ~ExtraRequestInfo();
26
27 std::string instance_id;
28 std::string authorized_entity;
29 std::string scope;
30 int gcm_version;
31 std::map<std::string, std::string> options;
32 };
33
34 InstanceIDGetTokenRequest(
35 const GURL& registration_url,
36 const RequestInfo& request_info,
37 const ExtraRequestInfo& extra_request_info,
38 const net::BackoffEntry::Policy& backoff_policy,
39 const RegistrationCallback& callback,
40 int max_retry_count,
41 scoped_refptr<net::URLRequestContextGetter> request_context_getter,
42 GCMStatsRecorder* recorder);
43 ~InstanceIDGetTokenRequest() override;
44
45 // RegistrationRequest overrides:
46 void BuildRequestBody(std::string* body) override;
47 std::string GetSourceForRecorder() const override;
48
49 private:
50 ExtraRequestInfo extra_request_info_;
51
52 DISALLOW_COPY_AND_ASSIGN(InstanceIDGetTokenRequest);
53 };
54
55 } // namespace gcm
56
57 #endif // GOOGLE_APIS_GCM_ENGINE_INSTANCE_ID_GET_TOKEN_REQUEST_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698