Commit 794fe3ee authored by Nicolas Ouellet-Payeur's avatar Nicolas Ouellet-Payeur Committed by Commit Bot

[Extensions] Add a WeakPtr guard in CrxInstaller

With the recently-added DestroyProfileOnBrowserClose flag, the Profile
object is not guaranteed to exist throughout an extension's install
process.

There was one missing guard clause in CrxInstaller, which caused it to
crash if the Profile was deleted too early. This patch adds the missing
clause.

Bug: 88586
Change-Id: I61cfa73ab5a1543263b3fdc72809694ac3dd0870
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2462175
Commit-Queue: Nicolas Ouellet-Payeur <nicolaso@chromium.org>
Reviewed-by: default avatarKaran Bhatia <karandeepb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#817093}
parent 979885db
......@@ -491,6 +491,10 @@ void CrxInstaller::ShouldComputeHashesOnUI(
scoped_refptr<const Extension> extension,
base::OnceCallback<void(bool)> callback) {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
ExtensionService* service = service_weak_.get();
if (!service || service->browser_terminating())
return;
extensions::ContentVerifier* content_verifier =
extensions::ExtensionSystem::Get(profile_)->content_verifier();
bool result = content_verifier &&
......
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