| 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_EXTENSIONS_UPDATER_EXTENSION_DOWNLOADER_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_UPDATER_EXTENSION_DOWNLOADER_H_ |
| 6 #define CHROME_BROWSER_EXTENSIONS_UPDATER_EXTENSION_DOWNLOADER_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_UPDATER_EXTENSION_DOWNLOADER_H_ |
| 7 | 7 |
| 8 #include <deque> | 8 #include <deque> |
| 9 #include <map> | 9 #include <map> |
| 10 #include <set> | 10 #include <set> |
| (...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 189 // Adds all recorded stats taken so far to histogram counts. | 189 // Adds all recorded stats taken so far to histogram counts. |
| 190 void ReportStats() const; | 190 void ReportStats() const; |
| 191 | 191 |
| 192 // Begins an update check. | 192 // Begins an update check. |
| 193 void StartUpdateCheck(scoped_ptr<ManifestFetchData> fetch_data); | 193 void StartUpdateCheck(scoped_ptr<ManifestFetchData> fetch_data); |
| 194 | 194 |
| 195 // Called by RequestQueue when a new manifest fetch request is started. | 195 // Called by RequestQueue when a new manifest fetch request is started. |
| 196 void CreateManifestFetcher(); | 196 void CreateManifestFetcher(); |
| 197 | 197 |
| 198 // net::URLFetcherDelegate implementation. | 198 // net::URLFetcherDelegate implementation. |
| 199 virtual void OnURLFetchComplete(const net::URLFetcher* source) OVERRIDE; | 199 virtual void OnURLFetchComplete(const net::URLFetcher* source) override; |
| 200 | 200 |
| 201 // Handles the result of a manifest fetch. | 201 // Handles the result of a manifest fetch. |
| 202 void OnManifestFetchComplete(const GURL& url, | 202 void OnManifestFetchComplete(const GURL& url, |
| 203 const net::URLRequestStatus& status, | 203 const net::URLRequestStatus& status, |
| 204 int response_code, | 204 int response_code, |
| 205 const base::TimeDelta& backoff_delay, | 205 const base::TimeDelta& backoff_delay, |
| 206 const std::string& data); | 206 const std::string& data); |
| 207 | 207 |
| 208 // Once a manifest is parsed, this starts fetches of any relevant crx files. | 208 // Once a manifest is parsed, this starts fetches of any relevant crx files. |
| 209 // If |results| is null, it means something went wrong when parsing it. | 209 // If |results| is null, it means something went wrong when parsing it. |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 251 // Potentially updates an ExtensionFetch's authentication state and returns | 251 // Potentially updates an ExtensionFetch's authentication state and returns |
| 252 // |true| if the fetch should be retried. Returns |false| if the failure was | 252 // |true| if the fetch should be retried. Returns |false| if the failure was |
| 253 // not related to authentication, leaving the ExtensionFetch data unmodified. | 253 // not related to authentication, leaving the ExtensionFetch data unmodified. |
| 254 bool IterateFetchCredentialsAfterFailure(ExtensionFetch* fetch, | 254 bool IterateFetchCredentialsAfterFailure(ExtensionFetch* fetch, |
| 255 const net::URLRequestStatus& status, | 255 const net::URLRequestStatus& status, |
| 256 int response_code); | 256 int response_code); |
| 257 | 257 |
| 258 // OAuth2TokenService::Consumer implementation. | 258 // OAuth2TokenService::Consumer implementation. |
| 259 virtual void OnGetTokenSuccess(const OAuth2TokenService::Request* request, | 259 virtual void OnGetTokenSuccess(const OAuth2TokenService::Request* request, |
| 260 const std::string& access_token, | 260 const std::string& access_token, |
| 261 const base::Time& expiration_time) OVERRIDE; | 261 const base::Time& expiration_time) override; |
| 262 virtual void OnGetTokenFailure(const OAuth2TokenService::Request* request, | 262 virtual void OnGetTokenFailure(const OAuth2TokenService::Request* request, |
| 263 const GoogleServiceAuthError& error) OVERRIDE; | 263 const GoogleServiceAuthError& error) override; |
| 264 | 264 |
| 265 ManifestFetchData* CreateManifestFetchData(const GURL& update_url, | 265 ManifestFetchData* CreateManifestFetchData(const GURL& update_url, |
| 266 int request_id); | 266 int request_id); |
| 267 | 267 |
| 268 // The delegate that receives the crx files downloaded by the | 268 // The delegate that receives the crx files downloaded by the |
| 269 // ExtensionDownloader, and that fills in optional ping and update url data. | 269 // ExtensionDownloader, and that fills in optional ping and update url data. |
| 270 ExtensionDownloaderDelegate* delegate_; | 270 ExtensionDownloaderDelegate* delegate_; |
| 271 | 271 |
| 272 // The request context to use for the URLFetchers. | 272 // The request context to use for the URLFetchers. |
| 273 scoped_refptr<net::URLRequestContextGetter> request_context_; | 273 scoped_refptr<net::URLRequestContextGetter> request_context_; |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 325 | 325 |
| 326 // Used to create WeakPtrs to |this|. | 326 // Used to create WeakPtrs to |this|. |
| 327 base::WeakPtrFactory<ExtensionDownloader> weak_ptr_factory_; | 327 base::WeakPtrFactory<ExtensionDownloader> weak_ptr_factory_; |
| 328 | 328 |
| 329 DISALLOW_COPY_AND_ASSIGN(ExtensionDownloader); | 329 DISALLOW_COPY_AND_ASSIGN(ExtensionDownloader); |
| 330 }; | 330 }; |
| 331 | 331 |
| 332 } // namespace extensions | 332 } // namespace extensions |
| 333 | 333 |
| 334 #endif // CHROME_BROWSER_EXTENSIONS_UPDATER_EXTENSION_DOWNLOADER_H_ | 334 #endif // CHROME_BROWSER_EXTENSIONS_UPDATER_EXTENSION_DOWNLOADER_H_ |
| OLD | NEW |