 Chromium Code Reviews
 Chromium Code Reviews Issue 2751013002:
  Simplify ExtensionInstallChecker into a single-use class  (Closed)
    
  
    Issue 2751013002:
  Simplify ExtensionInstallChecker into a single-use class  (Closed) 
  | Index: chrome/browser/extensions/crx_installer.h | 
| diff --git a/chrome/browser/extensions/crx_installer.h b/chrome/browser/extensions/crx_installer.h | 
| index 7d7168faefe45e2403f4c5cce3abac9cdadadd6f..524a9fd230529190332fd43704bd604503be2da9 100644 | 
| --- a/chrome/browser/extensions/crx_installer.h | 
| +++ b/chrome/browser/extensions/crx_installer.h | 
| @@ -5,6 +5,7 @@ | 
| #ifndef CHROME_BROWSER_EXTENSIONS_CRX_INSTALLER_H_ | 
| #define CHROME_BROWSER_EXTENSIONS_CRX_INSTALLER_H_ | 
| +#include <memory> | 
| #include <string> | 
| #include <vector> | 
| @@ -200,9 +201,9 @@ class CrxInstaller : public SandboxedUnpackerClient { | 
| bool did_handle_successfully() const { return did_handle_successfully_; } | 
| - Profile* profile() { return install_checker_.profile(); } | 
| + Profile* profile() { return profile_; } | 
| - const Extension* extension() { return install_checker_.extension().get(); } | 
| + const Extension* extension() { return extension_.get(); } | 
| // The currently installed version of the extension, for updates. Will be | 
| // invalid if this isn't an update. | 
| @@ -288,6 +289,12 @@ class CrxInstaller : public SandboxedUnpackerClient { | 
| install_flags_ &= ~flag; | 
| } | 
| + // The Profile the extension is being installed in. | 
| + Profile* profile_; | 
| + | 
| + // The extension being installed. | 
| + scoped_refptr<const Extension> extension_; | 
| + | 
| // The file we're installing. | 
| base::FilePath source_file_; | 
| @@ -438,7 +445,7 @@ class CrxInstaller : public SandboxedUnpackerClient { | 
| int install_flags_; | 
| // Performs requirements, policy and blacklist checks on the extension. | 
| - ExtensionInstallChecker install_checker_; | 
| + std::unique_ptr<ExtensionInstallChecker> install_checker_; | 
| 
Devlin
2017/03/16 19:29:40
optional: Truthfully, given the (lack of) complexi
 
michaelpg
2017/03/17 04:25:22
I checked when I was considering using base::Optio
 | 
| DISALLOW_COPY_AND_ASSIGN(CrxInstaller); | 
| }; |