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

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

Issue 1953293003: EDK: Add handle rights checking to the various entrypoints. (Closed) Base URL: https://github.com/domokit/mojo.git@work788_edk_handle_13.9-x-work787_edk_handle_13.8
Patch Set: Created 4 years, 7 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/entrypoint_class.h ('k') | mojo/edk/system/message_pipe_dispatcher_unittest.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/message_pipe_dispatcher.h" 5 #include "mojo/edk/system/message_pipe_dispatcher.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "mojo/edk/system/configuration.h" 10 #include "mojo/edk/system/configuration.h"
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 message_pipe_ = std::move(message_pipe); 70 message_pipe_ = std::move(message_pipe);
71 port_ = port; 71 port_ = port;
72 } 72 }
73 73
74 Dispatcher::Type MessagePipeDispatcher::GetType() const { 74 Dispatcher::Type MessagePipeDispatcher::GetType() const {
75 return Type::MESSAGE_PIPE; 75 return Type::MESSAGE_PIPE;
76 } 76 }
77 77
78 bool MessagePipeDispatcher::SupportsEntrypointClass( 78 bool MessagePipeDispatcher::SupportsEntrypointClass(
79 EntrypointClass entrypoint_class) const { 79 EntrypointClass entrypoint_class) const {
80 return (entrypoint_class == EntrypointClass::MESSAGE_PIPE); 80 return (entrypoint_class == EntrypointClass::NONE ||
81 entrypoint_class == EntrypointClass::MESSAGE_PIPE);
81 } 82 }
82 83
83 // static 84 // static
84 RefPtr<MessagePipeDispatcher> MessagePipeDispatcher::CreateRemoteMessagePipe( 85 RefPtr<MessagePipeDispatcher> MessagePipeDispatcher::CreateRemoteMessagePipe(
85 RefPtr<ChannelEndpoint>* channel_endpoint) { 86 RefPtr<ChannelEndpoint>* channel_endpoint) {
86 auto message_pipe = MessagePipe::CreateLocalProxy(channel_endpoint); 87 auto message_pipe = MessagePipe::CreateLocalProxy(channel_endpoint);
87 auto dispatcher = MessagePipeDispatcher::Create(kDefaultCreateOptions); 88 auto dispatcher = MessagePipeDispatcher::Create(kDefaultCreateOptions);
88 dispatcher->Init(std::move(message_pipe), 0); 89 dispatcher->Init(std::move(message_pipe), 0);
89 return dispatcher; 90 return dispatcher;
90 } 91 }
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
232 233
233 bool rv = message_pipe_->EndSerialize(port_, channel, destination, 234 bool rv = message_pipe_->EndSerialize(port_, channel, destination,
234 actual_size, platform_handles); 235 actual_size, platform_handles);
235 message_pipe_ = nullptr; 236 message_pipe_ = nullptr;
236 port_ = kInvalidPort; 237 port_ = kInvalidPort;
237 return rv; 238 return rv;
238 } 239 }
239 240
240 } // namespace system 241 } // namespace system
241 } // namespace mojo 242 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/edk/system/entrypoint_class.h ('k') | mojo/edk/system/message_pipe_dispatcher_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698