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 "build/build_config.h" | 16 #include "build/build_config.h" |
17 #include "mojo/public/cpp/bindings/string.h" | |
18 | 17 |
19 #if defined(OS_WIN) | 18 #if defined(OS_WIN) |
20 #include "base/strings/utf_string_conversions.h" | 19 #include "base/strings/utf_string_conversions.h" |
21 #endif | 20 #endif |
22 | 21 |
23 // 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 |
24 // in base::File::Flags. | 23 // in base::File::Flags. |
25 static_assert(filesystem::mojom::kFlagOpen == | 24 static_assert(filesystem::mojom::kFlagOpen == |
26 static_cast<uint32_t>(base::File::FLAG_OPEN), | 25 static_cast<uint32_t>(base::File::FLAG_OPEN), |
27 ""); | 26 ""); |
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
166 if (full_path.ReferencesParent()) { | 165 if (full_path.ReferencesParent()) { |
167 // TODO(erg): For now, if it references a parent, we'll consider this bad. | 166 // TODO(erg): For now, if it references a parent, we'll consider this bad. |
168 return mojom::FileError::ACCESS_DENIED; | 167 return mojom::FileError::ACCESS_DENIED; |
169 } | 168 } |
170 | 169 |
171 *out = full_path; | 170 *out = full_path; |
172 return mojom::FileError::OK; | 171 return mojom::FileError::OK; |
173 } | 172 } |
174 | 173 |
175 } // namespace filesystem | 174 } // namespace filesystem |
OLD | NEW |