| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 THIRD_PARTY_WEBKIT_PUBLIC_PLATFORM_SCHEDULER_CHILD_WEBTHREAD_BASE_H_ | 5 #ifndef THIRD_PARTY_WEBKIT_PUBLIC_PLATFORM_SCHEDULER_CHILD_WEBTHREAD_BASE_H_ |
| 6 #define THIRD_PARTY_WEBKIT_PUBLIC_PLATFORM_SCHEDULER_CHILD_WEBTHREAD_BASE_H_ | 6 #define THIRD_PARTY_WEBKIT_PUBLIC_PLATFORM_SCHEDULER_CHILD_WEBTHREAD_BASE_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <memory> | 9 #include <memory> |
| 10 | 10 |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 // TODO(scheduler-dev): Do not expose this class in Blink public API. | 21 // TODO(scheduler-dev): Do not expose this class in Blink public API. |
| 22 class BLINK_PLATFORM_EXPORT WebThreadBase : public WebThread { | 22 class BLINK_PLATFORM_EXPORT WebThreadBase : public WebThread { |
| 23 public: | 23 public: |
| 24 ~WebThreadBase() override; | 24 ~WebThreadBase() override; |
| 25 | 25 |
| 26 static std::unique_ptr<WebThreadBase> CreateWorkerThread( | 26 static std::unique_ptr<WebThreadBase> CreateWorkerThread( |
| 27 const char* name, | 27 const char* name, |
| 28 base::Thread::Options options); | 28 base::Thread::Options options); |
| 29 static std::unique_ptr<WebThreadBase> CreateCompositorThread( | 29 static std::unique_ptr<WebThreadBase> CreateCompositorThread( |
| 30 base::Thread::Options options); | 30 base::Thread::Options options); |
| 31 // Must be called on utility thread. |
| 32 static std::unique_ptr<WebThreadBase> InitializeUtilityThread(); |
| 31 | 33 |
| 32 // WebThread implementation. | 34 // WebThread implementation. |
| 33 bool IsCurrentThread() const override; | 35 bool IsCurrentThread() const override; |
| 34 PlatformThreadId ThreadId() const override = 0; | 36 PlatformThreadId ThreadId() const override = 0; |
| 35 | 37 |
| 36 virtual void PostIdleTask(const WebTraceLocation& location, | 38 virtual void PostIdleTask(const WebTraceLocation& location, |
| 37 IdleTask* idle_task); | 39 IdleTask* idle_task); |
| 38 | 40 |
| 39 void AddTaskObserver(TaskObserver* observer) override; | 41 void AddTaskObserver(TaskObserver* observer) override; |
| 40 void RemoveTaskObserver(TaskObserver* observer) override; | 42 void RemoveTaskObserver(TaskObserver* observer) override; |
| (...skipping 30 matching lines...) Expand all Loading... |
| 71 | 73 |
| 72 private: | 74 private: |
| 73 typedef std::map<TaskObserver*, TaskObserverAdapter*> TaskObserverMap; | 75 typedef std::map<TaskObserver*, TaskObserverAdapter*> TaskObserverMap; |
| 74 TaskObserverMap task_observer_map_; | 76 TaskObserverMap task_observer_map_; |
| 75 }; | 77 }; |
| 76 | 78 |
| 77 } // namespace scheduler | 79 } // namespace scheduler |
| 78 } // namespace blink | 80 } // namespace blink |
| 79 | 81 |
| 80 #endif // THIRD_PARTY_WEBKIT_PUBLIC_PLATFORM_SCHEDULER_CHILD_WEBTHREAD_BASE_H_ | 82 #endif // THIRD_PARTY_WEBKIT_PUBLIC_PLATFORM_SCHEDULER_CHILD_WEBTHREAD_BASE_H_ |
| OLD | NEW |