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 CancellableTaskFactory_h | 5 #ifndef CancellableTaskFactory_h |
6 #define CancellableTaskFactory_h | 6 #define CancellableTaskFactory_h |
7 | 7 |
8 #include "platform/PlatformExport.h" | 8 #include "platform/PlatformExport.h" |
9 #include "public/platform/WebScheduler.h" | 9 #include "public/platform/WebScheduler.h" |
10 #include "wtf/AddressSanitizer.h" | 10 #include "wtf/AddressSanitizer.h" |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 // unpoisoning first. | 50 // unpoisoning first. |
51 void setUnpoisonBeforeUpdate() { m_unpoisonBeforeUpdate = true; } | 51 void setUnpoisonBeforeUpdate() { m_unpoisonBeforeUpdate = true; } |
52 #endif | 52 #endif |
53 | 53 |
54 private: | 54 private: |
55 class CancellableTask : public WebThread::Task { | 55 class CancellableTask : public WebThread::Task { |
56 WTF_MAKE_NONCOPYABLE(CancellableTask); | 56 WTF_MAKE_NONCOPYABLE(CancellableTask); |
57 | 57 |
58 public: | 58 public: |
59 explicit CancellableTask(WeakPtr<CancellableTaskFactory> weakPtr) | 59 explicit CancellableTask(WeakPtr<CancellableTaskFactory> weakPtr) |
60 : m_weakPtr(weakPtr) { } | 60 : m_weakPtr(weakPtr) {} |
61 | 61 |
62 virtual ~CancellableTask() { } | 62 ~CancellableTask() override {} |
63 | 63 |
64 void run() override; | 64 void run() override; |
65 | 65 |
66 private: | 66 private: |
67 WeakPtr<CancellableTaskFactory> m_weakPtr; | 67 WeakPtr<CancellableTaskFactory> m_weakPtr; |
68 }; | 68 }; |
69 | 69 |
70 OwnPtr<Closure> m_closure; | 70 OwnPtr<Closure> m_closure; |
71 #if defined(ADDRESS_SANITIZER) | 71 #if defined(ADDRESS_SANITIZER) |
72 bool m_unpoisonBeforeUpdate; | 72 bool m_unpoisonBeforeUpdate; |
73 #endif | 73 #endif |
74 WeakPtrFactory<CancellableTaskFactory> m_weakPtrFactory; | 74 WeakPtrFactory<CancellableTaskFactory> m_weakPtrFactory; |
75 }; | 75 }; |
76 | 76 |
77 } // namespace blink | 77 } // namespace blink |
78 | 78 |
79 #endif // CancellableTaskFactory_h | 79 #endif // CancellableTaskFactory_h |
OLD | NEW |