| OLD | NEW |
| (Empty) |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef CHROME_BROWSER_NET_CHROME_SDCH_POLICY_H_ | |
| 6 #define CHROME_BROWSER_NET_CHROME_SDCH_POLICY_H_ | |
| 7 | |
| 8 #include <string> | |
| 9 | |
| 10 #include "net/base/sdch_observer.h" | |
| 11 #include "net/url_request/sdch_dictionary_fetcher.h" | |
| 12 | |
| 13 class GURL; | |
| 14 | |
| 15 namespace net { | |
| 16 class SdchManager; | |
| 17 class URLRequestContext; | |
| 18 } | |
| 19 | |
| 20 // Implementation of chrome embedder policy for SDCH. Handles fetches. | |
| 21 // TODO(rdsmith): Implement dictionary prioritization. | |
| 22 class ChromeSdchPolicy : public net::SdchObserver { | |
| 23 public: | |
| 24 // Consumer must guarantee that |sdch_manager| and |context| outlive | |
| 25 // this object. | |
| 26 ChromeSdchPolicy(net::SdchManager* sdch_manager, | |
| 27 net::URLRequestContext* context); | |
| 28 ~ChromeSdchPolicy() override; | |
| 29 | |
| 30 void OnDictionaryFetched(const std::string& dictionary_text, | |
| 31 const GURL& dictionary_url, | |
| 32 const net::BoundNetLog& net_log); | |
| 33 | |
| 34 // SdchObserver implementation. | |
| 35 void OnGetDictionary(net::SdchManager* manager, | |
| 36 const GURL& request_url, | |
| 37 const GURL& dictionary_url) override; | |
| 38 void OnClearDictionaries(net::SdchManager* manager) override; | |
| 39 | |
| 40 private: | |
| 41 net::SdchManager* manager_; | |
| 42 net::SdchDictionaryFetcher fetcher_; | |
| 43 }; | |
| 44 | |
| 45 #endif // CHROME_BROWSER_NET_CHROME_SDCH_POLICY_H_ | |
| OLD | NEW |