| 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 WebThreadSupportingGC_h | 5 #ifndef WebThreadSupportingGC_h |
| 6 #define WebThreadSupportingGC_h | 6 #define WebThreadSupportingGC_h |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include "platform/WebTaskRunner.h" | 9 #include "platform/WebTaskRunner.h" |
| 10 #include "platform/heap/GCTaskRunner.h" | 10 #include "platform/heap/GCTaskRunner.h" |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 } | 64 } |
| 65 | 65 |
| 66 void RemoveTaskObserver(WebThread::TaskObserver* observer) { | 66 void RemoveTaskObserver(WebThread::TaskObserver* observer) { |
| 67 thread_->RemoveTaskObserver(observer); | 67 thread_->RemoveTaskObserver(observer); |
| 68 } | 68 } |
| 69 | 69 |
| 70 void Initialize(); | 70 void Initialize(); |
| 71 void Shutdown(); | 71 void Shutdown(); |
| 72 | 72 |
| 73 WebThread& PlatformThread() const { | 73 WebThread& PlatformThread() const { |
| 74 ASSERT(thread_); | 74 DCHECK(thread_); |
| 75 return *thread_; | 75 return *thread_; |
| 76 } | 76 } |
| 77 | 77 |
| 78 private: | 78 private: |
| 79 WebThreadSupportingGC(const char* name, WebThread*); | 79 WebThreadSupportingGC(const char* name, WebThread*); |
| 80 | 80 |
| 81 std::unique_ptr<GCTaskRunner> gc_task_runner_; | 81 std::unique_ptr<GCTaskRunner> gc_task_runner_; |
| 82 | 82 |
| 83 // m_thread is guaranteed to be non-null after this instance is constructed. | 83 // m_thread is guaranteed to be non-null after this instance is constructed. |
| 84 // m_owningThread is non-null unless this instance is constructed for an | 84 // m_owningThread is non-null unless this instance is constructed for an |
| 85 // existing thread via createForThread(). | 85 // existing thread via createForThread(). |
| 86 WebThread* thread_ = nullptr; | 86 WebThread* thread_ = nullptr; |
| 87 std::unique_ptr<WebThread> owning_thread_; | 87 std::unique_ptr<WebThread> owning_thread_; |
| 88 }; | 88 }; |
| 89 | 89 |
| 90 } // namespace blink | 90 } // namespace blink |
| 91 | 91 |
| 92 #endif | 92 #endif |
| OLD | NEW |