| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 // For 64-bit file access (off_t = off64_t, lseek64, etc). | 5 // For 64-bit file access (off_t = off64_t, lseek64, etc). |
| 6 #define _FILE_OFFSET_BITS 64 | 6 #define _FILE_OFFSET_BITS 64 |
| 7 | 7 |
| 8 #include "net/base/file_stream_context.h" | 8 #include "net/base/file_stream_context.h" |
| 9 | 9 |
| 10 #include <sys/types.h> | 10 #include <sys/types.h> |
| 11 #include <sys/stat.h> | 11 #include <sys/stat.h> |
| 12 #include <fcntl.h> | 12 #include <fcntl.h> |
| 13 #include <unistd.h> | 13 #include <unistd.h> |
| 14 #include <errno.h> | 14 #include <errno.h> |
| 15 | 15 |
| 16 #include "base/basictypes.h" | 16 #include "base/basictypes.h" |
| 17 #include "base/bind.h" | 17 #include "base/bind.h" |
| 18 #include "base/bind_helpers.h" | 18 #include "base/bind_helpers.h" |
| 19 #include "base/callback.h" | 19 #include "base/callback.h" |
| 20 #include "base/eintr_wrapper.h" | |
| 21 #include "base/file_path.h" | 20 #include "base/file_path.h" |
| 22 #include "base/location.h" | 21 #include "base/location.h" |
| 23 #include "base/logging.h" | 22 #include "base/logging.h" |
| 24 #include "base/metrics/histogram.h" | 23 #include "base/metrics/histogram.h" |
| 24 #include "base/posix/eintr_wrapper.h" |
| 25 #include "base/task_runner_util.h" | 25 #include "base/task_runner_util.h" |
| 26 #include "base/threading/worker_pool.h" | 26 #include "base/threading/worker_pool.h" |
| 27 #include "net/base/io_buffer.h" | 27 #include "net/base/io_buffer.h" |
| 28 #include "net/base/net_errors.h" | 28 #include "net/base/net_errors.h" |
| 29 | 29 |
| 30 #if defined(OS_ANDROID) | 30 #if defined(OS_ANDROID) |
| 31 // Android's bionic libc only supports the LFS transitional API. | 31 // Android's bionic libc only supports the LFS transitional API. |
| 32 #define off_t off64_t | 32 #define off_t off64_t |
| 33 #define lseek lseek64 | 33 #define lseek lseek64 |
| 34 #define stat stat64 | 34 #define stat stat64 |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 167 int64 FileStream::Context::WriteFileImpl(scoped_refptr<IOBuffer> buf, | 167 int64 FileStream::Context::WriteFileImpl(scoped_refptr<IOBuffer> buf, |
| 168 int buf_len) { | 168 int buf_len) { |
| 169 ssize_t res = HANDLE_EINTR(write(file_, buf->data(), buf_len)); | 169 ssize_t res = HANDLE_EINTR(write(file_, buf->data(), buf_len)); |
| 170 if (res == -1) | 170 if (res == -1) |
| 171 return errno; | 171 return errno; |
| 172 | 172 |
| 173 return res; | 173 return res; |
| 174 } | 174 } |
| 175 | 175 |
| 176 } // namespace net | 176 } // namespace net |
| OLD | NEW |