| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2014 Google Inc. All rights reserved. | 2 * Copyright (C) 2014 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 93 | 93 |
| 94 private: | 94 private: |
| 95 int m_nesting; | 95 int m_nesting; |
| 96 }; | 96 }; |
| 97 | 97 |
| 98 class GCTaskRunner final { | 98 class GCTaskRunner final { |
| 99 USING_FAST_MALLOC(GCTaskRunner); | 99 USING_FAST_MALLOC(GCTaskRunner); |
| 100 | 100 |
| 101 public: | 101 public: |
| 102 explicit GCTaskRunner(WebThread* thread) | 102 explicit GCTaskRunner(WebThread* thread) |
| 103 : m_gcTaskObserver(wrapUnique(new GCTaskObserver)), m_thread(thread) { | 103 : m_gcTaskObserver(WTF::wrapUnique(new GCTaskObserver)), |
| 104 m_thread(thread) { |
| 104 m_thread->addTaskObserver(m_gcTaskObserver.get()); | 105 m_thread->addTaskObserver(m_gcTaskObserver.get()); |
| 105 ThreadState::current()->addInterruptor( | 106 ThreadState::current()->addInterruptor(WTF::wrapUnique( |
| 106 wrapUnique(new MessageLoopInterruptor(thread->getWebTaskRunner()))); | 107 new MessageLoopInterruptor(thread->getWebTaskRunner()))); |
| 107 } | 108 } |
| 108 | 109 |
| 109 ~GCTaskRunner() { m_thread->removeTaskObserver(m_gcTaskObserver.get()); } | 110 ~GCTaskRunner() { m_thread->removeTaskObserver(m_gcTaskObserver.get()); } |
| 110 | 111 |
| 111 private: | 112 private: |
| 112 std::unique_ptr<GCTaskObserver> m_gcTaskObserver; | 113 std::unique_ptr<GCTaskObserver> m_gcTaskObserver; |
| 113 WebThread* m_thread; | 114 WebThread* m_thread; |
| 114 }; | 115 }; |
| 115 | 116 |
| 116 } // namespace blink | 117 } // namespace blink |
| 117 | 118 |
| 118 #endif | 119 #endif |
| OLD | NEW |