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

Unified Diff: ipc/ipc_message_utils.cc

Issue 1493413004: ipc: Allow attachment brokering for shared memory handles. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@temp1
Patch Set: Fix more tests. Created 4 years, 11 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
« no previous file with comments | « ipc/ipc.gyp ('k') | ipc/ipc_test_messages.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ipc/ipc_message_utils.cc
diff --git a/ipc/ipc_message_utils.cc b/ipc/ipc_message_utils.cc
index 60ae58f217c1568c3de6456ceafe73ecf5f16d77..ea88b55a2a5129260bdc984b35e97ee0171b9ad5 100644
--- a/ipc/ipc_message_utils.cc
+++ b/ipc/ipc_message_utils.cc
@@ -660,9 +660,6 @@ void ParamTraits<base::SharedMemoryHandle>::Log(const param_type& p,
#elif defined(OS_WIN)
void ParamTraits<base::SharedMemoryHandle>::Write(Message* m,
const param_type& p) {
- // Longs on windows are 32 bits.
- uint32_t pid = p.GetPID();
- m->WriteUInt32(pid);
m->WriteBool(p.NeedsBrokering());
if (p.NeedsBrokering()) {
@@ -676,11 +673,6 @@ void ParamTraits<base::SharedMemoryHandle>::Write(Message* m,
bool ParamTraits<base::SharedMemoryHandle>::Read(const Message* m,
base::PickleIterator* iter,
param_type* r) {
- uint32_t pid_int;
- if (!iter->ReadUInt32(&pid_int))
- return false;
- base::ProcessId pid = pid_int;
-
bool needs_brokering;
if (!iter->ReadBool(&needs_brokering))
return false;
@@ -689,7 +681,8 @@ bool ParamTraits<base::SharedMemoryHandle>::Read(const Message* m,
HandleWin handle_win;
if (!ParamTraits<HandleWin>::Read(m, iter, &handle_win))
return false;
- *r = base::SharedMemoryHandle(handle_win.get_handle(), pid);
+ *r = base::SharedMemoryHandle(handle_win.get_handle(),
+ base::GetCurrentProcId());
return true;
}
@@ -697,14 +690,12 @@ bool ParamTraits<base::SharedMemoryHandle>::Read(const Message* m,
if (!iter->ReadInt(&handle_int))
return false;
HANDLE handle = LongToHandle(handle_int);
- *r = base::SharedMemoryHandle(handle, pid);
+ *r = base::SharedMemoryHandle(handle, base::GetCurrentProcId());
return true;
}
void ParamTraits<base::SharedMemoryHandle>::Log(const param_type& p,
std::string* l) {
- LogParam(p.GetPID(), l);
- l->append(" ");
LogParam(p.GetHandle(), l);
l->append(" needs brokering: ");
LogParam(p.NeedsBrokering(), l);
« no previous file with comments | « ipc/ipc.gyp ('k') | ipc/ipc_test_messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698