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

Unified 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: Add PPAPI_SHARED_EXPORT to make component build work. 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ppapi/ppapi_shared.gypi ('k') | ppapi/proxy/ppb_audio_input_proxy.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/proxy/broker_dispatcher.cc
diff --git a/ppapi/proxy/broker_dispatcher.cc b/ppapi/proxy/broker_dispatcher.cc
index 30cee185aad16a20e386e64ead7f650ad728a87f..c3f3b47bc59b6b24fa5d7c6937b70687d2fe8664 100644
--- a/ppapi/proxy/broker_dispatcher.cc
+++ b/ppapi/proxy/broker_dispatcher.cc
@@ -7,24 +7,11 @@
#include "base/sync_socket.h"
#include "ppapi/c/pp_errors.h"
#include "ppapi/proxy/ppapi_messages.h"
+#include "ppapi/shared_impl/platform_file.h"
namespace ppapi {
namespace proxy {
-namespace {
-
-int32_t PlatformFileToInt(base::PlatformFile handle) {
-#if defined(OS_WIN)
- return static_cast<int32_t>(reinterpret_cast<intptr_t>(handle));
-#elif defined(OS_POSIX)
- return handle;
-#else
- #error Not implemented.
-#endif
-}
-
-} // namespace
-
BrokerDispatcher::BrokerDispatcher(base::ProcessHandle remote_process_handle,
PP_ConnectInstance_Func connect_instance)
: ProxyChannel(remote_process_handle),
@@ -66,7 +53,8 @@ void BrokerDispatcher::OnMsgConnectToPlugin(
IPC::PlatformFileForTransitToPlatformFile(handle);
if (connect_instance_) {
- *result = connect_instance_(instance, PlatformFileToInt(socket_handle));
+ *result = connect_instance_(instance,
+ ppapi::PlatformFileToInt(socket_handle));
} else {
*result = PP_ERROR_FAILED;
// Close the handle since there is no other owner.
« no previous file with comments | « ppapi/ppapi_shared.gypi ('k') | ppapi/proxy/ppb_audio_input_proxy.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698