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

Unified Diff: ipc/brokerable_attachment.h

Issue 1321093003: ipc: Add methods for AttachmentBroker nonce serialization. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Comments from tsepez. 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 | « no previous file | ipc/brokerable_attachment.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ipc/brokerable_attachment.h
diff --git a/ipc/brokerable_attachment.h b/ipc/brokerable_attachment.h
index 452d1297aa9df2cfdaa173652131b5f7a944d407..9c2bbbd69ec444ac0770a1df93cf7ae34110be20 100644
--- a/ipc/brokerable_attachment.h
+++ b/ipc/brokerable_attachment.h
@@ -22,6 +22,15 @@ class IPC_EXPORT BrokerableAttachment : public MessageAttachment {
struct IPC_EXPORT AttachmentId {
uint8_t nonce[kNonceSize];
+ // Default constructor returns an unguessable random nonce.
+ AttachmentId();
+
+ // Constructs an AttachmentId from a buffer.
+ AttachmentId(const char* start_address, size_t size);
+
+ // Writes the nonce into a buffer.
+ void SerializeToBuffer(char* start_address, size_t size);
+
bool operator==(const AttachmentId& rhs) const {
for (size_t i = 0; i < kNonceSize; ++i) {
if (nonce[i] != rhs.nonce[i])
« no previous file with comments | « no previous file | ipc/brokerable_attachment.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698