| 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/url_fetcher_core.h" | 5 #include "net/url_request/url_fetcher_core.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 584 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 595 ElementsUploadDataStream::CreateWithReader(reader.Pass(), 0)); | 595 ElementsUploadDataStream::CreateWithReader(reader.Pass(), 0)); |
| 596 } else if (!upload_stream_factory_.is_null()) { | 596 } else if (!upload_stream_factory_.is_null()) { |
| 597 scoped_ptr<UploadDataStream> stream = upload_stream_factory_.Run(); | 597 scoped_ptr<UploadDataStream> stream = upload_stream_factory_.Run(); |
| 598 DCHECK(stream); | 598 DCHECK(stream); |
| 599 request_->set_upload(stream.Pass()); | 599 request_->set_upload(stream.Pass()); |
| 600 } | 600 } |
| 601 | 601 |
| 602 current_upload_bytes_ = -1; | 602 current_upload_bytes_ = -1; |
| 603 // TODO(kinaba): http://crbug.com/118103. Implement upload callback in the | 603 // TODO(kinaba): http://crbug.com/118103. Implement upload callback in the |
| 604 // layer and avoid using timer here. | 604 // layer and avoid using timer here. |
| 605 upload_progress_checker_timer_.reset( | 605 upload_progress_checker_timer_.reset(new base::RepeatingTimer()); |
| 606 new base::RepeatingTimer<URLFetcherCore>()); | |
| 607 upload_progress_checker_timer_->Start( | 606 upload_progress_checker_timer_->Start( |
| 608 FROM_HERE, | 607 FROM_HERE, |
| 609 base::TimeDelta::FromMilliseconds(kUploadProgressTimerInterval), | 608 base::TimeDelta::FromMilliseconds(kUploadProgressTimerInterval), |
| 610 this, | 609 this, |
| 611 &URLFetcherCore::InformDelegateUploadProgress); | 610 &URLFetcherCore::InformDelegateUploadProgress); |
| 612 break; | 611 break; |
| 613 } | 612 } |
| 614 | 613 |
| 615 case URLFetcher::HEAD: | 614 case URLFetcher::HEAD: |
| 616 request_->set_method("HEAD"); | 615 request_->set_method("HEAD"); |
| (...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 950 } | 949 } |
| 951 | 950 |
| 952 void URLFetcherCore::AssertHasNoUploadData() const { | 951 void URLFetcherCore::AssertHasNoUploadData() const { |
| 953 DCHECK(!upload_content_set_); | 952 DCHECK(!upload_content_set_); |
| 954 DCHECK(upload_content_.empty()); | 953 DCHECK(upload_content_.empty()); |
| 955 DCHECK(upload_file_path_.empty()); | 954 DCHECK(upload_file_path_.empty()); |
| 956 DCHECK(upload_stream_factory_.is_null()); | 955 DCHECK(upload_stream_factory_.is_null()); |
| 957 } | 956 } |
| 958 | 957 |
| 959 } // namespace net | 958 } // namespace net |
| OLD | NEW |