Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(203)

Side by Side Diff: content/browser/appcache/appcache_request_handler.cc

Issue 2902653002: Get main frame and subframe AppCache loads to work. (Closed)
Patch Set: Fix check Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 304 matching lines...) Expand 10 before | Expand all | Expand 10 after
315 315
316 // If a page falls into the scope of a ServiceWorker, any matching AppCaches 316 // If a page falls into the scope of a ServiceWorker, any matching AppCaches
317 // should be ignored. This depends on the ServiceWorker handler being invoked 317 // should be ignored. This depends on the ServiceWorker handler being invoked
318 // prior to the AppCache handler. 318 // prior to the AppCache handler.
319 if (ServiceWorkerRequestHandler::IsControlledByServiceWorker( 319 if (ServiceWorkerRequestHandler::IsControlledByServiceWorker(
320 request_->GetURLRequest())) { 320 request_->GetURLRequest())) {
321 host_->enable_cache_selection(false); 321 host_->enable_cache_selection(false);
322 return nullptr; 322 return nullptr;
323 } 323 }
324 324
325 if (service_->storage()->IsInitialized() &&
326 service_->storage()->usage_map()->find(request_->GetURL().GetOrigin()) ==
327 service_->storage()->usage_map()->end()) {
328 return nullptr;
329 }
330
325 host_->enable_cache_selection(true); 331 host_->enable_cache_selection(true);
326 332
327 const AppCacheHost* spawning_host = 333 const AppCacheHost* spawning_host =
328 (resource_type_ == RESOURCE_TYPE_SHARED_WORKER) ? 334 (resource_type_ == RESOURCE_TYPE_SHARED_WORKER) ?
329 host_ : host_->GetSpawningHost(); 335 host_ : host_->GetSpawningHost();
330 GURL preferred_manifest_url = spawning_host ? 336 GURL preferred_manifest_url = spawning_host ?
331 spawning_host->preferred_manifest_url() : GURL(); 337 spawning_host->preferred_manifest_url() : GURL();
332 338
333 // We may have to wait for our storage query to complete, but 339 // We may have to wait for our storage query to complete, but
334 // this query can also complete syncrhonously. 340 // this query can also complete syncrhonously.
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
497 if (!host_->associated_cache() || 503 if (!host_->associated_cache() ||
498 !host_->associated_cache()->is_complete()) { 504 !host_->associated_cache()->is_complete()) {
499 DeliverNetworkResponse(); 505 DeliverNetworkResponse();
500 return; 506 return;
501 } 507 }
502 508
503 ContinueMaybeLoadSubResource(); 509 ContinueMaybeLoadSubResource();
504 } 510 }
505 511
506 } // namespace content 512 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | content/browser/appcache/appcache_storage.h » ('j') | content/browser/url_loader_factory_getter.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698