| 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_dispatcher_host_impl.h" |
| 16 #include "content/browser/renderer_host/resource_request_info_impl.h" | 16 #include "content/browser/renderer_host/resource_request_info_impl.h" |
| 17 #include "content/browser/tcmalloc_internals_request_job.h" |
| 17 #include "content/public/browser/browser_context.h" | 18 #include "content/public/browser/browser_context.h" |
| 18 #include "content/public/browser/browser_thread.h" | 19 #include "content/public/browser/browser_thread.h" |
| 19 #include "content/public/common/url_constants.h" | 20 #include "content/public/common/url_constants.h" |
| 20 #include "net/url_request/url_request.h" | 21 #include "net/url_request/url_request.h" |
| 21 #include "net/url_request/url_request_context.h" | 22 #include "net/url_request/url_request_context.h" |
| 22 #include "net/url_request/url_request_context_getter.h" | 23 #include "net/url_request/url_request_context_getter.h" |
| 23 #include "webkit/appcache/appcache_service.h" | 24 #include "webkit/appcache/appcache_service.h" |
| 24 #include "webkit/appcache/view_appcache_internals_job.h" | 25 #include "webkit/appcache/view_appcache_internals_job.h" |
| 25 #include "webkit/blob/blob_data.h" | 26 #include "webkit/blob/blob_data.h" |
| 26 #include "webkit/blob/blob_url_request_job_factory.h" | 27 #include "webkit/blob/blob_url_request_job_factory.h" |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 102 request->url().host() == chrome::kChromeUIAppCacheInternalsHost) { | 103 request->url().host() == chrome::kChromeUIAppCacheInternalsHost) { |
| 103 return appcache::ViewAppCacheInternalsJobFactory::CreateJobForRequest( | 104 return appcache::ViewAppCacheInternalsJobFactory::CreateJobForRequest( |
| 104 request, appcache_service_); | 105 request, appcache_service_); |
| 105 } | 106 } |
| 106 | 107 |
| 107 // Next check for chrome://blob-internals/, which uses its own job type. | 108 // Next check for chrome://blob-internals/, which uses its own job type. |
| 108 if (ViewBlobInternalsJobFactory::IsSupportedURL(request->url())) { | 109 if (ViewBlobInternalsJobFactory::IsSupportedURL(request->url())) { |
| 109 return ViewBlobInternalsJobFactory::CreateJobForRequest( | 110 return ViewBlobInternalsJobFactory::CreateJobForRequest( |
| 110 request, blob_storage_controller_); | 111 request, blob_storage_controller_); |
| 111 } | 112 } |
| 113 |
| 114 #if defined(USE_TCMALLOC) |
| 115 // Next check for chrome://tcmalloc/, which uses its own job type. |
| 116 if (request->url().SchemeIs(chrome::kChromeUIScheme) && |
| 117 request->url().host() == chrome::kChromeUITcmallocHost) { |
| 118 return new TcmallocInternalsRequestJob(request); |
| 119 } |
| 120 #endif |
| 121 |
| 112 return NULL; | 122 return NULL; |
| 113 } | 123 } |
| 114 | 124 |
| 115 virtual net::URLRequestJob* MaybeInterceptRedirect( | 125 virtual net::URLRequestJob* MaybeInterceptRedirect( |
| 116 const GURL& location, | 126 const GURL& location, |
| 117 net::URLRequest* request) const OVERRIDE { | 127 net::URLRequest* request) const OVERRIDE { |
| 118 return NULL; | 128 return NULL; |
| 119 } | 129 } |
| 120 | 130 |
| 121 virtual net::URLRequestJob* MaybeInterceptResponse( | 131 virtual net::URLRequestJob* MaybeInterceptResponse( |
| (...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 255 BrowserThread::PostTask( | 265 BrowserThread::PostTask( |
| 256 BrowserThread::IO, FROM_HERE, | 266 BrowserThread::IO, FROM_HERE, |
| 257 base::Bind(&InitializeRequestContext, | 267 base::Bind(&InitializeRequestContext, |
| 258 resource_context, | 268 resource_context, |
| 259 make_scoped_refptr( | 269 make_scoped_refptr( |
| 260 browser_context->GetRequestContextForMedia()))); | 270 browser_context->GetRequestContextForMedia()))); |
| 261 } | 271 } |
| 262 } | 272 } |
| 263 | 273 |
| 264 } // namespace content | 274 } // namespace content |
| OLD | NEW |