| OLD | NEW |
| 1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 the V8 project 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 V8_LIBPLATFORM_WORKER_THREAD_H_ | 5 #ifndef V8_LIBPLATFORM_WORKER_THREAD_H_ |
| 6 #define V8_LIBPLATFORM_WORKER_THREAD_H_ | 6 #define V8_LIBPLATFORM_WORKER_THREAD_H_ |
| 7 | 7 |
| 8 #include <queue> | 8 #include <queue> |
| 9 | 9 |
| 10 #include "include/libplatform/libplatform-export.h" |
| 11 #include "src/base/compiler-specific.h" |
| 10 #include "src/base/macros.h" | 12 #include "src/base/macros.h" |
| 11 #include "src/base/platform/platform.h" | 13 #include "src/base/platform/platform.h" |
| 12 | 14 |
| 13 namespace v8 { | 15 namespace v8 { |
| 14 | 16 |
| 15 namespace platform { | 17 namespace platform { |
| 16 | 18 |
| 17 class TaskQueue; | 19 class TaskQueue; |
| 18 | 20 |
| 19 class WorkerThread : public base::Thread { | 21 class V8_PLATFORM_EXPORT WorkerThread : public NON_EXPORTED_BASE(base::Thread) { |
| 20 public: | 22 public: |
| 21 explicit WorkerThread(TaskQueue* queue); | 23 explicit WorkerThread(TaskQueue* queue); |
| 22 virtual ~WorkerThread(); | 24 virtual ~WorkerThread(); |
| 23 | 25 |
| 24 // Thread implementation. | 26 // Thread implementation. |
| 25 void Run() override; | 27 void Run() override; |
| 26 | 28 |
| 27 private: | 29 private: |
| 28 friend class QuitTask; | 30 friend class QuitTask; |
| 29 | 31 |
| 30 TaskQueue* queue_; | 32 TaskQueue* queue_; |
| 31 | 33 |
| 32 DISALLOW_COPY_AND_ASSIGN(WorkerThread); | 34 DISALLOW_COPY_AND_ASSIGN(WorkerThread); |
| 33 }; | 35 }; |
| 34 | 36 |
| 35 } // namespace platform | 37 } // namespace platform |
| 36 } // namespace v8 | 38 } // namespace v8 |
| 37 | 39 |
| 38 | 40 |
| 39 #endif // V8_LIBPLATFORM_WORKER_THREAD_H_ | 41 #endif // V8_LIBPLATFORM_WORKER_THREAD_H_ |
| OLD | NEW |