OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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_navigation_handle_core.h" | 5 #include "content/browser/appcache/appcache_navigation_handle_core.h" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
11 #include "base/lazy_instance.h" | 11 #include "base/lazy_instance.h" |
12 #include "content/browser/appcache/appcache_host.h" | 12 #include "content/browser/appcache/appcache_host.h" |
13 #include "content/browser/appcache/appcache_navigation_handle.h" | 13 #include "content/browser/appcache/appcache_navigation_handle.h" |
14 #include "content/browser/appcache/appcache_service_impl.h" | 14 #include "content/browser/appcache/appcache_service_impl.h" |
15 #include "content/browser/appcache/chrome_appcache_service.h" | 15 #include "content/browser/appcache/chrome_appcache_service.h" |
16 #include "content/public/browser/browser_thread.h" | 16 #include "content/public/browser/browser_thread.h" |
17 | 17 |
18 namespace { | 18 namespace { |
19 | 19 |
20 // Map of AppCache host id to the AppCacheNavigationHandleCore instance. | 20 // Map of AppCache host id to the AppCacheNavigationHandleCore instance. |
21 // Accessed on the IO thread only. | 21 // Accessed on the IO thread only. |
22 using AppCacheHandleMap = | 22 using AppCacheHandleMap = |
23 std::map <int, content::AppCacheNavigationHandleCore*>; | 23 std::map <int, content::AppCacheNavigationHandleCore*>; |
24 base::LazyInstance<AppCacheHandleMap> g_appcache_handle_map; | 24 base::LazyInstance<AppCacheHandleMap>::DestructorAtExit g_appcache_handle_map = |
| 25 LAZY_INSTANCE_INITIALIZER; |
25 | 26 |
26 } // namespace | 27 } // namespace |
27 | 28 |
28 namespace content { | 29 namespace content { |
29 | 30 |
30 | 31 |
31 AppCacheNavigationHandleCore::AppCacheNavigationHandleCore( | 32 AppCacheNavigationHandleCore::AppCacheNavigationHandleCore( |
32 base::WeakPtr<AppCacheNavigationHandle> ui_handle, | 33 base::WeakPtr<AppCacheNavigationHandle> ui_handle, |
33 ChromeAppCacheService* appcache_service, | 34 ChromeAppCacheService* appcache_service, |
34 int appcache_host_id) | 35 int appcache_host_id) |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
116 DCHECK(false); | 117 DCHECK(false); |
117 } | 118 } |
118 | 119 |
119 void AppCacheNavigationHandleCore::OnContentBlocked(int host_id, | 120 void AppCacheNavigationHandleCore::OnContentBlocked(int host_id, |
120 const GURL& manifest_url) { | 121 const GURL& manifest_url) { |
121 // Should never be called. | 122 // Should never be called. |
122 DCHECK(false); | 123 DCHECK(false); |
123 } | 124 } |
124 | 125 |
125 } // namespace content | 126 } // namespace content |
OLD | NEW |