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

Side by Side Diff: ipc/ipc_channel_proxy.cc

Issue 155944: Switch the first thread in a child process to be the main thread... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: sync Created 11 years, 5 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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 "base/message_loop.h" 5 #include "base/message_loop.h"
6 #include "base/thread.h" 6 #include "base/thread.h"
7 #include "ipc/ipc_channel_proxy.h" 7 #include "ipc/ipc_channel_proxy.h"
8 #include "ipc/ipc_logging.h" 8 #include "ipc/ipc_logging.h"
9 #include "ipc/ipc_message_utils.h" 9 #include "ipc/ipc_message_utils.h"
10 10
(...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after
265 filter->AddRef(); 265 filter->AddRef();
266 context_->ipc_message_loop()->PostTask(FROM_HERE, NewRunnableMethod( 266 context_->ipc_message_loop()->PostTask(FROM_HERE, NewRunnableMethod(
267 context_.get(), &Context::OnAddFilter, filter)); 267 context_.get(), &Context::OnAddFilter, filter));
268 } 268 }
269 269
270 void ChannelProxy::RemoveFilter(MessageFilter* filter) { 270 void ChannelProxy::RemoveFilter(MessageFilter* filter) {
271 context_->ipc_message_loop()->PostTask(FROM_HERE, NewRunnableMethod( 271 context_->ipc_message_loop()->PostTask(FROM_HERE, NewRunnableMethod(
272 context_.get(), &Context::OnRemoveFilter, filter)); 272 context_.get(), &Context::OnRemoveFilter, filter));
273 } 273 }
274 274
275 void ChannelProxy::ClearIPCMessageLoop() {
276 context()->ClearIPCMessageLoop();
277 }
278
275 #if defined(OS_POSIX) 279 #if defined(OS_POSIX)
276 // See the TODO regarding lazy initialization of the channel in 280 // See the TODO regarding lazy initialization of the channel in
277 // ChannelProxy::Init(). 281 // ChannelProxy::Init().
278 // We assume that IPC::Channel::GetClientFileDescriptorMapping() is thread-safe. 282 // We assume that IPC::Channel::GetClientFileDescriptorMapping() is thread-safe.
279 int ChannelProxy::GetClientFileDescriptor() const { 283 int ChannelProxy::GetClientFileDescriptor() const {
280 Channel *channel = context_.get()->channel_; 284 Channel *channel = context_.get()->channel_;
281 DCHECK(channel); // Channel must have been created first. 285 DCHECK(channel); // Channel must have been created first.
282 return channel->GetClientFileDescriptor(); 286 return channel->GetClientFileDescriptor();
283 } 287 }
284 #endif 288 #endif
285 289
286 //----------------------------------------------------------------------------- 290 //-----------------------------------------------------------------------------
287 291
288 } // namespace IPC 292 } // namespace IPC
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698