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 { |
11 | 11 |
12 // Inline helper to keep the lines shorter and unwrapped. | 12 // Inline helper to keep the lines shorter and unwrapped. |
13 inline WebApplicationCacheHostImpl* GetHost(int id) { | 13 inline WebApplicationCacheHostImpl* GetHost(int id) { |
14 return WebApplicationCacheHostImpl::FromId(id); | 14 return WebApplicationCacheHostImpl::FromId(id); |
15 } | 15 } |
16 | 16 |
17 void AppCacheFrontendImpl::OnCacheSelected(int host_id, int64 cache_id , | 17 void AppCacheFrontendImpl::OnCacheSelected( |
18 Status status) { | 18 int host_id, const AppCacheInfo& info) { |
19 WebApplicationCacheHostImpl* host = GetHost(host_id); | 19 WebApplicationCacheHostImpl* host = GetHost(host_id); |
20 if (host) | 20 if (host) |
21 host->OnCacheSelected(cache_id, status); | 21 host->OnCacheSelected(info); |
22 } | 22 } |
23 | 23 |
24 void AppCacheFrontendImpl::OnStatusChanged(const std::vector<int>& host_ids, | 24 void AppCacheFrontendImpl::OnStatusChanged(const std::vector<int>& host_ids, |
25 Status status) { | 25 Status status) { |
26 for (std::vector<int>::const_iterator i = host_ids.begin(); | 26 for (std::vector<int>::const_iterator i = host_ids.begin(); |
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 } |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 } | 73 } |
74 | 74 |
75 void AppCacheFrontendImpl::OnContentBlocked(int host_id, | 75 void AppCacheFrontendImpl::OnContentBlocked(int host_id, |
76 const GURL& manifest_url) { | 76 const GURL& manifest_url) { |
77 WebApplicationCacheHostImpl* host = GetHost(host_id); | 77 WebApplicationCacheHostImpl* host = GetHost(host_id); |
78 if (host) | 78 if (host) |
79 host->OnContentBlocked(manifest_url); | 79 host->OnContentBlocked(manifest_url); |
80 } | 80 } |
81 | 81 |
82 } // namespace appcache | 82 } // namespace appcache |
OLD | NEW |