OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 451 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
462 WebStringToFilePath(element.filePath), | 462 WebStringToFilePath(element.filePath), |
463 0, kuint64max, base::Time()); | 463 0, kuint64max, base::Time()); |
464 } else { | 464 } else { |
465 request_body->AppendFileRange( | 465 request_body->AppendFileRange( |
466 WebStringToFilePath(element.filePath), | 466 WebStringToFilePath(element.filePath), |
467 static_cast<uint64>(element.fileStart), | 467 static_cast<uint64>(element.fileStart), |
468 static_cast<uint64>(element.fileLength), | 468 static_cast<uint64>(element.fileLength), |
469 base::Time::FromDoubleT(element.modificationTime)); | 469 base::Time::FromDoubleT(element.modificationTime)); |
470 } | 470 } |
471 break; | 471 break; |
| 472 case WebHTTPBody::Element::TypeURL: { |
| 473 GURL url = GURL(element.url); |
| 474 DCHECK(url.SchemeIsFileSystem()); |
| 475 request_body->AppendFileSystemFileRange( |
| 476 url, |
| 477 static_cast<uint64>(element.fileStart), |
| 478 static_cast<uint64>(element.fileLength), |
| 479 base::Time::FromDoubleT(element.modificationTime)); |
| 480 break; |
| 481 } |
472 case WebHTTPBody::Element::TypeBlob: | 482 case WebHTTPBody::Element::TypeBlob: |
473 request_body->AppendBlob(GURL(element.blobURL)); | 483 request_body->AppendBlob(GURL(element.blobURL)); |
474 break; | 484 break; |
475 default: | 485 default: |
476 NOTREACHED(); | 486 NOTREACHED(); |
477 } | 487 } |
478 } | 488 } |
479 request_body->set_identifier(request.httpBody().identifier()); | 489 request_body->set_identifier(request.httpBody().identifier()); |
480 bridge_->SetRequestBody(request_body); | 490 bridge_->SetRequestBody(request_body); |
481 } | 491 } |
(...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
769 | 779 |
770 void WebURLLoaderImpl::cancel() { | 780 void WebURLLoaderImpl::cancel() { |
771 context_->Cancel(); | 781 context_->Cancel(); |
772 } | 782 } |
773 | 783 |
774 void WebURLLoaderImpl::setDefersLoading(bool value) { | 784 void WebURLLoaderImpl::setDefersLoading(bool value) { |
775 context_->SetDefersLoading(value); | 785 context_->SetDefersLoading(value); |
776 } | 786 } |
777 | 787 |
778 } // namespace webkit_glue | 788 } // namespace webkit_glue |
OLD | NEW |