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

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

Issue 1582022: Unpack extensions inside chrome's directory. (Closed)
Patch Set: Final rebase. Created 10 years, 8 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/sandboxed_extension_unpacker.cc
diff --git a/chrome/browser/extensions/sandboxed_extension_unpacker.cc b/chrome/browser/extensions/sandboxed_extension_unpacker.cc
index a9764008c2281d9f0220b120c0210ed8be85baf8..9df675cc323ac70dabb2a659baa9bc1a3bf98470 100644
--- a/chrome/browser/extensions/sandboxed_extension_unpacker.cc
+++ b/chrome/browser/extensions/sandboxed_extension_unpacker.cc
@@ -28,10 +28,13 @@
const char SandboxedExtensionUnpacker::kExtensionHeaderMagic[] = "Cr24";
SandboxedExtensionUnpacker::SandboxedExtensionUnpacker(
- const FilePath& crx_path, ResourceDispatcherHost* rdh,
+ const FilePath& crx_path,
+ const FilePath& temp_path,
+ ResourceDispatcherHost* rdh,
SandboxedExtensionUnpackerClient* client)
- : crx_path_(crx_path), thread_identifier_(ChromeThread::ID_COUNT),
- rdh_(rdh), client_(client), got_response_(false) {
+ : crx_path_(crx_path), temp_path_(temp_path),
+ thread_identifier_(ChromeThread::ID_COUNT),
+ rdh_(rdh), client_(client), got_response_(false) {
}
void SandboxedExtensionUnpacker::Start() {
@@ -40,13 +43,14 @@ void SandboxedExtensionUnpacker::Start() {
CHECK(ChromeThread::GetCurrentThreadIdentifier(&thread_identifier_));
// Create a temporary directory to work in.
- if (!temp_dir_.CreateUniqueTempDir()) {
+ if (!temp_dir_.CreateUniqueTempDirUnderPath(temp_path_)) {
ReportFailure("Could not create temporary directory.");
return;
}
// Initialize the path that will eventually contain the unpacked extension.
- extension_root_ = temp_dir_.path().AppendASCII("TEMP_INSTALL");
+ extension_root_ = temp_dir_.path().AppendASCII(
+ extension_filenames::kTempExtensionName);
// Extract the public key and validate the package.
if (!ValidateSignature())

Powered by Google App Engine
This is Rietveld 408576698