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 410 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
421 request_info.referrer = referrer_url; | 421 request_info.referrer = referrer_url; |
422 request_info.frame_origin = frame_origin; | 422 request_info.frame_origin = frame_origin; |
423 request_info.main_frame_origin = main_frame_origin; | 423 request_info.main_frame_origin = main_frame_origin; |
424 request_info.headers = flattener.GetBuffer(); | 424 request_info.headers = flattener.GetBuffer(); |
425 request_info.load_flags = load_flags; | 425 request_info.load_flags = load_flags; |
426 request_info.requestor_pid = requestor_pid; | 426 request_info.requestor_pid = requestor_pid; |
427 request_info.request_type = FromTargetType(request.targetType()); | 427 request_info.request_type = FromTargetType(request.targetType()); |
428 request_info.appcache_host_id = request.appCacheHostID(); | 428 request_info.appcache_host_id = request.appCacheHostID(); |
429 request_info.routing_id = request.requestorID(); | 429 request_info.routing_id = request.requestorID(); |
430 request_info.download_to_file = request.downloadToFile(); | 430 request_info.download_to_file = request.downloadToFile(); |
| 431 request_info.has_user_gesture = request.hasUserGesture(); |
431 bridge_.reset(ResourceLoaderBridge::Create(request_info)); | 432 bridge_.reset(ResourceLoaderBridge::Create(request_info)); |
432 | 433 |
433 if (!request.httpBody().isNull()) { | 434 if (!request.httpBody().isNull()) { |
434 // GET and HEAD requests shouldn't have http bodies. | 435 // GET and HEAD requests shouldn't have http bodies. |
435 DCHECK(method != "GET" && method != "HEAD"); | 436 DCHECK(method != "GET" && method != "HEAD"); |
436 const WebHTTPBody& httpBody = request.httpBody(); | 437 const WebHTTPBody& httpBody = request.httpBody(); |
437 size_t i = 0; | 438 size_t i = 0; |
438 WebHTTPBody::Element element; | 439 WebHTTPBody::Element element; |
439 while (httpBody.elementAt(i++, element)) { | 440 while (httpBody.elementAt(i++, element)) { |
440 switch (element.type) { | 441 switch (element.type) { |
(...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
719 | 720 |
720 void WebURLLoaderImpl::cancel() { | 721 void WebURLLoaderImpl::cancel() { |
721 context_->Cancel(); | 722 context_->Cancel(); |
722 } | 723 } |
723 | 724 |
724 void WebURLLoaderImpl::setDefersLoading(bool value) { | 725 void WebURLLoaderImpl::setDefersLoading(bool value) { |
725 context_->SetDefersLoading(value); | 726 context_->SetDefersLoading(value); |
726 } | 727 } |
727 | 728 |
728 } // namespace webkit_glue | 729 } // namespace webkit_glue |
OLD | NEW |