OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "content/renderer/service_worker/cache_storage_message_filter.h" | 5 #include "content/renderer/cache_storage/cache_storage_message_filter.h" |
6 | 6 |
7 #include "content/child/thread_safe_sender.h" | 7 #include "content/child/thread_safe_sender.h" |
8 #include "content/common/service_worker/cache_storage_messages.h" | 8 #include "content/common/cache_storage/cache_storage_messages.h" |
9 #include "content/renderer/service_worker/service_worker_cache_storage_dispatche
r.h" | 9 #include "content/renderer/cache_storage/cache_storage_dispatcher.h" |
10 | 10 |
11 namespace content { | 11 namespace content { |
12 | 12 |
13 CacheStorageMessageFilter::CacheStorageMessageFilter( | 13 CacheStorageMessageFilter::CacheStorageMessageFilter( |
14 ThreadSafeSender* thread_safe_sender) | 14 ThreadSafeSender* thread_safe_sender) |
15 : WorkerThreadMessageFilter(thread_safe_sender) { | 15 : WorkerThreadMessageFilter(thread_safe_sender) { |
16 } | 16 } |
17 | 17 |
18 CacheStorageMessageFilter::~CacheStorageMessageFilter() { | 18 CacheStorageMessageFilter::~CacheStorageMessageFilter() { |
19 } | 19 } |
20 | 20 |
21 bool CacheStorageMessageFilter::ShouldHandleMessage( | 21 bool CacheStorageMessageFilter::ShouldHandleMessage( |
22 const IPC::Message& msg) const { | 22 const IPC::Message& msg) const { |
23 return IPC_MESSAGE_CLASS(msg) == CacheStorageMsgStart; | 23 return IPC_MESSAGE_CLASS(msg) == CacheStorageMsgStart; |
24 } | 24 } |
25 | 25 |
26 void CacheStorageMessageFilter::OnFilteredMessageReceived( | 26 void CacheStorageMessageFilter::OnFilteredMessageReceived( |
27 const IPC::Message& msg) { | 27 const IPC::Message& msg) { |
28 ServiceWorkerCacheStorageDispatcher::ThreadSpecificInstance( | 28 CacheStorageDispatcher::ThreadSpecificInstance(thread_safe_sender()) |
29 thread_safe_sender())->OnMessageReceived(msg); | 29 ->OnMessageReceived(msg); |
30 } | 30 } |
31 | 31 |
32 bool CacheStorageMessageFilter::GetWorkerThreadIdForMessage( | 32 bool CacheStorageMessageFilter::GetWorkerThreadIdForMessage( |
33 const IPC::Message& msg, | 33 const IPC::Message& msg, |
34 int* ipc_thread_id) { | 34 int* ipc_thread_id) { |
35 return PickleIterator(msg).ReadInt(ipc_thread_id); | 35 return PickleIterator(msg).ReadInt(ipc_thread_id); |
36 } | 36 } |
37 | 37 |
38 } // namespace content | 38 } // namespace content |
OLD | NEW |