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

Unified Diff: bench/ResultsWriter.h

Issue 1302103002: VisualBenchTest: Write JSON output (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Add comment Created 5 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | platform_tools/android/apps/robotium.cfg » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: bench/ResultsWriter.h
diff --git a/bench/ResultsWriter.h b/bench/ResultsWriter.h
index f53a980de43d87c79e3ff45570e7064fdcdaf594..b8b9a2e5ed52ce5ac4fa12214ba37a04ed25b9da 100644
--- a/bench/ResultsWriter.h
+++ b/bench/ResultsWriter.h
@@ -12,6 +12,7 @@
#include "BenchLogger.h"
#include "SkJSONCPP.h"
+#include "SkOSFile.h"
#include "SkStream.h"
#include "SkString.h"
#include "SkTArray.h"
@@ -116,6 +117,12 @@ public:
// Flush to storage now please.
virtual void flush() {
+ SkString dirname = SkOSPath::Dirname(fFilename.c_str());
+ if (!sk_exists(dirname.c_str(), kWrite_SkFILE_Flag)) {
+ if (!sk_mkdir(dirname.c_str())) {
+ SkDebugf("Failed to create directory.");
+ }
+ }
SkFILEWStream stream(fFilename.c_str());
stream.writeText(Json::StyledWriter().write(fRoot).c_str());
stream.flush();
« no previous file with comments | « no previous file | platform_tools/android/apps/robotium.cfg » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698