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

Unified Diff: chrome/common/message_router.cc

Issue 1625015: Refactor ChildProcess and related classes to create a framework outside of br... (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: Created 10 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 | « chrome/common/message_router.h ('k') | chrome/common/plugin_messages_internal.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/common/message_router.cc
===================================================================
--- chrome/common/message_router.cc (revision 44239)
+++ chrome/common/message_router.cc (working copy)
@@ -1,46 +0,0 @@
-// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "chrome/common/message_router.h"
-
-void MessageRouter::OnControlMessageReceived(const IPC::Message& msg) {
- NOTREACHED() <<
- "should override in subclass if you care about control messages";
-}
-
-bool MessageRouter::Send(IPC::Message* msg) {
- NOTREACHED() <<
- "should override in subclass if you care about sending messages";
- return false;
-}
-
-void MessageRouter::AddRoute(int32 routing_id,
- IPC::Channel::Listener* listener) {
- routes_.AddWithID(listener, routing_id);
-}
-
-void MessageRouter::RemoveRoute(int32 routing_id) {
- routes_.Remove(routing_id);
-}
-
-void MessageRouter::OnMessageReceived(const IPC::Message& msg) {
- if (msg.routing_id() == MSG_ROUTING_CONTROL) {
- OnControlMessageReceived(msg);
- } else {
- RouteMessage(msg);
- }
-}
-
-bool MessageRouter::RouteMessage(const IPC::Message& msg) {
- IPC::Channel::Listener* listener = ResolveRoute(msg.routing_id());
- if (!listener)
- return false;
-
- listener->OnMessageReceived(msg);
- return true;
-}
-
-IPC::Channel::Listener* MessageRouter::ResolveRoute(int32 routing_id) {
- return routes_.Lookup(routing_id);
-}
« no previous file with comments | « chrome/common/message_router.h ('k') | chrome/common/plugin_messages_internal.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698