| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |