Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(207)

Side by Side Diff: content/browser/webui/url_data_manager_backend.cc

Issue 1421743002: Implement chrome://network-errors for direct access to network error interstitials (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/network_error_request_job.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"
36 #include "content/public/browser/resource_request_info.h" 37 #include "content/public/browser/resource_request_info.h"
37 #include "content/public/common/url_constants.h" 38 #include "content/public/common/url_constants.h"
(...skipping 462 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 if (request->url().SchemeIs(kChromeUIScheme) &&
mmenke 2015/10/22 15:41:31 Should have a comment about this.
edwardjung 2015/11/06 12:05:51 Done.
512 request->url().host() == kChromeUINetworkErrorHost) {
mmenke 2015/10/22 15:41:31 Hrm...Doesn't look like there's an easy way to put
edwardjung 2015/11/06 12:05:51 Acknowledged.
513 return new NetworkErrorRequestJob(request, network_delegate);
514 }
515
510 // Fall back to using a custom handler 516 // Fall back to using a custom handler
511 return new URLRequestChromeJob( 517 return new URLRequestChromeJob(
512 request, network_delegate, 518 request, network_delegate,
513 GetURLDataManagerForResourceContext(resource_context_), is_incognito_); 519 GetURLDataManagerForResourceContext(resource_context_), is_incognito_);
514 } 520 }
515 521
516 bool IsSafeRedirectTarget(const GURL& location) const override { 522 bool IsSafeRedirectTarget(const GURL& location) const override {
517 return false; 523 return false;
518 } 524 }
519 525
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after
773 779
774 } // namespace 780 } // namespace
775 781
776 net::URLRequestJobFactory::ProtocolHandler* 782 net::URLRequestJobFactory::ProtocolHandler*
777 CreateDevToolsProtocolHandler(content::ResourceContext* resource_context, 783 CreateDevToolsProtocolHandler(content::ResourceContext* resource_context,
778 bool is_incognito) { 784 bool is_incognito) {
779 return new DevToolsJobFactory(resource_context, is_incognito); 785 return new DevToolsJobFactory(resource_context, is_incognito);
780 } 786 }
781 787
782 } // namespace content 788 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698