| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 // An implementation of WebURLLoader in terms of ResourceLoaderBridge. | 5 // An implementation of WebURLLoader in terms of ResourceLoaderBridge. |
| 6 | 6 |
| 7 #include "webkit/glue/weburlloader_impl.h" | 7 #include "webkit/glue/weburlloader_impl.h" |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/file_path.h" | 10 #include "base/file_path.h" |
| (...skipping 402 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 413 // the render process, so we can use requestorProcessID even for requests | 413 // the render process, so we can use requestorProcessID even for requests |
| 414 // from in-process plugins. | 414 // from in-process plugins. |
| 415 request_info.requestor_pid = request.requestorProcessID(); | 415 request_info.requestor_pid = request.requestorProcessID(); |
| 416 request_info.request_type = | 416 request_info.request_type = |
| 417 ResourceType::FromTargetType(request.targetType()); | 417 ResourceType::FromTargetType(request.targetType()); |
| 418 request_info.appcache_host_id = request.appCacheHostID(); | 418 request_info.appcache_host_id = request.appCacheHostID(); |
| 419 request_info.routing_id = request.requestorID(); | 419 request_info.routing_id = request.requestorID(); |
| 420 request_info.download_to_file = request.downloadToFile(); | 420 request_info.download_to_file = request.downloadToFile(); |
| 421 request_info.has_user_gesture = request.hasUserGesture(); | 421 request_info.has_user_gesture = request.hasUserGesture(); |
| 422 request_info.extra_data = request.extraData(); | 422 request_info.extra_data = request.extraData(); |
| 423 bridge_.reset(platform->CreateResourceLoader(request_info)); | |
| 424 | |
| 425 if (request.extraData()) { | 423 if (request.extraData()) { |
| 426 referrer_policy_ = static_cast<WebURLRequestExtraDataImpl*>( | 424 referrer_policy_ = static_cast<WebURLRequestExtraDataImpl*>( |
| 427 request.extraData())->referrer_policy(); | 425 request.extraData())->referrer_policy(); |
| 426 request_info.referrer_policy = referrer_policy_; |
| 428 } | 427 } |
| 428 bridge_.reset(platform->CreateResourceLoader(request_info)); |
| 429 | 429 |
| 430 if (!request.httpBody().isNull()) { | 430 if (!request.httpBody().isNull()) { |
| 431 // GET and HEAD requests shouldn't have http bodies. | 431 // GET and HEAD requests shouldn't have http bodies. |
| 432 DCHECK(method != "GET" && method != "HEAD"); | 432 DCHECK(method != "GET" && method != "HEAD"); |
| 433 const WebHTTPBody& httpBody = request.httpBody(); | 433 const WebHTTPBody& httpBody = request.httpBody(); |
| 434 size_t i = 0; | 434 size_t i = 0; |
| 435 WebHTTPBody::Element element; | 435 WebHTTPBody::Element element; |
| 436 while (httpBody.elementAt(i++, element)) { | 436 while (httpBody.elementAt(i++, element)) { |
| 437 switch (element.type) { | 437 switch (element.type) { |
| 438 case WebHTTPBody::Element::TypeData: | 438 case WebHTTPBody::Element::TypeData: |
| (...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 752 | 752 |
| 753 void WebURLLoaderImpl::setDefersLoading(bool value) { | 753 void WebURLLoaderImpl::setDefersLoading(bool value) { |
| 754 context_->SetDefersLoading(value); | 754 context_->SetDefersLoading(value); |
| 755 } | 755 } |
| 756 | 756 |
| 757 void WebURLLoaderImpl::UpdateRoutingId(int new_routing_id) { | 757 void WebURLLoaderImpl::UpdateRoutingId(int new_routing_id) { |
| 758 context_->UpdateRoutingId(new_routing_id); | 758 context_->UpdateRoutingId(new_routing_id); |
| 759 } | 759 } |
| 760 | 760 |
| 761 } // namespace webkit_glue | 761 } // namespace webkit_glue |
| OLD | NEW |