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

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

Issue 98173009: GCM Checkin implementation with unit tests and protobufs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@gcm-store
Patch Set: Updating the copyright notice Created 6 years, 11 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 (c) 2014 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_CHECKIN_REQUEST_H_
6 #define GOOGLE_APIS_GCM_ENGINE_CHECKIN_REQUEST_H_
7
8 #include "base/basictypes.h"
9 #include "base/callback.h"
10 #include "google_apis/gcm/base/gcm_export.h"
11 #include "google_apis/gcm/protocol/android_checkin.pb.h"
12 #include "net/url_request/url_fetcher_delegate.h"
13
14 namespace net {
15 class URLRequestContextGetter;
16 }
17
18 namespace gcm {
19
20 // Enables making check-in requests with the GCM infrastructure. When call with
Nicolas Zea 2014/01/08 19:53:36 nit: when call -> when called
fgorski 2014/01/08 21:26:39 Done.
21 // android_id and security_token both set to 0 it is an initial check-in used to
22 // obtain credentials. These should be persisted and used for subsequent
23 // check-ins.
24 class GCM_EXPORT CheckinRequest : public net::URLFetcherDelegate {
25 public:
26 // A callback function for the checkin request, accepting |android_id| and
27 // |security_token|.
28 typedef base::Callback<void(uint64, uint64)> CheckinRequestCallback;
Nicolas Zea 2014/01/08 19:53:36 nit: I find it useful to include parameter names i
fgorski 2014/01/08 21:26:39 Done.
29
30 CheckinRequest(const CheckinRequestCallback& callback,
31 const checkin_proto::ChromeBuildProto& chrome_build_proto,
32 int64 user_serial_number,
33 uint64 android_id,
34 uint64 secret_token,
35 net::URLRequestContextGetter* request_context_getter);
36 virtual ~CheckinRequest();
37
38 void Start();
39
40 // URLFetcherDelegate implementation.
41 virtual void OnURLFetchComplete(const net::URLFetcher* source) OVERRIDE;
42
43 private:
44 net::URLRequestContextGetter* request_context_getter_;
45 CheckinRequestCallback callback_;
46
47 scoped_ptr<net::URLFetcher> url_fetcher_;
48 checkin_proto::ChromeBuildProto chrome_build_proto_;
49 uint64 android_id_;
50 uint64 security_token_;
51 int64 user_serial_number_;
52
53 DISALLOW_COPY_AND_ASSIGN(CheckinRequest);
54 };
55
56 } // namespace gcm
57
58 #endif // GOOGLE_APIS_GCM_ENGINE_CHECKIN_REQUEST_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698