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

Side by Side Diff: bench/ResultsWriter.cpp

Issue 303913002: In Android framework, make tools depend on jsoncpp (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Do as Thoreau would do. Created 6 years, 6 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 unified diff | Download patch
« no previous file with comments | « bench/ResultsWriter.h ('k') | bench/TimerData.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2014 Google Inc. 2 * Copyright 2014 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 * 6 *
7 * Helper functions for result writing operations. 7 * Helper functions for result writing operations.
8 */ 8 */
9 9
10 #include "ResultsWriter.h" 10 #include "ResultsWriter.h"
11 11
12 #ifdef SK_BUILD_JSON_WRITER
13
14 Json::Value* SkFindNamedNode(Json::Value* root, const char name[]) { 12 Json::Value* SkFindNamedNode(Json::Value* root, const char name[]) {
15 Json::Value* search_results = NULL; 13 Json::Value* search_results = NULL;
16 for(Json::Value::iterator iter = root->begin(); 14 for(Json::Value::iterator iter = root->begin();
17 iter!= root->end(); ++iter) { 15 iter!= root->end(); ++iter) {
18 if(SkString(name).equals((*iter)["name"].asCString())) { 16 if(SkString(name).equals((*iter)["name"].asCString())) {
19 search_results = &(*iter); 17 search_results = &(*iter);
20 break; 18 break;
21 } 19 }
22 } 20 }
23 21
24 if(search_results != NULL) { 22 if(search_results != NULL) {
25 return search_results; 23 return search_results;
26 } else { 24 } else {
27 Json::Value* new_val = &(root->append(Json::Value())); 25 Json::Value* new_val = &(root->append(Json::Value()));
28 (*new_val)["name"] = name; 26 (*new_val)["name"] = name;
29 return new_val; 27 return new_val;
30 } 28 }
31 } 29 }
32 30
33 #endif // SK_BUILD_JSON_WRITER
OLDNEW
« no previous file with comments | « bench/ResultsWriter.h ('k') | bench/TimerData.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698