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

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

Issue 2642733002: Prerender: Disable prefetch if there's an appcache. (Closed)
Patch Set: comments Created 3 years, 10 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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_service_impl.h" 5 #include "content/browser/appcache/appcache_service_impl.h"
6 6
7 #include <functional> 7 #include <functional>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
11 #include "base/bind_helpers.h" 11 #include "base/bind_helpers.h"
12 #include "base/location.h" 12 #include "base/location.h"
13 #include "base/logging.h" 13 #include "base/logging.h"
14 #include "base/macros.h" 14 #include "base/macros.h"
15 #include "base/memory/ptr_util.h" 15 #include "base/memory/ptr_util.h"
16 #include "base/single_thread_task_runner.h" 16 #include "base/single_thread_task_runner.h"
17 #include "base/threading/thread_task_runner_handle.h" 17 #include "base/threading/thread_task_runner_handle.h"
18 #include "content/browser/appcache/appcache.h" 18 #include "content/browser/appcache/appcache.h"
19 #include "content/browser/appcache/appcache_backend_impl.h" 19 #include "content/browser/appcache/appcache_backend_impl.h"
20 #include "content/browser/appcache/appcache_entry.h" 20 #include "content/browser/appcache/appcache_entry.h"
21 #include "content/browser/appcache/appcache_executable_handler.h" 21 #include "content/browser/appcache/appcache_executable_handler.h"
22 #include "content/browser/appcache/appcache_histograms.h" 22 #include "content/browser/appcache/appcache_histograms.h"
23 #include "content/browser/appcache/appcache_interceptor.h"
23 #include "content/browser/appcache/appcache_policy.h" 24 #include "content/browser/appcache/appcache_policy.h"
24 #include "content/browser/appcache/appcache_quota_client.h" 25 #include "content/browser/appcache/appcache_quota_client.h"
26 #include "content/browser/appcache/appcache_request_handler.h"
25 #include "content/browser/appcache/appcache_response.h" 27 #include "content/browser/appcache/appcache_response.h"
26 #include "content/browser/appcache/appcache_service_impl.h" 28 #include "content/browser/appcache/appcache_service_impl.h"
27 #include "content/browser/appcache/appcache_storage_impl.h" 29 #include "content/browser/appcache/appcache_storage_impl.h"
28 #include "net/base/completion_callback.h" 30 #include "net/base/completion_callback.h"
29 #include "net/base/io_buffer.h" 31 #include "net/base/io_buffer.h"
30 #include "storage/browser/quota/special_storage_policy.h" 32 #include "storage/browser/quota/special_storage_policy.h"
31 33
32 namespace content { 34 namespace content {
33 35
34 namespace { 36 namespace {
(...skipping 485 matching lines...) Expand 10 before | Expand all | Expand 10 after
520 DCHECK(backends_.find(backend_impl->process_id()) == backends_.end()); 522 DCHECK(backends_.find(backend_impl->process_id()) == backends_.end());
521 backends_.insert( 523 backends_.insert(
522 BackendMap::value_type(backend_impl->process_id(), backend_impl)); 524 BackendMap::value_type(backend_impl->process_id(), backend_impl));
523 } 525 }
524 526
525 void AppCacheServiceImpl::UnregisterBackend( 527 void AppCacheServiceImpl::UnregisterBackend(
526 AppCacheBackendImpl* backend_impl) { 528 AppCacheBackendImpl* backend_impl) {
527 backends_.erase(backend_impl->process_id()); 529 backends_.erase(backend_impl->process_id());
528 } 530 }
529 531
532 // Static AppCacheService methods -------
533
534 // static
535 bool AppCacheService::URLRequestHasActiveAppCache(net::URLRequest* request) {
536 AppCacheRequestHandler* appcache_handle =
537 AppCacheInterceptor::GetHandler(request);
538 if (appcache_handle) {
539 int64_t appcache_id;
540 GURL unused_manifest_url;
541 appcache_handle->GetExtraResponseInfo(&appcache_id, &unused_manifest_url);
542 if (appcache_id != kAppCacheNoCacheId)
543 return true;
544 }
545 return false;
546 }
547
530 } // namespace content 548 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698