| Index: ipc/ipc_channel_win.cc
|
| diff --git a/ipc/ipc_channel_win.cc b/ipc/ipc_channel_win.cc
|
| index f89e94655426bfac2351c15c0a4b1f7d579de9e2..971dfc1eeb7ddb278a7ccf4be1c65453477f7e8d 100644
|
| --- a/ipc/ipc_channel_win.cc
|
| +++ b/ipc/ipc_channel_win.cc
|
| @@ -17,6 +17,7 @@
|
| #include "base/strings/utf_string_conversions.h"
|
| #include "base/threading/thread_checker.h"
|
| #include "base/win/scoped_handle.h"
|
| +#include "ipc/attachment_broker.h"
|
| #include "ipc/ipc_listener.h"
|
| #include "ipc/ipc_logging.h"
|
| #include "ipc/ipc_message_attachment_set.h"
|
| @@ -37,8 +38,7 @@ ChannelWin::State::~State() {
|
|
|
| ChannelWin::ChannelWin(const IPC::ChannelHandle& channel_handle,
|
| Mode mode,
|
| - Listener* listener,
|
| - AttachmentBroker* broker)
|
| + Listener* listener)
|
| : ChannelReader(listener),
|
| input_state_(this),
|
| output_state_(this),
|
| @@ -47,7 +47,6 @@ ChannelWin::ChannelWin(const IPC::ChannelHandle& channel_handle,
|
| processing_incoming_(false),
|
| validate_client_(false),
|
| client_secret_(0),
|
| - broker_(broker),
|
| weak_factory_(this) {
|
| CreatePipe(channel_handle, mode);
|
| }
|
| @@ -106,11 +105,12 @@ bool ChannelWin::ProcessMessageForDelivery(Message* message) {
|
| // both Send() and ProcessMessageForDelivery() may be re-entrant. Brokered
|
| // attachments must be sent before the Message itself.
|
| if (message->HasBrokerableAttachments()) {
|
| - DCHECK(broker_);
|
| + DCHECK(GetAttachmentBroker());
|
| DCHECK(peer_pid_ != base::kNullProcessId);
|
| for (const BrokerableAttachment* attachment :
|
| message->attachment_set()->PeekBrokerableAttachments()) {
|
| - if (!broker_->SendAttachmentToProcess(attachment, peer_pid_)) {
|
| + if (!GetAttachmentBroker()->SendAttachmentToProcess(attachment,
|
| + peer_pid_)) {
|
| delete message;
|
| return false;
|
| }
|
| @@ -167,7 +167,7 @@ void ChannelWin::FlushPrelimQueue() {
|
| }
|
|
|
| AttachmentBroker* ChannelWin::GetAttachmentBroker() {
|
| - return broker_;
|
| + return AttachmentBroker::GetGlobal();
|
| }
|
|
|
| base::ProcessId ChannelWin::GetPeerPID() const {
|
| @@ -571,7 +571,7 @@ scoped_ptr<Channel> Channel::Create(const IPC::ChannelHandle& channel_handle,
|
| Listener* listener,
|
| AttachmentBroker* broker) {
|
| return scoped_ptr<Channel>(
|
| - new ChannelWin(channel_handle, mode, listener, broker));
|
| + new ChannelWin(channel_handle, mode, listener));
|
| }
|
|
|
| // static
|
|
|