| 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 be moved out to the net/ embedder and | 5 // TODO(rdsmith): This class needs to be moved out to the net/ embedder and |
| 6 // hooked into whatever mechanisms the embedder uses for authentication. | 6 // hooked into whatever mechanisms the embedder uses for authentication. |
| 7 // Specifically, this class needs methods overriding | 7 // Specifically, this class needs methods overriding |
| 8 // URLRequest::Delegate::{OnAuthRequired,OnCertificateRequested} and can't | 8 // URLRequest::Delegate::{OnAuthRequired,OnCertificateRequested} and can't |
| 9 // implement them at the net/ layer. | 9 // implement them at the net/ layer. |
| 10 | 10 |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 namespace net { | 25 namespace net { |
| 26 | 26 |
| 27 class URLRequest; | 27 class URLRequest; |
| 28 class URLRequestThrottlerEntryInterface; | 28 class URLRequestThrottlerEntryInterface; |
| 29 | 29 |
| 30 // This class implements the SdchFetcher interface. It queues requests | 30 // This class implements the SdchFetcher interface. It queues requests |
| 31 // for dictionaries and dispatches them serially, implementing | 31 // for dictionaries and dispatches them serially, implementing |
| 32 // the URLRequest::Delegate interface to handle callbacks (but see above | 32 // the URLRequest::Delegate interface to handle callbacks (but see above |
| 33 // TODO). It tracks all requests, only attempting to fetch each dictionary | 33 // TODO). It tracks all requests, only attempting to fetch each dictionary |
| 34 // once. | 34 // once. |
| 35 class NET_EXPORT SdchDictionaryFetcher | 35 class NET_EXPORT SdchDictionaryFetcher : public SdchFetcher, |
| 36 : public SdchFetcher, | 36 public URLRequest::Delegate, |
| 37 public URLRequest::Delegate, | 37 public base::NonThreadSafe { |
| 38 public base::NonThreadSafe { | |
| 39 public: | 38 public: |
| 40 // The consumer must guarantee that |*consumer| and |*context| outlive | 39 // The consumer must guarantee that |*consumer| and |*context| outlive |
| 41 // this object. | 40 // this object. |
| 42 SdchDictionaryFetcher(SdchFetcher::Delegate* consumer, | 41 SdchDictionaryFetcher(SdchFetcher::Delegate* consumer, |
| 43 URLRequestContext* context); | 42 URLRequestContext* context); |
| 44 virtual ~SdchDictionaryFetcher(); | 43 virtual ~SdchDictionaryFetcher(); |
| 45 | 44 |
| 46 // Implementation of SdchFetcher methods. | 45 // Implementation of SdchFetcher methods. |
| 47 virtual void Schedule(const GURL& dictionary_url) override; | 46 virtual void Schedule(const GURL& dictionary_url) override; |
| 48 virtual void Cancel() override; | 47 virtual void Cancel() override; |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 103 URLRequestContext* context_; | 102 URLRequestContext* context_; |
| 104 | 103 |
| 105 base::WeakPtrFactory<SdchDictionaryFetcher> weak_factory_; | 104 base::WeakPtrFactory<SdchDictionaryFetcher> weak_factory_; |
| 106 | 105 |
| 107 DISALLOW_COPY_AND_ASSIGN(SdchDictionaryFetcher); | 106 DISALLOW_COPY_AND_ASSIGN(SdchDictionaryFetcher); |
| 108 }; | 107 }; |
| 109 | 108 |
| 110 } // namespace net | 109 } // namespace net |
| 111 | 110 |
| 112 #endif // NET_BASE_SDCH_DICTIONARY_FETCHER_H_ | 111 #endif // NET_BASE_SDCH_DICTIONARY_FETCHER_H_ |
| OLD | NEW |