summaryrefslogtreecommitdiffstats
path: root/ipc/ipc_message_utils.cc
diff options
context:
space:
mode:
authorerikchen <erikchen@chromium.org>2015-07-07 15:13:11 -0700
committerCommit bot <commit-bot@chromium.org>2015-07-07 22:14:00 +0000
commiteece6c3ca617b0d3c37ce137aba1d2079ab892e4 (patch)
tree3378ce9340ebec508ad4d3c5800b75419137de7d /ipc/ipc_message_utils.cc
parentad58c57745969ba925d0f527854bef3a59b39c0d (diff)
downloadchromium_src-eece6c3ca617b0d3c37ce137aba1d2079ab892e4.zip
chromium_src-eece6c3ca617b0d3c37ce137aba1d2079ab892e4.tar.gz
chromium_src-eece6c3ca617b0d3c37ce137aba1d2079ab892e4.tar.bz2
Stub in more IPC attachment brokering functionality.
This CL fills in most of the logic for sending a Windows HANDLE from a non-broker process to the broker process. This consists of several small changes: - Create the new IPC messages AttachmentBrokerMsg_WinHandleHasBeenBrokered and AttachmentBrokerMsg_RequestBrokerageOfWinHandle. - Add a sender_ member variable to AttachmentBrokerWin. - Define the wire format for HandleAttachmentWin. - Add logic to ChannelWin to send AttachmentBrokerMsg_RequestBrokerageOfWinHandle for each HANDLE attachment. BUG=466437 Review URL: https://codereview.chromium.org/1188923003 Cr-Commit-Position: refs/heads/master@{#337689}
Diffstat (limited to 'ipc/ipc_message_utils.cc')
-rw-r--r--ipc/ipc_message_utils.cc22
1 files changed, 22 insertions, 0 deletions
diff --git a/ipc/ipc_message_utils.cc b/ipc/ipc_message_utils.cc
index b6b9792..dbb2572 100644
--- a/ipc/ipc_message_utils.cc
+++ b/ipc/ipc_message_utils.cc
@@ -449,6 +449,28 @@ void ParamTraits<std::vector<bool> >::Log(const param_type& p, std::string* l) {
}
}
+void ParamTraits<BrokerableAttachment::AttachmentId>::Write(
+ Message* m,
+ const param_type& p) {
+ m->WriteBytes(p.nonce, BrokerableAttachment::kNonceSize);
+}
+
+bool ParamTraits<BrokerableAttachment::AttachmentId>::Read(
+ const Message* m,
+ base::PickleIterator* iter,
+ param_type* r) {
+ const char* data;
+ if (!iter->ReadBytes(&data, BrokerableAttachment::kNonceSize))
+ return false;
+ memcpy(r->nonce, data, BrokerableAttachment::kNonceSize);
+ return true;
+}
+
+void ParamTraits<BrokerableAttachment::AttachmentId>::Log(const param_type& p,
+ std::string* l) {
+ l->append(base::HexEncode(p.nonce, BrokerableAttachment::kNonceSize));
+}
+
void ParamTraits<base::DictionaryValue>::Write(Message* m,
const param_type& p) {
WriteValue(m, &p, 0);