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

Unified Diff: ipc/attachment_broker.h

Issue 1184523003: attachment broker wip (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Minor comments. Created 5 years, 6 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 | « content/test/render_thread_impl_browser_test_ipc_helper.cc ('k') | ipc/attachment_broker_win.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ipc/attachment_broker.h
diff --git a/ipc/attachment_broker.h b/ipc/attachment_broker.h
new file mode 100644
index 0000000000000000000000000000000000000000..de9d13dba2165c5754fda9a321b744065a468d0e
--- /dev/null
+++ b/ipc/attachment_broker.h
@@ -0,0 +1,54 @@
+// 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_H_
+#define IPC_ATTACHMENT_BROKER_H_
+
+#include "base/macros.h"
+#include "base/process/process_handle.h"
+#include "ipc/brokerable_attachment.h"
+#include "ipc/ipc_export.h"
+
+namespace IPC {
+
+class AttachmentBroker;
+// Classes that inherit from this abstract base class are capable of
+// communicating with a broker to send and receive attachments to Chrome IPC
+// messages.
+class IPC_EXPORT SupportsAttachmentBrokering {
+ public:
+ // Returns an AttachmentBroker used to broker attachments of IPC messages to
+ // other processes. There must be exactly one AttachmentBroker per process.
+ virtual AttachmentBroker* GetAttachmentBroker() = 0;
+};
+
+// Responsible for brokering attachments to Chrome IPC messages. On platforms
+// that support attachment brokering, every IPC channel should have an
+// AttachmentBroker.
+class IPC_EXPORT AttachmentBroker {
+ public:
+ AttachmentBroker() {}
+ virtual ~AttachmentBroker() {}
+
+ // Sends |attachment| to |destination_process|. The implementation uses an
+ // IPC::Channel to communicate with the broker process. This may be the same
+ // IPC::Channel that is requesting the brokerage of an attachment.
+ virtual void SendAttachmentToProcess(
+ internal::BrokerableAttachment* attachment,
+ base::ProcessId destination_process) = 0;
+
+ // Returns whether the attachment was available. If the attachment was
+ // available, populates the output parameter |attachment|. The caller then
+ // becomes the owner of |attachment|.
+ virtual bool GetAttachmentWithId(
+ BrokerableAttachmentId,
+ internal::BrokerableAttachment* attachment) = 0;
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(AttachmentBroker);
+};
+
+} // namespace IPC
+
+#endif // IPC_ATTACHMENT_BROKER_H_
« no previous file with comments | « content/test/render_thread_impl_browser_test_ipc_helper.cc ('k') | ipc/attachment_broker_win.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698