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 #ifndef CHROME_BROWSER_CHROME_TO_MOBILE_SERVICE_H_ | 5 #ifndef CHROME_BROWSER_CHROME_TO_MOBILE_SERVICE_H_ |
6 #define CHROME_BROWSER_CHROME_TO_MOBILE_SERVICE_H_ | 6 #define CHROME_BROWSER_CHROME_TO_MOBILE_SERVICE_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <queue> | 9 #include <queue> |
10 #include <set> | 10 #include <set> |
11 #include <string> | 11 #include <string> |
12 #include <vector> | 12 #include <vector> |
13 | 13 |
14 #include "base/compiler_specific.h" | 14 #include "base/compiler_specific.h" |
15 #include "base/file_path.h" | 15 #include "base/file_path.h" |
| 16 #include "base/memory/scoped_vector.h" |
16 #include "base/memory/weak_ptr.h" | 17 #include "base/memory/weak_ptr.h" |
17 #include "base/string16.h" | 18 #include "base/string16.h" |
18 #include "base/timer.h" | 19 #include "base/timer.h" |
19 #include "base/values.h" | 20 #include "base/values.h" |
20 #include "chrome/browser/profiles/profile_keyed_service.h" | 21 #include "chrome/browser/profiles/profile_keyed_service.h" |
21 #include "chrome/browser/sessions/session_id.h" | 22 #include "chrome/browser/sessions/session_id.h" |
22 #include "content/public/browser/notification_observer.h" | 23 #include "content/public/browser/notification_observer.h" |
23 #include "content/public/browser/notification_registrar.h" | 24 #include "content/public/browser/notification_registrar.h" |
24 #include "google_apis/gaia/oauth2_access_token_consumer.h" | 25 #include "google_apis/gaia/oauth2_access_token_consumer.h" |
25 #include "googleurl/src/gurl.h" | 26 #include "googleurl/src/gurl.h" |
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
211 // Used to recieve TokenService notifications for GaiaOAuth2LoginRefreshToken. | 212 // Used to recieve TokenService notifications for GaiaOAuth2LoginRefreshToken. |
212 content::NotificationRegistrar registrar_; | 213 content::NotificationRegistrar registrar_; |
213 | 214 |
214 // The cloud print service URL and auth access token. | 215 // The cloud print service URL and auth access token. |
215 GURL cloud_print_url_; | 216 GURL cloud_print_url_; |
216 std::string access_token_; | 217 std::string access_token_; |
217 | 218 |
218 // The set of snapshots currently available. | 219 // The set of snapshots currently available. |
219 std::set<FilePath> snapshots_; | 220 std::set<FilePath> snapshots_; |
220 | 221 |
| 222 // The list of active URLFetcher requests owned by the service. |
| 223 ScopedVector<net::URLFetcher> url_fetchers_; |
| 224 |
221 // Map URLFetchers to observers for reporting OnSendComplete. | 225 // Map URLFetchers to observers for reporting OnSendComplete. |
222 typedef std::map<const net::URLFetcher*, base::WeakPtr<Observer> > | 226 typedef std::map<const net::URLFetcher*, base::WeakPtr<Observer> > |
223 RequestObserverMap; | 227 RequestObserverMap; |
224 RequestObserverMap request_observer_map_; | 228 RequestObserverMap request_observer_map_; |
225 | 229 |
226 // The pending OAuth access token request and a timer for retrying on failure. | 230 // The pending OAuth access token request and a timer for retrying on failure. |
227 scoped_ptr<OAuth2AccessTokenFetcher> access_token_fetcher_; | 231 scoped_ptr<OAuth2AccessTokenFetcher> access_token_fetcher_; |
228 base::OneShotTimer<ChromeToMobileService> auth_retry_timer_; | 232 base::OneShotTimer<ChromeToMobileService> auth_retry_timer_; |
229 | 233 |
230 // A queue of tasks to perform after an access token is lazily initialized. | 234 // A queue of tasks to perform after an access token is lazily initialized. |
231 std::queue<base::Closure> task_queue_; | 235 std::queue<base::Closure> task_queue_; |
232 | 236 |
233 DISALLOW_COPY_AND_ASSIGN(ChromeToMobileService); | 237 DISALLOW_COPY_AND_ASSIGN(ChromeToMobileService); |
234 }; | 238 }; |
235 | 239 |
236 #endif // CHROME_BROWSER_CHROME_TO_MOBILE_SERVICE_H_ | 240 #endif // CHROME_BROWSER_CHROME_TO_MOBILE_SERVICE_H_ |
OLD | NEW |