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

Side by Side Diff: memory/shared_memory_handle_mac.cc

Issue 2050803003: Update to Chromium //base at Chromium commit e3a753f17bac62738b0dbf0b36510f767b081e4b. (Closed) Base URL: https://github.com/domokit/base.git@master
Patch Set: Created 4 years, 6 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 | « memory/shared_memory_handle.h ('k') | message_loop/message_pump_android.cc » ('j') | 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 SharedMemoryHandle::SharedMemoryHandle( 20 SharedMemoryHandle::SharedMemoryHandle(
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 75
77 SharedMemoryHandle SharedMemoryHandle::Duplicate() const { 76 SharedMemoryHandle SharedMemoryHandle::Duplicate() const {
78 DCHECK_EQ(type_, POSIX); 77 DCHECK_EQ(type_, POSIX);
79 int duped_handle = HANDLE_EINTR(dup(file_descriptor_.fd)); 78 int duped_handle = HANDLE_EINTR(dup(file_descriptor_.fd));
80 if (duped_handle < 0) 79 if (duped_handle < 0)
81 return SharedMemoryHandle(); 80 return SharedMemoryHandle();
82 return SharedMemoryHandle(duped_handle, true); 81 return SharedMemoryHandle(duped_handle, true);
83 } 82 }
84 83
85 } // namespace base 84 } // namespace base
86 #endif // defined(OS_MACOSX) && !defined(OS_IOS)
OLDNEW
« no previous file with comments | « memory/shared_memory_handle.h ('k') | message_loop/message_pump_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698