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 #ifndef CHROME_BROWSER_NET_CRL_SET_FETCHER_H_ | 5 #ifndef CHROME_BROWSER_NET_CRL_SET_FETCHER_H_ |
6 #define CHROME_BROWSER_NET_CRL_SET_FETCHER_H_ | 6 #define CHROME_BROWSER_NET_CRL_SET_FETCHER_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
11 #include "base/memory/ref_counted.h" | 11 #include "base/memory/ref_counted.h" |
12 #include "chrome/browser/component_updater/component_updater_service.h" | 12 #include "chrome/browser/component_updater/component_updater_service.h" |
13 | 13 |
14 namespace base { | 14 namespace base { |
15 class DictionaryValue; | 15 class DictionaryValue; |
16 class FilePath; | 16 class FilePath; |
17 } | 17 } |
18 | 18 |
19 namespace net { | 19 namespace net { |
20 class CRLSet; | 20 class CRLSet; |
21 } | 21 } |
22 | 22 |
23 class ComponentUpdateService; | 23 class CRLSetFetcher : public component_updater::ComponentInstaller, |
24 | |
25 class CRLSetFetcher : public ComponentInstaller, | |
26 public base::RefCountedThreadSafe<CRLSetFetcher> { | 24 public base::RefCountedThreadSafe<CRLSetFetcher> { |
27 public: | 25 public: |
28 CRLSetFetcher(); | 26 CRLSetFetcher(); |
29 | 27 |
30 void StartInitialLoad(ComponentUpdateService* cus); | 28 void StartInitialLoad(component_updater::ComponentUpdateService* cus); |
31 | 29 |
32 // ComponentInstaller interface | 30 // ComponentInstaller interface |
33 virtual void OnUpdateError(int error) OVERRIDE; | 31 virtual void OnUpdateError(int error) OVERRIDE; |
34 virtual bool Install(const base::DictionaryValue& manifest, | 32 virtual bool Install(const base::DictionaryValue& manifest, |
35 const base::FilePath& unpack_path) OVERRIDE; | 33 const base::FilePath& unpack_path) OVERRIDE; |
36 virtual bool GetInstalledFile(const std::string& file, | 34 virtual bool GetInstalledFile(const std::string& file, |
37 base::FilePath* installed_file) OVERRIDE; | 35 base::FilePath* installed_file) OVERRIDE; |
38 | 36 |
39 private: | 37 private: |
40 friend class base::RefCountedThreadSafe<CRLSetFetcher>; | 38 friend class base::RefCountedThreadSafe<CRLSetFetcher>; |
(...skipping 14 matching lines...) Expand all Loading... |
55 void LoadFromDisk(base::FilePath load_from, | 53 void LoadFromDisk(base::FilePath load_from, |
56 scoped_refptr<net::CRLSet>* out_crl_set); | 54 scoped_refptr<net::CRLSet>* out_crl_set); |
57 | 55 |
58 // SetCRLSetIfNewer runs on the IO thread and installs a CRL set | 56 // SetCRLSetIfNewer runs on the IO thread and installs a CRL set |
59 // as the global CRL set if it's newer than the existing one. | 57 // as the global CRL set if it's newer than the existing one. |
60 void SetCRLSetIfNewer(scoped_refptr<net::CRLSet> crl_set); | 58 void SetCRLSetIfNewer(scoped_refptr<net::CRLSet> crl_set); |
61 | 59 |
62 // RegisterComponent registers this object as a component updater. | 60 // RegisterComponent registers this object as a component updater. |
63 void RegisterComponent(uint32 sequence_of_loaded_crl); | 61 void RegisterComponent(uint32 sequence_of_loaded_crl); |
64 | 62 |
65 ComponentUpdateService* cus_; | 63 component_updater::ComponentUpdateService* cus_; |
66 | 64 |
67 // We keep a pointer to the current CRLSet for use on the FILE thread when | 65 // We keep a pointer to the current CRLSet for use on the FILE thread when |
68 // applying delta updates. | 66 // applying delta updates. |
69 scoped_refptr<net::CRLSet> crl_set_; | 67 scoped_refptr<net::CRLSet> crl_set_; |
70 | 68 |
71 DISALLOW_COPY_AND_ASSIGN(CRLSetFetcher); | 69 DISALLOW_COPY_AND_ASSIGN(CRLSetFetcher); |
72 }; | 70 }; |
73 | 71 |
74 #endif // CHROME_BROWSER_NET_CRL_SET_FETCHER_H_ | 72 #endif // CHROME_BROWSER_NET_CRL_SET_FETCHER_H_ |
OLD | NEW |