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

Unified Diff: trunk/src/base/file_util_posix.cc

Issue 65043023: Revert 235752 "Fix chrome upload with content uri" (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 7 years, 1 month 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 | « trunk/src/base/base.gypi ('k') | trunk/src/base/file_util_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: trunk/src/base/file_util_posix.cc
===================================================================
--- trunk/src/base/file_util_posix.cc (revision 235758)
+++ trunk/src/base/file_util_posix.cc (working copy)
@@ -48,7 +48,6 @@
#include "base/time/time.h"
#if defined(OS_ANDROID)
-#include "base/android/content_uri_utils.h"
#include "base/os_compat_android.h"
#endif
@@ -80,13 +79,7 @@
ThreadRestrictions::AssertIOAllowed();
return lstat64(path, sb);
}
-#if defined(OS_ANDROID)
-static int CallFstat(int fd, stat_wrapper_t *sb) {
- ThreadRestrictions::AssertIOAllowed();
- return fstat64(fd, sb);
-}
#endif
-#endif
// Helper for NormalizeFilePath(), defined below.
bool RealPath(const FilePath& path, FilePath* real_path) {
@@ -315,11 +308,6 @@
bool PathExists(const FilePath& path) {
ThreadRestrictions::AssertIOAllowed();
-#if defined(OS_ANDROID)
- if (path.IsContentUri()) {
- return ContentUriExists(path);
- }
-#endif
return access(path.value().c_str(), F_OK) == 0;
}
@@ -581,21 +569,8 @@
bool GetFileInfo(const FilePath& file_path, base::PlatformFileInfo* results) {
stat_wrapper_t file_info;
-#if defined(OS_ANDROID)
- if (file_path.IsContentUri()) {
- int fd = OpenContentUriForRead(file_path);
- if (fd < 0)
- return false;
- ScopedFD scoped_fd(&fd);
- if (base::CallFstat(fd, &file_info) != 0)
- return false;
- } else {
-#endif // defined(OS_ANDROID)
- if (CallStat(file_path.value().c_str(), &file_info) != 0)
- return false;
-#if defined(OS_ANDROID)
- }
-#endif // defined(OS_ANDROID)
+ if (CallStat(file_path.value().c_str(), &file_info) != 0)
+ return false;
results->is_directory = S_ISDIR(file_info.st_mode);
results->size = file_info.st_size;
#if defined(OS_MACOSX)
« no previous file with comments | « trunk/src/base/base.gypi ('k') | trunk/src/base/file_util_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698