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

Side by Side Diff: mojo/edk/system/shared_buffer_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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/shared_buffer_dispatcher.h" 5 #include "mojo/edk/system/shared_buffer_dispatcher.h"
6 6
7 #include <limits> 7 #include <limits>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 *result = MOJO_RESULT_OK; 95 *result = MOJO_RESULT_OK;
96 return CreateInternal(std::move(shared_buffer)); 96 return CreateInternal(std::move(shared_buffer));
97 } 97 }
98 98
99 Dispatcher::Type SharedBufferDispatcher::GetType() const { 99 Dispatcher::Type SharedBufferDispatcher::GetType() const {
100 return Type::SHARED_BUFFER; 100 return Type::SHARED_BUFFER;
101 } 101 }
102 102
103 bool SharedBufferDispatcher::SupportsEntrypointClass( 103 bool SharedBufferDispatcher::SupportsEntrypointClass(
104 EntrypointClass entrypoint_class) const { 104 EntrypointClass entrypoint_class) const {
105 return (entrypoint_class == EntrypointClass::BUFFER); 105 return (entrypoint_class == EntrypointClass::NONE ||
106 entrypoint_class == EntrypointClass::BUFFER);
106 } 107 }
107 108
108 // static 109 // static
109 RefPtr<SharedBufferDispatcher> SharedBufferDispatcher::Deserialize( 110 RefPtr<SharedBufferDispatcher> SharedBufferDispatcher::Deserialize(
110 Channel* channel, 111 Channel* channel,
111 const void* source, 112 const void* source,
112 size_t size, 113 size_t size,
113 std::vector<ScopedPlatformHandle>* platform_handles) { 114 std::vector<ScopedPlatformHandle>* platform_handles) {
114 DCHECK(channel); 115 DCHECK(channel);
115 116
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after
329 platform_handles->push_back(std::move(platform_handle)); 330 platform_handles->push_back(std::move(platform_handle));
330 *actual_size = sizeof(SerializedSharedBufferDispatcher); 331 *actual_size = sizeof(SerializedSharedBufferDispatcher);
331 332
332 shared_buffer_ = nullptr; 333 shared_buffer_ = nullptr;
333 334
334 return true; 335 return true;
335 } 336 }
336 337
337 } // namespace system 338 } // namespace system
338 } // namespace mojo 339 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/edk/system/platform_handle_dispatcher_unittest.cc ('k') | mojo/edk/system/shared_buffer_dispatcher_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698