OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 // TODO(rdsmith): This class needs to delegate URLRequest::Delegate methods | 5 // TODO(rdsmith): This class needs to delegate URLRequest::Delegate methods |
6 // to the net/ embedder for correct implementation of authentication. | 6 // to the net/ embedder for correct implementation of authentication. |
7 // Specifically, this class needs the embedder to provide functionality | 7 // Specifically, this class needs the embedder to provide functionality |
8 // corresponding to | 8 // corresponding to |
9 // URLRequest::Delegate::{OnAuthRequired,OnCertificateRequested}. | 9 // URLRequest::Delegate::{OnAuthRequired,OnCertificateRequested}. |
10 | 10 |
(...skipping 18 matching lines...) Expand all Loading... |
29 | 29 |
30 // This class is used by embedder SDCH policy object to fetch | 30 // This class is used by embedder SDCH policy object to fetch |
31 // dictionaries. It queues requests for dictionaries and dispatches | 31 // dictionaries. It queues requests for dictionaries and dispatches |
32 // them serially, implementing the URLRequest::Delegate interface to | 32 // them serially, implementing the URLRequest::Delegate interface to |
33 // handle callbacks (but see above TODO). It tracks all requests, only | 33 // handle callbacks (but see above TODO). It tracks all requests, only |
34 // attempting to fetch each dictionary once. | 34 // attempting to fetch each dictionary once. |
35 class NET_EXPORT SdchDictionaryFetcher : public URLRequest::Delegate, | 35 class NET_EXPORT SdchDictionaryFetcher : public URLRequest::Delegate, |
36 public base::NonThreadSafe { | 36 public base::NonThreadSafe { |
37 public: | 37 public: |
38 typedef base::Callback<void(const std::string& dictionary_text, | 38 typedef base::Callback<void(const std::string& dictionary_text, |
39 const GURL& dictionary_url)> | 39 const GURL& dictionary_url, |
| 40 const BoundNetLog& net_log)> |
40 OnDictionaryFetchedCallback; | 41 OnDictionaryFetchedCallback; |
41 | 42 |
42 // The consumer must guarantee that |*context| outlives this object. | 43 // The consumer must guarantee that |*context| outlives this object. |
43 // |callback| will be called on successful dictionary fetch | 44 // |callback| will be called on successful dictionary fetch |
44 // requested through Schedule(). |callback| will not be called | 45 // requested through Schedule(). |callback| will not be called |
45 // after object destruction. | 46 // after object destruction. |
46 SdchDictionaryFetcher(URLRequestContext* context, | 47 SdchDictionaryFetcher(URLRequestContext* context, |
47 const OnDictionaryFetchedCallback& callback); | 48 const OnDictionaryFetchedCallback& callback); |
48 ~SdchDictionaryFetcher() override; | 49 ~SdchDictionaryFetcher() override; |
49 | 50 |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
109 const OnDictionaryFetchedCallback dictionary_fetched_callback_; | 110 const OnDictionaryFetchedCallback dictionary_fetched_callback_; |
110 | 111 |
111 base::WeakPtrFactory<SdchDictionaryFetcher> weak_factory_; | 112 base::WeakPtrFactory<SdchDictionaryFetcher> weak_factory_; |
112 | 113 |
113 DISALLOW_COPY_AND_ASSIGN(SdchDictionaryFetcher); | 114 DISALLOW_COPY_AND_ASSIGN(SdchDictionaryFetcher); |
114 }; | 115 }; |
115 | 116 |
116 } // namespace net | 117 } // namespace net |
117 | 118 |
118 #endif // NET_URL_REQUEST_SDCH_DICTIONARY_FETCHER_H_ | 119 #endif // NET_URL_REQUEST_SDCH_DICTIONARY_FETCHER_H_ |
OLD | NEW |