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/webui/url_data_manager_backend.h" | 5 #include "content/browser/webui/url_data_manager_backend.h" |
6 | 6 |
7 #include <set> | 7 #include <set> |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
11 #include "base/command_line.h" | 11 #include "base/command_line.h" |
12 #include "base/compiler_specific.h" | 12 #include "base/compiler_specific.h" |
13 #include "base/debug/alias.h" | 13 #include "base/debug/alias.h" |
14 #include "base/lazy_instance.h" | 14 #include "base/lazy_instance.h" |
15 #include "base/location.h" | 15 #include "base/location.h" |
16 #include "base/memory/ref_counted.h" | 16 #include "base/memory/ref_counted.h" |
17 #include "base/memory/ref_counted_memory.h" | 17 #include "base/memory/ref_counted_memory.h" |
18 #include "base/memory/weak_ptr.h" | 18 #include "base/memory/weak_ptr.h" |
19 #include "base/profiler/scoped_tracker.h" | 19 #include "base/profiler/scoped_tracker.h" |
20 #include "base/single_thread_task_runner.h" | 20 #include "base/single_thread_task_runner.h" |
21 #include "base/strings/string_util.h" | 21 #include "base/strings/string_util.h" |
22 #include "base/strings/stringprintf.h" | 22 #include "base/strings/stringprintf.h" |
23 #include "base/trace_event/trace_event.h" | 23 #include "base/trace_event/trace_event.h" |
24 #include "content/browser/fileapi/chrome_blob_storage_context.h" | 24 #include "content/browser/fileapi/chrome_blob_storage_context.h" |
25 #include "content/browser/histogram_internals_request_job.h" | 25 #include "content/browser/histogram_internals_request_job.h" |
26 #include "content/browser/net/view_blob_internals_job_factory.h" | 26 #include "content/browser/net/view_blob_internals_job_factory.h" |
27 #include "content/browser/net/view_http_cache_job_factory.h" | 27 #include "content/browser/net/view_http_cache_job_factory.h" |
28 #include "content/browser/resource_context_impl.h" | 28 #include "content/browser/resource_context_impl.h" |
29 #include "content/browser/tcmalloc_internals_request_job.h" | |
30 #include "content/browser/webui/shared_resources_data_source.h" | 29 #include "content/browser/webui/shared_resources_data_source.h" |
31 #include "content/browser/webui/url_data_source_impl.h" | 30 #include "content/browser/webui/url_data_source_impl.h" |
32 #include "content/public/browser/browser_context.h" | 31 #include "content/public/browser/browser_context.h" |
33 #include "content/public/browser/browser_thread.h" | 32 #include "content/public/browser/browser_thread.h" |
34 #include "content/public/browser/content_browser_client.h" | 33 #include "content/public/browser/content_browser_client.h" |
35 #include "content/public/browser/render_process_host.h" | 34 #include "content/public/browser/render_process_host.h" |
36 #include "content/public/browser/resource_request_info.h" | 35 #include "content/public/browser/resource_request_info.h" |
37 #include "content/public/common/url_constants.h" | 36 #include "content/public/common/url_constants.h" |
38 #include "net/base/io_buffer.h" | 37 #include "net/base/io_buffer.h" |
39 #include "net/base/net_errors.h" | 38 #include "net/base/net_errors.h" |
(...skipping 448 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
488 if (ViewHttpCacheJobFactory::IsSupportedURL(request->url())) | 487 if (ViewHttpCacheJobFactory::IsSupportedURL(request->url())) |
489 return ViewHttpCacheJobFactory::CreateJobForRequest(request, | 488 return ViewHttpCacheJobFactory::CreateJobForRequest(request, |
490 network_delegate); | 489 network_delegate); |
491 | 490 |
492 // Next check for chrome://blob-internals/, which uses its own job type. | 491 // Next check for chrome://blob-internals/, which uses its own job type. |
493 if (ViewBlobInternalsJobFactory::IsSupportedURL(request->url())) { | 492 if (ViewBlobInternalsJobFactory::IsSupportedURL(request->url())) { |
494 return ViewBlobInternalsJobFactory::CreateJobForRequest( | 493 return ViewBlobInternalsJobFactory::CreateJobForRequest( |
495 request, network_delegate, blob_storage_context_->context()); | 494 request, network_delegate, blob_storage_context_->context()); |
496 } | 495 } |
497 | 496 |
498 #if defined(USE_TCMALLOC) | |
499 // Next check for chrome://tcmalloc/, which uses its own job type. | |
500 if (request->url().SchemeIs(kChromeUIScheme) && | |
501 request->url().host() == kChromeUITcmallocHost) { | |
502 return new TcmallocInternalsRequestJob(request, network_delegate); | |
503 } | |
504 #endif | |
505 | |
506 // Next check for chrome://histograms/, which uses its own job type. | 497 // Next check for chrome://histograms/, which uses its own job type. |
507 if (request->url().SchemeIs(kChromeUIScheme) && | 498 if (request->url().SchemeIs(kChromeUIScheme) && |
508 request->url().host() == kChromeUIHistogramHost) { | 499 request->url().host() == kChromeUIHistogramHost) { |
509 return new HistogramInternalsRequestJob(request, network_delegate); | 500 return new HistogramInternalsRequestJob(request, network_delegate); |
510 } | 501 } |
511 | 502 |
512 // Fall back to using a custom handler | 503 // Fall back to using a custom handler |
513 return new URLRequestChromeJob( | 504 return new URLRequestChromeJob( |
514 request, network_delegate, | 505 request, network_delegate, |
515 GetURLDataManagerForResourceContext(resource_context_), is_incognito_); | 506 GetURLDataManagerForResourceContext(resource_context_), is_incognito_); |
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
775 | 766 |
776 } // namespace | 767 } // namespace |
777 | 768 |
778 net::URLRequestJobFactory::ProtocolHandler* | 769 net::URLRequestJobFactory::ProtocolHandler* |
779 CreateDevToolsProtocolHandler(content::ResourceContext* resource_context, | 770 CreateDevToolsProtocolHandler(content::ResourceContext* resource_context, |
780 bool is_incognito) { | 771 bool is_incognito) { |
781 return new DevToolsJobFactory(resource_context, is_incognito); | 772 return new DevToolsJobFactory(resource_context, is_incognito); |
782 } | 773 } |
783 | 774 |
784 } // namespace content | 775 } // namespace content |
OLD | NEW |