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

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

Issue 16295003: Update chrome/ to use scoped_refptr<T>::get() rather than implicit "operator T*" (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased Created 7 years, 7 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/installed_loader.cc
diff --git a/chrome/browser/extensions/installed_loader.cc b/chrome/browser/extensions/installed_loader.cc
index 2a6d97b08e9ec2665c26edae2cf0e268bdd62998..155a177b2b591b59c84a1ad01121c2a7e641dd62 100644
--- a/chrome/browser/extensions/installed_loader.cc
+++ b/chrome/browser/extensions/installed_loader.cc
@@ -107,8 +107,7 @@ void InstalledLoader::Load(const ExtensionInfo& info, bool write_to_prefs) {
// Once installed, non-unpacked extensions cannot change their IDs (e.g., by
// updating the 'key' field in their manifest).
// TODO(jstritar): migrate preferences when unpacked extensions change IDs.
- if (extension &&
- !Manifest::IsUnpackedLocation(extension->location()) &&
+ if (extension.get() && !Manifest::IsUnpackedLocation(extension->location()) &&
info.extension_id != extension->id()) {
error = errors::kCannotChangeExtensionID;
extension = NULL;
@@ -119,24 +118,23 @@ void InstalledLoader::Load(const ExtensionInfo& info, bool write_to_prefs) {
// Chrome was not running.
const ManagementPolicy* policy = extensions::ExtensionSystem::Get(
extension_service_->profile())->management_policy();
- if (extension &&
- !policy->UserMayLoad(extension, NULL)) {
+ if (extension.get() && !policy->UserMayLoad(extension.get(), NULL)) {
// The error message from UserMayInstall() often contains the extension ID
// and is therefore not well suited to this UI.
error = errors::kDisabledByPolicy;
extension = NULL;
}
- if (!extension) {
- extension_service_->
- ReportExtensionLoadError(info.extension_path, error, false);
+ if (!extension.get()) {
+ extension_service_->ReportExtensionLoadError(
+ info.extension_path, error, false);
return;
}
if (write_to_prefs)
- extension_prefs_->UpdateManifest(extension);
+ extension_prefs_->UpdateManifest(extension.get());
- extension_service_->AddExtension(extension);
+ extension_service_->AddExtension(extension.get());
}
void InstalledLoader::LoadAllExtensions() {
@@ -206,9 +204,9 @@ void InstalledLoader::LoadAllExtensions() {
GetCreationFlags(info),
&error));
- if (!extension) {
- extension_service_->
- ReportExtensionLoadError(info->extension_path, error, false);
+ if (!extension.get()) {
+ extension_service_->ReportExtensionLoadError(
+ info->extension_path, error, false);
continue;
}
« no previous file with comments | « chrome/browser/extensions/image_loader_unittest.cc ('k') | chrome/browser/extensions/menu_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698