OLD | NEW |
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 COMPONENTS_CRYPTAUTH_CRYPTAUTH_CLIENT_IMPL_H_ | 5 #ifndef COMPONENTS_CRYPTAUTH_CRYPTAUTH_CLIENT_IMPL_H_ |
6 #define COMPONENTS_CRYPTAUTH_CRYPTAUTH_CLIENT_IMPL_H_ | 6 #define COMPONENTS_CRYPTAUTH_CRYPTAUTH_CLIENT_IMPL_H_ |
7 | 7 |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "base/memory/weak_ptr.h" | 9 #include "base/memory/weak_ptr.h" |
10 #include "components/cryptauth/cryptauth_access_token_fetcher.h" | 10 #include "components/cryptauth/cryptauth_access_token_fetcher.h" |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 | 61 |
62 private: | 62 private: |
63 // Starts a call to the API given by |request_path|, with the templated | 63 // Starts a call to the API given by |request_path|, with the templated |
64 // request and response types. The client first fetches the access token and | 64 // request and response types. The client first fetches the access token and |
65 // then makes the HTTP request. | 65 // then makes the HTTP request. |
66 template <class RequestProto, class ResponseProto> | 66 template <class RequestProto, class ResponseProto> |
67 void MakeApiCall( | 67 void MakeApiCall( |
68 const std::string& request_path, | 68 const std::string& request_path, |
69 const RequestProto& request_proto, | 69 const RequestProto& request_proto, |
70 const base::Callback<void(const ResponseProto&)>& response_callback, | 70 const base::Callback<void(const ResponseProto&)>& response_callback, |
71 const ErrorCallback& error_callback); | 71 const ErrorCallback& error_callback, |
| 72 const net::PartialNetworkTrafficAnnotationTag& |
| 73 partial_traffic_annotation); |
72 | 74 |
73 // Called when the access token is obtained so the API request can be made. | 75 // Called when the access token is obtained so the API request can be made. |
74 template <class ResponseProto> | 76 template <class ResponseProto> |
75 void OnAccessTokenFetched( | 77 void OnAccessTokenFetched( |
76 const std::string& serialized_request, | 78 const std::string& serialized_request, |
77 const base::Callback<void(const ResponseProto&)>& response_callback, | 79 const base::Callback<void(const ResponseProto&)>& response_callback, |
78 const std::string& access_token); | 80 const std::string& access_token); |
79 | 81 |
80 // Called with CryptAuthApiCallFlow completes successfully to deserialize and | 82 // Called with CryptAuthApiCallFlow completes successfully to deserialize and |
81 // return the result. | 83 // return the result. |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
141 const std::string account_id_; | 143 const std::string account_id_; |
142 const scoped_refptr<net::URLRequestContextGetter> url_request_context_; | 144 const scoped_refptr<net::URLRequestContextGetter> url_request_context_; |
143 const DeviceClassifier device_classifier_; | 145 const DeviceClassifier device_classifier_; |
144 | 146 |
145 DISALLOW_COPY_AND_ASSIGN(CryptAuthClientFactoryImpl); | 147 DISALLOW_COPY_AND_ASSIGN(CryptAuthClientFactoryImpl); |
146 }; | 148 }; |
147 | 149 |
148 } // namespace cryptauth | 150 } // namespace cryptauth |
149 | 151 |
150 #endif // COMPONENTS_CRYPTAUTH_CRYPTAUTH_CLIENT_IMPL_H_ | 152 #endif // COMPONENTS_CRYPTAUTH_CRYPTAUTH_CLIENT_IMPL_H_ |
OLD | NEW |