Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(458)

Unified Diff: chrome/browser/extensions/unpacked_installer.cc

Issue 2348633002: Make sure to to check weak ptr validity before use in UnpackedInstaller (Closed)
Patch Set: reset callback Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/unpacked_installer.cc
diff --git a/chrome/browser/extensions/unpacked_installer.cc b/chrome/browser/extensions/unpacked_installer.cc
index 0f29e6c2fbb805cefaa8de399a4816bd0ab5f8a4..2970b9d0b083731a2014bd6d5ded94f71663f789 100644
--- a/chrome/browser/extensions/unpacked_installer.cc
+++ b/chrome/browser/extensions/unpacked_installer.cc
@@ -369,6 +369,11 @@ void UnpackedInstaller::ReportExtensionLoadError(const std::string &error) {
void UnpackedInstaller::InstallExtension() {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
+ if (!service_weak_.get()) {
+ callback_.Reset();
+ return;
+ }
+
PermissionsUpdater perms_updater(service_weak_->profile());
perms_updater.InitializePermissions(extension());
perms_updater.GrantActivePermissions(extension());
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698