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

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

Issue 11275088: Remove implicit scoped_refptr operator T* Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 8 years, 2 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 | « chrome/browser/extensions/bundle_installer.cc ('k') | chrome/browser/extensions/extension_function.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/crx_installer.cc
diff --git a/chrome/browser/extensions/crx_installer.cc b/chrome/browser/extensions/crx_installer.cc
index 040e353d098d4a95f43a556f0f4e96a215968a18..fc759ed234162ed7c1ea0683c1a6fb0d9ef3be95 100644
--- a/chrome/browser/extensions/crx_installer.cc
+++ b/chrome/browser/extensions/crx_installer.cc
@@ -182,12 +182,12 @@ void CrxInstaller::ConvertUserScriptOnFileThread() {
string16 error;
scoped_refptr<Extension> extension = ConvertUserScriptToExtension(
source_file_, download_url_, install_directory_, &error);
- if (!extension) {
+ if (!extension.get()) {
ReportFailureFromFileThread(CrxInstallerError(error));
return;
}
- OnUnpackSuccess(extension->path(), extension->path(), NULL, extension);
+ OnUnpackSuccess(extension->path(), extension->path(), NULL, extension.get());
}
void CrxInstaller::InstallWebApp(const WebApplicationInfo& web_app) {
@@ -205,7 +205,7 @@ void CrxInstaller::ConvertWebAppOnFileThread(
string16 error;
scoped_refptr<Extension> extension(
ConvertWebAppToExtension(web_app, base::Time::Now(), install_directory));
- if (!extension) {
+ if (!extension.get()) {
// Validation should have stopped any potential errors before getting here.
NOTREACHED() << "Could not convert web app to extension.";
return;
@@ -213,7 +213,7 @@ void CrxInstaller::ConvertWebAppOnFileThread(
// TODO(aa): conversion data gets lost here :(
- OnUnpackSuccess(extension->path(), extension->path(), NULL, extension);
+ OnUnpackSuccess(extension->path(), extension->path(), NULL, extension.get());
}
CrxInstallerError CrxInstaller::AllowInstall(const Extension* extension) {
@@ -445,7 +445,7 @@ void CrxInstaller::ConfirmInstall() {
frontend_weak_->extensions()->
GetHostedAppByOverlappingWebExtent(extension_->web_extent());
if (overlapping_extension &&
- overlapping_extension->id() != extension_->id()) {
+ overlapping_extension_.get()>id() != extension_->id()) {
ReportFailureFromUIThread(
CrxInstallerError(
l10n_util::GetStringFUTF16(
@@ -493,8 +493,8 @@ void CrxInstaller::InstallUIAbort(bool user_initiated) {
content::NotificationService::NoDetails());
NotifyCrxInstallComplete(NULL);
-
- Release(); // balanced in ConfirmInstall().
+extension_.get()
+ Release(); // balanced in ConfirmInstall().
// We're done. Since we don't post any more tasks to ourself, our ref count
// should go to zero and we die. The destructor will clean up the temp dir.
@@ -560,7 +560,7 @@ void CrxInstaller::CompleteInstall() {
}
void CrxInstaller::ReportFailureFromFileThread(const CrxInstallerError& error) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE));
+ DCHEextension_.get()Thread::CurrentlyOn(BrowserThread::FILE));
if (!BrowserThread::PostTask(
BrowserThread::UI, FROM_HERE,
base::Bind(&CrxInstaller::ReportFailureFromUIThread, this, error))) {
@@ -638,12 +638,12 @@ void CrxInstaller::ReportSuccessFromUIThread() {
// We're done. We don't post any more tasks to ourselves so we are deleted
// soon.
-}
+}extension_.get()
-void CrxInstaller::NotifyCrxInstallComplete(const Extension* extension) {
+ void CrxInstaller::NotifyCrxInstallComplete(const Extension* extension) {
// Some users (such as the download shelf) need to know when a
// CRXInstaller is done. Listening for the EXTENSION_* events
- // is problematic because they don't know anything about the
+ // is problematic because they don't extension_.get()ing about the
// extension before it is unpacked, so they cannot filter based
// on the extension.
content::NotificationService::current()->Notify(
« no previous file with comments | « chrome/browser/extensions/bundle_installer.cc ('k') | chrome/browser/extensions/extension_function.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698