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 // Implementation of chrome embedder policy for SDCH. Handles fetches. | |
6 // TODO(rdsmith): Implement dictionary prioritization. | |
mmenke
2014/11/06 15:30:12
nit: Comments like this generally go above the cl
Randy Smith (Not in Mondays)
2014/11/06 16:39:04
Done.
| |
7 | |
8 #ifndef CHROME_BROWSER_NET_CHROME_SDCH_POLICY_H_ | |
9 #define CHROME_BROWSER_NET_CHROME_SDCH_POLICY_H_ | |
10 | |
11 #include "net/base/sdch_observer.h" | |
12 #include "net/url_request/sdch_dictionary_fetcher.h" | |
13 | |
14 namespace net { | |
15 class SdchManager; | |
16 class URLRequestContext; | |
17 } | |
18 | |
19 class ChromeSdchPolicy : public net::SdchObserver { | |
mmenke
2014/11/06 15:30:12
I wonder about the name... "Policy" indicates to
Randy Smith (Not in Mondays)
2014/11/06 16:39:04
Yeah. The context here is that we want an embedde
| |
20 public: | |
21 // Consumer must guarantee that |sdch_manager| and |context| outlive | |
22 // this object. | |
23 ChromeSdchPolicy(net::SdchManager* sdch_manager, | |
24 net::URLRequestContext* context); | |
25 virtual ~ChromeSdchPolicy(); | |
mmenke
2014/11/06 15:30:12
nit: -virtual +override
Randy Smith (Not in Mondays)
2014/11/06 16:39:04
Done.
| |
26 | |
27 void OnDictionaryFetched(const std::string& dictionary_text, | |
mmenke
2014/11/06 15:30:12
#include <string>
Randy Smith (Not in Mondays)
2014/11/06 16:39:04
Done.
| |
28 const GURL& dictionary_url); | |
29 | |
30 // SdchObserver implementation. | |
31 virtual void OnGetDictionary(net::SdchManager* manager, | |
32 const GURL& request_url, | |
mmenke
2014/11/06 15:30:12
Maybe forward declare GURL? Know it's part of the
Randy Smith (Not in Mondays)
2014/11/06 16:39:04
I think if we really want consistency, we'd need t
| |
33 const GURL& dictionary_url) override; | |
34 virtual void OnClearDictionaries(net::SdchManager* manager) override; | |
mmenke
2014/11/06 15:30:11
nit: -virtual +override (x2)
Randy Smith (Not in Mondays)
2014/11/06 16:39:04
Done.
| |
35 | |
36 private: | |
37 net::SdchManager* manager_; | |
38 net::SdchDictionaryFetcher fetcher_; | |
39 }; | |
40 | |
41 #endif // CHROME_BROWSER_NET_CHROME_SDCH_POLICY_H_ | |
OLD | NEW |