| 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_host.h" | 5 #include "webkit/appcache/appcache_host.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/string_util.h" | 8 #include "base/string_util.h" |
| 9 #include "base/stringprintf.h" | 9 #include "base/stringprintf.h" |
| 10 #include "webkit/appcache/appcache.h" | 10 #include "webkit/appcache/appcache.h" |
| (...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 248 pending_callback_param_ = NULL; | 248 pending_callback_param_ = NULL; |
| 249 } | 249 } |
| 250 | 250 |
| 251 AppCacheHost* AppCacheHost::GetParentAppCacheHost() const { | 251 AppCacheHost* AppCacheHost::GetParentAppCacheHost() const { |
| 252 DCHECK(is_for_dedicated_worker()); | 252 DCHECK(is_for_dedicated_worker()); |
| 253 AppCacheBackendImpl* backend = service_->GetBackend(parent_process_id_); | 253 AppCacheBackendImpl* backend = service_->GetBackend(parent_process_id_); |
| 254 return backend ? backend->GetHost(parent_host_id_) : NULL; | 254 return backend ? backend->GetHost(parent_host_id_) : NULL; |
| 255 } | 255 } |
| 256 | 256 |
| 257 AppCacheRequestHandler* AppCacheHost::CreateRequestHandler( | 257 AppCacheRequestHandler* AppCacheHost::CreateRequestHandler( |
| 258 URLRequest* request, | 258 net::URLRequest* request, |
| 259 ResourceType::Type resource_type) { | 259 ResourceType::Type resource_type) { |
| 260 if (is_for_dedicated_worker()) { | 260 if (is_for_dedicated_worker()) { |
| 261 AppCacheHost* parent_host = GetParentAppCacheHost(); | 261 AppCacheHost* parent_host = GetParentAppCacheHost(); |
| 262 if (parent_host) | 262 if (parent_host) |
| 263 return parent_host->CreateRequestHandler(request, resource_type); | 263 return parent_host->CreateRequestHandler(request, resource_type); |
| 264 return NULL; | 264 return NULL; |
| 265 } | 265 } |
| 266 | 266 |
| 267 if (AppCacheRequestHandler::IsMainResourceType(resource_type)) | 267 if (AppCacheRequestHandler::IsMainResourceType(resource_type)) |
| 268 return new AppCacheRequestHandler(this, resource_type); | 268 return new AppCacheRequestHandler(this, resource_type); |
| 269 | 269 |
| (...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 475 associated_cache_info_pending_ = cache && !cache->is_complete(); | 475 associated_cache_info_pending_ = cache && !cache->is_complete(); |
| 476 AppCacheInfo info; | 476 AppCacheInfo info; |
| 477 if (cache) { | 477 if (cache) { |
| 478 cache->AssociateHost(this); | 478 cache->AssociateHost(this); |
| 479 FillCacheInfo(cache, GetStatus(), &info); | 479 FillCacheInfo(cache, GetStatus(), &info); |
| 480 } | 480 } |
| 481 frontend_->OnCacheSelected(host_id_, info); | 481 frontend_->OnCacheSelected(host_id_, info); |
| 482 } | 482 } |
| 483 | 483 |
| 484 } // namespace appcache | 484 } // namespace appcache |
| OLD | NEW |