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

Side by Side Diff: mojo/edk/system/platform_handle_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/platform_handle_dispatcher.h" 5 #include "mojo/edk/system/platform_handle_dispatcher.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 22 matching lines...) Expand all
33 MutexLocker locker(&mutex()); 33 MutexLocker locker(&mutex());
34 return platform_handle_.Pass(); 34 return platform_handle_.Pass();
35 } 35 }
36 36
37 Dispatcher::Type PlatformHandleDispatcher::GetType() const { 37 Dispatcher::Type PlatformHandleDispatcher::GetType() const {
38 return Type::PLATFORM_HANDLE; 38 return Type::PLATFORM_HANDLE;
39 } 39 }
40 40
41 bool PlatformHandleDispatcher::SupportsEntrypointClass( 41 bool PlatformHandleDispatcher::SupportsEntrypointClass(
42 EntrypointClass entrypoint_class) const { 42 EntrypointClass entrypoint_class) const {
43 return false; 43 return (entrypoint_class == EntrypointClass::NONE);
44 } 44 }
45 45
46 // static 46 // static
47 RefPtr<PlatformHandleDispatcher> PlatformHandleDispatcher::Deserialize( 47 RefPtr<PlatformHandleDispatcher> PlatformHandleDispatcher::Deserialize(
48 Channel* channel, 48 Channel* channel,
49 const void* source, 49 const void* source,
50 size_t size, 50 size_t size,
51 std::vector<ScopedPlatformHandle>* platform_handles) { 51 std::vector<ScopedPlatformHandle>* platform_handles) {
52 if (size != sizeof(SerializedPlatformHandleDispatcher)) { 52 if (size != sizeof(SerializedPlatformHandleDispatcher)) {
53 LOG(ERROR) << "Invalid serialized platform handle dispatcher (bad size)"; 53 LOG(ERROR) << "Invalid serialized platform handle dispatcher (bad size)";
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 } else { 121 } else {
122 serialization->platform_handle_index = kInvalidPlatformHandleIndex; 122 serialization->platform_handle_index = kInvalidPlatformHandleIndex;
123 } 123 }
124 124
125 *actual_size = sizeof(SerializedPlatformHandleDispatcher); 125 *actual_size = sizeof(SerializedPlatformHandleDispatcher);
126 return true; 126 return true;
127 } 127 }
128 128
129 } // namespace system 129 } // namespace system
130 } // namespace mojo 130 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/edk/system/mock_simple_dispatcher.cc ('k') | mojo/edk/system/platform_handle_dispatcher_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698