Index: content/child/geofencing/geofencing_message_filter.cc |
diff --git a/content/child/geofencing/geofencing_message_filter.cc b/content/child/geofencing/geofencing_message_filter.cc |
index a8334571d5b4f20eb6ca13f3724c760680ddd31b..a866b378f395bf35992b4b2bd8b9903a63468f2e 100644 |
--- a/content/child/geofencing/geofencing_message_filter.cc |
+++ b/content/child/geofencing/geofencing_message_filter.cc |
@@ -4,40 +4,33 @@ |
#include "content/child/geofencing/geofencing_message_filter.h" |
-#include "base/message_loop/message_loop_proxy.h" |
#include "content/child/geofencing/geofencing_dispatcher.h" |
-#include "content/child/thread_safe_sender.h" |
-#include "content/child/worker_thread_task_runner.h" |
#include "ipc/ipc_message_macros.h" |
namespace content { |
GeofencingMessageFilter::GeofencingMessageFilter(ThreadSafeSender* sender) |
- : main_thread_loop_proxy_(base::MessageLoopProxy::current()), |
- thread_safe_sender_(sender) { |
+ : WorkerThreadMessageFilter(sender) { |
} |
GeofencingMessageFilter::~GeofencingMessageFilter() { |
} |
-base::TaskRunner* GeofencingMessageFilter::OverrideTaskRunnerForMessage( |
+bool GeofencingMessageFilter::ShouldHandleMessage( |
+ const IPC::Message& msg) const { |
+ return IPC_MESSAGE_CLASS(msg) == GeofencingMsgStart; |
+} |
+ |
+void GeofencingMessageFilter::OnFilteredMessageReceived( |
const IPC::Message& msg) { |
- if (IPC_MESSAGE_CLASS(msg) != GeofencingMsgStart) |
- return NULL; |
- int ipc_thread_id = 0; |
- const bool success = PickleIterator(msg).ReadInt(&ipc_thread_id); |
- DCHECK(success); |
- if (!ipc_thread_id) |
- return main_thread_loop_proxy_.get(); |
- return new WorkerThreadTaskRunner(ipc_thread_id); |
+ GeofencingDispatcher::GetOrCreateThreadSpecificInstance(thread_safe_sender()) |
+ ->OnMessageReceived(msg); |
} |
-bool GeofencingMessageFilter::OnMessageReceived(const IPC::Message& msg) { |
- if (IPC_MESSAGE_CLASS(msg) != GeofencingMsgStart) |
- return false; |
- GeofencingDispatcher::GetOrCreateThreadSpecificInstance( |
- thread_safe_sender_.get())->OnMessageReceived(msg); |
- return true; |
+bool GeofencingMessageFilter::GetWorkerThreadIdForMessage( |
+ const IPC::Message& msg, |
+ int* ipc_thread_id) { |
+ return PickleIterator(msg).ReadInt(ipc_thread_id); |
} |
} // namespace content |