OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/browser/appcache/appcache_dispatcher_host.h" | 5 #include "content/browser/appcache/appcache_dispatcher_host.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
9 #include "content/browser/appcache/chrome_appcache_service.h" | 9 #include "content/browser/appcache/chrome_appcache_service.h" |
10 #include "content/common/appcache_messages.h" | 10 #include "content/common/appcache_messages.h" |
(...skipping 19 matching lines...) Expand all Loading... |
30 base::Unretained(this)); | 30 base::Unretained(this)); |
31 start_update_callback_ = | 31 start_update_callback_ = |
32 base::Bind(&AppCacheDispatcherHost::StartUpdateCallback, | 32 base::Bind(&AppCacheDispatcherHost::StartUpdateCallback, |
33 base::Unretained(this)); | 33 base::Unretained(this)); |
34 swap_cache_callback_ = | 34 swap_cache_callback_ = |
35 base::Bind(&AppCacheDispatcherHost::SwapCacheCallback, | 35 base::Bind(&AppCacheDispatcherHost::SwapCacheCallback, |
36 base::Unretained(this)); | 36 base::Unretained(this)); |
37 } | 37 } |
38 } | 38 } |
39 | 39 |
40 bool AppCacheDispatcherHost::OnMessageReceived(const IPC::Message& message, | 40 bool AppCacheDispatcherHost::OnMessageReceived(const IPC::Message& message) { |
41 bool* message_was_ok) { | |
42 bool handled = true; | 41 bool handled = true; |
43 IPC_BEGIN_MESSAGE_MAP_EX(AppCacheDispatcherHost, message, *message_was_ok) | 42 IPC_BEGIN_MESSAGE_MAP(AppCacheDispatcherHost, message) |
44 IPC_MESSAGE_HANDLER(AppCacheHostMsg_RegisterHost, OnRegisterHost) | 43 IPC_MESSAGE_HANDLER(AppCacheHostMsg_RegisterHost, OnRegisterHost) |
45 IPC_MESSAGE_HANDLER(AppCacheHostMsg_UnregisterHost, OnUnregisterHost) | 44 IPC_MESSAGE_HANDLER(AppCacheHostMsg_UnregisterHost, OnUnregisterHost) |
46 IPC_MESSAGE_HANDLER(AppCacheHostMsg_SetSpawningHostId, OnSetSpawningHostId) | 45 IPC_MESSAGE_HANDLER(AppCacheHostMsg_SetSpawningHostId, OnSetSpawningHostId) |
47 IPC_MESSAGE_HANDLER(AppCacheHostMsg_GetResourceList, OnGetResourceList) | 46 IPC_MESSAGE_HANDLER(AppCacheHostMsg_GetResourceList, OnGetResourceList) |
48 IPC_MESSAGE_HANDLER(AppCacheHostMsg_SelectCache, OnSelectCache) | 47 IPC_MESSAGE_HANDLER(AppCacheHostMsg_SelectCache, OnSelectCache) |
49 IPC_MESSAGE_HANDLER(AppCacheHostMsg_SelectCacheForWorker, | 48 IPC_MESSAGE_HANDLER(AppCacheHostMsg_SelectCacheForWorker, |
50 OnSelectCacheForWorker) | 49 OnSelectCacheForWorker) |
51 IPC_MESSAGE_HANDLER(AppCacheHostMsg_SelectCacheForSharedWorker, | 50 IPC_MESSAGE_HANDLER(AppCacheHostMsg_SelectCacheForSharedWorker, |
52 OnSelectCacheForSharedWorker) | 51 OnSelectCacheForSharedWorker) |
53 IPC_MESSAGE_HANDLER(AppCacheHostMsg_MarkAsForeignEntry, | 52 IPC_MESSAGE_HANDLER(AppCacheHostMsg_MarkAsForeignEntry, |
54 OnMarkAsForeignEntry) | 53 OnMarkAsForeignEntry) |
55 IPC_MESSAGE_HANDLER_DELAY_REPLY(AppCacheHostMsg_GetStatus, OnGetStatus) | 54 IPC_MESSAGE_HANDLER_DELAY_REPLY(AppCacheHostMsg_GetStatus, OnGetStatus) |
56 IPC_MESSAGE_HANDLER_DELAY_REPLY(AppCacheHostMsg_StartUpdate, OnStartUpdate) | 55 IPC_MESSAGE_HANDLER_DELAY_REPLY(AppCacheHostMsg_StartUpdate, OnStartUpdate) |
57 IPC_MESSAGE_HANDLER_DELAY_REPLY(AppCacheHostMsg_SwapCache, OnSwapCache) | 56 IPC_MESSAGE_HANDLER_DELAY_REPLY(AppCacheHostMsg_SwapCache, OnSwapCache) |
58 IPC_MESSAGE_UNHANDLED(handled = false) | 57 IPC_MESSAGE_UNHANDLED(handled = false) |
59 IPC_END_MESSAGE_MAP_EX() | 58 IPC_END_MESSAGE_MAP() |
60 | 59 |
61 return handled; | 60 return handled; |
62 } | 61 } |
63 | 62 |
64 AppCacheDispatcherHost::~AppCacheDispatcherHost() {} | 63 AppCacheDispatcherHost::~AppCacheDispatcherHost() {} |
65 | 64 |
66 void AppCacheDispatcherHost::BadMessageReceived() { | 65 void AppCacheDispatcherHost::BadMessageReceived() { |
67 RecordAction(base::UserMetricsAction("BadMessageTerminate_ACDH")); | 66 RecordAction(base::UserMetricsAction("BadMessageTerminate_ACDH")); |
68 BrowserMessageFilter::BadMessageReceived(); | 67 BrowserMessageFilter::BadMessageReceived(); |
69 } | 68 } |
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
221 } | 220 } |
222 | 221 |
223 void AppCacheDispatcherHost::SwapCacheCallback(bool result, void* param) { | 222 void AppCacheDispatcherHost::SwapCacheCallback(bool result, void* param) { |
224 IPC::Message* reply_msg = reinterpret_cast<IPC::Message*>(param); | 223 IPC::Message* reply_msg = reinterpret_cast<IPC::Message*>(param); |
225 DCHECK_EQ(pending_reply_msg_.get(), reply_msg); | 224 DCHECK_EQ(pending_reply_msg_.get(), reply_msg); |
226 AppCacheHostMsg_SwapCache::WriteReplyParams(reply_msg, result); | 225 AppCacheHostMsg_SwapCache::WriteReplyParams(reply_msg, result); |
227 Send(pending_reply_msg_.release()); | 226 Send(pending_reply_msg_.release()); |
228 } | 227 } |
229 | 228 |
230 } // namespace content | 229 } // namespace content |
OLD | NEW |