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_host.h" | 5 #include "content/browser/appcache/appcache_host.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/strings/string_util.h" | 8 #include "base/strings/string_util.h" |
9 #include "base/strings/stringprintf.h" | 9 #include "base/strings/stringprintf.h" |
10 #include "content/browser/appcache/appcache.h" | 10 #include "content/browser/appcache/appcache.h" |
(...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
278 } | 278 } |
279 | 279 |
280 AppCacheHost* AppCacheHost::GetParentAppCacheHost() const { | 280 AppCacheHost* AppCacheHost::GetParentAppCacheHost() const { |
281 DCHECK(is_for_dedicated_worker()); | 281 DCHECK(is_for_dedicated_worker()); |
282 AppCacheBackendImpl* backend = service_->GetBackend(parent_process_id_); | 282 AppCacheBackendImpl* backend = service_->GetBackend(parent_process_id_); |
283 return backend ? backend->GetHost(parent_host_id_) : NULL; | 283 return backend ? backend->GetHost(parent_host_id_) : NULL; |
284 } | 284 } |
285 | 285 |
286 AppCacheRequestHandler* AppCacheHost::CreateRequestHandler( | 286 AppCacheRequestHandler* AppCacheHost::CreateRequestHandler( |
287 net::URLRequest* request, | 287 net::URLRequest* request, |
288 ResourceType::Type resource_type) { | 288 ResourceType resource_type) { |
289 if (is_for_dedicated_worker()) { | 289 if (is_for_dedicated_worker()) { |
290 AppCacheHost* parent_host = GetParentAppCacheHost(); | 290 AppCacheHost* parent_host = GetParentAppCacheHost(); |
291 if (parent_host) | 291 if (parent_host) |
292 return parent_host->CreateRequestHandler(request, resource_type); | 292 return parent_host->CreateRequestHandler(request, resource_type); |
293 return NULL; | 293 return NULL; |
294 } | 294 } |
295 | 295 |
296 if (AppCacheRequestHandler::IsMainResourceType(resource_type)) { | 296 if (AppCacheRequestHandler::IsMainResourceType(resource_type)) { |
297 // Store the first party origin so that it can be used later in SelectCache | 297 // Store the first party origin so that it can be used later in SelectCache |
298 // for checking whether the creation of the appcache is allowed. | 298 // for checking whether the creation of the appcache is allowed. |
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
537 associated_cache_info_pending_ = cache && !cache->is_complete(); | 537 associated_cache_info_pending_ = cache && !cache->is_complete(); |
538 AppCacheInfo info; | 538 AppCacheInfo info; |
539 if (cache) | 539 if (cache) |
540 cache->AssociateHost(this); | 540 cache->AssociateHost(this); |
541 | 541 |
542 FillCacheInfo(cache, manifest_url, GetStatus(), &info); | 542 FillCacheInfo(cache, manifest_url, GetStatus(), &info); |
543 frontend_->OnCacheSelected(host_id_, info); | 543 frontend_->OnCacheSelected(host_id_, info); |
544 } | 544 } |
545 | 545 |
546 } // namespace content | 546 } // namespace content |
OLD | NEW |