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 #include <algorithm> | 8 #include <algorithm> |
9 #include <string> | 9 #include <string> |
10 #include <utility> | 10 #include <utility> |
(...skipping 441 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
452 request_id_, | 452 request_id_, |
453 ConvertWebKitPriorityToNetPriority(new_priority), | 453 ConvertWebKitPriorityToNetPriority(new_priority), |
454 intra_priority_value); | 454 intra_priority_value); |
455 } | 455 } |
456 } | 456 } |
457 | 457 |
458 void WebURLLoaderImpl::Context::Start(const WebURLRequest& request, | 458 void WebURLLoaderImpl::Context::Start(const WebURLRequest& request, |
459 SyncLoadResponse* sync_load_response) { | 459 SyncLoadResponse* sync_load_response) { |
460 DCHECK(request_id_ == -1); | 460 DCHECK(request_id_ == -1); |
461 request_ = request; // Save the request. | 461 request_ = request; // Save the request. |
462 if (request.extraData()) { | 462 if (request.getExtraData()) { |
463 RequestExtraData* extra_data = | 463 RequestExtraData* extra_data = |
464 static_cast<RequestExtraData*>(request.extraData()); | 464 static_cast<RequestExtraData*>(request.getExtraData()); |
465 stream_override_ = extra_data->TakeStreamOverrideOwnership(); | 465 stream_override_ = extra_data->TakeStreamOverrideOwnership(); |
466 } | 466 } |
467 | 467 |
468 GURL url = request.url(); | 468 GURL url = request.url(); |
469 | 469 |
470 if (CanHandleDataURLRequestLocally()) { | 470 if (CanHandleDataURLRequestLocally()) { |
471 if (sync_load_response) { | 471 if (sync_load_response) { |
472 // This is a sync load. Do the work now. | 472 // This is a sync load. Do the work now. |
473 sync_load_response->url = url; | 473 sync_load_response->url = url; |
474 sync_load_response->error_code = | 474 sync_load_response->error_code = |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
533 request_info.fetch_request_mode = | 533 request_info.fetch_request_mode = |
534 GetFetchRequestModeForWebURLRequest(request); | 534 GetFetchRequestModeForWebURLRequest(request); |
535 request_info.fetch_credentials_mode = | 535 request_info.fetch_credentials_mode = |
536 GetFetchCredentialsModeForWebURLRequest(request); | 536 GetFetchCredentialsModeForWebURLRequest(request); |
537 request_info.fetch_redirect_mode = | 537 request_info.fetch_redirect_mode = |
538 GetFetchRedirectModeForWebURLRequest(request); | 538 GetFetchRedirectModeForWebURLRequest(request); |
539 request_info.fetch_request_context_type = | 539 request_info.fetch_request_context_type = |
540 GetRequestContextTypeForWebURLRequest(request); | 540 GetRequestContextTypeForWebURLRequest(request); |
541 request_info.fetch_frame_type = | 541 request_info.fetch_frame_type = |
542 GetRequestContextFrameTypeForWebURLRequest(request); | 542 GetRequestContextFrameTypeForWebURLRequest(request); |
543 request_info.extra_data = request.extraData(); | 543 request_info.extra_data = request.getExtraData(); |
544 request_info.report_raw_headers = request.reportRawHeaders(); | 544 request_info.report_raw_headers = request.reportRawHeaders(); |
545 request_info.loading_web_task_runner.reset(web_task_runner_->clone()); | 545 request_info.loading_web_task_runner.reset(web_task_runner_->clone()); |
546 | 546 |
547 scoped_refptr<ResourceRequestBody> request_body = | 547 scoped_refptr<ResourceRequestBody> request_body = |
548 GetRequestBodyForWebURLRequest(request).get(); | 548 GetRequestBodyForWebURLRequest(request).get(); |
549 | 549 |
550 // PlzNavigate: during navigation, the renderer should request a stream which | 550 // PlzNavigate: during navigation, the renderer should request a stream which |
551 // contains the body of the response. The network request has already been | 551 // contains the body of the response. The network request has already been |
552 // made by the browser. | 552 // made by the browser. |
553 if (stream_override_.get()) { | 553 if (stream_override_.get()) { |
(...skipping 642 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1196 response->clearHTTPHeaderField(webStringName); | 1196 response->clearHTTPHeaderField(webStringName); |
1197 while (response_headers->EnumerateHeader(&iterator, name, &value)) { | 1197 while (response_headers->EnumerateHeader(&iterator, name, &value)) { |
1198 response->addHTTPHeaderField(webStringName, | 1198 response->addHTTPHeaderField(webStringName, |
1199 WebString::fromLatin1(value)); | 1199 WebString::fromLatin1(value)); |
1200 } | 1200 } |
1201 } | 1201 } |
1202 return true; | 1202 return true; |
1203 } | 1203 } |
1204 | 1204 |
1205 } // namespace content | 1205 } // namespace content |
OLD | NEW |