LCOV - app.info - ipc/chromium/src/chrome/common/message_router.cc

LCOV - code coverage report
| Current view: | directory - ipc/chromium/src/chrome/common - message_router.cc (source / functions) |  | Found | Hit | Coverage |
| Test: | app.info | Lines: | 25 | 0 | 0.0 %
| Date: | 2012-06-02 | Functions: | 6 | 0 | 0.0 %

           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
           3                 : // found in the LICENSE file.
           4                 :
           5                 : #include "chrome/common/message_router.h"
           6                 :
           7               0 : void MessageRouter::OnControlMessageReceived(const IPC::Message& msg) {
           8               0 :   NOTREACHED() <<
           9               0 :       "should override in subclass if you care about control messages";
          10               0 : }
          11                 :
          12               0 : bool MessageRouter::Send(IPC::Message* msg) {
          13               0 :   NOTREACHED() <<
          14               0 :       "should override in subclass if you care about sending messages";
          15               0 :   return false;
          16                 : }
          17                 :
          18               0 : void MessageRouter::AddRoute(int32 routing_id,
          19                 :                              IPC::Channel::Listener* listener) {
          20               0 :   routes_.AddWithID(listener, routing_id);
          21               0 : }
          22                 :
          23               0 : void MessageRouter::RemoveRoute(int32 routing_id) {
          24               0 :   routes_.Remove(routing_id);
          25               0 : }
          26                 :
          27               0 : void MessageRouter::OnMessageReceived(const IPC::Message& msg) {
          28               0 :   if (msg.routing_id() == MSG_ROUTING_CONTROL) {
          29               0 :     OnControlMessageReceived(msg);
          30                 :   } else {
          31               0 :     RouteMessage(msg);
          32                 :   }
          33               0 : }
          34                 :
          35               0 : bool MessageRouter::RouteMessage(const IPC::Message& msg) {
          36               0 :   IPC::Channel::Listener* listener = routes_.Lookup(msg.routing_id());
          37               0 :   if (!listener)
          38               0 :     return false;
          39                 :
          40               0 :   listener->OnMessageReceived(msg);
          41               0 :   return true;
          42                 : }

Generated by: LCOV version 1.7