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

Side by Side Diff: content/child/child_thread.cc

Issue 310853003: Add IPC::ChannelProxy::Create() and IPC::SyncChannel::Create() (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Landing Created 6 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 unified diff | Download patch | Annotate | Revision Log
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 "content/child/child_thread.h" 5 #include "content/child/child_thread.h"
6 6
7 #include <signal.h> 7 #include <signal.h>
8 8
9 #include <string> 9 #include <string>
10 10
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after
218 void ChildThread::Init() { 218 void ChildThread::Init() {
219 g_lazy_tls.Pointer()->Set(this); 219 g_lazy_tls.Pointer()->Set(this);
220 on_channel_error_called_ = false; 220 on_channel_error_called_ = false;
221 message_loop_ = base::MessageLoop::current(); 221 message_loop_ = base::MessageLoop::current();
222 #ifdef IPC_MESSAGE_LOG_ENABLED 222 #ifdef IPC_MESSAGE_LOG_ENABLED
223 // We must make sure to instantiate the IPC Logger *before* we create the 223 // We must make sure to instantiate the IPC Logger *before* we create the
224 // channel, otherwise we can get a callback on the IO thread which creates 224 // channel, otherwise we can get a callback on the IO thread which creates
225 // the logger, and the logger does not like being created on the IO thread. 225 // the logger, and the logger does not like being created on the IO thread.
226 IPC::Logging::GetInstance(); 226 IPC::Logging::GetInstance();
227 #endif 227 #endif
228 channel_.reset( 228 channel_ =
229 new IPC::SyncChannel(channel_name_, 229 IPC::SyncChannel::Create(channel_name_,
230 IPC::Channel::MODE_CLIENT, 230 IPC::Channel::MODE_CLIENT,
231 this, 231 this,
232 ChildProcess::current()->io_message_loop_proxy(), 232 ChildProcess::current()->io_message_loop_proxy(),
233 true, 233 true,
234 ChildProcess::current()->GetShutDownEvent())); 234 ChildProcess::current()->GetShutDownEvent());
235 #ifdef IPC_MESSAGE_LOG_ENABLED 235 #ifdef IPC_MESSAGE_LOG_ENABLED
236 if (!in_browser_process_) 236 if (!in_browser_process_)
237 IPC::Logging::GetInstance()->SetIPCSender(this); 237 IPC::Logging::GetInstance()->SetIPCSender(this);
238 #endif 238 #endif
239 239
240 mojo_application_.reset(new MojoApplication(this)); 240 mojo_application_.reset(new MojoApplication(this));
241 241
242 sync_message_filter_ = 242 sync_message_filter_ =
243 new IPC::SyncMessageFilter(ChildProcess::current()->GetShutDownEvent()); 243 new IPC::SyncMessageFilter(ChildProcess::current()->GetShutDownEvent());
244 thread_safe_sender_ = new ThreadSafeSender( 244 thread_safe_sender_ = new ThreadSafeSender(
(...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after
553 base::KillProcess(base::GetCurrentProcessHandle(), 0, false); 553 base::KillProcess(base::GetCurrentProcessHandle(), 0, false);
554 } 554 }
555 555
556 #if defined(OS_WIN) 556 #if defined(OS_WIN)
557 void ChildThread::OnProcessBackgrounded(bool background) { 557 void ChildThread::OnProcessBackgrounded(bool background) {
558 base::Process::Current().SetProcessBackgrounded(background); 558 base::Process::Current().SetProcessBackgrounded(background);
559 } 559 }
560 #endif 560 #endif
561 561
562 } // namespace content 562 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/renderer_host/render_process_host_impl.cc ('k') | content/child/npapi/np_channel_base.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698