| 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/network_error_request_job.h" |
| 26 #include "content/browser/net/view_blob_internals_job_factory.h" | 27 #include "content/browser/net/view_blob_internals_job_factory.h" |
| 27 #include "content/browser/net/view_http_cache_job_factory.h" | 28 #include "content/browser/net/view_http_cache_job_factory.h" |
| 28 #include "content/browser/resource_context_impl.h" | 29 #include "content/browser/resource_context_impl.h" |
| 29 #include "content/browser/tcmalloc_internals_request_job.h" | 30 #include "content/browser/tcmalloc_internals_request_job.h" |
| 30 #include "content/browser/webui/shared_resources_data_source.h" | 31 #include "content/browser/webui/shared_resources_data_source.h" |
| 31 #include "content/browser/webui/url_data_source_impl.h" | 32 #include "content/browser/webui/url_data_source_impl.h" |
| 32 #include "content/public/browser/browser_context.h" | 33 #include "content/public/browser/browser_context.h" |
| 33 #include "content/public/browser/browser_thread.h" | 34 #include "content/public/browser/browser_thread.h" |
| 34 #include "content/public/browser/content_browser_client.h" | 35 #include "content/public/browser/content_browser_client.h" |
| 35 #include "content/public/browser/render_process_host.h" | 36 #include "content/public/browser/render_process_host.h" |
| (...skipping 464 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 500 return new TcmallocInternalsRequestJob(request, network_delegate); | 501 return new TcmallocInternalsRequestJob(request, network_delegate); |
| 501 } | 502 } |
| 502 #endif | 503 #endif |
| 503 | 504 |
| 504 // Next check for chrome://histograms/, which uses its own job type. | 505 // Next check for chrome://histograms/, which uses its own job type. |
| 505 if (request->url().SchemeIs(kChromeUIScheme) && | 506 if (request->url().SchemeIs(kChromeUIScheme) && |
| 506 request->url().host() == kChromeUIHistogramHost) { | 507 request->url().host() == kChromeUIHistogramHost) { |
| 507 return new HistogramInternalsRequestJob(request, network_delegate); | 508 return new HistogramInternalsRequestJob(request, network_delegate); |
| 508 } | 509 } |
| 509 | 510 |
| 511 // Check for chrome://network-errors/, which uses its own job type. |
| 512 if (request->url().SchemeIs(kChromeUIScheme) && |
| 513 request->url().host() == kChromeUINetworkErrorHost) { |
| 514 return new NetworkErrorRequestJob(request, network_delegate); |
| 515 } |
| 516 |
| 510 // Fall back to using a custom handler | 517 // Fall back to using a custom handler |
| 511 return new URLRequestChromeJob( | 518 return new URLRequestChromeJob( |
| 512 request, network_delegate, | 519 request, network_delegate, |
| 513 GetURLDataManagerForResourceContext(resource_context_), is_incognito_); | 520 GetURLDataManagerForResourceContext(resource_context_), is_incognito_); |
| 514 } | 521 } |
| 515 | 522 |
| 516 bool IsSafeRedirectTarget(const GURL& location) const override { | 523 bool IsSafeRedirectTarget(const GURL& location) const override { |
| 517 return false; | 524 return false; |
| 518 } | 525 } |
| 519 | 526 |
| (...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 773 | 780 |
| 774 } // namespace | 781 } // namespace |
| 775 | 782 |
| 776 net::URLRequestJobFactory::ProtocolHandler* | 783 net::URLRequestJobFactory::ProtocolHandler* |
| 777 CreateDevToolsProtocolHandler(content::ResourceContext* resource_context, | 784 CreateDevToolsProtocolHandler(content::ResourceContext* resource_context, |
| 778 bool is_incognito) { | 785 bool is_incognito) { |
| 779 return new DevToolsJobFactory(resource_context, is_incognito); | 786 return new DevToolsJobFactory(resource_context, is_incognito); |
| 780 } | 787 } |
| 781 | 788 |
| 782 } // namespace content | 789 } // namespace content |
| OLD | NEW |