Chromium Code Reviews| 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/files/file_util.h" | 5 #include "base/files/file_util.h" |
| 6 | 6 |
| 7 #include <dirent.h> | 7 #include <dirent.h> |
| 8 #include <errno.h> | 8 #include <errno.h> |
| 9 #include <fcntl.h> | 9 #include <fcntl.h> |
| 10 #include <libgen.h> | 10 #include <libgen.h> |
| (...skipping 436 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 447 | 447 |
| 448 #if !defined(OS_MACOSX) | 448 #if !defined(OS_MACOSX) |
| 449 // This is implemented in file_util_mac.mm for Mac. | 449 // This is implemented in file_util_mac.mm for Mac. |
| 450 bool GetTempDir(FilePath* path) { | 450 bool GetTempDir(FilePath* path) { |
| 451 const char* tmp = getenv("TMPDIR"); | 451 const char* tmp = getenv("TMPDIR"); |
| 452 if (tmp) { | 452 if (tmp) { |
| 453 *path = FilePath(tmp); | 453 *path = FilePath(tmp); |
| 454 } else { | 454 } else { |
| 455 #if defined(OS_ANDROID) | 455 #if defined(OS_ANDROID) |
| 456 return PathService::Get(base::DIR_CACHE, path); | 456 return PathService::Get(base::DIR_CACHE, path); |
| 457 #elif defined(__BRILLO__) | |
| 458 *path = FilePath("/data/local/tmp"); | |
|
Daniel Erat
2015/08/06 23:25:09
i think that this one shouldn't be upstreamed; __B
arihc
2015/08/06 23:51:22
Done.
| |
| 457 #else | 459 #else |
| 458 *path = FilePath("/tmp"); | 460 *path = FilePath("/tmp"); |
| 459 #endif | 461 #endif |
| 460 } | 462 } |
| 461 return true; | 463 return true; |
| 462 } | 464 } |
| 463 #endif // !defined(OS_MACOSX) | 465 #endif // !defined(OS_MACOSX) |
| 464 | 466 |
| 465 #if !defined(OS_MACOSX) // Mac implementation is in file_util_mac.mm. | 467 #if !defined(OS_MACOSX) // Mac implementation is in file_util_mac.mm. |
| 466 FilePath GetHomeDir() { | 468 FilePath GetHomeDir() { |
| (...skipping 459 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 926 return false; | 928 return false; |
| 927 | 929 |
| 928 DeleteFile(from_path, true); | 930 DeleteFile(from_path, true); |
| 929 return true; | 931 return true; |
| 930 } | 932 } |
| 931 | 933 |
| 932 } // namespace internal | 934 } // namespace internal |
| 933 | 935 |
| 934 #endif // !defined(OS_NACL_NONSFI) | 936 #endif // !defined(OS_NACL_NONSFI) |
| 935 } // namespace base | 937 } // namespace base |
| OLD | NEW |