diff options
author | erikchen <erikchen@chromium.org> | 2016-03-24 10:16:54 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-03-24 17:18:14 +0000 |
commit | 39a33a2215a11f63da53fe4abd358204bf42c5f7 (patch) | |
tree | 7f7d741e45bd6c25bf9c04c388650eb1c2aff469 /base | |
parent | be4817807690ad47baa4e87a9fb538bca04649f8 (diff) | |
download | chromium_src-39a33a2215a11f63da53fe4abd358204bf42c5f7.zip chromium_src-39a33a2215a11f63da53fe4abd358204bf42c5f7.tar.gz chromium_src-39a33a2215a11f63da53fe4abd358204bf42c5f7.tar.bz2 |
mac: Only use Mach shared memory.
The experiment comparing it to POSIX shared memory has finished.
BUG=547261
Review URL: https://codereview.chromium.org/1826723002
Cr-Commit-Position: refs/heads/master@{#383086}
Diffstat (limited to 'base')
-rw-r--r-- | base/memory/shared_memory_mac.cc | 46 |
1 files changed, 1 insertions, 45 deletions
diff --git a/base/memory/shared_memory_mac.cc b/base/memory/shared_memory_mac.cc index 6fc299d..6dd9576 100644 --- a/base/memory/shared_memory_mac.cc +++ b/base/memory/shared_memory_mac.cc @@ -35,38 +35,6 @@ namespace base { namespace { -const char kTrialName[] = "MacMemoryMechanism"; -const char kTrialMach[] = "Mach"; -const char kTrialPosix[] = "Posix"; - -SharedMemoryHandle::Type GetABTestMechanism() { - static bool found_group = false; - static SharedMemoryHandle::Type group = SharedMemoryHandle::MACH; - - if (found_group) - return group; - - const std::string group_name = - base::FieldTrialList::FindFullName(kTrialName); - if (group_name == kTrialMach) { - group = SharedMemoryHandle::MACH; - found_group = true; - } else if (group_name == kTrialPosix) { - group = SharedMemoryHandle::POSIX; - found_group = true; - } else { - group = SharedMemoryHandle::MACH; - } - - return group; -} - -// Emits a histogram entry indicating which type of SharedMemory was created. -void EmitMechanism(SharedMemoryHandle::Type type) { - UMA_HISTOGRAM_ENUMERATION("OSX.SharedMemory.Mechanism", type, - SharedMemoryHandle::TypeMax); -} - // Returns whether the operation succeeded. // |new_handle| is an output variable, populated on success. The caller takes // ownership of the underlying memory object. @@ -180,17 +148,7 @@ SharedMemoryCreateOptions::SharedMemoryCreateOptions() : type(SharedMemoryHandle::MACH), size(0), executable(false), - share_read_only(false) { - if (mac::IsOSLionOrLater()) { - // A/B test the mechanism. Once the experiment is over, this will always be - // set to SharedMemoryHandle::MACH. - // http://crbug.com/547261 - type = GetABTestMechanism(); - } else { - // Mach shared memory isn't supported on OSX 10.6 or older. - type = SharedMemoryHandle::POSIX; - } -} + share_read_only(false) {} SharedMemory::SharedMemory() : mapped_memory_mechanism_(SharedMemoryHandle::POSIX), @@ -282,8 +240,6 @@ bool SharedMemory::Create(const SharedMemoryCreateOptions& options) { if (options.size > static_cast<size_t>(std::numeric_limits<int>::max())) return false; - EmitMechanism(options.type); - if (options.type == SharedMemoryHandle::MACH) { shm_ = SharedMemoryHandle(options.size); requested_size_ = options.size; |