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 417 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
428 request_info.referrer = referrer_url; | 428 request_info.referrer = referrer_url; |
429 request_info.frame_origin = frame_origin; | 429 request_info.frame_origin = frame_origin; |
430 request_info.main_frame_origin = main_frame_origin; | 430 request_info.main_frame_origin = main_frame_origin; |
431 request_info.headers = flattener.GetBuffer(); | 431 request_info.headers = flattener.GetBuffer(); |
432 request_info.load_flags = load_flags; | 432 request_info.load_flags = load_flags; |
433 request_info.requestor_pid = requestor_pid; | 433 request_info.requestor_pid = requestor_pid; |
434 request_info.request_type = FromTargetType(request.targetType()); | 434 request_info.request_type = FromTargetType(request.targetType()); |
435 request_info.appcache_host_id = request.appCacheHostID(); | 435 request_info.appcache_host_id = request.appCacheHostID(); |
436 request_info.routing_id = request.requestorID(); | 436 request_info.routing_id = request.requestorID(); |
437 request_info.download_to_file = request.downloadToFile(); | 437 request_info.download_to_file = request.downloadToFile(); |
| 438 request_info.has_user_gesture = request.hasUserGesture(); |
438 bridge_.reset(ResourceLoaderBridge::Create(request_info)); | 439 bridge_.reset(ResourceLoaderBridge::Create(request_info)); |
439 | 440 |
440 if (!request.httpBody().isNull()) { | 441 if (!request.httpBody().isNull()) { |
441 // GET and HEAD requests shouldn't have http bodies. | 442 // GET and HEAD requests shouldn't have http bodies. |
442 DCHECK(method != "GET" && method != "HEAD"); | 443 DCHECK(method != "GET" && method != "HEAD"); |
443 const WebHTTPBody& httpBody = request.httpBody(); | 444 const WebHTTPBody& httpBody = request.httpBody(); |
444 size_t i = 0; | 445 size_t i = 0; |
445 WebHTTPBody::Element element; | 446 WebHTTPBody::Element element; |
446 while (httpBody.elementAt(i++, element)) { | 447 while (httpBody.elementAt(i++, element)) { |
447 switch (element.type) { | 448 switch (element.type) { |
(...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
749 | 750 |
750 void WebURLLoaderImpl::cancel() { | 751 void WebURLLoaderImpl::cancel() { |
751 context_->Cancel(); | 752 context_->Cancel(); |
752 } | 753 } |
753 | 754 |
754 void WebURLLoaderImpl::setDefersLoading(bool value) { | 755 void WebURLLoaderImpl::setDefersLoading(bool value) { |
755 context_->SetDefersLoading(value); | 756 context_->SetDefersLoading(value); |
756 } | 757 } |
757 | 758 |
758 } // namespace webkit_glue | 759 } // namespace webkit_glue |
OLD | NEW |