Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(239)

Side by Side Diff: webkit/glue/weburlloader_impl.cc

Issue 10828252: Support FileSystem URL in File object (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698