| Index: extensions/browser/requirements_checker.h
|
| diff --git a/extensions/browser/requirements_checker.h b/extensions/browser/requirements_checker.h
|
| index 8844157e1d8333afb84912180ff09496fa8e5ead..13d2660c6d37619c1286fb821ca8aca49e69b11e 100644
|
| --- a/extensions/browser/requirements_checker.h
|
| +++ b/extensions/browser/requirements_checker.h
|
| @@ -5,10 +5,17 @@
|
| #ifndef EXTENSIONS_BROWSER_REQUIREMENTS_CHECKER_H_
|
| #define EXTENSIONS_BROWSER_REQUIREMENTS_CHECKER_H_
|
|
|
| +#include <memory>
|
| #include <vector>
|
|
|
| -#include "base/callback.h"
|
| +#include "base/macros.h"
|
| #include "base/memory/ref_counted.h"
|
| +#include "base/memory/weak_ptr.h"
|
| +#include "extensions/browser/preload_check.h"
|
| +
|
| +namespace content {
|
| +class GpuFeatureChecker;
|
| +}
|
|
|
| namespace extensions {
|
| class Extension;
|
| @@ -17,20 +24,30 @@ class Extension;
|
| // asynchronous process that involves several threads, but the public interface
|
| // of this class (including constructor and destructor) must only be used on
|
| // the UI thread.
|
| -class RequirementsChecker {
|
| +class RequirementsChecker : public PreloadCheck {
|
| public:
|
| - virtual ~RequirementsChecker() {}
|
| -
|
| - using RequirementsCheckedCallback =
|
| - base::Callback<void(const std::vector<std::string>& /* requirements */)>;
|
| -
|
| - // The vector passed to the callback are any localized errors describing
|
| - // requirement violations. If this vector is non-empty, requirements checking
|
| - // failed. This should only be called once. |callback| will always be invoked
|
| - // asynchronously on the UI thread. |callback| will only be called once, and
|
| - // will be reset after called.
|
| - virtual void Check(const scoped_refptr<const Extension>& extension,
|
| - const RequirementsCheckedCallback& callback) = 0;
|
| + explicit RequirementsChecker(const Extension* extension);
|
| + ~RequirementsChecker() override;
|
| +
|
| + // PreloadCheck:
|
| + void Start(ResultCallback callback) override;
|
| + base::string16 GetErrorMessage() const override;
|
| +
|
| + private:
|
| + // Callback for the GpuFeatureChecker.
|
| + void OnGetWebGLAvailability(bool available);
|
| +
|
| + void RunCallback();
|
| +
|
| + Errors errors_;
|
| +
|
| + scoped_refptr<content::GpuFeatureChecker> webgl_checker_;
|
| +
|
| + ResultCallback callback_;
|
| +
|
| + base::WeakPtrFactory<RequirementsChecker> weak_ptr_factory_;
|
| +
|
| + DISALLOW_COPY_AND_ASSIGN(RequirementsChecker);
|
| };
|
|
|
| } // namespace extensions
|
|
|