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

Side by Side Diff: net/url_request/url_fetcher_impl.cc

Issue 14578004: Support range uploading of a file. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 7 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 #include "net/url_request/url_fetcher_impl.h" 5 #include "net/url_request/url_fetcher_impl.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/message_loop_proxy.h" 8 #include "base/message_loop_proxy.h"
9 #include "net/url_request/url_fetcher_core.h" 9 #include "net/url_request/url_fetcher_core.h"
10 #include "net/url_request/url_fetcher_factory.h" 10 #include "net/url_request/url_fetcher_factory.h"
(...skipping 15 matching lines...) Expand all
26 26
27 void URLFetcherImpl::SetUploadData(const std::string& upload_content_type, 27 void URLFetcherImpl::SetUploadData(const std::string& upload_content_type,
28 const std::string& upload_content) { 28 const std::string& upload_content) {
29 core_->SetUploadData(upload_content_type, upload_content); 29 core_->SetUploadData(upload_content_type, upload_content);
30 } 30 }
31 31
32 void URLFetcherImpl::SetUploadFilePath( 32 void URLFetcherImpl::SetUploadFilePath(
33 const std::string& upload_content_type, 33 const std::string& upload_content_type,
34 const base::FilePath& file_path, 34 const base::FilePath& file_path,
35 scoped_refptr<base::TaskRunner> file_task_runner) { 35 scoped_refptr<base::TaskRunner> file_task_runner) {
36 core_->SetUploadFilePath(upload_content_type, file_path, file_task_runner); 36 core_->SetUploadFilePath(upload_content_type,
37 file_path,
38 0,
39 kuint64max,
40 file_task_runner);
41 }
42
43 void URLFetcherImpl::SetUploadFilePathWithRange(
44 const std::string& upload_content_type,
45 const base::FilePath& file_path,
46 uint64 range_offset,
47 uint64 range_length,
48 scoped_refptr<base::TaskRunner> file_task_runner) {
49 core_->SetUploadFilePath(upload_content_type,
50 file_path,
51 range_offset,
52 range_length,
53 file_task_runner);
37 } 54 }
38 55
39 void URLFetcherImpl::SetChunkedUpload(const std::string& content_type) { 56 void URLFetcherImpl::SetChunkedUpload(const std::string& content_type) {
40 core_->SetChunkedUpload(content_type); 57 core_->SetChunkedUpload(content_type);
41 } 58 }
42 59
43 void URLFetcherImpl::AppendChunkToUpload(const std::string& data, 60 void URLFetcherImpl::AppendChunkToUpload(const std::string& data,
44 bool is_last_chunk) { 61 bool is_last_chunk) {
45 DCHECK(data.length()); 62 DCHECK(data.length());
46 core_->AppendChunkToUpload(data, is_last_chunk); 63 core_->AppendChunkToUpload(data, is_last_chunk);
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
207 URLFetcherFactory* URLFetcherImpl::factory() { 224 URLFetcherFactory* URLFetcherImpl::factory() {
208 return g_factory; 225 return g_factory;
209 } 226 }
210 227
211 // static 228 // static
212 void URLFetcherImpl::set_factory(URLFetcherFactory* factory) { 229 void URLFetcherImpl::set_factory(URLFetcherFactory* factory) {
213 g_factory = factory; 230 g_factory = factory;
214 } 231 }
215 232
216 } // namespace net 233 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698