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

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

Issue 1349613003: [Extensions] Un-refcount PermissionSet (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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/bundle_installer.cc
diff --git a/chrome/browser/extensions/bundle_installer.cc b/chrome/browser/extensions/bundle_installer.cc
index 98b60ee0fd1262b487fcd02a22965f6bc1006ca7..8b77be048dc71b76b31bf4e26548f1c85cbab52b 100644
--- a/chrome/browser/extensions/bundle_installer.cc
+++ b/chrome/browser/extensions/bundle_installer.cc
@@ -261,11 +261,10 @@ void BundleInstaller::ShowPrompt() {
return;
}
- scoped_refptr<const PermissionSet> permissions =
- dummy_extensions_[0]->permissions_data()->active_permissions();
- for (size_t i = 1; i < dummy_extensions_.size(); ++i) {
+ scoped_ptr<const PermissionSet> permissions;
+ for (size_t i = 0; i < dummy_extensions_.size(); ++i) {
permissions = PermissionSet::CreateUnion(
- *permissions,
+ permissions ? *permissions : PermissionSet(),
*dummy_extensions_[i]->permissions_data()->active_permissions());
}
@@ -285,10 +284,10 @@ void BundleInstaller::ShowPrompt() {
web_contents = browser->tab_strip_model()->GetActiveWebContents();
install_ui_.reset(new ExtensionInstallPrompt(web_contents));
if (delegated_username_.empty()) {
- install_ui_->ConfirmBundleInstall(this, &icon_, permissions.get());
+ install_ui_->ConfirmBundleInstall(this, &icon_, permissions.Pass());
} else {
install_ui_->ConfirmPermissionsForDelegatedBundleInstall(
- this, delegated_username_, &icon_, permissions.get());
+ this, delegated_username_, &icon_, permissions.Pass());
}
}
}

Powered by Google App Engine
This is Rietveld 408576698