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 | 8 |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 | 10 |
(...skipping 14 matching lines...) Expand all Loading... |
25 embedder::ScopedPlatformHandle platform_handle) | 25 embedder::ScopedPlatformHandle platform_handle) |
26 : platform_handle_(platform_handle.Pass()) { | 26 : platform_handle_(platform_handle.Pass()) { |
27 } | 27 } |
28 | 28 |
29 embedder::ScopedPlatformHandle PlatformHandleDispatcher::PassPlatformHandle() { | 29 embedder::ScopedPlatformHandle PlatformHandleDispatcher::PassPlatformHandle() { |
30 base::AutoLock locker(lock()); | 30 base::AutoLock locker(lock()); |
31 return platform_handle_.Pass(); | 31 return platform_handle_.Pass(); |
32 } | 32 } |
33 | 33 |
34 Dispatcher::Type PlatformHandleDispatcher::GetType() const { | 34 Dispatcher::Type PlatformHandleDispatcher::GetType() const { |
35 return kTypePlatformHandle; | 35 return Type::PLATFORM_HANDLE; |
36 } | 36 } |
37 | 37 |
38 // static | 38 // static |
39 scoped_refptr<PlatformHandleDispatcher> PlatformHandleDispatcher::Deserialize( | 39 scoped_refptr<PlatformHandleDispatcher> PlatformHandleDispatcher::Deserialize( |
40 Channel* channel, | 40 Channel* channel, |
41 const void* source, | 41 const void* source, |
42 size_t size, | 42 size_t size, |
43 embedder::PlatformHandleVector* platform_handles) { | 43 embedder::PlatformHandleVector* platform_handles) { |
44 if (size != sizeof(SerializedPlatformHandleDispatcher)) { | 44 if (size != sizeof(SerializedPlatformHandleDispatcher)) { |
45 LOG(ERROR) << "Invalid serialized platform handle dispatcher (bad size)"; | 45 LOG(ERROR) << "Invalid serialized platform handle dispatcher (bad size)"; |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
109 } else { | 109 } else { |
110 serialization->platform_handle_index = kInvalidPlatformHandleIndex; | 110 serialization->platform_handle_index = kInvalidPlatformHandleIndex; |
111 } | 111 } |
112 | 112 |
113 *actual_size = sizeof(SerializedPlatformHandleDispatcher); | 113 *actual_size = sizeof(SerializedPlatformHandleDispatcher); |
114 return true; | 114 return true; |
115 } | 115 } |
116 | 116 |
117 } // namespace system | 117 } // namespace system |
118 } // namespace mojo | 118 } // namespace mojo |
OLD | NEW |