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

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

Issue 2788563002: Transfer DictionaryValue ownership in SandboxedUnpacker::OnUnpackSuccess() (Closed)
Patch Set: address comments Created 3 years, 9 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/crx_installer.h ('k') | chrome/browser/extensions/startup_helper.cc » ('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 2bf7570f7304e7b13ae5c092f5f010b862a0eb1f..beb79a7c226fc12c0c5a10f86980da018484da2e 100644
--- a/chrome/browser/extensions/crx_installer.cc
+++ b/chrome/browser/extensions/crx_installer.cc
@@ -215,8 +215,8 @@ void CrxInstaller::ConvertUserScriptOnFileThread() {
return;
}
- OnUnpackSuccess(extension->path(), extension->path(), NULL, extension.get(),
- SkBitmap());
+ OnUnpackSuccess(extension->path(), extension->path(), nullptr,
+ extension.get(), SkBitmap());
}
void CrxInstaller::InstallWebApp(const WebApplicationInfo& web_app) {
@@ -240,8 +240,8 @@ void CrxInstaller::ConvertWebAppOnFileThread(
// TODO(aa): conversion data gets lost here :(
- OnUnpackSuccess(extension->path(), extension->path(), NULL, extension.get(),
- SkBitmap());
+ OnUnpackSuccess(extension->path(), extension->path(), nullptr,
+ extension.get(), SkBitmap());
}
CrxInstallError CrxInstaller::AllowInstall(const Extension* extension) {
@@ -418,7 +418,7 @@ void CrxInstaller::OnUnpackFailure(const CrxInstallError& error) {
void CrxInstaller::OnUnpackSuccess(
const base::FilePath& temp_dir,
const base::FilePath& extension_dir,
- const base::DictionaryValue* original_manifest,
+ std::unique_ptr<base::DictionaryValue> original_manifest,
const Extension* extension,
const SkBitmap& install_icon) {
DCHECK(installer_task_runner_->RunsTasksOnCurrentThread());
@@ -436,10 +436,10 @@ void CrxInstaller::OnUnpackSuccess(
if (!install_icon.empty())
install_icon_.reset(new SkBitmap(install_icon));
- if (original_manifest)
- original_manifest_.reset(new Manifest(
- Manifest::INVALID_LOCATION,
- std::unique_ptr<base::DictionaryValue>(original_manifest->DeepCopy())));
+ if (original_manifest) {
+ original_manifest_.reset(
+ new Manifest(Manifest::INVALID_LOCATION, std::move(original_manifest)));
+ }
// We don't have to delete the unpack dir explicity since it is a child of
// the temp dir.
« no previous file with comments | « chrome/browser/extensions/crx_installer.h ('k') | chrome/browser/extensions/startup_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698