summaryrefslogtreecommitdiffstats
path: root/ipc/ipc_message.cc
diff options
context:
space:
mode:
authordsinclair@chromium.org <dsinclair@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-07-26 13:17:12 +0000
committerdsinclair@chromium.org <dsinclair@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-07-26 13:17:12 +0000
commit285250fbf9bbb07cfaff19549166cdcec262b7b9 (patch)
treedb4e544e72b374b1aa83f10a9b8cc9ee5d4d5bc1 /ipc/ipc_message.cc
parentddb0f262406ef9a22704f38256c8bdb341490c42 (diff)
downloadchromium_src-285250fbf9bbb07cfaff19549166cdcec262b7b9.zip
chromium_src-285250fbf9bbb07cfaff19549166cdcec262b7b9.tar.gz
chromium_src-285250fbf9bbb07cfaff19549166cdcec262b7b9.tar.bz2
Correct bit-shift in IPC hash generation.
The actual bit shifting that happens does not match what is specified in the comment. With the current implementation we will shift the PID over 14 bits, this sets the top 22 bits with the bottom 22 bits of the PID. When then OR the count with 0x3fff giving us 14 bits which we shift over 8 bits. This will end up OR'ing 8 bits of the count with 8 bits of the PID. Instead, we shift the PID over 22 bits, giving is 10 bits of the PID and shift the 14 bits of the count over 8. There should be no OR'ing between the PID and the count. This then matches what is specified in the comments. BUG= Review URL: https://chromiumcodereview.appspot.com/20106002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@213882 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ipc/ipc_message.cc')
-rw-r--r--ipc/ipc_message.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/ipc/ipc_message.cc b/ipc/ipc_message.cc
index cf3a65e..2fb9097 100644
--- a/ipc/ipc_message.cc
+++ b/ipc/ipc_message.cc
@@ -27,7 +27,7 @@ inline uint32 GetRefNumUpper24() {
// Process ID. With the current trace event buffer cap, the 14-bit count did
// not appear to wrap during a trace. Note that it is not a big deal if
// collisions occur, as this is only used for debugging and trace analysis.
- return ((pid << 14) | (count & 0x3fff)) << 8;
+ return ((pid << 22) | (count & 0x3fff)) << 8;
}
} // namespace