Chromium Code Reviews| 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. |
| */ |