summaryrefslogtreecommitdiffstats
path: root/chrome/common/extensions
diff options
context:
space:
mode:
authorskerner@chromium.org <skerner@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-06-14 18:50:19 +0000
committerskerner@chromium.org <skerner@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-06-14 18:50:19 +0000
commitbaedfdf14e911a4e9a3fbf36cd726e065bd08673 (patch)
treec31fa7cc4cc71029b5e433e05301fd7cbdfa1e57 /chrome/common/extensions
parent485af9bb88177c78dcd905234fe6e543fa108789 (diff)
downloadchromium_src-baedfdf14e911a4e9a3fbf36cd726e065bd08673.zip
chromium_src-baedfdf14e911a4e9a3fbf36cd726e065bd08673.tar.gz
chromium_src-baedfdf14e911a4e9a3fbf36cd726e065bd08673.tar.bz2
If CreateDirectory() fails during extension unpacking, log the exact OS call that failed.
This change is designed to help understand bug 35198, which we can not reproduce locally. BUG=35198 TEST=manual Review URL: http://codereview.chromium.org/2714016 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@49703 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common/extensions')
-rw-r--r--chrome/common/extensions/extension_unpacker.cc14
1 files changed, 11 insertions, 3 deletions
diff --git a/chrome/common/extensions/extension_unpacker.cc b/chrome/common/extensions/extension_unpacker.cc
index 8c634e2..599aa11 100644
--- a/chrome/common/extensions/extension_unpacker.cc
+++ b/chrome/common/extensions/extension_unpacker.cc
@@ -140,15 +140,23 @@ bool ExtensionUnpacker::Run() {
// <profile>/Extensions/INSTALL_TEMP/<version>
temp_install_dir_ =
extension_path_.DirName().AppendASCII(filenames::kTempExtensionName);
- if (!file_util::CreateDirectory(temp_install_dir_)) {
+
#if defined(OS_WIN)
- std::string dir_string = WideToUTF8(temp_install_dir_.value());
+ std::ostringstream log_stream;
+ std::string dir_string = WideToUTF8(temp_install_dir_.value());
+ log_stream << kCouldNotCreateDirectoryError << dir_string << std::endl;
+ if (!file_util::CreateDirectoryExtraLogging(temp_install_dir_, log_stream)) {
+ log_stream.flush();
+ SetError(log_stream.str());
+ return false;
+ }
#else
+ if (!file_util::CreateDirectory(temp_install_dir_)) {
std::string dir_string = temp_install_dir_.value();
-#endif
SetError(kCouldNotCreateDirectoryError + dir_string);
return false;
}
+#endif
if (!Unzip(extension_path_, temp_install_dir_)) {
SetError(kCouldNotUnzipExtension);