| #ifndef DMReporter_DEFINED |
| #define DMReporter_DEFINED |
| // Used to report status changes including failures. All public methods are threadsafe. |
| class Reporter : SkNoncopyable { |
| Reporter() : fPending(0), fFailed(0) {} |
| void taskCreated() { sk_atomic_inc(&fPending); } |
| void taskDestroyed() { sk_atomic_dec(&fPending); } |
| void printStatus(SkString name, SkMSec timeMs) const; |
| void getFailures(SkTArray<SkString>*) const; |
| int32_t fPending; // atomic |
| int32_t fFailed; // atomic, == fFailures.count(). |
| mutable SkMutex fMutex; // Guards fFailures. |
| SkTArray<SkString> fFailures; |
| #endif // DMReporter_DEFINED |