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

Side by Side Diff: ipc/ipc_channel_nacl.cc

Issue 2484943004: Remove unused parts of IPC::ChannelHandle. (Closed)
Patch Set: rebase Created 4 years, 1 month 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 unified diff | Download patch
« no previous file with comments | « ipc/ipc_channel_nacl.h ('k') | ipc/ipc_message_utils.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ipc/ipc_channel_nacl.h" 5 #include "ipc/ipc_channel_nacl.h"
6 6
7 #include <errno.h> 7 #include <errno.h>
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 #include <sys/types.h> 10 #include <sys/types.h>
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
122 } 122 }
123 } 123 }
124 124
125 ChannelNacl::ChannelNacl(const IPC::ChannelHandle& channel_handle, 125 ChannelNacl::ChannelNacl(const IPC::ChannelHandle& channel_handle,
126 Mode mode, 126 Mode mode,
127 Listener* listener) 127 Listener* listener)
128 : ChannelReader(listener), 128 : ChannelReader(listener),
129 mode_(mode), 129 mode_(mode),
130 waiting_connect_(true), 130 waiting_connect_(true),
131 pipe_(-1), 131 pipe_(-1),
132 pipe_name_(channel_handle.name),
133 weak_ptr_factory_(this) { 132 weak_ptr_factory_(this) {
134 if (!CreatePipe(channel_handle)) { 133 if (!CreatePipe(channel_handle)) {
135 // The pipe may have been closed already. 134 // The pipe may have been closed already.
136 const char *modestr = (mode_ & MODE_SERVER_FLAG) ? "server" : "client"; 135 const char *modestr = (mode_ & MODE_SERVER_FLAG) ? "server" : "client";
137 LOG(WARNING) << "Unable to create pipe named \"" << channel_handle.name 136 LOG(WARNING) << "Unable to create pipe in " << modestr << " mode";
138 << "\" in " << modestr << " mode";
139 } 137 }
140 } 138 }
141 139
142 ChannelNacl::~ChannelNacl() { 140 ChannelNacl::~ChannelNacl() {
143 CleanUp(); 141 CleanUp();
144 Close(); 142 Close();
145 } 143 }
146 144
147 bool ChannelNacl::Connect() { 145 bool ChannelNacl::Connect() {
148 WillConnect(); 146 WillConnect();
149 147
150 if (pipe_ == -1) { 148 if (pipe_ == -1) {
151 DLOG(WARNING) << "Channel creation failed: " << pipe_name_; 149 DLOG(WARNING) << "Channel creation failed";
152 return false; 150 return false;
153 } 151 }
154 152
155 // Note that Connect is called on the "Channel" thread (i.e., the same thread 153 // Note that Connect is called on the "Channel" thread (i.e., the same thread
156 // where Channel::Send will be called, and the same thread that should receive 154 // where Channel::Send will be called, and the same thread that should receive
157 // messages). The constructor might be invoked on another thread (see 155 // messages). The constructor might be invoked on another thread (see
158 // ChannelProxy for an example of that). Therefore, we must wait until Connect 156 // ChannelProxy for an example of that). Therefore, we must wait until Connect
159 // is called to decide which SingleThreadTaskRunner to pass to 157 // is called to decide which SingleThreadTaskRunner to pass to
160 // ReaderThreadRunner. 158 // ReaderThreadRunner.
161 reader_thread_runner_.reset(new ReaderThreadRunner( 159 reader_thread_runner_.reset(new ReaderThreadRunner(
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after
376 374
377 // static 375 // static
378 std::unique_ptr<Channel> Channel::Create( 376 std::unique_ptr<Channel> Channel::Create(
379 const IPC::ChannelHandle& channel_handle, 377 const IPC::ChannelHandle& channel_handle,
380 Mode mode, 378 Mode mode,
381 Listener* listener) { 379 Listener* listener) {
382 return base::WrapUnique(new ChannelNacl(channel_handle, mode, listener)); 380 return base::WrapUnique(new ChannelNacl(channel_handle, mode, listener));
383 } 381 }
384 382
385 } // namespace IPC 383 } // namespace IPC
OLDNEW
« no previous file with comments | « ipc/ipc_channel_nacl.h ('k') | ipc/ipc_message_utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698