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

Unified Diff: webkit/dom_storage/dom_storage_task_runner.h

Issue 9389009: Hook up DomStorageArea with a DomStorageDatabase. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address comments Created 8 years, 10 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 | « webkit/dom_storage/dom_storage_namespace.cc ('k') | webkit/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: webkit/dom_storage/dom_storage_task_runner.h
diff --git a/webkit/dom_storage/dom_storage_task_runner.h b/webkit/dom_storage/dom_storage_task_runner.h
index a5c09b1cf73d667b50936fa5edfb95b86cf1f122..21e4ab769e2c209ae8048c923fd9b067f2b0435b 100644
--- a/webkit/dom_storage/dom_storage_task_runner.h
+++ b/webkit/dom_storage/dom_storage_task_runner.h
@@ -25,12 +25,12 @@ class DomStorageTaskRunner
virtual ~DomStorageTaskRunner();
// Schedules a task to be run immediately.
- virtual void PostTask(
+ virtual bool PostTask(
const tracked_objects::Location& from_here,
const base::Closure& task);
// Schedules a task to be run after a delay.
- virtual void PostDelayedTask(
+ virtual bool PostDelayedTask(
const tracked_objects::Location& from_here,
const base::Closure& task,
base::TimeDelta delay);
@@ -50,12 +50,12 @@ class DomStorageWorkerPoolTaskRunner : public DomStorageTaskRunner {
virtual ~DomStorageWorkerPoolTaskRunner();
// Schedules a sequenced worker task to be run immediately.
- virtual void PostTask(
+ virtual bool PostTask(
const tracked_objects::Location& from_here,
const base::Closure& task) OVERRIDE;
// Schedules a sequenced worker task to be run after a delay.
- virtual void PostDelayedTask(
+ virtual bool PostDelayedTask(
const tracked_objects::Location& from_here,
const base::Closure& task,
base::TimeDelta delay) OVERRIDE;
@@ -65,6 +65,20 @@ class DomStorageWorkerPoolTaskRunner : public DomStorageTaskRunner {
base::SequencedWorkerPool::SequenceToken sequence_token_;
};
+// A derived class used in unit tests that causes us to ignore the
+// delay in PostDelayedTask so we don't need to block in unit tests
+// for the timeout to expire.
+class MockDomStorageTaskRunner : public DomStorageTaskRunner {
+ public:
+ explicit MockDomStorageTaskRunner(base::MessageLoopProxy* message_loop);
+ virtual ~MockDomStorageTaskRunner() { }
+
+ virtual bool PostDelayedTask(
+ const tracked_objects::Location& from_here,
+ const base::Closure& task,
+ base::TimeDelta delay) OVERRIDE;
+};
+
} // namespace dom_storage
#endif // WEBKIT_DOM_STORAGE_DOM_STORAGE_TASK_RUNNER_
« no previous file with comments | « webkit/dom_storage/dom_storage_namespace.cc ('k') | webkit/dom_storage/dom_storage_task_runner.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698