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

Side by Side Diff: mojo/edk/system/data_pipe_consumer_dispatcher.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/system/core.cc ('k') | mojo/edk/system/data_pipe_producer_dispatcher.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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/data_pipe_consumer_dispatcher.h" 5 #include "mojo/edk/system/data_pipe_consumer_dispatcher.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <algorithm> 10 #include <algorithm>
(...skipping 385 matching lines...) Expand 10 before | Expand all | Expand 10 after
396 NodeController* node_controller = internal::g_core->GetNodeController(); 396 NodeController* node_controller = internal::g_core->GetNodeController();
397 ports::PortRef port; 397 ports::PortRef port;
398 if (node_controller->node()->GetPort(ports[0], &port) != ports::OK) 398 if (node_controller->node()->GetPort(ports[0], &port) != ports::OK)
399 return nullptr; 399 return nullptr;
400 400
401 PlatformHandle buffer_handle; 401 PlatformHandle buffer_handle;
402 std::swap(buffer_handle, handles[0]); 402 std::swap(buffer_handle, handles[0]);
403 scoped_refptr<PlatformSharedBuffer> ring_buffer = 403 scoped_refptr<PlatformSharedBuffer> ring_buffer =
404 PlatformSharedBuffer::CreateFromPlatformHandle( 404 PlatformSharedBuffer::CreateFromPlatformHandle(
405 state->options.capacity_num_bytes, 405 state->options.capacity_num_bytes,
406 false /* read_only */,
406 ScopedPlatformHandle(buffer_handle)); 407 ScopedPlatformHandle(buffer_handle));
407 if (!ring_buffer) { 408 if (!ring_buffer) {
408 DLOG(ERROR) << "Failed to deserialize shared buffer handle."; 409 DLOG(ERROR) << "Failed to deserialize shared buffer handle.";
409 return nullptr; 410 return nullptr;
410 } 411 }
411 412
412 scoped_refptr<DataPipeConsumerDispatcher> dispatcher = 413 scoped_refptr<DataPipeConsumerDispatcher> dispatcher =
413 new DataPipeConsumerDispatcher(node_controller, port, ring_buffer, 414 new DataPipeConsumerDispatcher(node_controller, port, ring_buffer,
414 state->options, false /* initialized */, 415 state->options, false /* initialized */,
415 state->pipe_id); 416 state->pipe_id);
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
561 } 562 }
562 563
563 if (peer_closed_ != was_peer_closed || 564 if (peer_closed_ != was_peer_closed ||
564 bytes_available_ != previous_bytes_available) { 565 bytes_available_ != previous_bytes_available) {
565 awakable_list_.AwakeForStateChange(GetHandleSignalsStateNoLock()); 566 awakable_list_.AwakeForStateChange(GetHandleSignalsStateNoLock());
566 } 567 }
567 } 568 }
568 569
569 } // namespace edk 570 } // namespace edk
570 } // namespace mojo 571 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/edk/system/core.cc ('k') | mojo/edk/system/data_pipe_producer_dispatcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698