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

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

Issue 2148363004: Use std::unique_ptr<> for WebTaskRunner::clone (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 5 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 | « content/child/resource_dispatcher.cc ('k') | content/renderer/renderer_blink_platform_impl.cc » ('j') | 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>
(...skipping 532 matching lines...) Expand 10 before | Expand all | Expand 10 after
543 request_info.fetch_credentials_mode = 543 request_info.fetch_credentials_mode =
544 GetFetchCredentialsModeForWebURLRequest(request); 544 GetFetchCredentialsModeForWebURLRequest(request);
545 request_info.fetch_redirect_mode = 545 request_info.fetch_redirect_mode =
546 GetFetchRedirectModeForWebURLRequest(request); 546 GetFetchRedirectModeForWebURLRequest(request);
547 request_info.fetch_request_context_type = 547 request_info.fetch_request_context_type =
548 GetRequestContextTypeForWebURLRequest(request); 548 GetRequestContextTypeForWebURLRequest(request);
549 request_info.fetch_frame_type = 549 request_info.fetch_frame_type =
550 GetRequestContextFrameTypeForWebURLRequest(request); 550 GetRequestContextFrameTypeForWebURLRequest(request);
551 request_info.extra_data = request.getExtraData(); 551 request_info.extra_data = request.getExtraData();
552 request_info.report_raw_headers = request.reportRawHeaders(); 552 request_info.report_raw_headers = request.reportRawHeaders();
553 request_info.loading_web_task_runner.reset(web_task_runner_->clone()); 553 request_info.loading_web_task_runner = web_task_runner_->clone();
554 request_info.lofi_state = static_cast<LoFiState>(request.getLoFiState()); 554 request_info.lofi_state = static_cast<LoFiState>(request.getLoFiState());
555 555
556 scoped_refptr<ResourceRequestBodyImpl> request_body = 556 scoped_refptr<ResourceRequestBodyImpl> request_body =
557 GetRequestBodyForWebURLRequest(request).get(); 557 GetRequestBodyForWebURLRequest(request).get();
558 558
559 // PlzNavigate: during navigation, the renderer should request a stream which 559 // PlzNavigate: during navigation, the renderer should request a stream which
560 // contains the body of the response. The network request has already been 560 // contains the body of the response. The network request has already been
561 // made by the browser. 561 // made by the browser.
562 if (stream_override_.get()) { 562 if (stream_override_.get()) {
563 CHECK(IsBrowserSideNavigationEnabled()); 563 CHECK(IsBrowserSideNavigationEnabled());
(...skipping 616 matching lines...) Expand 10 before | Expand all | Expand 10 after
1180 1180
1181 void WebURLLoaderImpl::didChangePriority(WebURLRequest::Priority new_priority, 1181 void WebURLLoaderImpl::didChangePriority(WebURLRequest::Priority new_priority,
1182 int intra_priority_value) { 1182 int intra_priority_value) {
1183 context_->DidChangePriority(new_priority, intra_priority_value); 1183 context_->DidChangePriority(new_priority, intra_priority_value);
1184 } 1184 }
1185 1185
1186 void WebURLLoaderImpl::setLoadingTaskRunner( 1186 void WebURLLoaderImpl::setLoadingTaskRunner(
1187 blink::WebTaskRunner* loading_task_runner) { 1187 blink::WebTaskRunner* loading_task_runner) {
1188 // There's no guarantee on the lifetime of |loading_task_runner| so we take a 1188 // There's no guarantee on the lifetime of |loading_task_runner| so we take a
1189 // copy. 1189 // copy.
1190 context_->SetWebTaskRunner(base::WrapUnique(loading_task_runner->clone())); 1190 context_->SetWebTaskRunner(loading_task_runner->clone());
1191 } 1191 }
1192 1192
1193 // This function is implemented here because it uses net functions. it is 1193 // This function is implemented here because it uses net functions. it is
1194 // tested in 1194 // tested in
1195 // third_party/WebKit/Source/core/fetch/MultipartImageResourceParserTest.cpp. 1195 // third_party/WebKit/Source/core/fetch/MultipartImageResourceParserTest.cpp.
1196 bool WebURLLoaderImpl::ParseMultipartHeadersFromBody( 1196 bool WebURLLoaderImpl::ParseMultipartHeadersFromBody(
1197 const char* bytes, 1197 const char* bytes,
1198 size_t size, 1198 size_t size,
1199 blink::WebURLResponse* response, 1199 blink::WebURLResponse* response,
1200 size_t* end) { 1200 size_t* end) {
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
1232 response->clearHTTPHeaderField(webStringName); 1232 response->clearHTTPHeaderField(webStringName);
1233 while (response_headers->EnumerateHeader(&iterator, name, &value)) { 1233 while (response_headers->EnumerateHeader(&iterator, name, &value)) {
1234 response->addHTTPHeaderField(webStringName, 1234 response->addHTTPHeaderField(webStringName,
1235 WebString::fromLatin1(value)); 1235 WebString::fromLatin1(value));
1236 } 1236 }
1237 } 1237 }
1238 return true; 1238 return true;
1239 } 1239 }
1240 1240
1241 } // namespace content 1241 } // namespace content
OLDNEW
« no previous file with comments | « content/child/resource_dispatcher.cc ('k') | content/renderer/renderer_blink_platform_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698