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

Unified Diff: ppapi/proxy/proxy_channel.cc

Issue 11366038: Rewrite PPB_AudioInput_Dev to use the new-style host/resource. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 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/proxy/ppb_audio_input_proxy.cc ('k') | ppapi/proxy/resource_creation_proxy.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/proxy/proxy_channel.cc
diff --git a/ppapi/proxy/proxy_channel.cc b/ppapi/proxy/proxy_channel.cc
index 2a68def3b1a710bb5cf14c60a8444015f159bc97..d1c47a5fbec8596471323b6be2802ef0d1eb1679 100644
--- a/ppapi/proxy/proxy_channel.cc
+++ b/ppapi/proxy/proxy_channel.cc
@@ -7,6 +7,10 @@
#include "ipc/ipc_platform_file.h"
#include "ipc/ipc_test_sink.h"
+#if defined(OS_NACL)
+#include <unistd.h>
+#endif
+
namespace ppapi {
namespace proxy {
@@ -51,8 +55,16 @@ IPC::PlatformFileForTransit ProxyChannel::ShareHandleWithRemote(
base::PlatformFile handle,
bool should_close_source) {
// Channel could be closed if the plugin crashes.
- if (!channel_.get())
+ if (!channel_.get()) {
+ if (should_close_source) {
+#if !defined(OS_NACL)
+ base::ClosePlatformFile(handle);
+#else
+ close(handle);
+#endif
+ }
return IPC::InvalidPlatformFileForTransit();
+ }
return delegate_->ShareHandleWithRemote(handle, *channel_,
should_close_source);
}
« no previous file with comments | « ppapi/proxy/ppb_audio_input_proxy.cc ('k') | ppapi/proxy/resource_creation_proxy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698