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

Unified Diff: ipc/ipc_channel_posix.cc

Issue 1185133006: IPC: Make ChannelReader inherit from SupportsAttachmentBrokering. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Comments from tsepez. 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 | « ipc/ipc_channel_posix.h ('k') | ipc/ipc_channel_posix_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ipc/ipc_channel_posix.cc
diff --git a/ipc/ipc_channel_posix.cc b/ipc/ipc_channel_posix.cc
index 20c73e2c6be5fac4bd385b8d478d4f59338c9898..6c0393b929f66a302f89e99db9c632395d292b59 100644
--- a/ipc/ipc_channel_posix.cc
+++ b/ipc/ipc_channel_posix.cc
@@ -182,7 +182,9 @@ int ChannelPosix::global_pid_ = 0;
#endif // OS_LINUX
ChannelPosix::ChannelPosix(const IPC::ChannelHandle& channel_handle,
- Mode mode, Listener* listener)
+ Mode mode,
+ Listener* listener,
+ AttachmentBroker* broker)
: ChannelReader(listener),
mode_(mode),
peer_pid_(base::kNullProcessId),
@@ -191,7 +193,8 @@ ChannelPosix::ChannelPosix(const IPC::ChannelHandle& channel_handle,
message_send_bytes_written_(0),
pipe_name_(channel_handle.name),
in_dtor_(false),
- must_unlink_(false) {
+ must_unlink_(false),
+ broker_(broker) {
if (!CreatePipe(channel_handle)) {
// The pipe may have been closed already.
const char *modestr = (mode_ & MODE_SERVER_FLAG) ? "server" : "client";
@@ -517,6 +520,10 @@ bool ChannelPosix::Send(Message* message) {
return true;
}
+AttachmentBroker* ChannelPosix::GetAttachmentBroker() {
+ return broker_;
+}
+
int ChannelPosix::GetClientFileDescriptor() const {
base::AutoLock lock(client_pipe_lock_);
return client_pipe_.get();
@@ -995,9 +1002,12 @@ void ChannelPosix::ResetSafely(base::ScopedFD* fd) {
// Channel's methods
// static
-scoped_ptr<Channel> Channel::Create(
- const IPC::ChannelHandle &channel_handle, Mode mode, Listener* listener) {
- return make_scoped_ptr(new ChannelPosix(channel_handle, mode, listener));
+scoped_ptr<Channel> Channel::Create(const IPC::ChannelHandle& channel_handle,
+ Mode mode,
+ Listener* listener,
+ AttachmentBroker* broker) {
+ return make_scoped_ptr(
+ new ChannelPosix(channel_handle, mode, listener, broker));
}
// static
« no previous file with comments | « ipc/ipc_channel_posix.h ('k') | ipc/ipc_channel_posix_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698