| 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 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 542 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 553 network_delegate); | 553 network_delegate); |
| 554 | 554 |
| 555 // Next check for chrome://blob-internals/, which uses its own job type. | 555 // Next check for chrome://blob-internals/, which uses its own job type. |
| 556 if (ViewBlobInternalsJobFactory::IsSupportedURL(request->url())) { | 556 if (ViewBlobInternalsJobFactory::IsSupportedURL(request->url())) { |
| 557 return ViewBlobInternalsJobFactory::CreateJobForRequest( | 557 return ViewBlobInternalsJobFactory::CreateJobForRequest( |
| 558 request, network_delegate, blob_storage_context_->context()); | 558 request, network_delegate, blob_storage_context_->context()); |
| 559 } | 559 } |
| 560 | 560 |
| 561 // Next check for chrome://histograms/, which uses its own job type. | 561 // Next check for chrome://histograms/, which uses its own job type. |
| 562 if (request->url().SchemeIs(kChromeUIScheme) && | 562 if (request->url().SchemeIs(kChromeUIScheme) && |
| 563 request->url().host() == kChromeUIHistogramHost) { | 563 request->url().host_piece() == kChromeUIHistogramHost) { |
| 564 return new HistogramInternalsRequestJob(request, network_delegate); | 564 return new HistogramInternalsRequestJob(request, network_delegate); |
| 565 } | 565 } |
| 566 | 566 |
| 567 // Check for chrome://network-error/, which uses its own job type. | 567 // Check for chrome://network-error/, which uses its own job type. |
| 568 if (request->url().SchemeIs(kChromeUIScheme) && | 568 if (request->url().SchemeIs(kChromeUIScheme) && |
| 569 request->url().host() == kChromeUINetworkErrorHost) { | 569 request->url().host_piece() == kChromeUINetworkErrorHost) { |
| 570 // Get the error code passed in via the request URL path. | 570 // Get the error code passed in via the request URL path. |
| 571 std::basic_string<char> error_code_string = | 571 std::basic_string<char> error_code_string = |
| 572 request->url().path().substr(1); | 572 request->url().path().substr(1); |
| 573 | 573 |
| 574 int error_code; | 574 int error_code; |
| 575 if (base::StringToInt(error_code_string, &error_code)) { | 575 if (base::StringToInt(error_code_string, &error_code)) { |
| 576 // Check for a valid error code. | 576 // Check for a valid error code. |
| 577 if (IsValidNetworkErrorCode(error_code) && | 577 if (IsValidNetworkErrorCode(error_code) && |
| 578 error_code != net::Error::ERR_IO_PENDING) { | 578 error_code != net::Error::ERR_IO_PENDING) { |
| 579 return new net::URLRequestErrorJob(request, network_delegate, | 579 return new net::URLRequestErrorJob(request, network_delegate, |
| (...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 856 | 856 |
| 857 } // namespace | 857 } // namespace |
| 858 | 858 |
| 859 net::URLRequestJobFactory::ProtocolHandler* CreateDevToolsProtocolHandler( | 859 net::URLRequestJobFactory::ProtocolHandler* CreateDevToolsProtocolHandler( |
| 860 ResourceContext* resource_context, | 860 ResourceContext* resource_context, |
| 861 bool is_incognito) { | 861 bool is_incognito) { |
| 862 return new DevToolsJobFactory(resource_context, is_incognito); | 862 return new DevToolsJobFactory(resource_context, is_incognito); |
| 863 } | 863 } |
| 864 | 864 |
| 865 } // namespace content | 865 } // namespace content |
| OLD | NEW |