OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef WEBKIT_GLUE_WORKER_TASK_RUNNER_H_ | 5 #ifndef WEBKIT_GLUE_WORKER_TASK_RUNNER_H_ |
6 #define WEBKIT_GLUE_WORKER_TASK_RUNNER_H_ | 6 #define WEBKIT_GLUE_WORKER_TASK_RUNNER_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 | 9 |
10 #include "base/atomic_sequence_num.h" | 10 #include "base/atomic_sequence_num.h" |
11 #include "base/callback_forward.h" | 11 #include "base/callback_forward.h" |
12 #include "base/synchronization/lock.h" | 12 #include "base/synchronization/lock.h" |
13 #include "base/threading/thread_local.h" | 13 #include "base/threading/thread_local.h" |
14 #include "third_party/WebKit/Source/Platform/chromium/public/WebWorkerRunLoop.h" | 14 #include "third_party/WebKit/public/platform/WebWorkerRunLoop.h" |
15 #include "webkit/glue/webkit_glue_export.h" | 15 #include "webkit/glue/webkit_glue_export.h" |
16 | 16 |
17 namespace webkit_glue { | 17 namespace webkit_glue { |
18 | 18 |
19 class WEBKIT_GLUE_EXPORT WorkerTaskRunner { | 19 class WEBKIT_GLUE_EXPORT WorkerTaskRunner { |
20 public: | 20 public: |
21 WorkerTaskRunner(); | 21 WorkerTaskRunner(); |
22 | 22 |
23 bool PostTask(int id, const base::Closure& task); | 23 bool PostTask(int id, const base::Closure& task); |
24 int CurrentWorkerId(); | 24 int CurrentWorkerId(); |
(...skipping 24 matching lines...) Expand all Loading... |
49 base::ThreadLocalPointer<ThreadLocalState> current_tls_; | 49 base::ThreadLocalPointer<ThreadLocalState> current_tls_; |
50 | 50 |
51 base::AtomicSequenceNumber id_sequence_; | 51 base::AtomicSequenceNumber id_sequence_; |
52 IDToLoopMap loop_map_; | 52 IDToLoopMap loop_map_; |
53 base::Lock loop_map_lock_; | 53 base::Lock loop_map_lock_; |
54 }; | 54 }; |
55 | 55 |
56 } // namespace webkit_glue | 56 } // namespace webkit_glue |
57 | 57 |
58 #endif // WEBKIT_GLUE_WORKER_TASK_RUNNER_H_ | 58 #endif // WEBKIT_GLUE_WORKER_TASK_RUNNER_H_ |
OLD | NEW |