OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/extensions/sandboxed_extension_unpacker.h" | 5 #include "chrome/browser/extensions/sandboxed_extension_unpacker.h" |
6 | 6 |
7 #include <set> | 7 #include <set> |
8 | 8 |
9 #include "base/base64.h" | 9 #include "base/base64.h" |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
254 ReportFailure( | 254 ReportFailure( |
255 UTILITY_PROCESS_CRASHED_WHILE_TRYING_TO_INSTALL, | 255 UTILITY_PROCESS_CRASHED_WHILE_TRYING_TO_INSTALL, |
256 l10n_util::GetStringFUTF8( | 256 l10n_util::GetStringFUTF8( |
257 IDS_EXTENSION_PACKAGE_INSTALL_ERROR, | 257 IDS_EXTENSION_PACKAGE_INSTALL_ERROR, |
258 ASCIIToUTF16("UTILITY_PROCESS_CRASHED_WHILE_TRYING_TO_INSTALL"))); | 258 ASCIIToUTF16("UTILITY_PROCESS_CRASHED_WHILE_TRYING_TO_INSTALL"))); |
259 } | 259 } |
260 | 260 |
261 void SandboxedExtensionUnpacker::StartProcessOnIOThread( | 261 void SandboxedExtensionUnpacker::StartProcessOnIOThread( |
262 const FilePath& temp_crx_path) { | 262 const FilePath& temp_crx_path) { |
263 UtilityProcessHost* host = new UtilityProcessHost(this, thread_identifier_); | 263 UtilityProcessHost* host = new UtilityProcessHost(this, thread_identifier_); |
| 264 // Don't launch the utility process from the zygote on Linux since |
| 265 // extension unpacking needs FS access. |
| 266 host->set_use_linux_zygote(false); |
264 // Grant the subprocess access to the entire subdir the extension file is | 267 // Grant the subprocess access to the entire subdir the extension file is |
265 // in, so that it can unpack to that dir. | 268 // in, so that it can unpack to that dir. |
266 host->set_exposed_dir(temp_crx_path.DirName()); | 269 host->set_exposed_dir(temp_crx_path.DirName()); |
267 host->Send( | 270 host->Send( |
268 new ChromeUtilityMsg_UnpackExtension( | 271 new ChromeUtilityMsg_UnpackExtension( |
269 temp_crx_path, location_, creation_flags_)); | 272 temp_crx_path, location_, creation_flags_)); |
270 } | 273 } |
271 | 274 |
272 void SandboxedExtensionUnpacker::OnUnpackExtensionSucceeded( | 275 void SandboxedExtensionUnpacker::OnUnpackExtensionSucceeded( |
273 const DictionaryValue& manifest) { | 276 const DictionaryValue& manifest) { |
(...skipping 439 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
713 ERROR_SAVING_CATALOG, | 716 ERROR_SAVING_CATALOG, |
714 l10n_util::GetStringFUTF8( | 717 l10n_util::GetStringFUTF8( |
715 IDS_EXTENSION_PACKAGE_INSTALL_ERROR, | 718 IDS_EXTENSION_PACKAGE_INSTALL_ERROR, |
716 ASCIIToUTF16("ERROR_SAVING_CATALOG"))); | 719 ASCIIToUTF16("ERROR_SAVING_CATALOG"))); |
717 return false; | 720 return false; |
718 } | 721 } |
719 } | 722 } |
720 | 723 |
721 return true; | 724 return true; |
722 } | 725 } |
OLD | NEW |