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

Unified Diff: content/child/child_thread.cc

Issue 236813002: Move Mojo channel initialization closer to IPC::Channel setup (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: more missing deps Created 6 years, 8 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 | « content/child/child_thread.h ('k') | content/child/mojo/mojo_application.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/child/child_thread.cc
diff --git a/content/child/child_thread.cc b/content/child/child_thread.cc
index 72be9fba30678ed1e49a9cec6b18d4e0166d84e0..4bced8c0817645f138a7ca674f99d9e1b142f069 100644
--- a/content/child/child_thread.cc
+++ b/content/child/child_thread.cc
@@ -29,6 +29,7 @@
#include "content/child/child_resource_message_filter.h"
#include "content/child/child_shared_bitmap_manager.h"
#include "content/child/fileapi/file_system_dispatcher.h"
+#include "content/child/mojo/mojo_application.h"
#include "content/child/power_monitor_broadcast_source.h"
#include "content/child/quota_dispatcher.h"
#include "content/child/quota_message_filter.h"
@@ -236,6 +237,8 @@ void ChildThread::Init() {
IPC::Logging::GetInstance()->SetIPCSender(this);
#endif
+ mojo_application_.reset(new MojoApplication(this));
+
sync_message_filter_ =
new IPC::SyncMessageFilter(ChildProcess::current()->GetShutDownEvent());
thread_safe_sender_ = new ThreadSafeSender(
@@ -349,6 +352,13 @@ void ChildThread::OnChannelError() {
base::MessageLoop::current()->Quit();
}
+void ChildThread::AcceptConnection(
+ const mojo::String& service_name,
+ mojo::ScopedMessagePipeHandle message_pipe) {
+ // By default, we don't expect incoming connections.
+ NOTREACHED();
+}
+
bool ChildThread::Send(IPC::Message* msg) {
DCHECK(base::MessageLoop::current() == message_loop());
if (!channel_) {
@@ -409,6 +419,9 @@ base::SharedMemory* ChildThread::AllocateSharedMemory(
}
bool ChildThread::OnMessageReceived(const IPC::Message& msg) {
+ if (mojo_application_->OnMessageReceived(msg))
+ return true;
+
// Resource responses are sent to the resource dispatcher.
if (resource_dispatcher_->OnMessageReceived(msg))
return true;
« 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