| 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 #include "net/url_request/test_url_fetcher_factory.h" | 5 #include "net/url_request/test_url_fetcher_factory.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 delegate_for_tests_->OnRequestEnd(id_); | 50 delegate_for_tests_->OnRequestEnd(id_); |
| 51 if (owner_) | 51 if (owner_) |
| 52 owner_->RemoveFetcherFromMap(id_); | 52 owner_->RemoveFetcherFromMap(id_); |
| 53 } | 53 } |
| 54 | 54 |
| 55 void TestURLFetcher::SetUploadData(const std::string& upload_content_type, | 55 void TestURLFetcher::SetUploadData(const std::string& upload_content_type, |
| 56 const std::string& upload_content) { | 56 const std::string& upload_content) { |
| 57 upload_data_ = upload_content; | 57 upload_data_ = upload_content; |
| 58 } | 58 } |
| 59 | 59 |
| 60 void TestURLFetcher::SetUploadFilePath( |
| 61 const std::string& upload_content_type, |
| 62 const base::FilePath& file_path, |
| 63 scoped_refptr<base::TaskRunner> file_task_runner) { |
| 64 upload_file_path_ = file_path; |
| 65 } |
| 66 |
| 60 void TestURLFetcher::SetChunkedUpload(const std::string& upload_content_type) { | 67 void TestURLFetcher::SetChunkedUpload(const std::string& upload_content_type) { |
| 61 } | 68 } |
| 62 | 69 |
| 63 void TestURLFetcher::AppendChunkToUpload(const std::string& data, | 70 void TestURLFetcher::AppendChunkToUpload(const std::string& data, |
| 64 bool is_last_chunk) { | 71 bool is_last_chunk) { |
| 65 DCHECK(!did_receive_last_chunk_); | 72 DCHECK(!did_receive_last_chunk_); |
| 66 did_receive_last_chunk_ = is_last_chunk; | 73 did_receive_last_chunk_ = is_last_chunk; |
| 67 chunks_.push_back(data); | 74 chunks_.push_back(data); |
| 68 if (delegate_for_tests_) | 75 if (delegate_for_tests_) |
| 69 delegate_for_tests_->OnChunkUpload(id_); | 76 delegate_for_tests_->OnChunkUpload(id_); |
| (...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 366 | 373 |
| 367 URLFetcher* URLFetcherImplFactory::CreateURLFetcher( | 374 URLFetcher* URLFetcherImplFactory::CreateURLFetcher( |
| 368 int id, | 375 int id, |
| 369 const GURL& url, | 376 const GURL& url, |
| 370 URLFetcher::RequestType request_type, | 377 URLFetcher::RequestType request_type, |
| 371 URLFetcherDelegate* d) { | 378 URLFetcherDelegate* d) { |
| 372 return new URLFetcherImpl(url, request_type, d); | 379 return new URLFetcherImpl(url, request_type, d); |
| 373 } | 380 } |
| 374 | 381 |
| 375 } // namespace net | 382 } // namespace net |
| OLD | NEW |