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

Unified Diff: bench/ResultsWriter.h

Issue 286903025: PictureBenchmark JSON logging (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Switch JSON styles from styled to fast Created 6 years, 7 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 | bench/TimerData.h » ('j') | tools/PictureResultsWriter.h » ('J')
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 a9eef802bda103f2ec0341782c3fc0f68bbe6954..927d8bdab65363ba50249491ec600347ef749a33 100644
--- a/bench/ResultsWriter.h
+++ b/bench/ResultsWriter.h
@@ -101,26 +101,9 @@ private:
* },
* ...
*/
-class JSONResultsWriter : public ResultsWriter {
-private:
- Json::Value* find_named_node(Json::Value* root, const char name[]) {
- Json::Value* search_results = NULL;
- for(Json::Value::iterator iter = root->begin();
- iter!= root->end(); ++iter) {
- if(SkString(name).equals((*iter)["name"].asCString())) {
- search_results = &(*iter);
- break;
- }
- }
- if(search_results != NULL) {
- return search_results;
- } else {
- Json::Value* new_val = &(root->append(Json::Value()));
- (*new_val)["name"] = name;
- return new_val;
- }
- }
+Json::Value* find_named_node(Json::Value* root, const char name[]);
+class JSONResultsWriter : public ResultsWriter {
public:
explicit JSONResultsWriter(const char filename[])
: fFilename(filename)
@@ -163,7 +146,27 @@ private:
Json::Value* fConfig;
};
+
+Json::Value* find_named_node(Json::Value* root, const char name[]) {
jcgregorio 2014/05/27 15:34:25 Should be moved to a CPP file. Also I believe the
kelvinly 2014/05/27 16:41:06 Ah, sorry. Any advice on what to name the CPP file
jcgregorio 2014/05/27 17:14:05 ResultsWriter.cpp On 2014/05/27 16:41:06, kelvinl
kelvinly 2014/05/27 18:55:28 Done.
+ Json::Value* search_results = NULL;
+ for(Json::Value::iterator iter = root->begin();
+ iter!= root->end(); ++iter) {
+ if(SkString(name).equals((*iter)["name"].asCString())) {
+ search_results = &(*iter);
+ break;
+ }
+ }
+
+ if(search_results != NULL) {
+ return search_results;
+ } else {
+ Json::Value* new_val = &(root->append(Json::Value()));
+ (*new_val)["name"] = name;
+ return new_val;
+ }
+}
#endif // SK_BUILD_JSON_WRITER
+
/**
* This ResultsWriter writes out to multiple ResultsWriters.
*/
« no previous file with comments | « no previous file | bench/TimerData.h » ('j') | tools/PictureResultsWriter.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698