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 #include "base/platform_file.h" | 5 #include "base/platform_file.h" |
6 | 6 |
7 #include <fcntl.h> | 7 #include <fcntl.h> |
8 #include <errno.h> | 8 #include <errno.h> |
9 #include <sys/stat.h> | 9 #include <sys/stat.h> |
10 #include <unistd.h> | 10 #include <unistd.h> |
11 | 11 |
12 #include "base/files/file_path.h" | 12 #include "base/files/file_path.h" |
13 #include "base/logging.h" | 13 #include "base/logging.h" |
14 #include "base/metrics/sparse_histogram.h" | 14 #include "base/metrics/sparse_histogram.h" |
15 #include "base/posix/eintr_wrapper.h" | 15 #include "base/posix/eintr_wrapper.h" |
| 16 #include "base/strings/utf_string_conversions.h" |
16 #include "base/threading/thread_restrictions.h" | 17 #include "base/threading/thread_restrictions.h" |
17 #include "base/utf_string_conversions.h" | |
18 | 18 |
19 #if defined(OS_ANDROID) | 19 #if defined(OS_ANDROID) |
20 #include "base/os_compat_android.h" | 20 #include "base/os_compat_android.h" |
21 #endif | 21 #endif |
22 | 22 |
23 namespace base { | 23 namespace base { |
24 | 24 |
25 // Make sure our Whence mappings match the system headers. | 25 // Make sure our Whence mappings match the system headers. |
26 COMPILE_ASSERT(PLATFORM_FILE_FROM_BEGIN == SEEK_SET && | 26 COMPILE_ASSERT(PLATFORM_FILE_FROM_BEGIN == SEEK_SET && |
27 PLATFORM_FILE_FROM_CURRENT == SEEK_CUR && | 27 PLATFORM_FILE_FROM_CURRENT == SEEK_CUR && |
(...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
329 default: | 329 default: |
330 #if !defined(OS_NACL) // NaCl build has no metrics code. | 330 #if !defined(OS_NACL) // NaCl build has no metrics code. |
331 UMA_HISTOGRAM_SPARSE_SLOWLY("PlatformFile.UnknownErrors.Posix", | 331 UMA_HISTOGRAM_SPARSE_SLOWLY("PlatformFile.UnknownErrors.Posix", |
332 saved_errno); | 332 saved_errno); |
333 #endif | 333 #endif |
334 return PLATFORM_FILE_ERROR_FAILED; | 334 return PLATFORM_FILE_ERROR_FAILED; |
335 } | 335 } |
336 } | 336 } |
337 | 337 |
338 } // namespace base | 338 } // namespace base |
OLD | NEW |