| 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_backend_impl.h" | 5 #include "content/browser/appcache/appcache_backend_impl.h" |
| 6 | 6 |
| 7 #include "base/stl_util.h" | 7 #include "base/stl_util.h" |
| 8 #include "content/browser/appcache/appcache.h" | 8 #include "content/browser/appcache/appcache.h" |
| 9 #include "content/browser/appcache/appcache_group.h" | 9 #include "content/browser/appcache/appcache_group.h" |
| 10 #include "content/browser/appcache/appcache_service_impl.h" | 10 #include "content/browser/appcache/appcache_service_impl.h" |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 AppCacheHost* host = GetHost(host_id); | 58 AppCacheHost* host = GetHost(host_id); |
| 59 if (!host) | 59 if (!host) |
| 60 return false; | 60 return false; |
| 61 host->SetSpawningHostId(process_id_, spawning_host_id); | 61 host->SetSpawningHostId(process_id_, spawning_host_id); |
| 62 return true; | 62 return true; |
| 63 } | 63 } |
| 64 | 64 |
| 65 bool AppCacheBackendImpl::SelectCache( | 65 bool AppCacheBackendImpl::SelectCache( |
| 66 int host_id, | 66 int host_id, |
| 67 const GURL& document_url, | 67 const GURL& document_url, |
| 68 const int64 cache_document_was_loaded_from, | 68 const int64_t cache_document_was_loaded_from, |
| 69 const GURL& manifest_url) { | 69 const GURL& manifest_url) { |
| 70 AppCacheHost* host = GetHost(host_id); | 70 AppCacheHost* host = GetHost(host_id); |
| 71 if (!host) | 71 if (!host) |
| 72 return false; | 72 return false; |
| 73 | 73 |
| 74 return host->SelectCache(document_url, cache_document_was_loaded_from, | 74 return host->SelectCache(document_url, cache_document_was_loaded_from, |
| 75 manifest_url); | 75 manifest_url); |
| 76 } | 76 } |
| 77 | 77 |
| 78 bool AppCacheBackendImpl::SelectCacheForWorker( | 78 bool AppCacheBackendImpl::SelectCacheForWorker( |
| 79 int host_id, int parent_process_id, int parent_host_id) { | 79 int host_id, int parent_process_id, int parent_host_id) { |
| 80 AppCacheHost* host = GetHost(host_id); | 80 AppCacheHost* host = GetHost(host_id); |
| 81 if (!host) | 81 if (!host) |
| 82 return false; | 82 return false; |
| 83 | 83 |
| 84 return host->SelectCacheForWorker(parent_process_id, parent_host_id); | 84 return host->SelectCacheForWorker(parent_process_id, parent_host_id); |
| 85 } | 85 } |
| 86 | 86 |
| 87 bool AppCacheBackendImpl::SelectCacheForSharedWorker( | 87 bool AppCacheBackendImpl::SelectCacheForSharedWorker(int host_id, |
| 88 int host_id, int64 appcache_id) { | 88 int64_t appcache_id) { |
| 89 AppCacheHost* host = GetHost(host_id); | 89 AppCacheHost* host = GetHost(host_id); |
| 90 if (!host) | 90 if (!host) |
| 91 return false; | 91 return false; |
| 92 | 92 |
| 93 return host->SelectCacheForSharedWorker(appcache_id); | 93 return host->SelectCacheForSharedWorker(appcache_id); |
| 94 } | 94 } |
| 95 | 95 |
| 96 bool AppCacheBackendImpl::MarkAsForeignEntry( | 96 bool AppCacheBackendImpl::MarkAsForeignEntry( |
| 97 int host_id, | 97 int host_id, |
| 98 const GURL& document_url, | 98 const GURL& document_url, |
| 99 int64 cache_document_was_loaded_from) { | 99 int64_t cache_document_was_loaded_from) { |
| 100 AppCacheHost* host = GetHost(host_id); | 100 AppCacheHost* host = GetHost(host_id); |
| 101 if (!host) | 101 if (!host) |
| 102 return false; | 102 return false; |
| 103 | 103 |
| 104 return host->MarkAsForeignEntry(document_url, cache_document_was_loaded_from); | 104 return host->MarkAsForeignEntry(document_url, cache_document_was_loaded_from); |
| 105 } | 105 } |
| 106 | 106 |
| 107 bool AppCacheBackendImpl::GetStatusWithCallback( | 107 bool AppCacheBackendImpl::GetStatusWithCallback( |
| 108 int host_id, const GetStatusCallback& callback, void* callback_param) { | 108 int host_id, const GetStatusCallback& callback, void* callback_param) { |
| 109 AppCacheHost* host = GetHost(host_id); | 109 AppCacheHost* host = GetHost(host_id); |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 169 } | 169 } |
| 170 | 170 |
| 171 delete found->second; | 171 delete found->second; |
| 172 | 172 |
| 173 // We take onwership. | 173 // We take onwership. |
| 174 host->CompleteTransfer(new_host_id, frontend_); | 174 host->CompleteTransfer(new_host_id, frontend_); |
| 175 found->second = host.release(); | 175 found->second = host.release(); |
| 176 } | 176 } |
| 177 | 177 |
| 178 } // namespace content | 178 } // namespace content |
| OLD | NEW |