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

Unified Diff: ipc/ipc_channel_nacl.cc

Issue 1185133006: IPC: Make ChannelReader inherit from SupportsAttachmentBrokering. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Comments from tsepez. Created 5 years, 6 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_nacl.h ('k') | ipc/ipc_channel_posix.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ipc/ipc_channel_nacl.cc
diff --git a/ipc/ipc_channel_nacl.cc b/ipc/ipc_channel_nacl.cc
index f5b33cea41adc83a4035eb0d3d64db124a3a972f..19a32891af1ab95f9393e2702f3082373f43fc4d 100644
--- a/ipc/ipc_channel_nacl.cc
+++ b/ipc/ipc_channel_nacl.cc
@@ -122,13 +122,15 @@ void ChannelNacl::ReaderThreadRunner::Run() {
ChannelNacl::ChannelNacl(const IPC::ChannelHandle& channel_handle,
Mode mode,
- Listener* listener)
+ Listener* listener,
+ AttachmentBroker* broker)
: ChannelReader(listener),
mode_(mode),
waiting_connect_(true),
pipe_(-1),
pipe_name_(channel_handle.name),
- weak_ptr_factory_(this) {
+ weak_ptr_factory_(this),
+ broker_(broker) {
if (!CreatePipe(channel_handle)) {
// The pipe may have been closed already.
const char *modestr = (mode_ & MODE_SERVER_FLAG) ? "server" : "client";
@@ -217,6 +219,10 @@ bool ChannelNacl::Send(Message* message) {
return true;
}
+AttachmentBroker* ChannelNacl::GetAttachmentBroker() {
+ return broker_;
+}
+
void ChannelNacl::DidRecvMsg(scoped_ptr<MessageContents> contents) {
// Close sets the pipe to -1. It's possible we'll get a buffer sent to us from
// the reader thread after Close is called. If so, we ignore it.
@@ -372,10 +378,12 @@ void ChannelNacl::HandleInternalMessage(const Message& msg) {
// Channel's methods
// static
-scoped_ptr<Channel> Channel::Create(
- const IPC::ChannelHandle &channel_handle, Mode mode, Listener* listener) {
+scoped_ptr<Channel> Channel::Create(const IPC::ChannelHandle& channel_handle,
+ Mode mode,
+ Listener* listener,
+ AttachmentBroker* broker) {
return scoped_ptr<Channel>(
- new ChannelNacl(channel_handle, mode, listener));
+ new ChannelNacl(channel_handle, mode, listener, broker));
}
} // namespace IPC
« no previous file with comments | « ipc/ipc_channel_nacl.h ('k') | ipc/ipc_channel_posix.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698