Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(56)

Side by Side Diff: base/memory/shared_memory_handle_mac.cc

Issue 1328963002: Build shared_memory_mac.cc and shared_memory_handle_mac.cc for iOS (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « base/memory/shared_memory_handle.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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_handle.h" 5 #include "base/memory/shared_memory_handle.h"
6 6
7 #include <unistd.h> 7 #include <unistd.h>
8 8
9 #include "base/posix/eintr_wrapper.h" 9 #include "base/posix/eintr_wrapper.h"
10 10
11 #if defined(OS_MACOSX) && !defined(OS_IOS)
12 namespace base { 11 namespace base {
13 12
14 static_assert(sizeof(SharedMemoryHandle::Type) <= 13 static_assert(sizeof(SharedMemoryHandle::Type) <=
15 sizeof(SharedMemoryHandle::TypeWireFormat), 14 sizeof(SharedMemoryHandle::TypeWireFormat),
16 "Size of enum SharedMemoryHandle::Type exceeds size of type " 15 "Size of enum SharedMemoryHandle::Type exceeds size of type "
17 "transmitted over wire."); 16 "transmitted over wire.");
18 17
19 SharedMemoryHandle::SharedMemoryHandle() : type_(POSIX), file_descriptor_() { 18 SharedMemoryHandle::SharedMemoryHandle() : type_(POSIX), file_descriptor_() {
20 } 19 }
21 20
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 79
81 SharedMemoryHandle SharedMemoryHandle::Duplicate() const { 80 SharedMemoryHandle SharedMemoryHandle::Duplicate() const {
82 DCHECK_EQ(type_, POSIX); 81 DCHECK_EQ(type_, POSIX);
83 int duped_handle = HANDLE_EINTR(dup(file_descriptor_.fd)); 82 int duped_handle = HANDLE_EINTR(dup(file_descriptor_.fd));
84 if (duped_handle < 0) 83 if (duped_handle < 0)
85 return SharedMemoryHandle(); 84 return SharedMemoryHandle();
86 return SharedMemoryHandle(duped_handle, true); 85 return SharedMemoryHandle(duped_handle, true);
87 } 86 }
88 87
89 } // namespace base 88 } // namespace base
90 #endif // defined(OS_MACOSX) && !defined(OS_IOS)
OLDNEW
« no previous file with comments | « base/memory/shared_memory_handle.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698