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

Unified Diff: content/browser/byte_stream.cc

Issue 2873333004: Rename TaskRunner::RunsTasksOnCurrentThread() in //content (Closed)
Patch Set: Created 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/browser/browser_thread_impl.cc ('k') | content/browser/dom_storage/dom_storage_task_runner.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/byte_stream.cc
diff --git a/content/browser/byte_stream.cc b/content/browser/byte_stream.cc
index 0bb824a00524fb50dec935b7eaa17b453737daae..0209bb85d5ba4c3522a60ec6dee4d723e255d219 100644
--- a/content/browser/byte_stream.cc
+++ b/content/browser/byte_stream.cc
@@ -191,7 +191,7 @@ ByteStreamWriterImpl::ByteStreamWriterImpl(
}
ByteStreamWriterImpl::~ByteStreamWriterImpl() {
- // No RunsTasksOnCurrentThread() check to allow deleting a created writer
+ // No RunsTasksInCurrentSequence() check to allow deleting a created writer
// before we start using it. Once started, should be deleted on the specified
// task runner.
my_lifetime_flag_->is_alive = false;
@@ -208,7 +208,7 @@ void ByteStreamWriterImpl::SetPeer(
bool ByteStreamWriterImpl::Write(
scoped_refptr<net::IOBuffer> buffer, size_t byte_count) {
- DCHECK(my_task_runner_->RunsTasksOnCurrentThread());
+ DCHECK(my_task_runner_->RunsTasksInCurrentSequence());
// Check overflow.
//
@@ -233,24 +233,24 @@ bool ByteStreamWriterImpl::Write(
}
void ByteStreamWriterImpl::Flush() {
- DCHECK(my_task_runner_->RunsTasksOnCurrentThread());
+ DCHECK(my_task_runner_->RunsTasksInCurrentSequence());
if (input_contents_size_ > 0)
PostToPeer(false, 0);
}
void ByteStreamWriterImpl::Close(int status) {
- DCHECK(my_task_runner_->RunsTasksOnCurrentThread());
+ DCHECK(my_task_runner_->RunsTasksInCurrentSequence());
PostToPeer(true, status);
}
void ByteStreamWriterImpl::RegisterCallback(
const base::Closure& source_callback) {
- DCHECK(my_task_runner_->RunsTasksOnCurrentThread());
+ DCHECK(my_task_runner_->RunsTasksInCurrentSequence());
space_available_callback_ = source_callback;
}
size_t ByteStreamWriterImpl::GetTotalBufferedBytes() const {
- DCHECK(my_task_runner_->RunsTasksOnCurrentThread());
+ DCHECK(my_task_runner_->RunsTasksInCurrentSequence());
// This sum doesn't overflow since Write() fails if this sum is going to
// overflow.
return input_contents_size_ + output_size_used_;
@@ -267,7 +267,7 @@ void ByteStreamWriterImpl::UpdateWindow(
}
void ByteStreamWriterImpl::UpdateWindowInternal(size_t bytes_consumed) {
- DCHECK(my_task_runner_->RunsTasksOnCurrentThread());
+ DCHECK(my_task_runner_->RunsTasksInCurrentSequence());
bool was_above_limit = GetTotalBufferedBytes() > total_buffer_size_;
@@ -283,7 +283,7 @@ void ByteStreamWriterImpl::UpdateWindowInternal(size_t bytes_consumed) {
}
void ByteStreamWriterImpl::PostToPeer(bool complete, int status) {
- DCHECK(my_task_runner_->RunsTasksOnCurrentThread());
+ DCHECK(my_task_runner_->RunsTasksInCurrentSequence());
// Valid contexts in which to call.
DCHECK(complete || 0 != input_contents_size_);
@@ -323,7 +323,7 @@ ByteStreamReaderImpl::ByteStreamReaderImpl(
}
ByteStreamReaderImpl::~ByteStreamReaderImpl() {
- // No RunsTasksOnCurrentThread() check to allow deleting a created writer
+ // No RunsTasksInCurrentSequence() check to allow deleting a created writer
// before we start using it. Once started, should be deleted on the specified
// task runner.
my_lifetime_flag_->is_alive = false;
@@ -341,7 +341,7 @@ void ByteStreamReaderImpl::SetPeer(
ByteStreamReaderImpl::StreamState
ByteStreamReaderImpl::Read(scoped_refptr<net::IOBuffer>* data,
size_t* length) {
- DCHECK(my_task_runner_->RunsTasksOnCurrentThread());
+ DCHECK(my_task_runner_->RunsTasksInCurrentSequence());
if (available_contents_.size()) {
*data = available_contents_.front().first;
@@ -359,14 +359,14 @@ ByteStreamReaderImpl::Read(scoped_refptr<net::IOBuffer>* data,
}
int ByteStreamReaderImpl::GetStatus() const {
- DCHECK(my_task_runner_->RunsTasksOnCurrentThread());
+ DCHECK(my_task_runner_->RunsTasksInCurrentSequence());
DCHECK(received_status_);
return status_;
}
void ByteStreamReaderImpl::RegisterCallback(
const base::Closure& sink_callback) {
- DCHECK(my_task_runner_->RunsTasksOnCurrentThread());
+ DCHECK(my_task_runner_->RunsTasksInCurrentSequence());
data_available_callback_ = sink_callback;
}
@@ -391,7 +391,7 @@ void ByteStreamReaderImpl::TransferDataInternal(
size_t buffer_size,
bool source_complete,
int status) {
- DCHECK(my_task_runner_->RunsTasksOnCurrentThread());
+ DCHECK(my_task_runner_->RunsTasksInCurrentSequence());
bool was_empty = available_contents_.empty();
@@ -418,7 +418,7 @@ void ByteStreamReaderImpl::TransferDataInternal(
// Currently we do that whenever we've got unreported consumption
// greater than 1/3 of total size.
void ByteStreamReaderImpl::MaybeUpdateInput() {
- DCHECK(my_task_runner_->RunsTasksOnCurrentThread());
+ DCHECK(my_task_runner_->RunsTasksInCurrentSequence());
if (unreported_consumed_bytes_ <=
total_buffer_size_ / kFractionReadBeforeWindowUpdate)
« no previous file with comments | « content/browser/browser_thread_impl.cc ('k') | content/browser/dom_storage/dom_storage_task_runner.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698