OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/file_path.h" | 9 #include "base/file_path.h" |
10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
(...skipping 414 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
425 request_info.referrer = referrer_url; | 425 request_info.referrer = referrer_url; |
426 request_info.frame_origin = frame_origin; | 426 request_info.frame_origin = frame_origin; |
427 request_info.main_frame_origin = main_frame_origin; | 427 request_info.main_frame_origin = main_frame_origin; |
428 request_info.headers = flattener.GetBuffer(); | 428 request_info.headers = flattener.GetBuffer(); |
429 request_info.load_flags = load_flags; | 429 request_info.load_flags = load_flags; |
430 request_info.requestor_pid = requestor_pid; | 430 request_info.requestor_pid = requestor_pid; |
431 request_info.request_type = FromTargetType(request.targetType()); | 431 request_info.request_type = FromTargetType(request.targetType()); |
432 request_info.appcache_host_id = request.appCacheHostID(); | 432 request_info.appcache_host_id = request.appCacheHostID(); |
433 request_info.routing_id = request.requestorID(); | 433 request_info.routing_id = request.requestorID(); |
434 request_info.download_to_file = request.downloadToFile(); | 434 request_info.download_to_file = request.downloadToFile(); |
| 435 request_info.has_user_gesture = request.hasUserGesture(); |
435 bridge_.reset(ResourceLoaderBridge::Create(request_info)); | 436 bridge_.reset(ResourceLoaderBridge::Create(request_info)); |
436 | 437 |
437 if (!request.httpBody().isNull()) { | 438 if (!request.httpBody().isNull()) { |
438 // GET and HEAD requests shouldn't have http bodies. | 439 // GET and HEAD requests shouldn't have http bodies. |
439 DCHECK(method != "GET" && method != "HEAD"); | 440 DCHECK(method != "GET" && method != "HEAD"); |
440 const WebHTTPBody& httpBody = request.httpBody(); | 441 const WebHTTPBody& httpBody = request.httpBody(); |
441 size_t i = 0; | 442 size_t i = 0; |
442 WebHTTPBody::Element element; | 443 WebHTTPBody::Element element; |
443 while (httpBody.elementAt(i++, element)) { | 444 while (httpBody.elementAt(i++, element)) { |
444 switch (element.type) { | 445 switch (element.type) { |
(...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
723 | 724 |
724 void WebURLLoaderImpl::cancel() { | 725 void WebURLLoaderImpl::cancel() { |
725 context_->Cancel(); | 726 context_->Cancel(); |
726 } | 727 } |
727 | 728 |
728 void WebURLLoaderImpl::setDefersLoading(bool value) { | 729 void WebURLLoaderImpl::setDefersLoading(bool value) { |
729 context_->SetDefersLoading(value); | 730 context_->SetDefersLoading(value); |
730 } | 731 } |
731 | 732 |
732 } // namespace webkit_glue | 733 } // namespace webkit_glue |
OLD | NEW |