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_request_handler.h" | 5 #include "content/browser/appcache/appcache_request_handler.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "content/browser/appcache/appcache.h" | 10 #include "content/browser/appcache/appcache.h" |
(...skipping 362 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
373 return; | 373 return; |
374 } | 374 } |
375 | 375 |
376 if (should_reset_appcache_ && !manifest_url.is_empty()) { | 376 if (should_reset_appcache_ && !manifest_url.is_empty()) { |
377 host_->service()->DeleteAppCacheGroup( | 377 host_->service()->DeleteAppCacheGroup( |
378 manifest_url, net::CompletionCallback()); | 378 manifest_url, net::CompletionCallback()); |
379 DeliverNetworkResponse(); | 379 DeliverNetworkResponse(); |
380 return; | 380 return; |
381 } | 381 } |
382 | 382 |
383 if (IsResourceTypeFrame(resource_type_) && cache_id != kAppCacheNoCacheId) { | 383 if (IsMainResourceType(resource_type_) && cache_id != kAppCacheNoCacheId) { |
384 // AppCacheHost loads and holds a reference to the main resource cache | 384 // AppCacheHost loads and holds a reference to the main resource cache |
385 // for two reasons, firstly to preload the cache into the working set | 385 // for two reasons, firstly to preload the cache into the working set |
386 // in advance of subresource loads happening, secondly to prevent the | 386 // in advance of subresource loads happening, secondly to prevent the |
387 // AppCache from falling out of the working set on frame navigations. | 387 // AppCache from falling out of the working set on frame navigations. |
388 host_->LoadMainResourceCache(cache_id); | 388 host_->LoadMainResourceCache(cache_id); |
389 host_->set_preferred_manifest_url(manifest_url); | 389 host_->set_preferred_manifest_url(manifest_url); |
390 } | 390 } |
391 | 391 |
392 // 6.11.1 Navigating across documents, steps 10 and 14. | 392 // 6.11.1 Navigating across documents, steps 10 and 14. |
393 | 393 |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
501 if (!host_->associated_cache() || | 501 if (!host_->associated_cache() || |
502 !host_->associated_cache()->is_complete()) { | 502 !host_->associated_cache()->is_complete()) { |
503 DeliverNetworkResponse(); | 503 DeliverNetworkResponse(); |
504 return; | 504 return; |
505 } | 505 } |
506 | 506 |
507 ContinueMaybeLoadSubResource(); | 507 ContinueMaybeLoadSubResource(); |
508 } | 508 } |
509 | 509 |
510 } // namespace content | 510 } // namespace content |
OLD | NEW |