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

Unified Diff: ipc/ipc_forwarding_message_filter.cc

Issue 1244013002: Remove ForwardingMessageFilter. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove from build files and an unused include. Created 5 years, 5 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 | « ipc/ipc_forwarding_message_filter.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ipc/ipc_forwarding_message_filter.cc
diff --git a/ipc/ipc_forwarding_message_filter.cc b/ipc/ipc_forwarding_message_filter.cc
deleted file mode 100644
index 9857bdf67dcde3b952b733dc46404162678244eb..0000000000000000000000000000000000000000
--- a/ipc/ipc_forwarding_message_filter.cc
+++ /dev/null
@@ -1,57 +0,0 @@
-// Copyright (c) 2012 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 "ipc/ipc_forwarding_message_filter.h"
-
-#include "base/bind.h"
-#include "base/location.h"
-#include "ipc/ipc_message.h"
-
-namespace IPC {
-
-ForwardingMessageFilter::ForwardingMessageFilter(
- const uint32* message_ids_to_filter,
- size_t num_message_ids_to_filter,
- base::TaskRunner* target_task_runner)
- : target_task_runner_(target_task_runner) {
- DCHECK(target_task_runner_.get());
- for (size_t i = 0; i < num_message_ids_to_filter; i++)
- message_ids_to_filter_.insert(message_ids_to_filter[i]);
-}
-
-void ForwardingMessageFilter::AddRoute(int routing_id, const Handler& handler) {
- DCHECK(!handler.is_null());
- base::AutoLock locked(handlers_lock_);
- handlers_.insert(std::make_pair(routing_id, handler));
-}
-
-void ForwardingMessageFilter::RemoveRoute(int routing_id) {
- base::AutoLock locked(handlers_lock_);
- handlers_.erase(routing_id);
-}
-
-bool ForwardingMessageFilter::OnMessageReceived(const Message& message) {
- if (message_ids_to_filter_.find(message.type()) ==
- message_ids_to_filter_.end())
- return false;
-
-
- Handler handler;
-
- {
- base::AutoLock locked(handlers_lock_);
- std::map<int, Handler>::iterator it = handlers_.find(message.routing_id());
- if (it == handlers_.end())
- return false;
- handler = it->second;
- }
-
- target_task_runner_->PostTask(FROM_HERE, base::Bind(handler, message));
- return true;
-}
-
-ForwardingMessageFilter::~ForwardingMessageFilter() {
-}
-
-} // namespace IPC
« no previous file with comments | « ipc/ipc_forwarding_message_filter.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698