OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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_COMPONENT_UPDATER_STH_SET_COMPONENT_INSTALLER_H_ | 5 #ifndef CHROME_BROWSER_COMPONENT_UPDATER_STH_SET_COMPONENT_INSTALLER_H_ |
6 #define CHROME_BROWSER_COMPONENT_UPDATER_STH_SET_COMPONENT_INSTALLER_H_ | 6 #define CHROME_BROWSER_COMPONENT_UPDATER_STH_SET_COMPONENT_INSTALLER_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
11 #include <string> | 11 #include <string> |
12 #include <vector> | 12 #include <vector> |
13 | 13 |
14 #include "base/gtest_prod_util.h" | 14 #include "base/gtest_prod_util.h" |
| 15 #include "base/memory/weak_ptr.h" |
15 #include "components/component_updater/default_component_installer.h" | 16 #include "components/component_updater/default_component_installer.h" |
16 | 17 |
17 namespace base { | 18 namespace base { |
18 class FilePath; | 19 class FilePath; |
19 class Value; | 20 class Value; |
20 } // namespace base | 21 } // namespace base |
21 | 22 |
22 namespace net { | 23 namespace net { |
23 namespace ct { | 24 namespace ct { |
24 class STHObserver; | 25 class STHObserver; |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 std::unique_ptr<base::Value> parsed_json); | 71 std::unique_ptr<base::Value> parsed_json); |
71 | 72 |
72 // STH parsing failed - do nothing. | 73 // STH parsing failed - do nothing. |
73 void OnJsonParseError(const std::string& log_id, const std::string& error); | 74 void OnJsonParseError(const std::string& log_id, const std::string& error); |
74 | 75 |
75 // The observer is not owned by this class, so the code creating an instance | 76 // The observer is not owned by this class, so the code creating an instance |
76 // of this class is expected to ensure the STHObserver lives as long as | 77 // of this class is expected to ensure the STHObserver lives as long as |
77 // this class does. Typically the observer provided will be a global. | 78 // this class does. Typically the observer provided will be a global. |
78 net::ct::STHObserver* sth_observer_; | 79 net::ct::STHObserver* sth_observer_; |
79 | 80 |
| 81 base::WeakPtrFactory<STHSetComponentInstallerTraits> weak_ptr_factory_; |
| 82 |
80 DISALLOW_COPY_AND_ASSIGN(STHSetComponentInstallerTraits); | 83 DISALLOW_COPY_AND_ASSIGN(STHSetComponentInstallerTraits); |
81 }; | 84 }; |
82 | 85 |
83 void RegisterSTHSetComponent(ComponentUpdateService* cus, | 86 void RegisterSTHSetComponent(ComponentUpdateService* cus, |
84 const base::FilePath& user_data_dir); | 87 const base::FilePath& user_data_dir); |
85 | 88 |
86 } // namespace component_updater | 89 } // namespace component_updater |
87 | 90 |
88 #endif // CHROME_BROWSER_COMPONENT_UPDATER_STH_SET_COMPONENT_INSTALLER_H_ | 91 #endif // CHROME_BROWSER_COMPONENT_UPDATER_STH_SET_COMPONENT_INSTALLER_H_ |
OLD | NEW |