| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "components/filesystem/util.h" | 5 #include "components/filesystem/util.h" |
| 6 | 6 |
| 7 #include <errno.h> | 7 #include <errno.h> |
| 8 #include <fcntl.h> | 8 #include <fcntl.h> |
| 9 #include <sys/stat.h> | 9 #include <sys/stat.h> |
| 10 #include <time.h> | 10 #include <time.h> |
| 11 | 11 |
| 12 #include <limits> | 12 #include <limits> |
| 13 | 13 |
| 14 #include "base/logging.h" | 14 #include "base/logging.h" |
| 15 #include "base/strings/string_util.h" | 15 #include "base/strings/string_util.h" |
| 16 #include "third_party/mojo/src/mojo/public/cpp/bindings/string.h" | 16 #include "mojo/public/cpp/bindings/string.h" |
| 17 | 17 |
| 18 #if defined(OS_WIN) | 18 #if defined(OS_WIN) |
| 19 #include "base/strings/utf_string_conversions.h" | 19 #include "base/strings/utf_string_conversions.h" |
| 20 #endif | 20 #endif |
| 21 | 21 |
| 22 // module filesystem has various constants which must line up with enum values | 22 // module filesystem has various constants which must line up with enum values |
| 23 // in base::File::Flags. | 23 // in base::File::Flags. |
| 24 static_assert(filesystem::kFlagOpen == | 24 static_assert(filesystem::kFlagOpen == |
| 25 static_cast<uint32>(base::File::FLAG_OPEN), | 25 static_cast<uint32>(base::File::FLAG_OPEN), |
| 26 ""); | 26 ""); |
| (...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 164 if (full_path.ReferencesParent()) { | 164 if (full_path.ReferencesParent()) { |
| 165 // TODO(erg): For now, if it references a parent, we'll consider this bad. | 165 // TODO(erg): For now, if it references a parent, we'll consider this bad. |
| 166 return FILE_ERROR_ACCESS_DENIED; | 166 return FILE_ERROR_ACCESS_DENIED; |
| 167 } | 167 } |
| 168 | 168 |
| 169 *out = full_path; | 169 *out = full_path; |
| 170 return FILE_ERROR_OK; | 170 return FILE_ERROR_OK; |
| 171 } | 171 } |
| 172 | 172 |
| 173 } // namespace filesystem | 173 } // namespace filesystem |
| OLD | NEW |