| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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.h" | 5 #include "chrome/common/appcache/appcache_dispatcher.h" |
| 6 | 6 |
| 7 #include "chrome/common/render_messages.h" | 7 #include "chrome/common/render_messages.h" |
| 8 #include "webkit/appcache/web_application_cache_host_impl.h" | 8 #include "webkit/appcache/web_application_cache_host_impl.h" |
| 9 | 9 |
| 10 bool AppCacheDispatcher::OnMessageReceived(const IPC::Message& msg) { | 10 bool AppCacheDispatcher::OnMessageReceived(const IPC::Message& msg) { |
| 11 bool handled = true; | 11 bool handled = true; |
| 12 IPC_BEGIN_MESSAGE_MAP(AppCacheDispatcher, msg) | 12 IPC_BEGIN_MESSAGE_MAP(AppCacheDispatcher, msg) |
| 13 IPC_MESSAGE_HANDLER(AppCacheMsg_CacheSelected, OnCacheSelected) | 13 IPC_MESSAGE_HANDLER(AppCacheMsg_CacheSelected, OnCacheSelected) |
| 14 IPC_MESSAGE_HANDLER(AppCacheMsg_StatusChanged, OnStatusChanged) | 14 IPC_MESSAGE_HANDLER(AppCacheMsg_StatusChanged, OnStatusChanged) |
| 15 IPC_MESSAGE_HANDLER(AppCacheMsg_EventRaised, OnEventRaised) | 15 IPC_MESSAGE_HANDLER(AppCacheMsg_EventRaised, OnEventRaised) |
| 16 IPC_MESSAGE_HANDLER(AppCacheMsg_ProgressEventRaised, OnProgressEventRaised) | 16 IPC_MESSAGE_HANDLER(AppCacheMsg_ProgressEventRaised, OnProgressEventRaised) |
| 17 IPC_MESSAGE_HANDLER(AppCacheMsg_ErrorEventRaised, OnErrorEventRaised) |
| 17 IPC_MESSAGE_HANDLER(AppCacheMsg_LogMessage, OnLogMessage) | 18 IPC_MESSAGE_HANDLER(AppCacheMsg_LogMessage, OnLogMessage) |
| 18 IPC_MESSAGE_HANDLER(AppCacheMsg_ContentBlocked, OnContentBlocked) | 19 IPC_MESSAGE_HANDLER(AppCacheMsg_ContentBlocked, OnContentBlocked) |
| 19 IPC_MESSAGE_UNHANDLED(handled = false) | 20 IPC_MESSAGE_UNHANDLED(handled = false) |
| 20 IPC_END_MESSAGE_MAP() | 21 IPC_END_MESSAGE_MAP() |
| 21 return handled; | 22 return handled; |
| 22 } | 23 } |
| 23 | 24 |
| 24 void AppCacheDispatcher::OnCacheSelected(int host_id, int64 cache_id, | 25 void AppCacheDispatcher::OnCacheSelected(int host_id, int64 cache_id, |
| 25 appcache::Status status) { | 26 appcache::Status status) { |
| 26 frontend_impl_.OnCacheSelected(host_id, cache_id, status); | 27 frontend_impl_.OnCacheSelected(host_id, cache_id, status); |
| 27 } | 28 } |
| 28 | 29 |
| 29 void AppCacheDispatcher::OnStatusChanged(const std::vector<int>& host_ids, | 30 void AppCacheDispatcher::OnStatusChanged(const std::vector<int>& host_ids, |
| 30 appcache::Status status) { | 31 appcache::Status status) { |
| 31 frontend_impl_.OnStatusChanged(host_ids, status); | 32 frontend_impl_.OnStatusChanged(host_ids, status); |
| 32 } | 33 } |
| 33 | 34 |
| 34 void AppCacheDispatcher::OnEventRaised(const std::vector<int>& host_ids, | 35 void AppCacheDispatcher::OnEventRaised(const std::vector<int>& host_ids, |
| 35 appcache::EventID event_id) { | 36 appcache::EventID event_id) { |
| 36 frontend_impl_.OnEventRaised(host_ids, event_id); | 37 frontend_impl_.OnEventRaised(host_ids, event_id); |
| 37 } | 38 } |
| 38 | 39 |
| 39 void AppCacheDispatcher::OnProgressEventRaised( | 40 void AppCacheDispatcher::OnProgressEventRaised( |
| 40 const std::vector<int>& host_ids, | 41 const std::vector<int>& host_ids, |
| 41 const GURL& url, int num_total, int num_complete) { | 42 const GURL& url, int num_total, int num_complete) { |
| 42 frontend_impl_.OnProgressEventRaised(host_ids, url, num_total, num_complete); | 43 frontend_impl_.OnProgressEventRaised(host_ids, url, num_total, num_complete); |
| 43 } | 44 } |
| 44 | 45 |
| 46 void AppCacheDispatcher::OnErrorEventRaised( |
| 47 const std::vector<int>& host_ids, |
| 48 const std::string& message) { |
| 49 frontend_impl_.OnErrorEventRaised(host_ids, message); |
| 50 } |
| 51 |
| 45 void AppCacheDispatcher::OnLogMessage( | 52 void AppCacheDispatcher::OnLogMessage( |
| 46 int host_id, int log_level, const std::string& message) { | 53 int host_id, int log_level, const std::string& message) { |
| 47 frontend_impl_.OnLogMessage( | 54 frontend_impl_.OnLogMessage( |
| 48 host_id, static_cast<appcache::LogLevel>(log_level), message); | 55 host_id, static_cast<appcache::LogLevel>(log_level), message); |
| 49 } | 56 } |
| 50 | 57 |
| 51 void AppCacheDispatcher::OnContentBlocked(int host_id, | 58 void AppCacheDispatcher::OnContentBlocked(int host_id, |
| 52 const GURL& manifest_url) { | 59 const GURL& manifest_url) { |
| 53 frontend_impl_.OnContentBlocked(host_id, manifest_url); | 60 frontend_impl_.OnContentBlocked(host_id, manifest_url); |
| 54 } | 61 } |
| OLD | NEW |