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

Side by Side Diff: mojo/edk/embedder/embedder.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
« no previous file with comments | « no previous file | mojo/edk/system/channel_endpoint_id.h » ('j') | mojo/edk/system/transport_data.h » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/embedder/embedder.h" 5 #include "mojo/edk/embedder/embedder.h"
6 6
7 #include "base/atomicops.h" 7 #include "base/atomicops.h"
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/bind_helpers.h" 9 #include "base/bind_helpers.h"
10 #include "base/location.h" 10 #include "base/location.h"
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
141 MojoResult PassWrappedPlatformHandle(MojoHandle platform_handle_wrapper_handle, 141 MojoResult PassWrappedPlatformHandle(MojoHandle platform_handle_wrapper_handle,
142 ScopedPlatformHandle* platform_handle) { 142 ScopedPlatformHandle* platform_handle) {
143 DCHECK(platform_handle); 143 DCHECK(platform_handle);
144 144
145 DCHECK(internal::g_core); 145 DCHECK(internal::g_core);
146 scoped_refptr<system::Dispatcher> dispatcher( 146 scoped_refptr<system::Dispatcher> dispatcher(
147 internal::g_core->GetDispatcher(platform_handle_wrapper_handle)); 147 internal::g_core->GetDispatcher(platform_handle_wrapper_handle));
148 if (!dispatcher) 148 if (!dispatcher)
149 return MOJO_RESULT_INVALID_ARGUMENT; 149 return MOJO_RESULT_INVALID_ARGUMENT;
150 150
151 if (dispatcher->GetType() != system::Dispatcher::kTypePlatformHandle) 151 if (dispatcher->GetType() != system::Dispatcher::Type::PLATFORM_HANDLE)
152 return MOJO_RESULT_INVALID_ARGUMENT; 152 return MOJO_RESULT_INVALID_ARGUMENT;
153 153
154 *platform_handle = 154 *platform_handle =
155 static_cast<system::PlatformHandleDispatcher*>(dispatcher.get()) 155 static_cast<system::PlatformHandleDispatcher*>(dispatcher.get())
156 ->PassPlatformHandle() 156 ->PassPlatformHandle()
157 .Pass(); 157 .Pass();
158 return MOJO_RESULT_OK; 158 return MOJO_RESULT_OK;
159 } 159 }
160 160
161 void InitIPCSupport(ProcessType process_type, 161 void InitIPCSupport(ProcessType process_type,
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after
362 } 362 }
363 363
364 void WillDestroyChannelSoon(ChannelInfo* channel_info) { 364 void WillDestroyChannelSoon(ChannelInfo* channel_info) {
365 DCHECK(channel_info); 365 DCHECK(channel_info);
366 DCHECK(g_channel_manager); 366 DCHECK(g_channel_manager);
367 g_channel_manager->WillShutdownChannel(channel_info->channel_id); 367 g_channel_manager->WillShutdownChannel(channel_info->channel_id);
368 } 368 }
369 369
370 } // namespace embedder 370 } // namespace embedder
371 } // namespace mojo 371 } // namespace mojo
OLDNEW
« no previous file with comments | « no previous file | mojo/edk/system/channel_endpoint_id.h » ('j') | mojo/edk/system/transport_data.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698