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

Unified Diff: ppapi/proxy/proxy_channel.cc

Issue 1166443004: Further clean up pepper's use of SharedMemory. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@shared_memory_make_class3_base
Patch Set: Fix compile error on windows. Created 5 years, 7 months 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
Index: ppapi/proxy/proxy_channel.cc
diff --git a/ppapi/proxy/proxy_channel.cc b/ppapi/proxy/proxy_channel.cc
index 7e647553e3ea345ecb51aaeb3b60d7d98ff562cc..2784e4b978bce53cbe57bebd930fd000bcebc705 100644
--- a/ppapi/proxy/proxy_channel.cc
+++ b/ppapi/proxy/proxy_channel.cc
@@ -76,13 +76,11 @@ IPC::PlatformFileForTransit ProxyChannel::ShareHandleWithRemote(
base::SharedMemoryHandle ProxyChannel::ShareSharedMemoryHandleWithRemote(
const base::SharedMemoryHandle& handle) {
-#if defined(OS_POSIX)
- return ShareHandleWithRemote(handle.fd, false);
-#elif defined(OS_WIN)
- return ShareHandleWithRemote(handle, false);
-#else
-#error Not implemented.
-#endif
+ if (!channel_.get())
+ return base::SharedMemory::NULLHandle();
+
+ DCHECK(peer_pid_ != base::kNullProcessId);
+ return delegate_->ShareSharedMemoryHandleWithRemote(handle, peer_pid_);
}
bool ProxyChannel::Send(IPC::Message* msg) {

Powered by Google App Engine
This is Rietveld 408576698