Index: ipc/attachment_broker_unprivileged.h |
diff --git a/ipc/attachment_broker_unprivileged.h b/ipc/attachment_broker_unprivileged.h |
index f6d520de6e3bb1a0ad4faa455ce450bf8c93c192..b572ff8266a2fbef12bb5a2aa8dcd30ee3bef397 100644 |
--- a/ipc/attachment_broker_unprivileged.h |
+++ b/ipc/attachment_broker_unprivileged.h |
@@ -22,15 +22,17 @@ |
AttachmentBrokerUnprivileged(); |
~AttachmentBrokerUnprivileged() override; |
- // If there is no global attachment broker, makes a new |
- // AttachmentBrokerUnprivileged and sets it as the global attachment broker. |
- // This method is thread safe. |
- static void CreateBrokerIfNeeded(); |
+ // On platforms that support attachment brokering, returns a new instance of |
+ // a platform-specific attachment broker. Otherwise returns |nullptr|. |
+ // The caller takes ownership of the newly created instance, and is |
+ // responsible for ensuring that the attachment broker lives longer than |
+ // every IPC::Channel. The new instance automatically registers itself as the |
+ // global attachment broker. |
+ static scoped_ptr<AttachmentBrokerUnprivileged> CreateBroker(); |
- // AttachmentBroker: |
- void RegisterBrokerCommunicationChannel(Endpoint* endpoint) override; |
- void DeregisterBrokerCommunicationChannel(Endpoint* endpoint) override; |
- bool IsPrivilegedBroker() override; |
+ // In each unprivileged process, exactly one channel should be used to |
+ // communicate brokerable attachments with the broker process. |
+ void DesignateBrokerCommunicationChannel(Endpoint* endpoint); |
protected: |
IPC::Sender* get_sender() { return sender_; } |