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

Unified Diff: webkit/dom_storage/dom_storage_task_runner.h

Issue 9146025: Framing for a DOMStorage backend that does not depend on in-process-webkit. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 8 years, 11 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
Index: webkit/dom_storage/dom_storage_task_runner.h
===================================================================
--- webkit/dom_storage/dom_storage_task_runner.h (revision 0)
+++ webkit/dom_storage/dom_storage_task_runner.h (revision 0)
@@ -0,0 +1,54 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef WEBKIT_DOM_STORAGE_DOM_STORAGE_TASK_RUNNER_
+#define WEBKIT_DOM_STORAGE_DOM_STORAGE_TASK_RUNNER_
+#pragma once
+
+#include "base/memory/ref_counted.h"
+#include "base/threading/sequenced_worker_pool.h"
+
+namespace base {
+class MessageLoopProxy;
+}
+
+namespace dom_storage {
+
+// Tasks are guaranteed to run serially with respect to
+// one another, but may execute on different OS threads.
+// They're executed via the SequenceWorkerPool under a
+// dom_storage specific SequenceToken.
+class DomStorageTaskRunner
benm (inactive) 2012/02/02 16:23:19 This change is getting a bit big IMHO with a mix o
michaeln 2012/02/03 00:33:42 It's actually not so skeletal anymore. There are n
+ : public base::RefCountedThreadSafe<DomStorageTaskRunner> {
+ public:
+ DomStorageTaskRunner(
+ base::SequencedWorkerPool* sequenced_worker_pool,
+ base::MessageLoopProxy* delayed_task_loop);
+ ~DomStorageTaskRunner();
+
+ // Schedules a sequenced worker task to be run immediately.
+ void PostTask(
+ const tracked_objects::Location& from_here,
+ const base::Closure& task);
+
+ // Schedules a sequenced worker task to be run after a delay.
+ void PostDelayedTask(
+ const tracked_objects::Location& from_here,
+ const base::Closure& task,
+ base::TimeDelta delay);
+
+ private:
+ // Tasks are executed in sequence via the SequencedWorkerPool.
+ base::SequencedWorkerPool* sequenced_worker_pool_; // not owned
+ base::SequencedWorkerPool::SequenceToken sequence_token_;
+
+ // Delayed tasks are scheduled on the worker pool only
+ // after the delay has passed. This seperate message
+ // loop provides the delay.
+ scoped_refptr<base::MessageLoopProxy> delayed_task_loop_;
+};
+
+} // namespace dom_storage
+
+#endif // WEBKIT_DOM_STORAGE_DOM_STORAGE_TASK_RUNNER_
Property changes on: webkit\dom_storage\dom_storage_task_runner.h
___________________________________________________________________
Added: svn:eol-style
+ LF

Powered by Google App Engine
This is Rietveld 408576698