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 "webkit/appcache/appcache_frontend_impl.h" | 5 #include "webkit/appcache/appcache_frontend_impl.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "webkit/appcache/web_application_cache_host_impl.h" | 8 #include "webkit/appcache/web_application_cache_host_impl.h" |
9 | 9 |
10 namespace appcache { | 10 namespace appcache { |
(...skipping 16 matching lines...) Expand all Loading... |
27 i != host_ids.end(); ++i) { | 27 i != host_ids.end(); ++i) { |
28 WebApplicationCacheHostImpl* host = GetHost(*i); | 28 WebApplicationCacheHostImpl* host = GetHost(*i); |
29 if (host) | 29 if (host) |
30 host->OnStatusChanged(status); | 30 host->OnStatusChanged(status); |
31 } | 31 } |
32 } | 32 } |
33 | 33 |
34 void AppCacheFrontendImpl::OnEventRaised(const std::vector<int>& host_ids, | 34 void AppCacheFrontendImpl::OnEventRaised(const std::vector<int>& host_ids, |
35 EventID event_id) { | 35 EventID event_id) { |
36 DCHECK(event_id != PROGRESS_EVENT); // See OnProgressEventRaised. | 36 DCHECK(event_id != PROGRESS_EVENT); // See OnProgressEventRaised. |
| 37 DCHECK(event_id != ERROR_EVENT); // See OnErrorEventRaised. |
37 for (std::vector<int>::const_iterator i = host_ids.begin(); | 38 for (std::vector<int>::const_iterator i = host_ids.begin(); |
38 i != host_ids.end(); ++i) { | 39 i != host_ids.end(); ++i) { |
39 WebApplicationCacheHostImpl* host = GetHost(*i); | 40 WebApplicationCacheHostImpl* host = GetHost(*i); |
40 if (host) | 41 if (host) |
41 host->OnEventRaised(event_id); | 42 host->OnEventRaised(event_id); |
42 } | 43 } |
43 } | 44 } |
44 | 45 |
45 void AppCacheFrontendImpl::OnProgressEventRaised( | 46 void AppCacheFrontendImpl::OnProgressEventRaised( |
46 const std::vector<int>& host_ids, | 47 const std::vector<int>& host_ids, |
47 const GURL& url, int num_total, int num_complete) { | 48 const GURL& url, int num_total, int num_complete) { |
48 for (std::vector<int>::const_iterator i = host_ids.begin(); | 49 for (std::vector<int>::const_iterator i = host_ids.begin(); |
49 i != host_ids.end(); ++i) { | 50 i != host_ids.end(); ++i) { |
50 WebApplicationCacheHostImpl* host = GetHost(*i); | 51 WebApplicationCacheHostImpl* host = GetHost(*i); |
51 if (host) | 52 if (host) |
52 host->OnProgressEventRaised(url, num_total, num_complete); | 53 host->OnProgressEventRaised(url, num_total, num_complete); |
53 } | 54 } |
54 } | 55 } |
55 | 56 |
| 57 void AppCacheFrontendImpl::OnErrorEventRaised( |
| 58 const std::vector<int>& host_ids, |
| 59 const std::string& message) { |
| 60 for (std::vector<int>::const_iterator i = host_ids.begin(); |
| 61 i != host_ids.end(); ++i) { |
| 62 WebApplicationCacheHostImpl* host = GetHost(*i); |
| 63 if (host) |
| 64 host->OnErrorEventRaised(message); |
| 65 } |
| 66 } |
| 67 |
56 void AppCacheFrontendImpl::OnLogMessage(int host_id, LogLevel log_level, | 68 void AppCacheFrontendImpl::OnLogMessage(int host_id, LogLevel log_level, |
57 const std::string& message) { | 69 const std::string& message) { |
58 WebApplicationCacheHostImpl* host = GetHost(host_id); | 70 WebApplicationCacheHostImpl* host = GetHost(host_id); |
59 if (host) | 71 if (host) |
60 host->OnLogMessage(log_level, message); | 72 host->OnLogMessage(log_level, message); |
61 } | 73 } |
62 | 74 |
63 void AppCacheFrontendImpl::OnContentBlocked(int host_id, | 75 void AppCacheFrontendImpl::OnContentBlocked(int host_id, |
64 const GURL& manifest_url) { | 76 const GURL& manifest_url) { |
65 WebApplicationCacheHostImpl* host = GetHost(host_id); | 77 WebApplicationCacheHostImpl* host = GetHost(host_id); |
66 if (host) | 78 if (host) |
67 host->OnContentBlocked(manifest_url); | 79 host->OnContentBlocked(manifest_url); |
68 } | 80 } |
69 | 81 |
70 } // namespace appcache | 82 } // namespace appcache |
OLD | NEW |