OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/resource_context_impl.h" | 5 #include "content/browser/resource_context_impl.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "content/browser/appcache/chrome_appcache_service.h" | 8 #include "content/browser/appcache/chrome_appcache_service.h" |
9 #include "content/browser/fileapi/browser_file_system_helper.h" | 9 #include "content/browser/fileapi/browser_file_system_helper.h" |
10 #include "content/browser/fileapi/chrome_blob_storage_context.h" | 10 #include "content/browser/fileapi/chrome_blob_storage_context.h" |
11 #include "content/browser/host_zoom_map_impl.h" | 11 #include "content/browser/host_zoom_map_impl.h" |
12 #include "content/browser/in_process_webkit/indexed_db_context_impl.h" | 12 #include "content/browser/in_process_webkit/indexed_db_context_impl.h" |
13 #include "content/browser/net/view_blob_internals_job_factory.h" | 13 #include "content/browser/net/view_blob_internals_job_factory.h" |
14 #include "content/browser/net/view_http_cache_job_factory.h" | 14 #include "content/browser/net/view_http_cache_job_factory.h" |
| 15 #include "content/browser/renderer_host/resource_dispatcher_host_impl.h" |
15 #include "content/browser/renderer_host/resource_request_info_impl.h" | 16 #include "content/browser/renderer_host/resource_request_info_impl.h" |
16 #include "content/public/browser/browser_context.h" | 17 #include "content/public/browser/browser_context.h" |
17 #include "content/public/browser/browser_thread.h" | 18 #include "content/public/browser/browser_thread.h" |
18 #include "content/public/common/url_constants.h" | 19 #include "content/public/common/url_constants.h" |
19 #include "net/url_request/url_request.h" | 20 #include "net/url_request/url_request.h" |
20 #include "net/url_request/url_request_context.h" | 21 #include "net/url_request/url_request_context.h" |
21 #include "net/url_request/url_request_context_getter.h" | 22 #include "net/url_request/url_request_context_getter.h" |
22 #include "webkit/appcache/appcache_service.h" | 23 #include "webkit/appcache/appcache_service.h" |
23 #include "webkit/appcache/view_appcache_internals_job.h" | 24 #include "webkit/appcache/view_appcache_internals_job.h" |
24 #include "webkit/blob/blob_data.h" | 25 #include "webkit/blob/blob_data.h" |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
158 // TODO(jam): Add the ProtocolHandlerRegistryIntercepter here! | 159 // TODO(jam): Add the ProtocolHandlerRegistryIntercepter here! |
159 } | 160 } |
160 | 161 |
161 } // namespace | 162 } // namespace |
162 | 163 |
163 AppCacheService* ResourceContext::GetAppCacheService(ResourceContext* context) { | 164 AppCacheService* ResourceContext::GetAppCacheService(ResourceContext* context) { |
164 return UserDataAdapter<ChromeAppCacheService>::Get( | 165 return UserDataAdapter<ChromeAppCacheService>::Get( |
165 context, kAppCacheServicKeyName); | 166 context, kAppCacheServicKeyName); |
166 } | 167 } |
167 | 168 |
| 169 ResourceContext::~ResourceContext() { |
| 170 if (ResourceDispatcherHostImpl::Get()) |
| 171 ResourceDispatcherHostImpl::Get()->CancelRequestsForContext(this); |
| 172 } |
| 173 |
168 BlobStorageController* GetBlobStorageControllerForResourceContext( | 174 BlobStorageController* GetBlobStorageControllerForResourceContext( |
169 ResourceContext* resource_context) { | 175 ResourceContext* resource_context) { |
170 return GetChromeBlobStorageContextForResourceContext(resource_context)-> | 176 return GetChromeBlobStorageContextForResourceContext(resource_context)-> |
171 controller(); | 177 controller(); |
172 } | 178 } |
173 | 179 |
174 DatabaseTracker* GetDatabaseTrackerForResourceContext( | 180 DatabaseTracker* GetDatabaseTrackerForResourceContext( |
175 ResourceContext* resource_context) { | 181 ResourceContext* resource_context) { |
176 return UserDataAdapter<DatabaseTracker>::Get( | 182 return UserDataAdapter<DatabaseTracker>::Get( |
177 resource_context, kDatabaseTrackerKeyName); | 183 resource_context, kDatabaseTrackerKeyName); |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
245 BrowserThread::PostTask( | 251 BrowserThread::PostTask( |
246 BrowserThread::IO, FROM_HERE, | 252 BrowserThread::IO, FROM_HERE, |
247 base::Bind(&InitializeRequestContext, | 253 base::Bind(&InitializeRequestContext, |
248 resource_context, | 254 resource_context, |
249 make_scoped_refptr( | 255 make_scoped_refptr( |
250 browser_context->GetRequestContextForMedia()))); | 256 browser_context->GetRequestContextForMedia()))); |
251 } | 257 } |
252 } | 258 } |
253 | 259 |
254 } // namespace content | 260 } // namespace content |
OLD | NEW |