OLD | NEW |
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_policy.h" | 23 #include "content/browser/appcache/appcache_policy.h" |
24 #include "content/browser/appcache/appcache_quota_client.h" | 24 #include "content/browser/appcache/appcache_quota_client.h" |
25 #include "content/browser/appcache/appcache_response.h" | 25 #include "content/browser/appcache/appcache_response.h" |
26 #include "content/browser/appcache/appcache_service_impl.h" | 26 #include "content/browser/appcache/appcache_service_impl.h" |
27 #include "content/browser/appcache/appcache_storage_impl.h" | 27 #include "content/browser/appcache/appcache_storage_impl.h" |
| 28 #include "content/public/common/browser_side_navigation_policy.h" |
28 #include "net/base/completion_callback.h" | 29 #include "net/base/completion_callback.h" |
29 #include "net/base/io_buffer.h" | 30 #include "net/base/io_buffer.h" |
30 #include "storage/browser/quota/special_storage_policy.h" | 31 #include "storage/browser/quota/special_storage_policy.h" |
31 | 32 |
32 namespace content { | 33 namespace content { |
33 | 34 |
34 namespace { | 35 namespace { |
35 | 36 |
36 void DeferredCallback(const net::CompletionCallback& callback, int rv) { | 37 void DeferredCallback(const net::CompletionCallback& callback, int rv) { |
37 callback.Run(rv); | 38 callback.Run(rv); |
(...skipping 482 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
520 DCHECK(backends_.find(backend_impl->process_id()) == backends_.end()); | 521 DCHECK(backends_.find(backend_impl->process_id()) == backends_.end()); |
521 backends_.insert( | 522 backends_.insert( |
522 BackendMap::value_type(backend_impl->process_id(), backend_impl)); | 523 BackendMap::value_type(backend_impl->process_id(), backend_impl)); |
523 } | 524 } |
524 | 525 |
525 void AppCacheServiceImpl::UnregisterBackend( | 526 void AppCacheServiceImpl::UnregisterBackend( |
526 AppCacheBackendImpl* backend_impl) { | 527 AppCacheBackendImpl* backend_impl) { |
527 backends_.erase(backend_impl->process_id()); | 528 backends_.erase(backend_impl->process_id()); |
528 } | 529 } |
529 | 530 |
| 531 void AppCacheServiceImpl::RegisterBackendForFrame( |
| 532 AppCacheBackendImpl* backend_impl) { |
| 533 DCHECK(IsBrowserSideNavigationEnabled()); |
| 534 DCHECK(backends_for_frame_.find(backend_impl->frame_id()) == |
| 535 backends_for_frame_.end()); |
| 536 |
| 537 backends_for_frame_.insert( |
| 538 BackendMap::value_type(backend_impl->frame_id(), backend_impl)); |
| 539 } |
| 540 |
| 541 void AppCacheServiceImpl::UnregisterBackendForFrame( |
| 542 AppCacheBackendImpl* backend_impl) { |
| 543 DCHECK(IsBrowserSideNavigationEnabled()); |
| 544 backends_for_frame_.erase(backend_impl->frame_id()); |
| 545 } |
| 546 |
530 } // namespace content | 547 } // namespace content |
OLD | NEW |