OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_EXTENSIONS_INSTALL_VERIFIER_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_INSTALL_VERIFIER_H_ |
6 #define CHROME_BROWSER_EXTENSIONS_INSTALL_VERIFIER_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_INSTALL_VERIFIER_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 #include <queue> | 9 #include <queue> |
10 #include <set> | 10 #include <set> |
11 #include <string> | 11 #include <string> |
12 | 12 |
13 #include "base/callback.h" | 13 #include "base/callback.h" |
14 #include "base/macros.h" | 14 #include "base/macros.h" |
15 #include "base/memory/linked_ptr.h" | |
16 #include "base/memory/weak_ptr.h" | 15 #include "base/memory/weak_ptr.h" |
17 #include "components/keyed_service/core/keyed_service.h" | 16 #include "components/keyed_service/core/keyed_service.h" |
18 #include "extensions/browser/management_policy.h" | 17 #include "extensions/browser/management_policy.h" |
19 #include "extensions/common/extension.h" | 18 #include "extensions/common/extension.h" |
20 | 19 |
21 namespace content { | 20 namespace content { |
22 class BrowserContext; | 21 class BrowserContext; |
23 } | 22 } |
24 | 23 |
25 namespace net { | 24 namespace net { |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
163 bool bootstrap_check_complete_; | 162 bool bootstrap_check_complete_; |
164 | 163 |
165 // This is the most up-to-date signature, read out of |prefs_| during | 164 // This is the most up-to-date signature, read out of |prefs_| during |
166 // initialization and updated anytime we get new id's added. | 165 // initialization and updated anytime we get new id's added. |
167 std::unique_ptr<InstallSignature> signature_; | 166 std::unique_ptr<InstallSignature> signature_; |
168 | 167 |
169 // The current InstallSigner, if we have a signature request running. | 168 // The current InstallSigner, if we have a signature request running. |
170 std::unique_ptr<InstallSigner> signer_; | 169 std::unique_ptr<InstallSigner> signer_; |
171 | 170 |
172 // A queue of operations to apply to the current set of allowed ids. | 171 // A queue of operations to apply to the current set of allowed ids. |
173 std::queue<linked_ptr<PendingOperation> > operation_queue_; | 172 std::queue<std::unique_ptr<PendingOperation>> operation_queue_; |
174 | 173 |
175 // A set of ids that have been provisionally added, which we're willing to | 174 // A set of ids that have been provisionally added, which we're willing to |
176 // consider allowed until we hear back from the server signature request. | 175 // consider allowed until we hear back from the server signature request. |
177 ExtensionIdSet provisional_; | 176 ExtensionIdSet provisional_; |
178 | 177 |
179 base::WeakPtrFactory<InstallVerifier> weak_factory_; | 178 base::WeakPtrFactory<InstallVerifier> weak_factory_; |
180 | 179 |
181 DISALLOW_COPY_AND_ASSIGN(InstallVerifier); | 180 DISALLOW_COPY_AND_ASSIGN(InstallVerifier); |
182 }; | 181 }; |
183 | 182 |
184 // Instances of this class can be constructed to disable install verification | 183 // Instances of this class can be constructed to disable install verification |
185 // during tests. | 184 // during tests. |
186 class ScopedInstallVerifierBypassForTest { | 185 class ScopedInstallVerifierBypassForTest { |
187 public: | 186 public: |
188 ScopedInstallVerifierBypassForTest(); | 187 ScopedInstallVerifierBypassForTest(); |
189 ~ScopedInstallVerifierBypassForTest(); | 188 ~ScopedInstallVerifierBypassForTest(); |
190 | 189 |
191 // Should install verification be bypassed? | 190 // Should install verification be bypassed? |
192 static bool ShouldBypass(); | 191 static bool ShouldBypass(); |
193 | 192 |
194 private: | 193 private: |
195 bool old_value_; | 194 bool old_value_; |
196 DISALLOW_COPY_AND_ASSIGN(ScopedInstallVerifierBypassForTest); | 195 DISALLOW_COPY_AND_ASSIGN(ScopedInstallVerifierBypassForTest); |
197 }; | 196 }; |
198 | 197 |
199 } // namespace extensions | 198 } // namespace extensions |
200 | 199 |
201 #endif // CHROME_BROWSER_EXTENSIONS_INSTALL_VERIFIER_H_ | 200 #endif // CHROME_BROWSER_EXTENSIONS_INSTALL_VERIFIER_H_ |
OLD | NEW |