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

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

Issue 1355063004: Template methods on Timer classes instead of the classes themselves. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: timer: fixcaller Created 5 years, 3 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
« no previous file with comments | « net/url_request/url_fetcher_core.h ('k') | net/websockets/websocket_channel.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_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
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
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
OLDNEW
« no previous file with comments | « net/url_request/url_fetcher_core.h ('k') | net/websockets/websocket_channel.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698