Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(184)

Side by Side Diff: dm/DMReporter.h

Issue 853883004: Revert of Sketch DM refactor. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « dm/DMQuiltTask.cpp ('k') | dm/DMReporter.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 #ifndef DMReporter_DEFINED
2 #define DMReporter_DEFINED
3
4 #include "SkString.h"
5 #include "SkTArray.h"
6 #include "SkThread.h"
7 #include "SkTime.h"
8 #include "SkTypes.h"
9
10 // Used to report status changes including failures. All public methods are thr eadsafe.
11 namespace DM {
12
13 class Reporter : SkNoncopyable {
14 public:
15 Reporter() : fPending(0), fFailed(0) {}
16
17 void taskCreated() { sk_atomic_inc(&fPending); }
18 void taskDestroyed() { sk_atomic_dec(&fPending); }
19 void fail(SkString msg);
20
21 void printStatus(SkString name, SkMSec timeMs) const;
22
23 void getFailures(SkTArray<SkString>*) const;
24
25 private:
26 int32_t fPending; // atomic
27 int32_t fFailed; // atomic, == fFailures.count().
28
29 mutable SkMutex fMutex; // Guards fFailures.
30 SkTArray<SkString> fFailures;
31 };
32
33
34 } // namespace DM
35
36 #endif // DMReporter_DEFINED
OLDNEW
« no previous file with comments | « dm/DMQuiltTask.cpp ('k') | dm/DMReporter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698