OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #include "chrome/browser/google_apis/request_sender.h" | 5 #include "chrome/browser/google_apis/request_sender.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/stl_util.h" | 8 #include "base/stl_util.h" |
9 #include "chrome/browser/google_apis/auth_service.h" | 9 #include "chrome/browser/google_apis/auth_service.h" |
10 #include "chrome/browser/google_apis/base_requests.h" | 10 #include "chrome/browser/google_apis/base_requests.h" |
11 | 11 |
12 namespace google_apis { | 12 namespace google_apis { |
13 | 13 |
14 RequestSender::RequestSender( | 14 RequestSender::RequestSender( |
15 Profile* profile, | 15 Profile* profile, |
16 net::URLRequestContextGetter* url_request_context_getter, | 16 net::URLRequestContextGetter* url_request_context_getter, |
17 const std::vector<std::string>& scopes, | 17 const std::vector<std::string>& scopes, |
18 const std::string& custom_user_agent) | 18 const std::string& custom_user_agent) |
19 : profile_(profile), | 19 : profile_(profile), |
| 20 url_request_context_getter_(url_request_context_getter), |
20 auth_service_(new AuthService(url_request_context_getter, scopes)), | 21 auth_service_(new AuthService(url_request_context_getter, scopes)), |
21 custom_user_agent_(custom_user_agent), | 22 custom_user_agent_(custom_user_agent), |
22 weak_ptr_factory_(this) { | 23 weak_ptr_factory_(this) { |
23 DCHECK(thread_checker_.CalledOnValidThread()); | 24 DCHECK(thread_checker_.CalledOnValidThread()); |
24 } | 25 } |
25 | 26 |
26 RequestSender::~RequestSender() { | 27 RequestSender::~RequestSender() { |
27 DCHECK(thread_checker_.CalledOnValidThread()); | 28 DCHECK(thread_checker_.CalledOnValidThread()); |
28 STLDeleteContainerPointers(in_flight_requests_.begin(), | 29 STLDeleteContainerPointers(in_flight_requests_.begin(), |
29 in_flight_requests_.end()); | 30 in_flight_requests_.end()); |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 return; | 100 return; |
100 request->Cancel(); | 101 request->Cancel(); |
101 } | 102 } |
102 | 103 |
103 void RequestSender::RequestFinished(AuthenticatedRequestInterface* request) { | 104 void RequestSender::RequestFinished(AuthenticatedRequestInterface* request) { |
104 in_flight_requests_.erase(request); | 105 in_flight_requests_.erase(request); |
105 delete request; | 106 delete request; |
106 } | 107 } |
107 | 108 |
108 } // namespace google_apis | 109 } // namespace google_apis |
OLD | NEW |