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 // 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_ |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 | 50 |
51 // Ensure the download after the above delay. | 51 // Ensure the download after the above delay. |
52 void ScheduleDelayedRun(); | 52 void ScheduleDelayedRun(); |
53 | 53 |
54 // Make sure we're processing (or waiting for) the the arrival of the next URL | 54 // Make sure we're processing (or waiting for) the the arrival of the next URL |
55 // in the |fetch_queue_|. | 55 // in the |fetch_queue_|. |
56 void StartFetching(); | 56 void StartFetching(); |
57 | 57 |
58 // Implementation of content::URLFetcherDelegate. Called after transmission | 58 // Implementation of content::URLFetcherDelegate. Called after transmission |
59 // completes (either successfully or with failure). | 59 // completes (either successfully or with failure). |
60 virtual void OnURLFetchComplete(const content::URLFetcher* source) OVERRIDE; | 60 virtual void OnURLFetchComplete(const net::URLFetcher* source) OVERRIDE; |
61 | 61 |
62 // A queue of URLs that are being used to download dictionaries. | 62 // A queue of URLs that are being used to download dictionaries. |
63 std::queue<GURL> fetch_queue_; | 63 std::queue<GURL> fetch_queue_; |
64 // The currently outstanding URL fetch of a dicitonary. | 64 // The currently outstanding URL fetch of a dicitonary. |
65 // If this is null, then there is no outstanding request. | 65 // If this is null, then there is no outstanding request. |
66 scoped_ptr<content::URLFetcher> current_fetch_; | 66 scoped_ptr<content::URLFetcher> current_fetch_; |
67 | 67 |
68 // Always spread out the dictionary fetches, so that they don't steal | 68 // Always spread out the dictionary fetches, so that they don't steal |
69 // bandwidth from the actual page load. Create delayed tasks to spread out | 69 // bandwidth from the actual page load. Create delayed tasks to spread out |
70 // the download. | 70 // the download. |
(...skipping 16 matching lines...) Expand all Loading... |
87 std::set<GURL> attempted_load_; | 87 std::set<GURL> attempted_load_; |
88 | 88 |
89 // Store the system_url_request_context_getter to use it when we start | 89 // Store the system_url_request_context_getter to use it when we start |
90 // fetching. | 90 // fetching. |
91 scoped_refptr<net::URLRequestContextGetter> context_; | 91 scoped_refptr<net::URLRequestContextGetter> context_; |
92 | 92 |
93 DISALLOW_COPY_AND_ASSIGN(SdchDictionaryFetcher); | 93 DISALLOW_COPY_AND_ASSIGN(SdchDictionaryFetcher); |
94 }; | 94 }; |
95 | 95 |
96 #endif // CHROME_BROWSER_NET_SDCH_DICTIONARY_FETCHER_H_ | 96 #endif // CHROME_BROWSER_NET_SDCH_DICTIONARY_FETCHER_H_ |
OLD | NEW |