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

Unified Diff: ipc/ipc_channel_win.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
« ipc/attachment_broker_privileged_win_unittest.cc ('K') | « ipc/ipc_channel_win.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« ipc/attachment_broker_privileged_win_unittest.cc ('K') | « ipc/ipc_channel_win.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698