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

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

Issue 285333003: Support exposing Mojo services between render frames, render threads, and their respective hosts. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address comments 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
« no previous file with comments | « content/child/child_thread.h ('k') | content/child/mojo/mojo_application.h » ('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 "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 221 matching lines...) Expand 10 before | Expand all | Expand 10 after
232 IPC::Channel::MODE_CLIENT, 232 IPC::Channel::MODE_CLIENT,
233 this, 233 this,
234 ChildProcess::current()->io_message_loop_proxy(), 234 ChildProcess::current()->io_message_loop_proxy(),
235 true, 235 true,
236 ChildProcess::current()->GetShutDownEvent()); 236 ChildProcess::current()->GetShutDownEvent());
237 #ifdef IPC_MESSAGE_LOG_ENABLED 237 #ifdef IPC_MESSAGE_LOG_ENABLED
238 if (!in_browser_process_) 238 if (!in_browser_process_)
239 IPC::Logging::GetInstance()->SetIPCSender(this); 239 IPC::Logging::GetInstance()->SetIPCSender(this);
240 #endif 240 #endif
241 241
242 mojo_application_.reset(new MojoApplication(this)); 242 mojo_application_.reset(new MojoApplication);
243 243
244 sync_message_filter_ = 244 sync_message_filter_ =
245 new IPC::SyncMessageFilter(ChildProcess::current()->GetShutDownEvent()); 245 new IPC::SyncMessageFilter(ChildProcess::current()->GetShutDownEvent());
246 thread_safe_sender_ = new ThreadSafeSender( 246 thread_safe_sender_ = new ThreadSafeSender(
247 base::MessageLoopProxy::current().get(), sync_message_filter_.get()); 247 base::MessageLoopProxy::current().get(), sync_message_filter_.get());
248 248
249 resource_dispatcher_.reset(new ResourceDispatcher(this)); 249 resource_dispatcher_.reset(new ResourceDispatcher(this));
250 socket_stream_dispatcher_.reset(new SocketStreamDispatcher()); 250 socket_stream_dispatcher_.reset(new SocketStreamDispatcher());
251 websocket_dispatcher_.reset(new WebSocketDispatcher); 251 websocket_dispatcher_.reset(new WebSocketDispatcher);
252 file_system_dispatcher_.reset(new FileSystemDispatcher()); 252 file_system_dispatcher_.reset(new FileSystemDispatcher());
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
363 363
364 void ChildThread::OnChannelConnected(int32 peer_pid) { 364 void ChildThread::OnChannelConnected(int32 peer_pid) {
365 channel_connected_factory_.InvalidateWeakPtrs(); 365 channel_connected_factory_.InvalidateWeakPtrs();
366 } 366 }
367 367
368 void ChildThread::OnChannelError() { 368 void ChildThread::OnChannelError() {
369 set_on_channel_error_called(true); 369 set_on_channel_error_called(true);
370 base::MessageLoop::current()->Quit(); 370 base::MessageLoop::current()->Quit();
371 } 371 }
372 372
373 void ChildThread::ConnectToService(
374 const mojo::String& service_url,
375 const mojo::String& service_name,
376 mojo::ScopedMessagePipeHandle message_pipe,
377 const mojo::String& requestor_url) {
378 // By default, we don't expect incoming connections.
379 NOTREACHED();
380 }
381
382 bool ChildThread::Send(IPC::Message* msg) { 373 bool ChildThread::Send(IPC::Message* msg) {
383 DCHECK(base::MessageLoop::current() == message_loop()); 374 DCHECK(base::MessageLoop::current() == message_loop());
384 if (!channel_) { 375 if (!channel_) {
385 delete msg; 376 delete msg;
386 return false; 377 return false;
387 } 378 }
388 379
389 return channel_->Send(msg); 380 return channel_->Send(msg);
390 } 381 }
391 382
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after
577 base::MessageLoop::current()->SetTimerSlack(timer_slack); 568 base::MessageLoop::current()->SetTimerSlack(timer_slack);
578 569
579 #ifdef OS_WIN 570 #ifdef OS_WIN
580 // Windows Vista+ has a fancy process backgrounding mode that can only be set 571 // Windows Vista+ has a fancy process backgrounding mode that can only be set
581 // from within the process. 572 // from within the process.
582 base::Process::Current().SetProcessBackgrounded(background); 573 base::Process::Current().SetProcessBackgrounded(background);
583 #endif // OS_WIN 574 #endif // OS_WIN
584 } 575 }
585 576
586 } // namespace content 577 } // namespace content
OLDNEW
« no previous file with comments | « content/child/child_thread.h ('k') | content/child/mojo/mojo_application.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698