Commit f173cbc4 authored by rdevlin.cronin's avatar rdevlin.cronin Committed by Commit bot

Fix crash in UnpackedInstaller::LoadFromCommandLine

We were initializing permissions before checking that the extension existed.
Fix this.

BUG=415986

Review URL: https://codereview.chromium.org/584313002

Cr-Commit-Position: refs/heads/master@{#296463}
parent 31d26793
...@@ -151,8 +151,6 @@ bool UnpackedInstaller::LoadFromCommandLine(const base::FilePath& path_in, ...@@ -151,8 +151,6 @@ bool UnpackedInstaller::LoadFromCommandLine(const base::FilePath& path_in,
install_checker_.set_extension( install_checker_.set_extension(
file_util::LoadExtension( file_util::LoadExtension(
extension_path_, Manifest::COMMAND_LINE, GetFlags(), &error).get()); extension_path_, Manifest::COMMAND_LINE, GetFlags(), &error).get());
PermissionsUpdater(service_weak_->profile())
.InitializePermissions(extension());
if (!extension() || if (!extension() ||
!extension_l10n_util::ValidateExtensionLocales( !extension_l10n_util::ValidateExtensionLocales(
...@@ -161,6 +159,9 @@ bool UnpackedInstaller::LoadFromCommandLine(const base::FilePath& path_in, ...@@ -161,6 +159,9 @@ bool UnpackedInstaller::LoadFromCommandLine(const base::FilePath& path_in,
return false; return false;
} }
PermissionsUpdater(
service_weak_->profile(), PermissionsUpdater::INIT_FLAG_TRANSIENT)
.InitializePermissions(extension());
ShowInstallPrompt(); ShowInstallPrompt();
*extension_id = extension()->id(); *extension_id = extension()->id();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment