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

Unified Diff: chrome/browser/utility_process_host.cc

Issue 2001013: Use realpath() to find the path to the extension unpack dir on posix systems. (Closed)
Patch Set: Created 10 years, 7 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
« base/file_util_posix.cc ('K') | « base/file_util_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/utility_process_host.cc
diff --git a/chrome/browser/utility_process_host.cc b/chrome/browser/utility_process_host.cc
index 2f7ce5d53573bdb234db70921eeb732d397fedf3..e75339568991bab78b5c5aed3a5be68f69c60f63 100644
--- a/chrome/browser/utility_process_host.cc
+++ b/chrome/browser/utility_process_host.cc
@@ -26,9 +26,26 @@ UtilityProcessHost::~UtilityProcessHost() {
}
bool UtilityProcessHost::StartExtensionUnpacker(const FilePath& extension) {
+ FilePath initial_path = extension.DirName();
+ FilePath real_path;
+
+#if defined(OS_POSIX)
+ if (!file_util::RealPath(initial_path, &real_path)) {
+ real_path = initial_path;
+ }
+#else
+ // TODO(skerner): For windows, we need to expand NTFS junctions.
+ // http://crbug.com/13044
+ real_path = initial_path;
+#endif
+
+ // TODO(skerner): Remove this logging once we understand crbug.com/35198
+ LOG(INFO) << "initial_path: " << initial_path.value();
+ LOG(INFO) << "real_path: " << real_path.value();
+
// Grant the subprocess access to the entire subdir the extension file is
// in, so that it can unpack to that dir.
- if (!StartProcess(extension.DirName()))
+ if (!StartProcess(real_path))
return false;
Send(new UtilityMsg_UnpackExtension(extension));
« base/file_util_posix.cc ('K') | « base/file_util_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698