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

Side by Side Diff: ppapi/proxy/broker_dispatcher.cc

Issue 8585013: Merge definitions of PlatformFileToInt and IntToPlatformFile to one place. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 9 years, 1 month 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 (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "ppapi/proxy/broker_dispatcher.h" 5 #include "ppapi/proxy/broker_dispatcher.h"
6 6
7 #include "base/sync_socket.h" 7 #include "base/sync_socket.h"
8 #include "ppapi/c/pp_errors.h" 8 #include "ppapi/c/pp_errors.h"
9 #include "ppapi/proxy/ppapi_messages.h" 9 #include "ppapi/proxy/ppapi_messages.h"
10 10
11 namespace ppapi { 11 namespace ppapi {
12 namespace proxy { 12 namespace proxy {
13 13
14 namespace {
15
16 int32_t PlatformFileToInt(base::PlatformFile handle) {
17 #if defined(OS_WIN)
18 return static_cast<int32_t>(reinterpret_cast<intptr_t>(handle));
19 #elif defined(OS_POSIX)
20 return handle;
21 #else
22 #error Not implemented.
23 #endif
24 }
25
26 } // namespace
27
28 BrokerDispatcher::BrokerDispatcher(base::ProcessHandle remote_process_handle, 14 BrokerDispatcher::BrokerDispatcher(base::ProcessHandle remote_process_handle,
29 PP_ConnectInstance_Func connect_instance) 15 PP_ConnectInstance_Func connect_instance)
30 : ProxyChannel(remote_process_handle), 16 : ProxyChannel(remote_process_handle),
31 connect_instance_(connect_instance) { 17 connect_instance_(connect_instance) {
32 } 18 }
33 19
34 BrokerDispatcher::~BrokerDispatcher() { 20 BrokerDispatcher::~BrokerDispatcher() {
35 } 21 }
36 22
37 bool BrokerDispatcher::InitBrokerWithChannel( 23 bool BrokerDispatcher::InitBrokerWithChannel(
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 // The renderer has crashed or exited. This channel and all instances 90 // The renderer has crashed or exited. This channel and all instances
105 // associated with it are no longer valid. 91 // associated with it are no longer valid.
106 // TODO(ddorwin): This causes the broker process to exit, which may not be 92 // TODO(ddorwin): This causes the broker process to exit, which may not be
107 // desirable in some use cases. 93 // desirable in some use cases.
108 delete this; 94 delete this;
109 } 95 }
110 96
111 97
112 } // namespace proxy 98 } // namespace proxy
113 } // namespace ppapi 99 } // namespace ppapi
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698