| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 // Support modularity by calling to load a new SDCH filter dictionary. | 5 // Support modularity by calling to load a new SDCH filter dictionary. |
| 6 // Note that this sort of calling can't be done in the /net directory, as it has | 6 // Note that this sort of calling can't be done in the /net directory, as it has |
| 7 // no concept of the HTTP cache (which is only visible at the browser level). | 7 // no concept of the HTTP cache (which is only visible at the browser level). |
| 8 | 8 |
| 9 #ifndef CHROME_BROWSER_NET_SDCH_DICTIONARY_FETCHER_H_ | 9 #ifndef CHROME_BROWSER_NET_SDCH_DICTIONARY_FETCHER_H_ |
| 10 #define CHROME_BROWSER_NET_SDCH_DICTIONARY_FETCHER_H_ | 10 #define CHROME_BROWSER_NET_SDCH_DICTIONARY_FETCHER_H_ |
| 11 #pragma once | 11 #pragma once |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 void ScheduleDelayedRun(); | 45 void ScheduleDelayedRun(); |
| 46 | 46 |
| 47 // Make sure we're processing (or waiting for) the the arrival of the next URL | 47 // Make sure we're processing (or waiting for) the the arrival of the next URL |
| 48 // in the |fetch_queue_|. | 48 // in the |fetch_queue_|. |
| 49 void StartFetching(); | 49 void StartFetching(); |
| 50 | 50 |
| 51 // Implementation of URLFetcher::Delegate. Called after transmission | 51 // Implementation of URLFetcher::Delegate. Called after transmission |
| 52 // completes (either successfully or with failure). | 52 // completes (either successfully or with failure). |
| 53 virtual void OnURLFetchComplete(const URLFetcher* source, | 53 virtual void OnURLFetchComplete(const URLFetcher* source, |
| 54 const GURL& url, | 54 const GURL& url, |
| 55 const URLRequestStatus& status, | 55 const net::URLRequestStatus& status, |
| 56 int response_code, | 56 int response_code, |
| 57 const ResponseCookies& cookies, | 57 const ResponseCookies& cookies, |
| 58 const std::string& data); | 58 const std::string& data); |
| 59 | 59 |
| 60 // A queue of URLs that are being used to download dictionaries. | 60 // A queue of URLs that are being used to download dictionaries. |
| 61 std::queue<GURL> fetch_queue_; | 61 std::queue<GURL> fetch_queue_; |
| 62 // The currently outstanding URL fetch of a dicitonary. | 62 // The currently outstanding URL fetch of a dicitonary. |
| 63 // If this is null, then there is no outstanding request. | 63 // If this is null, then there is no outstanding request. |
| 64 scoped_ptr<URLFetcher> current_fetch_; | 64 scoped_ptr<URLFetcher> current_fetch_; |
| 65 | 65 |
| (...skipping 15 matching lines...) Expand all Loading... |
| 81 // bandwidth trying repeatedly). | 81 // bandwidth trying repeatedly). |
| 82 // The following set lists all the dictionary URLs that we've tried to load, | 82 // The following set lists all the dictionary URLs that we've tried to load, |
| 83 // so that we won't try to load from an URL more than once. | 83 // so that we won't try to load from an URL more than once. |
| 84 // TODO(jar): Try to augment the SDCH proposal to include this restiction. | 84 // TODO(jar): Try to augment the SDCH proposal to include this restiction. |
| 85 std::set<GURL> attempted_load_; | 85 std::set<GURL> attempted_load_; |
| 86 | 86 |
| 87 DISALLOW_COPY_AND_ASSIGN(SdchDictionaryFetcher); | 87 DISALLOW_COPY_AND_ASSIGN(SdchDictionaryFetcher); |
| 88 }; | 88 }; |
| 89 | 89 |
| 90 #endif // CHROME_BROWSER_NET_SDCH_DICTIONARY_FETCHER_H_ | 90 #endif // CHROME_BROWSER_NET_SDCH_DICTIONARY_FETCHER_H_ |
| OLD | NEW |