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

Side by Side Diff: content/child/web_url_loader_impl.cc

Issue 2805693002: PlzNavigate: add DumpWithoutCrashing for invalid main resource request. (Closed)
Patch Set: Add TODO. Created 3 years, 8 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/child/web_url_loader_impl.h" 5 #include "content/child/web_url_loader_impl.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <memory> 10 #include <memory>
11 #include <string> 11 #include <string>
12 #include <utility> 12 #include <utility>
13 #include <vector> 13 #include <vector>
14 14
15 #include "base/bind.h" 15 #include "base/bind.h"
16 #include "base/debug/dump_without_crashing.h"
16 #include "base/files/file_path.h" 17 #include "base/files/file_path.h"
17 #include "base/logging.h" 18 #include "base/logging.h"
18 #include "base/memory/ptr_util.h" 19 #include "base/memory/ptr_util.h"
19 #include "base/optional.h" 20 #include "base/optional.h"
20 #include "base/single_thread_task_runner.h" 21 #include "base/single_thread_task_runner.h"
21 #include "base/strings/string_number_conversions.h" 22 #include "base/strings/string_number_conversions.h"
22 #include "base/strings/string_util.h" 23 #include "base/strings/string_util.h"
23 #include "base/threading/thread_task_runner_handle.h" 24 #include "base/threading/thread_task_runner_handle.h"
24 #include "base/time/time.h" 25 #include "base/time/time.h"
25 #include "build/build_config.h" 26 #include "build/build_config.h"
(...skipping 579 matching lines...) Expand 10 before | Expand all | Expand 10 after
605 // PlzNavigate: during navigation, the renderer should request a stream which 606 // PlzNavigate: during navigation, the renderer should request a stream which
606 // contains the body of the response. The network request has already been 607 // contains the body of the response. The network request has already been
607 // made by the browser. 608 // made by the browser.
608 if (stream_override_.get()) { 609 if (stream_override_.get()) {
609 CHECK(IsBrowserSideNavigationEnabled()); 610 CHECK(IsBrowserSideNavigationEnabled());
610 DCHECK(!sync_load_response); 611 DCHECK(!sync_load_response);
611 DCHECK_NE(WebURLRequest::FrameTypeNone, request.getFrameType()); 612 DCHECK_NE(WebURLRequest::FrameTypeNone, request.getFrameType());
612 resource_request->resource_body_stream_url = stream_override_->stream_url; 613 resource_request->resource_body_stream_url = stream_override_->stream_url;
613 } 614 }
614 615
616 // PlzNavigate: Invalid renderer main resource requests are rejected by the
617 // browser. This should not happen.
618 // TODO(arthursonzogni): Remove this when the root cause for
619 // https://crbug.com/705508 is found.
620 if (IsBrowserSideNavigationEnabled() &&
621 IsResourceTypeFrame(resource_request->resource_type) &&
622 !resource_request->resource_body_stream_url.SchemeIs(url::kBlobScheme)) {
623 base::debug::DumpWithoutCrashing();
624 }
625
615 const RequestExtraData empty_extra_data; 626 const RequestExtraData empty_extra_data;
616 const RequestExtraData* extra_data; 627 const RequestExtraData* extra_data;
617 if (request.getExtraData()) 628 if (request.getExtraData())
618 extra_data = static_cast<RequestExtraData*>(request.getExtraData()); 629 extra_data = static_cast<RequestExtraData*>(request.getExtraData());
619 else 630 else
620 extra_data = &empty_extra_data; 631 extra_data = &empty_extra_data;
621 extra_data->CopyToResourceRequest(resource_request.get()); 632 extra_data->CopyToResourceRequest(resource_request.get());
622 633
623 if (sync_load_response) { 634 if (sync_load_response) {
624 DCHECK(defers_loading_ == NOT_DEFERRING); 635 DCHECK(defers_loading_ == NOT_DEFERRING);
(...skipping 624 matching lines...) Expand 10 before | Expand all | Expand 10 after
1249 int intra_priority_value) { 1260 int intra_priority_value) {
1250 context_->DidChangePriority(new_priority, intra_priority_value); 1261 context_->DidChangePriority(new_priority, intra_priority_value);
1251 } 1262 }
1252 1263
1253 void WebURLLoaderImpl::setLoadingTaskRunner( 1264 void WebURLLoaderImpl::setLoadingTaskRunner(
1254 base::SingleThreadTaskRunner* loading_task_runner) { 1265 base::SingleThreadTaskRunner* loading_task_runner) {
1255 context_->SetTaskRunner(loading_task_runner); 1266 context_->SetTaskRunner(loading_task_runner);
1256 } 1267 }
1257 1268
1258 } // namespace content 1269 } // 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