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

Side by Side Diff: dm/DMReporter.cpp

Issue 88543002: DM: some refactoring (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 years 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
1 #include "DMReporter.h" 1 #include "DMReporter.h"
2 2
3 #include "SkCommandLineFlags.h" 3 #include "SkCommandLineFlags.h"
4 4
5 DEFINE_bool(quiet, false, "If true, don't print status updates."); 5 DEFINE_bool(quiet, false, "If true, don't print status updates.");
6 6
7 namespace DM { 7 namespace DM {
8 8
9 void Reporter::updateStatusLine() const { 9 void Reporter::updateStatusLine() const {
10 if (FLAGS_quiet) { 10 if (FLAGS_quiet) {
11 return; 11 return;
12 } 12 }
13 13
14 SkString status; 14 SkString status;
15 status.printf("\r\033[K%d / %d", this->finished(), this->started()); 15 status.printf("\r\033[K%d tasks left", this->started() - this->finished());
epoger 2013/11/26 17:55:22 This user prefers to see "completed X of Y", rathe
bsalomon 2013/11/26 18:21:52 That is potentially misleading as Y grows in DM.
mtklein 2013/11/26 18:25:30 Have you run this or just talking abstractly? I'd
epoger 2013/11/26 18:34:48 I have not run DM, and it's not a big deal to me e
16 const int failed = this->failed(); 16 const int failed = this->failed();
17 if (failed > 0) { 17 if (failed > 0) {
18 status.appendf(", %d failed", failed); 18 status.appendf(", %d failed", failed);
19 } 19 }
20 SkDebugf(status.c_str()); 20 SkDebugf(status.c_str());
21 } 21 }
22 22
23 int32_t Reporter::failed() const { 23 int32_t Reporter::failed() const {
24 SkAutoMutexAcquire reader(&fMutex); 24 SkAutoMutexAcquire reader(&fMutex);
25 return fFailures.count(); 25 return fFailures.count();
26 } 26 }
27 27
28 void Reporter::fail(SkString name) { 28 void Reporter::fail(SkString name) {
29 SkAutoMutexAcquire writer(&fMutex); 29 SkAutoMutexAcquire writer(&fMutex);
30 fFailures.push_back(name); 30 fFailures.push_back(name);
31 } 31 }
32 32
33 void Reporter::getFailures(SkTArray<SkString>* failures) const { 33 void Reporter::getFailures(SkTArray<SkString>* failures) const {
34 SkAutoMutexAcquire reader(&fMutex); 34 SkAutoMutexAcquire reader(&fMutex);
35 *failures = fFailures; 35 *failures = fFailures;
36 } 36 }
37 37
38 } // namespace DM 38 } // namespace DM
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698