OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/child/appcache/appcache_dispatcher.h" | 5 #include "content/child/appcache/appcache_dispatcher.h" |
6 | 6 |
7 #include "content/common/appcache_messages.h" | 7 #include "content/common/appcache_messages.h" |
8 | 8 |
9 namespace content { | 9 namespace content { |
10 | 10 |
11 AppCacheDispatcher::AppCacheDispatcher( | 11 AppCacheDispatcher::AppCacheDispatcher( |
12 IPC::Sender* sender, | 12 IPC::Sender* sender, |
13 appcache::AppCacheFrontend* frontend) | 13 appcache::AppCacheFrontend* frontend) |
14 : backend_proxy_(sender), | 14 : backend_proxy_(sender), |
15 frontend_(frontend) {} | 15 frontend_(frontend) {} |
16 | 16 |
17 AppCacheDispatcher::~AppCacheDispatcher() {} | 17 AppCacheDispatcher::~AppCacheDispatcher() {} |
18 | 18 |
19 bool AppCacheDispatcher::OnMessageReceived(const IPC::Message& msg) { | 19 bool AppCacheDispatcher::OnMessageReceived(const IPC::Message& msg) { |
20 bool handled = true; | 20 bool handled = true; |
21 IPC_BEGIN_MESSAGE_MAP(AppCacheDispatcher, msg) | 21 IPC_BEGIN_MESSAGE_MAP(AppCacheDispatcher, msg) |
22 IPC_MESSAGE_HANDLER(AppCacheMsg_CacheSelected, OnCacheSelected) | 22 IPC_MESSAGE_HANDLER(AppCacheMsg_CacheSelected, OnCacheSelected) |
23 IPC_MESSAGE_HANDLER(AppCacheMsg_StatusChanged, OnStatusChanged) | 23 IPC_MESSAGE_HANDLER(AppCacheMsg_StatusChanged, OnStatusChanged) |
24 IPC_MESSAGE_HANDLER(AppCacheMsg_EventRaised, OnEventRaised) | 24 IPC_MESSAGE_HANDLER(AppCacheMsg_EventRaised, OnEventRaised) |
25 IPC_MESSAGE_HANDLER(AppCacheMsg_ProgressEventRaised, OnProgressEventRaised) | 25 IPC_MESSAGE_HANDLER(AppCacheMsg_ProgressEventRaised, OnProgressEventRaised) |
26 IPC_MESSAGE_HANDLER(AppCacheMsg_ErrorEventRaised, OnErrorEventRaised) | 26 IPC_MESSAGE_HANDLER(AppCacheMsg_ErrorEventRaised, OnErrorEventRaised) |
27 IPC_MESSAGE_HANDLER(AppCacheMsg_LogMessage, OnLogMessage) | 27 IPC_MESSAGE_HANDLER(AppCacheMsg_LogMessage, OnLogMessage) |
28 IPC_MESSAGE_HANDLER(AppCacheMsg_ContentBlocked, OnContentBlocked) | 28 IPC_MESSAGE_HANDLER(AppCacheMsg_ContentBlocked, OnContentBlocked) |
| 29 IPC_MESSAGE_HANDLER(AppCacheMsg_ControllerReady, OnControllerReady) |
29 IPC_MESSAGE_UNHANDLED(handled = false) | 30 IPC_MESSAGE_UNHANDLED(handled = false) |
30 IPC_END_MESSAGE_MAP() | 31 IPC_END_MESSAGE_MAP() |
31 return handled; | 32 return handled; |
32 } | 33 } |
33 | 34 |
34 void AppCacheDispatcher::OnCacheSelected( | 35 void AppCacheDispatcher::OnCacheSelected( |
35 int host_id, const appcache::AppCacheInfo& info) { | 36 int host_id, const appcache::AppCacheInfo& info) { |
36 frontend_->OnCacheSelected(host_id, info); | 37 frontend_->OnCacheSelected(host_id, info); |
37 } | 38 } |
38 | 39 |
(...skipping 23 matching lines...) Expand all Loading... |
62 int host_id, int log_level, const std::string& message) { | 63 int host_id, int log_level, const std::string& message) { |
63 frontend_->OnLogMessage( | 64 frontend_->OnLogMessage( |
64 host_id, static_cast<appcache::LogLevel>(log_level), message); | 65 host_id, static_cast<appcache::LogLevel>(log_level), message); |
65 } | 66 } |
66 | 67 |
67 void AppCacheDispatcher::OnContentBlocked(int host_id, | 68 void AppCacheDispatcher::OnContentBlocked(int host_id, |
68 const GURL& manifest_url) { | 69 const GURL& manifest_url) { |
69 frontend_->OnContentBlocked(host_id, manifest_url); | 70 frontend_->OnContentBlocked(host_id, manifest_url); |
70 } | 71 } |
71 | 72 |
| 73 void AppCacheDispatcher::OnControllerReady(int host_id) { |
| 74 frontend_->OnControllerReady(host_id); |
| 75 } |
| 76 |
72 } // namespace content | 77 } // namespace content |
OLD | NEW |