OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 CONTENT_PUBLIC_CHILD_WORKER_THREAD_H_ | 5 #ifndef CONTENT_PUBLIC_CHILD_WORKER_THREAD_H_ |
6 #define CONTENT_PUBLIC_CHILD_WORKER_THREAD_H_ | 6 #define CONTENT_PUBLIC_CHILD_WORKER_THREAD_H_ |
7 | 7 |
8 #include "base/callback.h" | 8 #include "base/callback.h" |
9 #include "base/macros.h" | 9 #include "base/macros.h" |
10 #include "content/common/content_export.h" | 10 #include "content/common/content_export.h" |
(...skipping 24 matching lines...) Expand all Loading... |
35 // that worker's thread. | 35 // that worker's thread. |
36 static void AddObserver(Observer* observer); | 36 static void AddObserver(Observer* observer); |
37 static void RemoveObserver(Observer* observer); | 37 static void RemoveObserver(Observer* observer); |
38 | 38 |
39 // Returns the thread ID for the current worker thread, or 0 if this is not a | 39 // Returns the thread ID for the current worker thread, or 0 if this is not a |
40 // worker thread (for example, the render thread). Worker thread IDs will | 40 // worker thread (for example, the render thread). Worker thread IDs will |
41 // always be > 0. | 41 // always be > 0. |
42 static int GetCurrentId(); | 42 static int GetCurrentId(); |
43 | 43 |
44 // Posts a task to the worker thread with ID |id|. ID must be > 0. | 44 // Posts a task to the worker thread with ID |id|. ID must be > 0. |
45 static void PostTask(int id, const base::Closure& task); | 45 static void PostTask(int id, base::Closure task); |
46 | 46 |
47 private: | 47 private: |
48 WorkerThread(){}; | 48 WorkerThread(){}; |
49 DISALLOW_COPY_AND_ASSIGN(WorkerThread); | 49 DISALLOW_COPY_AND_ASSIGN(WorkerThread); |
50 }; | 50 }; |
51 | 51 |
52 } // namespace content | 52 } // namespace content |
53 | 53 |
54 #endif // CONTENT_PUBLIC_CHILD_WORKER_THREAD_H_ | 54 #endif // CONTENT_PUBLIC_CHILD_WORKER_THREAD_H_ |
OLD | NEW |