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

Unified Diff: content/renderer/pepper_plugin_delegate_impl.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 | « no previous file | ppapi/ppapi_shared.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/pepper_plugin_delegate_impl.cc
diff --git a/content/renderer/pepper_plugin_delegate_impl.cc b/content/renderer/pepper_plugin_delegate_impl.cc
index ee5124a0ded071598cd69a495b2e939d287abac9..65645f1efd0b5f94813cbf985794532e5bd155b5 100644
--- a/content/renderer/pepper_plugin_delegate_impl.cc
+++ b/content/renderer/pepper_plugin_delegate_impl.cc
@@ -54,6 +54,7 @@
#include "ppapi/c/private/ppb_flash_net_connector.h"
#include "ppapi/proxy/host_dispatcher.h"
#include "ppapi/proxy/ppapi_messages.h"
+#include "ppapi/shared_impl/platform_file.h"
#include "ppapi/shared_impl/ppapi_preferences.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebCursorInfo.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebFileChooserCompletion.h"
@@ -81,16 +82,6 @@ using WebKit::WebView;
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
-}
-
base::SyncSocket::Handle DuplicateHandle(base::SyncSocket::Handle handle) {
base::SyncSocket::Handle out_handle = base::kInvalidPlatformFileValue;
#if defined(OS_WIN)
@@ -722,7 +713,8 @@ PpapiBrokerImpl::~PpapiBrokerImpl() {
base::WeakPtr<webkit::ppapi::PPB_Broker_Impl>& weak_ptr = i->second;
if (weak_ptr) {
weak_ptr->BrokerConnected(
- PlatformFileToInt(base::kInvalidPlatformFileValue), PP_ERROR_ABORTED);
+ ppapi::PlatformFileToInt(base::kInvalidPlatformFileValue),
+ PP_ERROR_ABORTED);
}
}
pending_connects_.clear();
@@ -809,7 +801,7 @@ void PpapiBrokerImpl::OnBrokerChannelConnected(
base::WeakPtr<webkit::ppapi::PPB_Broker_Impl>& weak_ptr = i->second;
if (weak_ptr) {
weak_ptr->BrokerConnected(
- PlatformFileToInt(base::kInvalidPlatformFileValue),
+ ppapi::PlatformFileToInt(base::kInvalidPlatformFileValue),
PP_ERROR_FAILED);
}
}
@@ -845,7 +837,7 @@ void PpapiBrokerImpl::ConnectPluginToBroker(
// That message handler will then call client->BrokerConnected() with the
// saved pipe handle.
// Temporarily, just call back.
- client->BrokerConnected(PlatformFileToInt(plugin_handle), result);
+ client->BrokerConnected(ppapi::PlatformFileToInt(plugin_handle), result);
}
PepperPluginDelegateImpl::PepperPluginDelegateImpl(RenderViewImpl* render_view)
« no previous file with comments | « no previous file | ppapi/ppapi_shared.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698