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

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

Issue 1160203002: Make Dispatcher::Type an enum class. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 6 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 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 10
(...skipping 14 matching lines...) Expand all
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698