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 448 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
459 bridge_->AppendFileToUpload( | 459 bridge_->AppendFileToUpload( |
460 WebStringToFilePath(element.filePath)); | 460 WebStringToFilePath(element.filePath)); |
461 } else { | 461 } else { |
462 bridge_->AppendFileRangeToUpload( | 462 bridge_->AppendFileRangeToUpload( |
463 WebStringToFilePath(element.filePath), | 463 WebStringToFilePath(element.filePath), |
464 static_cast<uint64>(element.fileStart), | 464 static_cast<uint64>(element.fileStart), |
465 static_cast<uint64>(element.fileLength), | 465 static_cast<uint64>(element.fileLength), |
466 base::Time::FromDoubleT(element.modificationTime)); | 466 base::Time::FromDoubleT(element.modificationTime)); |
467 } | 467 } |
468 break; | 468 break; |
| 469 case WebHTTPBody::Element::TypeURL: { |
| 470 GURL url = GURL(element.url); |
| 471 DCHECK(url.SchemeIsFileSystem()); |
| 472 bridge_->AppendFileSystemFileRangeToUpload( |
| 473 url, |
| 474 static_cast<uint64>(element.fileStart), |
| 475 static_cast<uint64>(element.fileLength), |
| 476 base::Time::FromDoubleT(element.modificationTime)); |
| 477 break; |
| 478 } |
469 case WebHTTPBody::Element::TypeBlob: | 479 case WebHTTPBody::Element::TypeBlob: |
470 bridge_->AppendBlobToUpload(GURL(element.blobURL)); | 480 bridge_->AppendBlobToUpload(GURL(element.url)); |
471 break; | 481 break; |
472 default: | 482 default: |
473 NOTREACHED(); | 483 NOTREACHED(); |
474 } | 484 } |
475 } | 485 } |
476 bridge_->SetUploadIdentifier(request.httpBody().identifier()); | 486 bridge_->SetUploadIdentifier(request.httpBody().identifier()); |
477 } | 487 } |
478 | 488 |
479 if (sync_load_response) { | 489 if (sync_load_response) { |
480 bridge_->SyncLoad(sync_load_response); | 490 bridge_->SyncLoad(sync_load_response); |
(...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
765 | 775 |
766 void WebURLLoaderImpl::cancel() { | 776 void WebURLLoaderImpl::cancel() { |
767 context_->Cancel(); | 777 context_->Cancel(); |
768 } | 778 } |
769 | 779 |
770 void WebURLLoaderImpl::setDefersLoading(bool value) { | 780 void WebURLLoaderImpl::setDefersLoading(bool value) { |
771 context_->SetDefersLoading(value); | 781 context_->SetDefersLoading(value); |
772 } | 782 } |
773 | 783 |
774 } // namespace webkit_glue | 784 } // namespace webkit_glue |
OLD | NEW |