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

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

Issue 11198067: Move extension unpack intermediate dir to Extensions/Temp (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: standardize names 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
Index: chrome/browser/extensions/sandboxed_unpacker.cc
diff --git a/chrome/browser/extensions/sandboxed_unpacker.cc b/chrome/browser/extensions/sandboxed_unpacker.cc
index 9a11ef4de4685fcbb38658157f50a31355743762..d0d529b772432707f1c21afc528695ea1bf2ab8e 100644
--- a/chrome/browser/extensions/sandboxed_unpacker.cc
+++ b/chrome/browser/extensions/sandboxed_unpacker.cc
@@ -147,11 +147,12 @@ bool VerifyJunctionFreeLocation(FilePath* temp_dir) {
// proceed and should fail.
// The result will be written to |temp_dir|. The function will write to this
// parameter even if it returns false.
-bool FindWritableTempLocation(FilePath* temp_dir) {
+bool FindWritableTempLocation(const FilePath& extensions_dir,
+ FilePath* temp_dir) {
PathService::Get(base::DIR_TEMP, temp_dir);
if (VerifyJunctionFreeLocation(temp_dir))
return true;
- *temp_dir = extension_file_util::GetUserDataTempDir();
+ *temp_dir = extension_file_util::GetInstallTempDir(extensions_dir);
if (VerifyJunctionFreeLocation(temp_dir))
return true;
// Neither paths is link free chances are good installation will fail.
@@ -169,11 +170,13 @@ SandboxedUnpacker::SandboxedUnpacker(
bool run_out_of_process,
Extension::Location location,
int creation_flags,
+ const FilePath& extensions_dir,
SandboxedUnpackerClient* client)
: crx_path_(crx_path),
thread_identifier_(BrowserThread::ID_COUNT),
run_out_of_process_(run_out_of_process),
client_(client),
+ extensions_dir_(extensions_dir),
got_response_(false),
location_(location),
creation_flags_(creation_flags) {
@@ -183,7 +186,7 @@ bool SandboxedUnpacker::CreateTempDirectory() {
CHECK(BrowserThread::GetCurrentThreadIdentifier(&thread_identifier_));
FilePath temp_dir;
- if (!FindWritableTempLocation(&temp_dir)) {
+ if (!FindWritableTempLocation(extensions_dir_, &temp_dir)) {
ReportFailure(
COULD_NOT_GET_TEMP_DIRECTORY,
l10n_util::GetStringFUTF16(
« no previous file with comments | « chrome/browser/extensions/sandboxed_unpacker.h ('k') | chrome/browser/extensions/sandboxed_unpacker_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698