summaryrefslogtreecommitdiffstats
path: root/remoting/host/desktop_session_proxy.cc
diff options
context:
space:
mode:
authorerikchen <erikchen@chromium.org>2016-01-29 16:06:24 -0800
committerCommit bot <commit-bot@chromium.org>2016-01-30 00:08:04 +0000
commit9d688915aac5b9c4143197c0a5432b46d61ed0fe (patch)
tree9bf279b0a9d6826aa2c11cbcc145cd13a534bf93 /remoting/host/desktop_session_proxy.cc
parent802c997e1e34fe6d4e445dad1af19f8b039b6cf9 (diff)
downloadchromium_src-9d688915aac5b9c4143197c0a5432b46d61ed0fe.zip
chromium_src-9d688915aac5b9c4143197c0a5432b46d61ed0fe.tar.gz
chromium_src-9d688915aac5b9c4143197c0a5432b46d61ed0fe.tar.bz2
Revert of Enable attachment brokering of SharedMemoryHandle on Windows. (patchset #4 id:60001 of https://codereview.chromium.org/1588683003/ )
Reason for revert: Causing Dr.Memory errors. https://code.google.com/p/chromium/issues/detail?id=580636 Original issue's description: > Enable attachment brokering of SharedMemoryHandle on Windows. > > Whenever a SharedMemoryHandle associated with the current process is passed as a > parameter to a Chrome IPC message, the object is automatically brokered into the > destination process. This means it is no longer necessary to have a constructor > of SharedMemoryHandle that takes a ProcessHandle, since the SharedMemoryHandle > is always associated with the current process. > > BUG=493414 > > Committed: https://crrev.com/7ceb8901740c35cd8ebfb92739efaf2ee441391e > Cr-Commit-Position: refs/heads/master@{#370193} TBR=mark@chromium.org,tsepez@chromium.org,thestig@chromium.org,avi@chromium.org,sergeyu@chromium.org # Not skipping CQ checks because original CL landed more than 1 days ago. BUG=493414 Review URL: https://codereview.chromium.org/1645273003 Cr-Commit-Position: refs/heads/master@{#372481}
Diffstat (limited to 'remoting/host/desktop_session_proxy.cc')
-rw-r--r--remoting/host/desktop_session_proxy.cc7
1 files changed, 6 insertions, 1 deletions
diff --git a/remoting/host/desktop_session_proxy.cc b/remoting/host/desktop_session_proxy.cc
index a7bfdba..8d05833 100644
--- a/remoting/host/desktop_session_proxy.cc
+++ b/remoting/host/desktop_session_proxy.cc
@@ -49,9 +49,14 @@ class DesktopSessionProxy::IpcSharedBufferCore
public:
IpcSharedBufferCore(int id,
base::SharedMemoryHandle handle,
+ base::ProcessHandle process,
size_t size)
: id_(id),
+#if defined(OS_WIN)
+ shared_memory_(handle, kReadOnly, process),
+#else // !defined(OS_WIN)
shared_memory_(handle, kReadOnly),
+#endif // !defined(OS_WIN)
size_(size) {
if (!shared_memory_.Map(size)) {
LOG(ERROR) << "Failed to map a shared buffer: id=" << id
@@ -470,7 +475,7 @@ void DesktopSessionProxy::OnCreateSharedBuffer(
DCHECK(caller_task_runner_->BelongsToCurrentThread());
scoped_refptr<IpcSharedBufferCore> shared_buffer =
- new IpcSharedBufferCore(id, handle, size);
+ new IpcSharedBufferCore(id, handle, desktop_process_.Handle(), size);
if (shared_buffer->memory() != nullptr &&
!shared_buffers_.insert(std::make_pair(id, shared_buffer)).second) {