Index: bench/ResultsWriter.h |
diff --git a/bench/ResultsWriter.h b/bench/ResultsWriter.h |
index f17bce3d930dbd9de8111d937cafb4f4ab003fd0..b8d97075a10bd150102007ede8e5f3febd403e14 100644 |
--- a/bench/ResultsWriter.h |
+++ b/bench/ResultsWriter.h |
@@ -45,6 +45,9 @@ public: |
// Record a single test metric. |
virtual void timer(const char name[], double ms) {} |
+ |
+ // Flush to storage now please. |
+ virtual void flush() {} |
}; |
/** |
@@ -79,9 +82,7 @@ public: |
, fConfig(NULL) {} |
~NanoJSONResultsWriter() { |
- SkFILEWStream stream(fFilename.c_str()); |
- stream.writeText(Json::StyledWriter().write(fRoot).c_str()); |
- stream.flush(); |
+ this->flush(); |
} |
// Added under "key". |
@@ -113,6 +114,13 @@ public: |
(*fConfig)[name] = ms; |
} |
+ // Flush to storage now please. |
+ virtual void flush() { |
+ SkFILEWStream stream(fFilename.c_str()); |
+ stream.writeText(Json::StyledWriter().write(fRoot).c_str()); |
+ stream.flush(); |
+ } |
+ |
private: |
SkString fFilename; |
Json::Value fRoot; |