| OLD | NEW |
| 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" | |
| 17 #include "base/files/file_path.h" | 16 #include "base/files/file_path.h" |
| 18 #include "base/logging.h" | 17 #include "base/logging.h" |
| 19 #include "base/memory/ptr_util.h" | 18 #include "base/memory/ptr_util.h" |
| 20 #include "base/optional.h" | 19 #include "base/optional.h" |
| 21 #include "base/single_thread_task_runner.h" | 20 #include "base/single_thread_task_runner.h" |
| 22 #include "base/strings/string_number_conversions.h" | 21 #include "base/strings/string_number_conversions.h" |
| 23 #include "base/strings/string_util.h" | 22 #include "base/strings/string_util.h" |
| 24 #include "base/threading/thread_task_runner_handle.h" | 23 #include "base/threading/thread_task_runner_handle.h" |
| 25 #include "base/time/time.h" | 24 #include "base/time/time.h" |
| 26 #include "build/build_config.h" | 25 #include "build/build_config.h" |
| (...skipping 582 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 609 CHECK(IsBrowserSideNavigationEnabled()); | 608 CHECK(IsBrowserSideNavigationEnabled()); |
| 610 DCHECK(!sync_load_response); | 609 DCHECK(!sync_load_response); |
| 611 DCHECK_NE(WebURLRequest::kFrameTypeNone, request.GetFrameType()); | 610 DCHECK_NE(WebURLRequest::kFrameTypeNone, request.GetFrameType()); |
| 612 if (stream_override_->consumer_handle.is_valid()) { | 611 if (stream_override_->consumer_handle.is_valid()) { |
| 613 consumer_handle = std::move(stream_override_->consumer_handle); | 612 consumer_handle = std::move(stream_override_->consumer_handle); |
| 614 } else { | 613 } else { |
| 615 resource_request->resource_body_stream_url = stream_override_->stream_url; | 614 resource_request->resource_body_stream_url = stream_override_->stream_url; |
| 616 } | 615 } |
| 617 } | 616 } |
| 618 | 617 |
| 619 // PlzNavigate: Invalid renderer main resource requests are rejected by the | |
| 620 // browser. This should not happen. | |
| 621 // TODO(arthursonzogni): Remove this when the root cause for | |
| 622 // https://crbug.com/705508 is found. | |
| 623 if (IsBrowserSideNavigationEnabled() && | |
| 624 IsResourceTypeFrame(resource_request->resource_type) && | |
| 625 !resource_request->resource_body_stream_url.SchemeIs(url::kBlobScheme) && | |
| 626 !consumer_handle.is_valid()) { | |
| 627 base::debug::DumpWithoutCrashing(); | |
| 628 } | |
| 629 | |
| 630 RequestExtraData empty_extra_data; | 618 RequestExtraData empty_extra_data; |
| 631 RequestExtraData* extra_data; | 619 RequestExtraData* extra_data; |
| 632 if (request.GetExtraData()) | 620 if (request.GetExtraData()) |
| 633 extra_data = static_cast<RequestExtraData*>(request.GetExtraData()); | 621 extra_data = static_cast<RequestExtraData*>(request.GetExtraData()); |
| 634 else | 622 else |
| 635 extra_data = &empty_extra_data; | 623 extra_data = &empty_extra_data; |
| 636 extra_data->CopyToResourceRequest(resource_request.get()); | 624 extra_data->CopyToResourceRequest(resource_request.get()); |
| 637 if (extra_data->url_loader_factory_override()) | 625 if (extra_data->url_loader_factory_override()) |
| 638 url_loader_factory_ = extra_data->url_loader_factory_override(); | 626 url_loader_factory_ = extra_data->url_loader_factory_override(); |
| 639 | 627 |
| (...skipping 648 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1288 int intra_priority_value) { | 1276 int intra_priority_value) { |
| 1289 context_->DidChangePriority(new_priority, intra_priority_value); | 1277 context_->DidChangePriority(new_priority, intra_priority_value); |
| 1290 } | 1278 } |
| 1291 | 1279 |
| 1292 void WebURLLoaderImpl::SetLoadingTaskRunner( | 1280 void WebURLLoaderImpl::SetLoadingTaskRunner( |
| 1293 base::SingleThreadTaskRunner* loading_task_runner) { | 1281 base::SingleThreadTaskRunner* loading_task_runner) { |
| 1294 context_->SetTaskRunner(loading_task_runner); | 1282 context_->SetTaskRunner(loading_task_runner); |
| 1295 } | 1283 } |
| 1296 | 1284 |
| 1297 } // namespace content | 1285 } // namespace content |
| OLD | NEW |