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

Unified Diff: ipc/attachment_broker_privileged.h

Issue 1256993003: ipc: Create AttachmentBrokerPrivileged and AttachmentBrokerUnprivileged. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@add_ipc_message_feature
Patch Set: Rebase. Created 5 years, 5 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
Index: ipc/attachment_broker_privileged.h
diff --git a/ipc/attachment_broker_privileged.h b/ipc/attachment_broker_privileged.h
new file mode 100644
index 0000000000000000000000000000000000000000..52befc45196109fdb2269ca6201dec671e50bec8
--- /dev/null
+++ b/ipc/attachment_broker_privileged.h
@@ -0,0 +1,44 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef IPC_ATTACHMENT_BROKER_PRIVILEGED_H_
+#define IPC_ATTACHMENT_BROKER_PRIVILEGED_H_
+
+#include <vector>
+
+#include "ipc/attachment_broker.h"
+#include "ipc/ipc_export.h"
+
+namespace IPC {
+
+class Channel;
+
+// This abstract subclass of AttachmentBroker is intended for use in a
+// privileged process . When unprivileged processes want to send attachments,
+// the attachments get routed through the privileged process, and more
+// specifically, an instance of this class.
+class IPC_EXPORT AttachmentBrokerPrivileged : public IPC::AttachmentBroker {
+ public:
+ AttachmentBrokerPrivileged();
+ ~AttachmentBrokerPrivileged() override;
+
+ // Each unprivileged process should have one IPC channel on which it
+ // communicates attachment information with the broker process. In the broker
+ // process, these channels must be registered and deregistered with the
+ // Attachment Broker as they are created and destroyed.
+ void RegisterCommunicationChannel(Channel* channel);
+ void DeregisterCommunicationChannel(Channel* channel);
+
+ protected:
+ // Returns nullptr if no channel is found.
+ Channel* GetChannelWithProcessId(base::ProcessId id);
+
+ private:
+ std::vector<Channel*> channels_;
+ DISALLOW_COPY_AND_ASSIGN(AttachmentBrokerPrivileged);
+};
+
+} // namespace IPC
+
+#endif // IPC_ATTACHMENT_BROKER_PRIVILEGED_H_

Powered by Google App Engine
This is Rietveld 408576698