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

Unified Diff: base/files/file_posix.cc

Issue 323683002: net: FileStream cleanup (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add DCHECK, fix ASSERT message Created 6 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
Index: base/files/file_posix.cc
diff --git a/base/files/file_posix.cc b/base/files/file_posix.cc
index 0764ee98660239ed813ada6d0dd0a7b15429aeee..a51aaa812799a311376e3b8f8f0103943f84afe4 100644
--- a/base/files/file_posix.cc
+++ b/base/files/file_posix.cc
@@ -280,11 +280,16 @@ void File::Close() {
int64 File::Seek(Whence whence, int64 offset) {
base::ThreadRestrictions::AssertIOAllowed();
DCHECK(IsValid());
- if (offset < 0)
- return -1;
+#if defined(OS_ANDROID)
+ COMPILE_ASSERT(sizeof(int64) == sizeof(off64_t), off64_t_64_bit);
+ return lseek64(file_.get(), static_cast<off64_t>(offset),
wtc 2014/06/19 18:20:49 The COMPILE_ASSERT and the static_cast<off64_t> sh
rvargas (doing something else) 2014/06/19 18:46:42 That was exactly my thought :)
+ static_cast<int>(whence));
+#else
+ COMPILE_ASSERT(sizeof(int64) == sizeof(off_t), off_t_64_bit);
return lseek(file_.get(), static_cast<off_t>(offset),
static_cast<int>(whence));
+#endif
}
int File::Read(int64 offset, char* data, int size) {
« no previous file with comments | « no previous file | base/files/file_unittest.cc » ('j') | chrome/browser/extensions/api/messaging/native_message_process_host.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698