| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 "chrome/common/appcache/appcache_dispatcher_host.h" | 5 #include "chrome/common/appcache/appcache_dispatcher_host.h" |
| 6 | 6 |
| 7 #include "chrome/common/appcache/chrome_appcache_service.h" | 7 #include "chrome/common/appcache/chrome_appcache_service.h" |
| 8 #include "chrome/common/render_messages.h" | 8 #include "chrome/common/render_messages.h" |
| 9 | 9 |
| 10 AppCacheDispatcherHost::AppCacheDispatcherHost( | 10 AppCacheDispatcherHost::AppCacheDispatcherHost( |
| (...skipping 28 matching lines...) Expand all Loading... |
| 39 IPC_MESSAGE_HANDLER(AppCacheMsg_SelectCache, OnSelectCache); | 39 IPC_MESSAGE_HANDLER(AppCacheMsg_SelectCache, OnSelectCache); |
| 40 IPC_MESSAGE_HANDLER(AppCacheMsg_MarkAsForeignEntry, OnMarkAsForeignEntry); | 40 IPC_MESSAGE_HANDLER(AppCacheMsg_MarkAsForeignEntry, OnMarkAsForeignEntry); |
| 41 IPC_MESSAGE_HANDLER_DELAY_REPLY(AppCacheMsg_GetStatus, OnGetStatus); | 41 IPC_MESSAGE_HANDLER_DELAY_REPLY(AppCacheMsg_GetStatus, OnGetStatus); |
| 42 IPC_MESSAGE_HANDLER_DELAY_REPLY(AppCacheMsg_StartUpdate, OnStartUpdate); | 42 IPC_MESSAGE_HANDLER_DELAY_REPLY(AppCacheMsg_StartUpdate, OnStartUpdate); |
| 43 IPC_MESSAGE_HANDLER_DELAY_REPLY(AppCacheMsg_SwapCache, OnSwapCache); | 43 IPC_MESSAGE_HANDLER_DELAY_REPLY(AppCacheMsg_SwapCache, OnSwapCache); |
| 44 IPC_MESSAGE_UNHANDLED(handled = false) | 44 IPC_MESSAGE_UNHANDLED(handled = false) |
| 45 IPC_END_MESSAGE_MAP_EX() | 45 IPC_END_MESSAGE_MAP_EX() |
| 46 return handled; | 46 return handled; |
| 47 } | 47 } |
| 48 | 48 |
| 49 // TODO(michaeln): Handle the invalid host id error condition, probably |
| 50 // terminate the child process. |
| 51 |
| 49 void AppCacheDispatcherHost::OnRegisterHost(int host_id) { | 52 void AppCacheDispatcherHost::OnRegisterHost(int host_id) { |
| 50 if (appcache_service_.get()) | 53 if (appcache_service_.get()) |
| 51 backend_impl_.RegisterHost(host_id); | 54 backend_impl_.RegisterHost(host_id); |
| 52 } | 55 } |
| 53 | 56 |
| 54 void AppCacheDispatcherHost::OnUnregisterHost(int host_id) { | 57 void AppCacheDispatcherHost::OnUnregisterHost(int host_id) { |
| 55 if (appcache_service_.get()) | 58 if (appcache_service_.get()) |
| 56 backend_impl_.UnregisterHost(host_id); | 59 backend_impl_.UnregisterHost(host_id); |
| 57 } | 60 } |
| 58 | 61 |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 115 IPC::Message* reply_msg = reinterpret_cast<IPC::Message*>(param); | 118 IPC::Message* reply_msg = reinterpret_cast<IPC::Message*>(param); |
| 116 AppCacheMsg_StartUpdate::WriteReplyParams(reply_msg, result); | 119 AppCacheMsg_StartUpdate::WriteReplyParams(reply_msg, result); |
| 117 frontend_proxy_.sender()->Send(reply_msg); | 120 frontend_proxy_.sender()->Send(reply_msg); |
| 118 } | 121 } |
| 119 | 122 |
| 120 void AppCacheDispatcherHost::SwapCacheCallback(bool result, void* param) { | 123 void AppCacheDispatcherHost::SwapCacheCallback(bool result, void* param) { |
| 121 IPC::Message* reply_msg = reinterpret_cast<IPC::Message*>(param); | 124 IPC::Message* reply_msg = reinterpret_cast<IPC::Message*>(param); |
| 122 AppCacheMsg_SwapCache::WriteReplyParams(reply_msg, result); | 125 AppCacheMsg_SwapCache::WriteReplyParams(reply_msg, result); |
| 123 frontend_proxy_.sender()->Send(reply_msg); | 126 frontend_proxy_.sender()->Send(reply_msg); |
| 124 } | 127 } |
| OLD | NEW |