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

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

Issue 18119009: Make utility process run in-process when running in single-process mode. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: undo unnecessary changes Created 7 years, 5 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
===================================================================
--- chrome/browser/extensions/sandboxed_unpacker.cc (revision 210446)
+++ chrome/browser/extensions/sandboxed_unpacker.cc (working copy)
@@ -178,14 +178,12 @@
SandboxedUnpacker::SandboxedUnpacker(
const base::FilePath& crx_path,
- bool run_out_of_process,
Manifest::Location location,
int creation_flags,
const base::FilePath& extensions_dir,
base::SequencedTaskRunner* unpacker_io_task_runner,
SandboxedUnpackerClient* client)
: crx_path_(crx_path),
- run_out_of_process_(run_out_of_process),
client_(client),
extensions_dir_(extensions_dir),
got_response_(false),
@@ -256,46 +254,29 @@
return;
}
- // If we are supposed to use a subprocess, kick off the subprocess.
- //
- // TODO(asargent) we shouldn't need to do this branch here - instead
- // UtilityProcessHost should handle it for us. (http://crbug.com/19192)
- bool use_utility_process = run_out_of_process_ &&
- !CommandLine::ForCurrentProcess()->HasSwitch(switches::kSingleProcess);
- if (use_utility_process) {
- // The utility process will have access to the directory passed to
- // SandboxedUnpacker. That directory should not contain a symlink or NTFS
- // reparse point. When the path is used, following the link/reparse point
- // will cause file system access outside the sandbox path, and the sandbox
- // will deny the operation.
- base::FilePath link_free_crx_path;
- if (!file_util::NormalizeFilePath(temp_crx_path, &link_free_crx_path)) {
- LOG(ERROR) << "Could not get the normalized path of "
- << temp_crx_path.value();
- ReportFailure(
- COULD_NOT_GET_SANDBOX_FRIENDLY_PATH,
- l10n_util::GetStringUTF16(IDS_EXTENSION_UNPACK_FAILED));
- return;
- }
- PATH_LENGTH_HISTOGRAM("Extensions.SandboxUnpackLinkFreeCrxPathLength",
- link_free_crx_path);
-
- BrowserThread::PostTask(
- BrowserThread::IO, FROM_HERE,
- base::Bind(
- &SandboxedUnpacker::StartProcessOnIOThread,
- this,
- link_free_crx_path));
- } else {
- // Otherwise, unpack the extension in this process.
- Unpacker unpacker(temp_crx_path, extension_id_, location_, creation_flags_);
- if (unpacker.Run() && unpacker.DumpImagesToFile() &&
- unpacker.DumpMessageCatalogsToFile()) {
- OnUnpackExtensionSucceeded(*unpacker.parsed_manifest());
- } else {
- OnUnpackExtensionFailed(unpacker.error_message());
- }
+ // The utility process will have access to the directory passed to
+ // SandboxedUnpacker. That directory should not contain a symlink or NTFS
+ // reparse point. When the path is used, following the link/reparse point
+ // will cause file system access outside the sandbox path, and the sandbox
+ // will deny the operation.
+ base::FilePath link_free_crx_path;
+ if (!file_util::NormalizeFilePath(temp_crx_path, &link_free_crx_path)) {
+ LOG(ERROR) << "Could not get the normalized path of "
+ << temp_crx_path.value();
+ ReportFailure(
+ COULD_NOT_GET_SANDBOX_FRIENDLY_PATH,
+ l10n_util::GetStringUTF16(IDS_EXTENSION_UNPACK_FAILED));
+ return;
}
+ PATH_LENGTH_HISTOGRAM("Extensions.SandboxUnpackLinkFreeCrxPathLength",
+ link_free_crx_path);
+
+ BrowserThread::PostTask(
+ BrowserThread::IO, FROM_HERE,
+ base::Bind(
+ &SandboxedUnpacker::StartProcessOnIOThread,
+ this,
+ link_free_crx_path));
}
SandboxedUnpacker::~SandboxedUnpacker() {
« 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