| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/memory/shared_memory_helper.h" | 5 #include "base/memory/shared_memory_helper.h" |
| 6 | 6 |
| 7 #include <unistd.h> |
| 8 |
| 7 #include "base/threading/thread_restrictions.h" | 9 #include "base/threading/thread_restrictions.h" |
| 8 | 10 |
| 9 namespace base { | 11 namespace base { |
| 10 | 12 |
| 11 struct ScopedPathUnlinkerTraits { | 13 struct ScopedPathUnlinkerTraits { |
| 12 static const FilePath* InvalidValue() { return nullptr; } | 14 static const FilePath* InvalidValue() { return nullptr; } |
| 13 | 15 |
| 14 static void Free(const FilePath* path) { | 16 static void Free(const FilePath* path) { |
| 15 if (unlink(path->value().c_str())) | 17 if (unlink(path->value().c_str())) |
| 16 PLOG(WARNING) << "unlink"; | 18 PLOG(WARNING) << "unlink"; |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 if (*mapped_file == -1) { | 91 if (*mapped_file == -1) { |
| 90 NOTREACHED() << "Call to dup failed, errno=" << errno; | 92 NOTREACHED() << "Call to dup failed, errno=" << errno; |
| 91 } | 93 } |
| 92 *readonly_mapped_file = readonly_fd.release(); | 94 *readonly_mapped_file = readonly_fd.release(); |
| 93 | 95 |
| 94 return true; | 96 return true; |
| 95 } | 97 } |
| 96 #endif // !defined(OS_ANDROID) | 98 #endif // !defined(OS_ANDROID) |
| 97 | 99 |
| 98 } // namespace base | 100 } // namespace base |
| OLD | NEW |