| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_frontend_proxy.h" | 5 #include "content/browser/appcache/appcache_frontend_proxy.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 AppCacheFrontendProxy::AppCacheFrontendProxy(IPC::Sender* sender) | 11 AppCacheFrontendProxy::AppCacheFrontendProxy(IPC::Sender* sender) |
| 12 : sender_(sender) { | 12 : sender_(sender) { |
| 13 } | 13 } |
| 14 | 14 |
| 15 void AppCacheFrontendProxy::OnCacheSelected( | 15 void AppCacheFrontendProxy::OnCacheSelected( |
| 16 int host_id, const appcache::AppCacheInfo& info) { | 16 int host_id, const AppCacheInfo& info) { |
| 17 sender_->Send(new AppCacheMsg_CacheSelected(host_id, info)); | 17 sender_->Send(new AppCacheMsg_CacheSelected(host_id, info)); |
| 18 } | 18 } |
| 19 | 19 |
| 20 void AppCacheFrontendProxy::OnStatusChanged(const std::vector<int>& host_ids, | 20 void AppCacheFrontendProxy::OnStatusChanged(const std::vector<int>& host_ids, |
| 21 appcache::AppCacheStatus status) { | 21 AppCacheStatus status) { |
| 22 sender_->Send(new AppCacheMsg_StatusChanged(host_ids, status)); | 22 sender_->Send(new AppCacheMsg_StatusChanged(host_ids, status)); |
| 23 } | 23 } |
| 24 | 24 |
| 25 void AppCacheFrontendProxy::OnEventRaised(const std::vector<int>& host_ids, | 25 void AppCacheFrontendProxy::OnEventRaised(const std::vector<int>& host_ids, |
| 26 appcache::AppCacheEventID event_id) { | 26 AppCacheEventID event_id) { |
| 27 DCHECK_NE(appcache::APPCACHE_PROGRESS_EVENT, | 27 DCHECK_NE(APPCACHE_PROGRESS_EVENT, |
| 28 event_id); // See OnProgressEventRaised. | 28 event_id); // See OnProgressEventRaised. |
| 29 sender_->Send(new AppCacheMsg_EventRaised(host_ids, event_id)); | 29 sender_->Send(new AppCacheMsg_EventRaised(host_ids, event_id)); |
| 30 } | 30 } |
| 31 | 31 |
| 32 void AppCacheFrontendProxy::OnProgressEventRaised( | 32 void AppCacheFrontendProxy::OnProgressEventRaised( |
| 33 const std::vector<int>& host_ids, | 33 const std::vector<int>& host_ids, |
| 34 const GURL& url, int num_total, int num_complete) { | 34 const GURL& url, int num_total, int num_complete) { |
| 35 sender_->Send(new AppCacheMsg_ProgressEventRaised( | 35 sender_->Send(new AppCacheMsg_ProgressEventRaised( |
| 36 host_ids, url, num_total, num_complete)); | 36 host_ids, url, num_total, num_complete)); |
| 37 } | 37 } |
| 38 | 38 |
| 39 void AppCacheFrontendProxy::OnErrorEventRaised( | 39 void AppCacheFrontendProxy::OnErrorEventRaised( |
| 40 const std::vector<int>& host_ids, | 40 const std::vector<int>& host_ids, |
| 41 const appcache::AppCacheErrorDetails& details) { | 41 const AppCacheErrorDetails& details) { |
| 42 sender_->Send(new AppCacheMsg_ErrorEventRaised(host_ids, details)); | 42 sender_->Send(new AppCacheMsg_ErrorEventRaised(host_ids, details)); |
| 43 } | 43 } |
| 44 | 44 |
| 45 void AppCacheFrontendProxy::OnLogMessage(int host_id, | 45 void AppCacheFrontendProxy::OnLogMessage(int host_id, |
| 46 appcache::AppCacheLogLevel log_level, | 46 AppCacheLogLevel log_level, |
| 47 const std::string& message) { | 47 const std::string& message) { |
| 48 sender_->Send(new AppCacheMsg_LogMessage(host_id, log_level, message)); | 48 sender_->Send(new AppCacheMsg_LogMessage(host_id, log_level, message)); |
| 49 } | 49 } |
| 50 | 50 |
| 51 void AppCacheFrontendProxy::OnContentBlocked(int host_id, | 51 void AppCacheFrontendProxy::OnContentBlocked(int host_id, |
| 52 const GURL& manifest_url) { | 52 const GURL& manifest_url) { |
| 53 sender_->Send(new AppCacheMsg_ContentBlocked(host_id, manifest_url)); | 53 sender_->Send(new AppCacheMsg_ContentBlocked(host_id, manifest_url)); |
| 54 } | 54 } |
| 55 | 55 |
| 56 } // namespace content | 56 } // namespace content |
| OLD | NEW |