Update ASan/Android runtime and setup script to LLVM r200682.
[chromium-blink-merge.git] / google_apis / gcm / engine / checkin_request.h
blob8ea6ad98f52c0aff4e05507cd32e24c6ea8eadf5
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
3 // found in the LICENSE file.
5 #ifndef GOOGLE_APIS_GCM_ENGINE_CHECKIN_REQUEST_H_
6 #define GOOGLE_APIS_GCM_ENGINE_CHECKIN_REQUEST_H_
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"
14 namespace net {
15 class URLRequestContextGetter;
18 namespace gcm {
20 // Enables making check-in requests with the GCM infrastructure. When called
21 // with android_id and security_token both set to 0 it is an initial check-in
22 // used to 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 android_id, uint64 security_token)>
29 CheckinRequestCallback;
31 CheckinRequest(const CheckinRequestCallback& callback,
32 const checkin_proto::ChromeBuildProto& chrome_build_proto,
33 int64 user_serial_number,
34 uint64 android_id,
35 uint64 secret_token,
36 net::URLRequestContextGetter* request_context_getter);
37 virtual ~CheckinRequest();
39 void Start();
41 // URLFetcherDelegate implementation.
42 virtual void OnURLFetchComplete(const net::URLFetcher* source) OVERRIDE;
44 private:
45 net::URLRequestContextGetter* request_context_getter_;
46 CheckinRequestCallback callback_;
48 scoped_ptr<net::URLFetcher> url_fetcher_;
49 checkin_proto::ChromeBuildProto chrome_build_proto_;
50 uint64 android_id_;
51 uint64 security_token_;
52 int64 user_serial_number_;
54 DISALLOW_COPY_AND_ASSIGN(CheckinRequest);
57 } // namespace gcm
59 #endif // GOOGLE_APIS_GCM_ENGINE_CHECKIN_REQUEST_H_