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

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

Issue 2002633002: PlzNavigate: fix issue preventing navigations to WebUIs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/bind.h" 9 #include "base/bind.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 17 matching lines...) Expand all
28 #include "content/browser/net/view_blob_internals_job_factory.h" 28 #include "content/browser/net/view_blob_internals_job_factory.h"
29 #include "content/browser/net/view_http_cache_job_factory.h" 29 #include "content/browser/net/view_http_cache_job_factory.h"
30 #include "content/browser/resource_context_impl.h" 30 #include "content/browser/resource_context_impl.h"
31 #include "content/browser/webui/shared_resources_data_source.h" 31 #include "content/browser/webui/shared_resources_data_source.h"
32 #include "content/browser/webui/url_data_source_impl.h" 32 #include "content/browser/webui/url_data_source_impl.h"
33 #include "content/public/browser/browser_context.h" 33 #include "content/public/browser/browser_context.h"
34 #include "content/public/browser/browser_thread.h" 34 #include "content/public/browser/browser_thread.h"
35 #include "content/public/browser/content_browser_client.h" 35 #include "content/public/browser/content_browser_client.h"
36 #include "content/public/browser/render_process_host.h" 36 #include "content/public/browser/render_process_host.h"
37 #include "content/public/browser/resource_request_info.h" 37 #include "content/public/browser/resource_request_info.h"
38 #include "content/public/common/browser_side_navigation_policy.h"
38 #include "content/public/common/url_constants.h" 39 #include "content/public/common/url_constants.h"
39 #include "net/base/io_buffer.h" 40 #include "net/base/io_buffer.h"
40 #include "net/base/net_errors.h" 41 #include "net/base/net_errors.h"
41 #include "net/http/http_response_headers.h" 42 #include "net/http/http_response_headers.h"
42 #include "net/http/http_status_code.h" 43 #include "net/http/http_status_code.h"
43 #include "net/log/net_log_util.h" 44 #include "net/log/net_log_util.h"
44 #include "net/url_request/url_request.h" 45 #include "net/url_request/url_request.h"
45 #include "net/url_request/url_request_context.h" 46 #include "net/url_request/url_request_context.h"
46 #include "net/url_request/url_request_error_job.h" 47 #include "net/url_request/url_request_error_job.h"
47 #include "net/url_request/url_request_job.h" 48 #include "net/url_request/url_request_job.h"
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after
265 void URLRequestChromeJob::Start() { 266 void URLRequestChromeJob::Start() {
266 const GURL url = request_->url(); 267 const GURL url = request_->url();
267 268
268 TRACE_EVENT_ASYNC_BEGIN1("browser", "DataManager:Request", this, "URL", 269 TRACE_EVENT_ASYNC_BEGIN1("browser", "DataManager:Request", this, "URL",
269 url.possibly_invalid_spec()); 270 url.possibly_invalid_spec());
270 271
271 int render_process_id, unused; 272 int render_process_id, unused;
272 bool is_renderer_request = ResourceRequestInfo::GetRenderFrameForRequest( 273 bool is_renderer_request = ResourceRequestInfo::GetRenderFrameForRequest(
273 request_, &render_process_id, &unused); 274 request_, &render_process_id, &unused);
274 275
275 if (!is_renderer_request) { 276 if (!is_renderer_request ||
277 (render_process_id == -1 && IsBrowserSideNavigationEnabled())) {
278 // PlzNavigate: no navigation to a WebUI is coming from a renderer.
Charlie Reis 2016/05/20 18:50:32 Hmm. This is only a safe change for PlzNavigate i
clamy 2016/05/23 14:21:21 There's one place in the NavigationRequest where w
276 StartAsync(true); 279 StartAsync(true);
277 return; 280 return;
278 } 281 }
279 282
280 if (url.SchemeIs(kChromeUIScheme)) { 283 if (url.SchemeIs(kChromeUIScheme)) {
281 // TODO(dbeam): it's not clear that partition checking is needed or used. It 284 // TODO(dbeam): it's not clear that partition checking is needed or used. It
282 // was added for iframe-based signin (http://crbug.com/338127), which has 285 // was added for iframe-based signin (http://crbug.com/338127), which has
283 // since changed. We should remove if no longer necessary. 286 // since changed. We should remove if no longer necessary.
284 std::vector<std::string> hosts; 287 std::vector<std::string> hosts;
285 hosts.push_back(content::kChromeUIResourcesHost); 288 hosts.push_back(content::kChromeUIResourcesHost);
(...skipping 517 matching lines...) Expand 10 before | Expand all | Expand 10 after
803 806
804 } // namespace 807 } // namespace
805 808
806 net::URLRequestJobFactory::ProtocolHandler* 809 net::URLRequestJobFactory::ProtocolHandler*
807 CreateDevToolsProtocolHandler(content::ResourceContext* resource_context, 810 CreateDevToolsProtocolHandler(content::ResourceContext* resource_context,
808 bool is_incognito) { 811 bool is_incognito) {
809 return new DevToolsJobFactory(resource_context, is_incognito); 812 return new DevToolsJobFactory(resource_context, is_incognito);
810 } 813 }
811 814
812 } // namespace content 815 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698