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

Side by Side Diff: ipc/attachment_broker.h

Issue 1688433005: Revert of Clean up public interface of AttachmentBrokerUnprivileged. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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 unified diff | Download patch
« no previous file with comments | « content/child/child_thread_impl.cc ('k') | ipc/attachment_broker.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef IPC_ATTACHMENT_BROKER_H_ 5 #ifndef IPC_ATTACHMENT_BROKER_H_
6 #define IPC_ATTACHMENT_BROKER_H_ 6 #define IPC_ATTACHMENT_BROKER_H_
7 7
8 #include "base/gtest_prod_util.h" 8 #include "base/gtest_prod_util.h"
9 #include "base/macros.h" 9 #include "base/macros.h"
10 #include "base/memory/ref_counted.h" 10 #include "base/memory/ref_counted.h"
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 90
91 // These two methods should only be called by the broker process. 91 // These two methods should only be called by the broker process.
92 // 92 //
93 // Each unprivileged process should have one IPC channel on which it 93 // Each unprivileged process should have one IPC channel on which it
94 // communicates attachment information with the broker process. In the broker 94 // communicates attachment information with the broker process. In the broker
95 // process, these channels must be registered and deregistered with the 95 // process, these channels must be registered and deregistered with the
96 // Attachment Broker as they are created and destroyed. 96 // Attachment Broker as they are created and destroyed.
97 virtual void RegisterCommunicationChannel(Endpoint* endpoint); 97 virtual void RegisterCommunicationChannel(Endpoint* endpoint);
98 virtual void DeregisterCommunicationChannel(Endpoint* endpoint); 98 virtual void DeregisterCommunicationChannel(Endpoint* endpoint);
99 99
100 // In each unprivileged process, exactly one channel should be used to
101 // communicate brokerable attachments with the broker process.
102 virtual void DesignateBrokerCommunicationChannel(Endpoint* endpoint);
103
104 // True if and only if this broker is privileged.
105 virtual bool IsPrivilegedBroker();
106
107 protected: 100 protected:
108 using AttachmentVector = std::vector<scoped_refptr<BrokerableAttachment>>; 101 using AttachmentVector = std::vector<scoped_refptr<BrokerableAttachment>>;
109 102
110 // Adds |attachment| to |attachments_|, and notifies the observers. 103 // Adds |attachment| to |attachments_|, and notifies the observers.
111 void HandleReceivedAttachment( 104 void HandleReceivedAttachment(
112 const scoped_refptr<BrokerableAttachment>& attachment); 105 const scoped_refptr<BrokerableAttachment>& attachment);
113 106
114 // Informs the observers that a new BrokerableAttachment has been received. 107 // Informs the observers that a new BrokerableAttachment has been received.
115 void NotifyObservers(const BrokerableAttachment::AttachmentId& id); 108 void NotifyObservers(const BrokerableAttachment::AttachmentId& id);
116 109
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
156 149
157 // The AttachmentBroker can be accessed from any thread, so modifications to 150 // The AttachmentBroker can be accessed from any thread, so modifications to
158 // internal state must be guarded by a lock. 151 // internal state must be guarded by a lock.
159 base::Lock lock_; 152 base::Lock lock_;
160 DISALLOW_COPY_AND_ASSIGN(AttachmentBroker); 153 DISALLOW_COPY_AND_ASSIGN(AttachmentBroker);
161 }; 154 };
162 155
163 } // namespace IPC 156 } // namespace IPC
164 157
165 #endif // IPC_ATTACHMENT_BROKER_H_ 158 #endif // IPC_ATTACHMENT_BROKER_H_
OLDNEW
« no previous file with comments | « content/child/child_thread_impl.cc ('k') | ipc/attachment_broker.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698