OLD | NEW |
| (Empty) |
1 // Copyright 2014 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 "content/child/geofencing/geofencing_message_filter.h" | |
6 | |
7 #include "content/child/geofencing/geofencing_dispatcher.h" | |
8 #include "ipc/ipc_message_macros.h" | |
9 | |
10 namespace content { | |
11 | |
12 GeofencingMessageFilter::GeofencingMessageFilter(ThreadSafeSender* sender) | |
13 : WorkerThreadMessageFilter(sender) { | |
14 } | |
15 | |
16 GeofencingMessageFilter::~GeofencingMessageFilter() { | |
17 } | |
18 | |
19 bool GeofencingMessageFilter::ShouldHandleMessage( | |
20 const IPC::Message& msg) const { | |
21 return IPC_MESSAGE_CLASS(msg) == GeofencingMsgStart; | |
22 } | |
23 | |
24 void GeofencingMessageFilter::OnFilteredMessageReceived( | |
25 const IPC::Message& msg) { | |
26 GeofencingDispatcher::GetOrCreateThreadSpecificInstance(thread_safe_sender()) | |
27 ->OnMessageReceived(msg); | |
28 } | |
29 | |
30 bool GeofencingMessageFilter::GetWorkerThreadIdForMessage( | |
31 const IPC::Message& msg, | |
32 int* ipc_thread_id) { | |
33 return base::PickleIterator(msg).ReadInt(ipc_thread_id); | |
34 } | |
35 | |
36 } // namespace content | |
OLD | NEW |