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

Unified Diff: ipc/ipc_channel_posix.cc

Issue 1292263003: ipc: Use a global for the process's attachment broker. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@ipc_message2
Patch Set: Comments from avi. Created 5 years, 3 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 233968712cdde419c6746b1bb0a1e3e90c1dbb7a..b3aee8e06bb06de8be578098541037406be4937b 100644
--- a/ipc/ipc_channel_posix.cc
+++ b/ipc/ipc_channel_posix.cc
@@ -38,6 +38,7 @@
#include "base/stl_util.h"
#include "base/strings/string_util.h"
#include "base/synchronization/lock.h"
+#include "ipc/attachment_broker.h"
#include "ipc/ipc_descriptors.h"
#include "ipc/ipc_listener.h"
#include "ipc/ipc_logging.h"
@@ -182,8 +183,7 @@ int ChannelPosix::global_pid_ = 0;
ChannelPosix::ChannelPosix(const IPC::ChannelHandle& channel_handle,
Mode mode,
- Listener* listener,
- AttachmentBroker* broker)
+ Listener* listener)
: ChannelReader(listener),
mode_(mode),
peer_pid_(base::kNullProcessId),
@@ -192,8 +192,7 @@ ChannelPosix::ChannelPosix(const IPC::ChannelHandle& channel_handle,
message_send_bytes_written_(0),
pipe_name_(channel_handle.name),
in_dtor_(false),
- must_unlink_(false),
- broker_(broker) {
+ must_unlink_(false) {
if (!CreatePipe(channel_handle)) {
// The pipe may have been closed already.
const char *modestr = (mode_ & MODE_SERVER_FLAG) ? "server" : "client";
@@ -524,7 +523,7 @@ bool ChannelPosix::Send(Message* message) {
}
AttachmentBroker* ChannelPosix::GetAttachmentBroker() {
- return broker_;
+ return AttachmentBroker::GetGlobal();
}
int ChannelPosix::GetClientFileDescriptor() const {
@@ -1023,7 +1022,7 @@ scoped_ptr<Channel> Channel::Create(const IPC::ChannelHandle& channel_handle,
Listener* listener,
AttachmentBroker* broker) {
return make_scoped_ptr(
- new ChannelPosix(channel_handle, mode, listener, broker));
+ new ChannelPosix(channel_handle, mode, listener));
}
// 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