| 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/memory/shared_memory.h" | 5 #include "base/memory/shared_memory.h" |
| 6 | 6 |
| 7 #include <errno.h> | 7 #include <errno.h> |
| 8 #include <fcntl.h> | 8 #include <fcntl.h> |
| 9 #include <mach/mach_vm.h> | 9 #include <mach/mach_vm.h> |
| 10 #include <stddef.h> |
| 10 #include <sys/mman.h> | 11 #include <sys/mman.h> |
| 11 #include <sys/stat.h> | 12 #include <sys/stat.h> |
| 12 #include <unistd.h> | 13 #include <unistd.h> |
| 13 | 14 |
| 14 #include "base/files/file_util.h" | 15 #include "base/files/file_util.h" |
| 15 #include "base/files/scoped_file.h" | 16 #include "base/files/scoped_file.h" |
| 16 #include "base/logging.h" | 17 #include "base/logging.h" |
| 17 #include "base/mac/mac_util.h" | 18 #include "base/mac/mac_util.h" |
| 18 #include "base/mac/scoped_mach_vm.h" | 19 #include "base/mac/scoped_mach_vm.h" |
| 19 #include "base/metrics/field_trial.h" | 20 #include "base/metrics/field_trial.h" |
| 20 #include "base/metrics/histogram_macros.h" | 21 #include "base/metrics/histogram_macros.h" |
| 21 #include "base/posix/eintr_wrapper.h" | 22 #include "base/posix/eintr_wrapper.h" |
| 22 #include "base/posix/safe_strerror.h" | 23 #include "base/posix/safe_strerror.h" |
| 23 #include "base/process/process_metrics.h" | 24 #include "base/process/process_metrics.h" |
| 24 #include "base/profiler/scoped_tracker.h" | 25 #include "base/profiler/scoped_tracker.h" |
| 25 #include "base/scoped_generic.h" | 26 #include "base/scoped_generic.h" |
| 26 #include "base/strings/utf_string_conversions.h" | 27 #include "base/strings/utf_string_conversions.h" |
| 28 #include "build/build_config.h" |
| 27 | 29 |
| 28 #if defined(OS_MACOSX) | 30 #if defined(OS_MACOSX) |
| 29 #include "base/mac/foundation_util.h" | 31 #include "base/mac/foundation_util.h" |
| 30 #endif // OS_MACOSX | 32 #endif // OS_MACOSX |
| 31 | 33 |
| 32 namespace base { | 34 namespace base { |
| 33 | 35 |
| 34 namespace { | 36 namespace { |
| 35 | 37 |
| 36 const char kTrialName[] = "MacMemoryMechanism"; | 38 const char kTrialName[] = "MacMemoryMechanism"; |
| (...skipping 440 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 477 | 479 |
| 478 if (close_self) { | 480 if (close_self) { |
| 479 Unmap(); | 481 Unmap(); |
| 480 Close(); | 482 Close(); |
| 481 } | 483 } |
| 482 | 484 |
| 483 return true; | 485 return true; |
| 484 } | 486 } |
| 485 | 487 |
| 486 } // namespace base | 488 } // namespace base |
| OLD | NEW |