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

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: Created 5 years, 4 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/ipc_channel_posix.cc
diff --git a/ipc/ipc_channel_posix.cc b/ipc/ipc_channel_posix.cc
index 977db226deb9e5203f8dd05da13caf70c6f8cb5a..82dd09183f27723f7812a68fc66066d3e26164c8 100644
--- a/ipc/ipc_channel_posix.cc
+++ b/ipc/ipc_channel_posix.cc
@@ -37,6 +37,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"
@@ -183,8 +184,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),
@@ -193,8 +193,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";
@@ -525,7 +524,7 @@ bool ChannelPosix::Send(Message* message) {
}
AttachmentBroker* ChannelPosix::GetAttachmentBroker() {
- return broker_;
+ return AttachmentBroker::GetGlobal();
}
int ChannelPosix::GetClientFileDescriptor() const {
@@ -1024,7 +1023,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

Powered by Google App Engine
This is Rietveld 408576698