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

Side by Side Diff: mojo/edk/system/broker_posix.cc

Issue 1689053003: Support read-only duplicates of Mojo shared buffers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@mojo-shm-interop
Patch Set: Rebase and fix comment. Created 4 years, 8 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 | « mojo/edk/embedder/platform_shared_buffer.cc ('k') | mojo/edk/system/core.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 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 "mojo/edk/system/broker.h" 5 #include "mojo/edk/system/broker.h"
6 6
7 #include <fcntl.h> 7 #include <fcntl.h>
8 #include <unistd.h> 8 #include <unistd.h>
9 9
10 #include <utility> 10 #include <utility>
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 out_message->data_num_bytes()) { 105 out_message->data_num_bytes()) {
106 LOG(ERROR) << "Error sending complete broker message"; 106 LOG(ERROR) << "Error sending complete broker message";
107 return nullptr; 107 return nullptr;
108 } 108 }
109 109
110 std::deque<PlatformHandle> incoming_platform_handles; 110 std::deque<PlatformHandle> incoming_platform_handles;
111 if (WaitForBrokerMessage(sync_channel_.get(), 111 if (WaitForBrokerMessage(sync_channel_.get(),
112 BrokerMessageType::BUFFER_RESPONSE, 1, 112 BrokerMessageType::BUFFER_RESPONSE, 1,
113 &incoming_platform_handles)) { 113 &incoming_platform_handles)) {
114 return PlatformSharedBuffer::CreateFromPlatformHandle( 114 return PlatformSharedBuffer::CreateFromPlatformHandle(
115 num_bytes, ScopedPlatformHandle(incoming_platform_handles.front())); 115 num_bytes, false /* read_only */,
116 ScopedPlatformHandle(incoming_platform_handles.front()));
116 } 117 }
117 118
118 return nullptr; 119 return nullptr;
119 } 120 }
120 121
121 } // namespace edk 122 } // namespace edk
122 } // namespace mojo 123 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/edk/embedder/platform_shared_buffer.cc ('k') | mojo/edk/system/core.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698