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

Unified Diff: ipc/brokerable_attachment.h

Issue 1286883003: Revert of IPC: Add attachment brokering support to the message header. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 4 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/attachment_broker_privileged_win_unittest.cc ('k') | 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 cad6f4d212b6949d7574d7575755ba38da91f4df..452d1297aa9df2cfdaa173652131b5f7a944d407 100644
--- a/ipc/brokerable_attachment.h
+++ b/ipc/brokerable_attachment.h
@@ -22,15 +22,6 @@
struct IPC_EXPORT AttachmentId {
uint8_t nonce[kNonceSize];
- // Default constructor returns a 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])
@@ -51,7 +42,6 @@
};
enum BrokerableType {
- PLACEHOLDER,
WIN_HANDLE,
};
@@ -62,26 +52,31 @@
// can be used.
bool NeedsBrokering() const;
+ // Fills in the data of this instance with the data from |attachment|.
+ // This instance must require brokering, |attachment| must be brokered, and
+ // both instances must have the same identifier.
+ virtual void PopulateWithAttachment(
+ const BrokerableAttachment* attachment) = 0;
+
// Returns TYPE_BROKERABLE_ATTACHMENT
Type GetType() const override;
virtual BrokerableType GetBrokerableType() const = 0;
-// MessageAttachment override.
-#if defined(OS_POSIX)
- base::PlatformFile TakePlatformFile() override;
-#endif // OS_POSIX
-
protected:
BrokerableAttachment();
- BrokerableAttachment(const AttachmentId& id);
+ BrokerableAttachment(const AttachmentId& id, bool needs_brokering);
~BrokerableAttachment() override;
+
+ void SetNeedsBrokering(bool needs_brokering);
private:
// This member uniquely identifies a BrokerableAttachment across all Chrome
// processes.
const AttachmentId id_;
+ // Whether the attachment still needs to be filled in by an AttachmentBroker.
+ bool needs_brokering_;
DISALLOW_COPY_AND_ASSIGN(BrokerableAttachment);
};
« no previous file with comments | « ipc/attachment_broker_privileged_win_unittest.cc ('k') | ipc/brokerable_attachment.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698