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

Unified Diff: ipc/brokerable_attachment.cc

Issue 1345633002: ipc: Move //crypto dependency into a Windows-only file. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 3 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/brokerable_attachment.h ('k') | ipc/brokerable_attachment_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ipc/brokerable_attachment.cc
diff --git a/ipc/brokerable_attachment.cc b/ipc/brokerable_attachment.cc
index 681e2ba0b5626d39130626d7f2b6563dbf32b5f5..2b7880923920d17ad12898280120f54008c396bb 100644
--- a/ipc/brokerable_attachment.cc
+++ b/ipc/brokerable_attachment.cc
@@ -8,6 +8,30 @@
namespace IPC {
+#if !USE_ATTACHMENT_BROKER
+BrokerableAttachment::AttachmentId::AttachmentId() {
+ CHECK(false) << "Not allowed to construct an attachment id if the platform "
+ "does not support attachment brokering.";
+}
+#endif
+
+BrokerableAttachment::AttachmentId::AttachmentId(const char* start_address,
+ size_t size) {
+ DCHECK(size == BrokerableAttachment::kNonceSize);
+ for (size_t i = 0; i < BrokerableAttachment::kNonceSize; ++i)
+ nonce[i] = start_address[i];
+}
+
+void BrokerableAttachment::AttachmentId::SerializeToBuffer(char* start_address,
+ size_t size) {
+ DCHECK(size == BrokerableAttachment::kNonceSize);
+ for (size_t i = 0; i < BrokerableAttachment::kNonceSize; ++i)
+ start_address[i] = nonce[i];
+}
+
+BrokerableAttachment::BrokerableAttachment()
+ : needs_brokering_(false) {}
+
BrokerableAttachment::BrokerableAttachment(const AttachmentId& id,
bool needs_brokering)
: id_(id), needs_brokering_(needs_brokering) {}
« no previous file with comments | « ipc/brokerable_attachment.h ('k') | ipc/brokerable_attachment_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698