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

Side by Side 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, 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 unified diff | Download patch | Annotate | Revision Log
Property Changes:
Added: svn:eol-style
+ LF
OLDNEW
(Empty)
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef WEBKIT_DOM_STORAGE_DOM_STORAGE_TASK_RUNNER_
6 #define WEBKIT_DOM_STORAGE_DOM_STORAGE_TASK_RUNNER_
7 #pragma once
8
9 #include "base/memory/ref_counted.h"
10 #include "base/threading/sequenced_worker_pool.h"
11
12 namespace base {
13 class MessageLoopProxy;
14 }
15
16 namespace dom_storage {
17
18 // Tasks are guaranteed to run serially with respect to
19 // one another, but may execute on different OS threads.
20 // They're executed via the SequenceWorkerPool under a
21 // dom_storage specific SequenceToken.
22 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
23 : public base::RefCountedThreadSafe<DomStorageTaskRunner> {
24 public:
25 DomStorageTaskRunner(
26 base::SequencedWorkerPool* sequenced_worker_pool,
27 base::MessageLoopProxy* delayed_task_loop);
28 ~DomStorageTaskRunner();
29
30 // Schedules a sequenced worker task to be run immediately.
31 void PostTask(
32 const tracked_objects::Location& from_here,
33 const base::Closure& task);
34
35 // Schedules a sequenced worker task to be run after a delay.
36 void PostDelayedTask(
37 const tracked_objects::Location& from_here,
38 const base::Closure& task,
39 base::TimeDelta delay);
40
41 private:
42 // Tasks are executed in sequence via the SequencedWorkerPool.
43 base::SequencedWorkerPool* sequenced_worker_pool_; // not owned
44 base::SequencedWorkerPool::SequenceToken sequence_token_;
45
46 // Delayed tasks are scheduled on the worker pool only
47 // after the delay has passed. This seperate message
48 // loop provides the delay.
49 scoped_refptr<base::MessageLoopProxy> delayed_task_loop_;
50 };
51
52 } // namespace dom_storage
53
54 #endif // WEBKIT_DOM_STORAGE_DOM_STORAGE_TASK_RUNNER_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698