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

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: 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..a98c431c93e07de4ed188970d0e7c5183dfd7450 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,17 @@ 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 {
+ return sequenced_worker_pool_->RunsTasksOnCurrentThread();
michaeln 2016/09/12 22:49:17 i think you've changed the semantics of this metho
fdoray 2016/09/13 14:24:13 This method is part of the TaskRunner interface ht
michaeln 2016/09/14 00:35:12 The base class is too abstract to provide a full d
fdoray 2016/09/14 13:23:53 Done
+}
+
bool DOMStorageWorkerPoolTaskRunner::PostDelayedTask(
const tracked_objects::Location& from_here,
const base::Closure& task,
@@ -62,10 +63,12 @@ bool DOMStorageWorkerPoolTaskRunner::PostShutdownBlockingTask(
base::SequencedWorkerPool::BLOCK_SHUTDOWN);
}
-bool DOMStorageWorkerPoolTaskRunner::IsRunningOnSequence(
- SequenceID sequence_id) const {
- return sequenced_worker_pool_->IsRunningSequenceOnCurrentThread(
michaeln 2016/09/12 22:49:17 wdyt about changing the impl w/o changing the publ
fdoray 2016/09/13 14:24:13 SequenceChecker::CalledOnValidThread() always retu
michaeln 2016/09/14 00:35:12 Surprising? Ok, I agree given the lack of the actu
fdoray 2016/09/14 13:23:53 Done. I rewrote the last paragraph of the CL descr
- 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 +94,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 +112,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