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

Unified Diff: chrome/common/extensions/extension_unpacker.cc

Issue 2714016: If CreateDirectory() fails during extension unpacking, log the exact OS call that failed. (Closed) Base URL: git://codf21.jail/chromium.git
Patch Set: Rebase for commit. Created 10 years, 6 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
« no previous file with comments | « base/file_util_win.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/common/extensions/extension_unpacker.cc
diff --git a/chrome/common/extensions/extension_unpacker.cc b/chrome/common/extensions/extension_unpacker.cc
index 8c634e2101f2177ead0ce1f57198dd5195c3efef..599aa1188aafa29491f39061eb1ac75363701a18 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);
« no previous file with comments | « base/file_util_win.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698