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

Unified Diff: content/browser/dom_storage/dom_storage_task_runner.cc

Issue 2317253007: Remove calls to IsRunningSequenceOnCurrentThread() from dom_storage_task_runner.cc (Closed)
Patch Set: CR michaeln #9 Created 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/browser/dom_storage/dom_storage_task_runner.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/dom_storage/dom_storage_task_runner.cc
diff --git a/content/browser/dom_storage/dom_storage_task_runner.cc b/content/browser/dom_storage/dom_storage_task_runner.cc
index ba2842802d4318a6f5a4d4099d756c3d7b41a1bc..c0d00d55d6e5f29342a512d6197e8b8e893e6e06 100644
--- a/content/browser/dom_storage/dom_storage_task_runner.cc
+++ b/content/browser/dom_storage/dom_storage_task_runner.cc
@@ -7,16 +7,11 @@
#include "base/bind.h"
#include "base/bind_helpers.h"
#include "base/location.h"
+#include "base/logging.h"
#include "base/tracked_objects.h"
namespace content {
-// DOMStorageTaskRunner
-
-bool DOMStorageTaskRunner::RunsTasksOnCurrentThread() const {
- return IsRunningOnSequence(PRIMARY_SEQUENCE);
-}
-
// DOMStorageWorkerPoolTaskRunner
DOMStorageWorkerPoolTaskRunner::DOMStorageWorkerPoolTaskRunner(
@@ -28,11 +23,18 @@ DOMStorageWorkerPoolTaskRunner::DOMStorageWorkerPoolTaskRunner(
sequenced_worker_pool_(sequenced_worker_pool),
primary_sequence_token_(primary_sequence_token),
commit_sequence_token_(commit_sequence_token) {
+ primary_sequence_checker_.DetachFromSequence();
+ commit_sequence_checker_.DetachFromSequence();
}
DOMStorageWorkerPoolTaskRunner::~DOMStorageWorkerPoolTaskRunner() {
}
+bool DOMStorageWorkerPoolTaskRunner::RunsTasksOnCurrentThread() const {
+ // It is valid for an implementation to always return true.
+ return true;
+}
+
bool DOMStorageWorkerPoolTaskRunner::PostDelayedTask(
const tracked_objects::Location& from_here,
const base::Closure& task,
@@ -62,10 +64,12 @@ bool DOMStorageWorkerPoolTaskRunner::PostShutdownBlockingTask(
base::SequencedWorkerPool::BLOCK_SHUTDOWN);
}
-bool DOMStorageWorkerPoolTaskRunner::IsRunningOnSequence(
- SequenceID sequence_id) const {
- return sequenced_worker_pool_->IsRunningSequenceOnCurrentThread(
- IDtoToken(sequence_id));
+void DOMStorageWorkerPoolTaskRunner::AssertIsRunningOnPrimarySequence() const {
+ DCHECK(primary_sequence_checker_.CalledOnValidSequence());
+}
+
+void DOMStorageWorkerPoolTaskRunner::AssertIsRunningOnCommitSequence() const {
+ DCHECK(commit_sequence_checker_.CalledOnValidSequence());
}
scoped_refptr<base::SequencedTaskRunner>
@@ -91,6 +95,10 @@ MockDOMStorageTaskRunner::MockDOMStorageTaskRunner(
MockDOMStorageTaskRunner::~MockDOMStorageTaskRunner() {
}
+bool MockDOMStorageTaskRunner::RunsTasksOnCurrentThread() const {
+ return task_runner_->RunsTasksOnCurrentThread();
+}
+
bool MockDOMStorageTaskRunner::PostDelayedTask(
const tracked_objects::Location& from_here,
const base::Closure& task,
@@ -105,8 +113,12 @@ bool MockDOMStorageTaskRunner::PostShutdownBlockingTask(
return task_runner_->PostTask(from_here, task);
}
-bool MockDOMStorageTaskRunner::IsRunningOnSequence(SequenceID) const {
- return task_runner_->RunsTasksOnCurrentThread();
+void MockDOMStorageTaskRunner::AssertIsRunningOnPrimarySequence() const {
+ DCHECK(RunsTasksOnCurrentThread());
+}
+
+void MockDOMStorageTaskRunner::AssertIsRunningOnCommitSequence() const {
+ DCHECK(RunsTasksOnCurrentThread());
}
scoped_refptr<base::SequencedTaskRunner>
« no previous file with comments | « content/browser/dom_storage/dom_storage_task_runner.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698