summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpph34r@gmail.com <pph34r@gmail.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-09-30 18:10:57 +0000
committerpph34r@gmail.com <pph34r@gmail.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-09-30 18:10:57 +0000
commit6990e5d44cd75f5427d5d2391d8330ef32bd28e7 (patch)
tree6a491503be37e17ce64964a5a319f14c5a2ed225
parentb7bf6b6840986d85a118a6888c2900aba87554f2 (diff)
downloadchromium_src-6990e5d44cd75f5427d5d2391d8330ef32bd28e7.zip
chromium_src-6990e5d44cd75f5427d5d2391d8330ef32bd28e7.tar.gz
chromium_src-6990e5d44cd75f5427d5d2391d8330ef32bd28e7.tar.bz2
Unused variables cleanup (gcc 4.6)
Make BrokerDispatcher::OnMsgConnectToPlugin report result via IPC. BUG=87490 TEST=None Review URL: http://codereview.chromium.org/8091001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@103501 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--content/renderer/pepper_plugin_delegate_impl.cc5
-rw-r--r--ppapi/proxy/broker_dispatcher.cc12
-rw-r--r--ppapi/proxy/broker_dispatcher.h3
-rw-r--r--ppapi/proxy/ppapi_messages.h5
4 files changed, 13 insertions, 12 deletions
diff --git a/content/renderer/pepper_plugin_delegate_impl.cc b/content/renderer/pepper_plugin_delegate_impl.cc
index a105fbc..6e24e97 100644
--- a/content/renderer/pepper_plugin_delegate_impl.cc
+++ b/content/renderer/pepper_plugin_delegate_impl.cc
@@ -503,8 +503,9 @@ int32_t BrokerDispatcherWrapper::SendHandleToBroker(
if (foreign_socket_handle == IPC::InvalidPlatformFileForTransit())
return PP_ERROR_FAILED;
+ int32_t result;
if (!dispatcher_->Send(
- new PpapiMsg_ConnectToPlugin(instance, foreign_socket_handle))) {
+ new PpapiMsg_ConnectToPlugin(instance, foreign_socket_handle, &result))) {
// The plugin did not receive the handle, so it must be closed.
// The easiest way to clean it up is to just put it in an object
// and then close it. This failure case is not performance critical.
@@ -514,7 +515,7 @@ int32_t BrokerDispatcherWrapper::SendHandleToBroker(
return PP_ERROR_FAILED;
}
- return PP_OK;
+ return result;
}
PpapiBrokerImpl::PpapiBrokerImpl(webkit::ppapi::PluginModule* plugin_module,
diff --git a/ppapi/proxy/broker_dispatcher.cc b/ppapi/proxy/broker_dispatcher.cc
index 0b39ae4..23c1324 100644
--- a/ppapi/proxy/broker_dispatcher.cc
+++ b/ppapi/proxy/broker_dispatcher.cc
@@ -57,26 +57,24 @@ bool BrokerDispatcher::OnMessageReceived(const IPC::Message& msg) {
// Transfers ownership of the handle to the broker module.
void BrokerDispatcher::OnMsgConnectToPlugin(
PP_Instance instance,
- IPC::PlatformFileForTransit handle) {
- int32_t result = PP_OK;
+ IPC::PlatformFileForTransit handle,
+ int32_t* result) {
if (handle == IPC::InvalidPlatformFileForTransit()) {
- result = PP_ERROR_FAILED;
+ *result = PP_ERROR_FAILED;
} else {
base::SyncSocket::Handle socket_handle =
IPC::PlatformFileForTransitToPlatformFile(handle);
if (connect_instance_) {
- result = connect_instance_(instance, PlatformFileToInt(socket_handle));
+ *result = connect_instance_(instance, PlatformFileToInt(socket_handle));
} else {
- result = PP_ERROR_FAILED;
+ *result = PP_ERROR_FAILED;
// Close the handle since there is no other owner.
// The easiest way to clean it up is to just put it in an object
// and then close them. This failure case is not performance critical.
base::SyncSocket temp_socket(socket_handle);
}
}
-
- // TODO(ddorwin): Report result via IPC.
}
BrokerHostDispatcher::BrokerHostDispatcher(
diff --git a/ppapi/proxy/broker_dispatcher.h b/ppapi/proxy/broker_dispatcher.h
index 85edaa6..126b82c 100644
--- a/ppapi/proxy/broker_dispatcher.h
+++ b/ppapi/proxy/broker_dispatcher.h
@@ -31,7 +31,8 @@ class PPAPI_PROXY_EXPORT BrokerDispatcher : public ProxyChannel {
PP_ConnectInstance_Func connect_instance);
void OnMsgConnectToPlugin(PP_Instance instance,
- IPC::PlatformFileForTransit handle);
+ IPC::PlatformFileForTransit handle,
+ int32_t* result);
PP_ConnectInstance_Func connect_instance_;
diff --git a/ppapi/proxy/ppapi_messages.h b/ppapi/proxy/ppapi_messages.h
index 96280c4..9b4442b 100644
--- a/ppapi/proxy/ppapi_messages.h
+++ b/ppapi/proxy/ppapi_messages.h
@@ -199,9 +199,10 @@ IPC_MESSAGE_CONTROL2(PpapiMsg_ExecuteCallback,
// Broker Process.
-IPC_SYNC_MESSAGE_CONTROL2_0(PpapiMsg_ConnectToPlugin,
+IPC_SYNC_MESSAGE_CONTROL2_1(PpapiMsg_ConnectToPlugin,
PP_Instance /* instance */,
- IPC::PlatformFileForTransit /* handle */)
+ IPC::PlatformFileForTransit /* handle */,
+ int32_t /* result */)
// PPB_Audio.