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 // This file contains an implementation of the ResourceLoaderBridge class. | 5 // This file contains an implementation of the ResourceLoaderBridge class. |
6 // The class is implemented using net::URLRequest, meaning it is a "simple" | 6 // The class is implemented using net::URLRequest, meaning it is a "simple" |
7 // version that directly issues requests. The more complicated one used in the | 7 // version that directly issues requests. The more complicated one used in the |
8 // browser uses IPC. | 8 // browser uses IPC. |
9 // | 9 // |
10 // Because net::URLRequest only provides an asynchronous resource loading API, | 10 // Because net::URLRequest only provides an asynchronous resource loading API, |
(...skipping 875 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
886 uint64 offset, | 886 uint64 offset, |
887 uint64 length, | 887 uint64 length, |
888 const base::Time& expected_modification_time) { | 888 const base::Time& expected_modification_time) { |
889 DCHECK(params_.get()); | 889 DCHECK(params_.get()); |
890 if (!params_->upload) | 890 if (!params_->upload) |
891 params_->upload = new net::UploadData(); | 891 params_->upload = new net::UploadData(); |
892 params_->upload->AppendFileRange(file_path, offset, length, | 892 params_->upload->AppendFileRange(file_path, offset, length, |
893 expected_modification_time); | 893 expected_modification_time); |
894 } | 894 } |
895 | 895 |
| 896 virtual void AppendFileSystemFileRangeToUpload( |
| 897 const GURL& url, |
| 898 uint64 offset, |
| 899 uint64 length, |
| 900 const base::Time& expected_modification_time) { |
| 901 DCHECK(params_.get()); |
| 902 if (!params_->upload) |
| 903 params_->upload = new net::UploadData(); |
| 904 params_->upload->AppendFileSystemFileRange(url, offset, length, |
| 905 expected_modification_time); |
| 906 } |
| 907 |
896 virtual void AppendBlobToUpload(const GURL& blob_url) { | 908 virtual void AppendBlobToUpload(const GURL& blob_url) { |
897 DCHECK(params_.get()); | 909 DCHECK(params_.get()); |
898 if (!params_->upload) | 910 if (!params_->upload) |
899 params_->upload = new net::UploadData(); | 911 params_->upload = new net::UploadData(); |
900 params_->upload->AppendBlob(blob_url); | 912 params_->upload->AppendBlob(blob_url); |
901 } | 913 } |
902 | 914 |
903 virtual void SetUploadIdentifier(int64 identifier) { | 915 virtual void SetUploadIdentifier(int64 identifier) { |
904 DCHECK(params_.get()); | 916 DCHECK(params_.get()); |
905 if (!params_->upload) | 917 if (!params_->upload) |
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1134 (http_prefix.SchemeIs("http") || http_prefix.SchemeIs("https"))); | 1146 (http_prefix.SchemeIs("http") || http_prefix.SchemeIs("https"))); |
1135 g_file_over_http_params = new FileOverHTTPParams(file_path_template, | 1147 g_file_over_http_params = new FileOverHTTPParams(file_path_template, |
1136 http_prefix); | 1148 http_prefix); |
1137 } | 1149 } |
1138 | 1150 |
1139 // static | 1151 // static |
1140 webkit_glue::ResourceLoaderBridge* SimpleResourceLoaderBridge::Create( | 1152 webkit_glue::ResourceLoaderBridge* SimpleResourceLoaderBridge::Create( |
1141 const webkit_glue::ResourceLoaderBridge::RequestInfo& request_info) { | 1153 const webkit_glue::ResourceLoaderBridge::RequestInfo& request_info) { |
1142 return new ResourceLoaderBridgeImpl(request_info); | 1154 return new ResourceLoaderBridgeImpl(request_info); |
1143 } | 1155 } |
OLD | NEW |