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

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

Issue 256049: Generate IDs for --load-extension by hashing the path instead (Closed)
Patch Set: Removed support for default Extension constructor Created 11 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/extensions_service_unittest.cc ('k') | chrome/common/extensions/extension.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/sandboxed_extension_unpacker.cc
diff --git a/chrome/browser/extensions/sandboxed_extension_unpacker.cc b/chrome/browser/extensions/sandboxed_extension_unpacker.cc
index 700313955b0c229501cf41d4b11588e51eef8fdb..184432c8c9a2b728712e548a151466c09dc61a90 100644
--- a/chrome/browser/extensions/sandboxed_extension_unpacker.cc
+++ b/chrome/browser/extensions/sandboxed_extension_unpacker.cc
@@ -119,18 +119,13 @@ void SandboxedExtensionUnpacker::OnUnpackExtensionSucceeded(
return;
}
- // Delete any images that may be used by the browser. We're going to write
- // out our own versions of the parsed images, and we want to make sure the
- // originals are gone for good.
- extension_.reset(new Extension);
- std::string manifest_error;
-
- // Update the path to refer to the temporary location. We do this because
- // clients may want to use resources inside the extension before it is
- // installed and they need the correct path. For example, the install UI shows
- // one of the icons from the extension.
- extension_->set_path(extension_root_);
+ // Create an extension object that refers to the temporary location the
+ // extension was unpacked to. We use this until the extension is finally
+ // installed. For example, the install UI shows images from inside the
+ // extension.
+ extension_.reset(new Extension(extension_root_));
+ std::string manifest_error;
if (!extension_->InitFromValue(*final_manifest, true, // require id
&manifest_error)) {
ReportFailure(std::string("Manifest is invalid: ") +
@@ -138,6 +133,9 @@ void SandboxedExtensionUnpacker::OnUnpackExtensionSucceeded(
return;
}
+ // Delete any images that may be used by the browser. We're going to write
+ // out our own versions of the parsed images, and we want to make sure the
+ // originals are gone for good.
std::set<FilePath> image_paths = extension_->GetBrowserImages();
if (image_paths.size() != images.size()) {
ReportFailure("Decoded images don't match what's in the manifest.");
« no previous file with comments | « chrome/browser/extensions/extensions_service_unittest.cc ('k') | chrome/common/extensions/extension.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698