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

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

Issue 510943003: Register granting of previously withheld permissions as a permissions (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Resolve threading issues, add crx installer browser test Created 6 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
Index: chrome/browser/extensions/crx_installer.cc
diff --git a/chrome/browser/extensions/crx_installer.cc b/chrome/browser/extensions/crx_installer.cc
index 8a370a03f3bee350911abfcbe7003d3f0afab23f..bc49ed2a00d32d848d88be62d800ae50b8004c52 100644
--- a/chrome/browser/extensions/crx_installer.cc
+++ b/chrome/browser/extensions/crx_installer.cc
@@ -459,6 +459,26 @@ void CrxInstaller::OnUnpackSuccess(
// the temp dir.
unpacked_extension_root_ = extension_dir;
+ if (!BrowserThread::PostTask(
+ BrowserThread::UI,
+ FROM_HERE,
+ base::Bind(&CrxInstaller::InitializeExtensionPermissions, this)))
Devlin 2014/09/09 16:04:26 Ew. We already bounce around a ton in extension i
gpdavis 2014/09/09 17:48:53 Well, the goal here is to call InitializePermissio
Devlin 2014/09/09 17:57:44 Hmm... that makes me wonder if this is actually th
+ NOTREACHED();
+}
+
+void CrxInstaller::InitializeExtensionPermissions() {
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
+ PermissionsUpdater(profile()).InitializePermissions(
+ install_checker_.extension().get());
+ if (!installer_task_runner_->PostTask(
+ FROM_HERE,
+ base::Bind(&CrxInstaller::ContinueUnpackSuccess, this)))
+ NOTREACHED();
+}
+
+void CrxInstaller::ContinueUnpackSuccess() {
+ DCHECK(installer_task_runner_->RunsTasksOnCurrentThread());
+ const Extension* extension = install_checker_.extension().get();
CrxInstallerError error = AllowInstall(extension);
if (error.type() != CrxInstallerError::ERROR_NONE) {
ReportFailureFromFileThread(error);

Powered by Google App Engine
This is Rietveld 408576698