| 487 | #endif // !defined(OS_MACOSX) |
| 488 | |
| 489 | bool CreateTemporaryFile(FilePath* path) { |
| 490 | ThreadRestrictions::AssertIOAllowed(); // For call to close(). |
| 491 | FilePath directory; |
| 492 | if (!GetTempDir(&directory)) |
| 493 | return false; |
| 494 | int fd = CreateAndOpenFdForTemporaryFile(directory, path); |
| 495 | if (fd < 0) |
| 496 | return false; |
| 497 | close(fd); |
| 498 | return true; |
| 499 | } |
| 500 | |
| 501 | FILE* CreateAndOpenTemporaryFileInDir(const FilePath& dir, FilePath* path) { |
| 502 | int fd = CreateAndOpenFdForTemporaryFile(dir, path); |