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

Side by Side Diff: dm/DMReporter.h

Issue 22839016: Skeleton of DM (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: missed one Created 7 years, 2 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 | Annotate | Revision Log
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 "SkTypes.h"
8
9 // Used to report status changes including failures. All public methods are thr eadsafe.
10
11 namespace DM {
12
13 class Reporter : SkNoncopyable {
14 public:
15 Reporter() : fStarted(0), fFinished(0) {}
16
17 void start() { sk_atomic_inc(&fStarted); }
18 void finish() { sk_atomic_inc(&fFinished); }
19 void fail(SkString name);
20
21 int32_t started() const { return fStarted; }
22 int32_t finished() const { return fFinished; }
23 int32_t failed() const;
24
25 void UpdateStatusLine() const;
26
27 void getFailures(SkTArray<SkString>*) const;
28
29 private:
30 int32_t fStarted, fFinished;
31
32 mutable SkMutex fMutex; // Guards fFailures.
33 SkTArray<SkString> fFailures;
34 };
35
36
37 } // namespace DM
38
39 #endif // DMReporter_DEFINED
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698