Chromium Code Reviews| Index: chrome/browser/extensions/extension_install_checker.h |
| diff --git a/chrome/browser/extensions/extension_install_checker.h b/chrome/browser/extensions/extension_install_checker.h |
| index b73255bdd4f1360c0239f6ec2f97fe434aa4756a..dd508bd9c42e2822eedbb9bb82b796b10dfca0c5 100644 |
| --- a/chrome/browser/extensions/extension_install_checker.h |
| +++ b/chrome/browser/extensions/extension_install_checker.h |
| @@ -42,25 +42,22 @@ class ExtensionInstallChecker { |
| CHECK_ALL = (1 << 3) - 1 |
| }; |
| - explicit ExtensionInstallChecker(Profile* profile); |
| + explicit ExtensionInstallChecker(Profile* profile, |
|
Devlin
2017/03/16 19:29:40
This no longer needs explicit.
michaelpg
2017/03/17 04:25:23
Made PG-rated.
|
| + scoped_refptr<const Extension> extension); |
| virtual ~ExtensionInstallChecker(); |
| - // Start a set of checks. |enabled_checks| is a bitmask of CheckTypes to run. |
| - // If |fail_fast| is true, the callback will be invoked once any check fails. |
| - // Otherwise it will be invoked when all checks have completed. |callback| |
| - // will only be called once. |
| + // Start the set of checks. |enabled_checks| is a bitmask of CheckTypes to |
|
Devlin
2017/03/16 19:29:41
nit: since we're updating this anyway, function co
michaelpg
2017/03/17 04:25:23
Done.
|
| + // run. If |fail_fast| is true, the callback will be invoked once any check |
| + // fails. Otherwise it will be invoked when all checks have completed. |
| + // |callback| will only be called once. |
| // This function must be called on the UI thread. The callback also occurs on |
| // the UI thread. Checks may run asynchronously in parallel. |
| - // If checks are currently running, the caller must wait for the callback to |
| - // be invoked before starting another set of checks. |
| + // This function should be invoked at most once. |
|
Devlin
2017/03/16 19:29:40
Let's also put something about single use in the c
michaelpg
2017/03/17 04:25:23
Done.
|
| void Start(int enabled_checks, bool fail_fast, const Callback& callback); |
| Profile* profile() const { return profile_; } |
| const scoped_refptr<const Extension>& extension() { return extension_; } |
| - void set_extension(const scoped_refptr<const Extension>& extension) { |
| - extension_ = extension; |
| - } |
| // Returns true if any checks are currently running. |
| bool is_running() const { return running_checks_ != 0; } |
| @@ -84,14 +81,10 @@ class ExtensionInstallChecker { |
| void OnManagementPolicyCheckDone(bool allows_load, const std::string& error); |
| virtual void CheckRequirements(); |
| - void OnRequirementsCheckDone(int sequence_number, |
| - const std::vector<std::string>& errors); |
| + void OnRequirementsCheckDone(const std::vector<std::string>& errors); |
| virtual void CheckBlacklistState(); |
| - void OnBlacklistStateCheckDone(int sequence_number, BlacklistState state); |
| - |
| - virtual void ResetResults(); |
| - int current_sequence_number() const { return current_sequence_number_; } |
| + void OnBlacklistStateCheckDone(BlacklistState state); |
| private: |
| void MaybeInvokeCallback(); |
| @@ -114,8 +107,8 @@ class ExtensionInstallChecker { |
| bool policy_allows_load_; |
| std::string policy_error_; |
| - // The sequence number of the currently running checks. |
| - int current_sequence_number_; |
| + // Bitmask of enabled checks. |
| + int enabled_checks_; |
| // Bitmask of currently running checks. |
| int running_checks_; |