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

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: 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_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 4ac5823d60e4f4c9e54b2d1d90fe4c6afa346758..79b000180546540289e80b2a5b9cad8195b9bd05 100644
--- a/ipc/ipc_channel_win.cc
+++ b/ipc/ipc_channel_win.cc
@@ -18,6 +18,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"
@@ -38,8 +39,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),
@@ -48,7 +48,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);
}
@@ -107,11 +106,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;
}
@@ -161,7 +161,7 @@ void ChannelWin::FlushPrelimQueue() {
}
AttachmentBroker* ChannelWin::GetAttachmentBroker() {
- return broker_;
+ return AttachmentBroker::GetGlobal();
}
base::ProcessId ChannelWin::GetPeerPID() const {
@@ -567,7 +567,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
« no previous file with comments | « ipc/ipc_channel_win.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698