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

Side by Side Diff: dm/DMJsonWriter.cpp

Issue 1059513002: Update DM to allow Src's to have optional options. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: blacklist bug Created 5 years, 8 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 | « dm/DMJsonWriter.h ('k') | tools/dm_flags.json » ('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 7
8 #include "DMJsonWriter.h" 8 #include "DMJsonWriter.h"
9 9
10 #include "ProcStats.h" 10 #include "ProcStats.h"
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 root[FLAGS_properties[i-1]] = FLAGS_properties[i]; 45 root[FLAGS_properties[i-1]] = FLAGS_properties[i];
46 } 46 }
47 for (int i = 1; i < FLAGS_key.count(); i += 2) { 47 for (int i = 1; i < FLAGS_key.count(); i += 2) {
48 root["key"][FLAGS_key[i-1]] = FLAGS_key[i]; 48 root["key"][FLAGS_key[i-1]] = FLAGS_key[i];
49 } 49 }
50 50
51 { 51 {
52 SkAutoMutexAcquire lock(&gBitmapResultLock); 52 SkAutoMutexAcquire lock(&gBitmapResultLock);
53 for (int i = 0; i < gBitmapResults.count(); i++) { 53 for (int i = 0; i < gBitmapResults.count(); i++) {
54 Json::Value result; 54 Json::Value result;
55 result["key"]["name"] = gBitmapResults[i].name.c_str(); 55 result["key"]["name"] = gBitmapResults[i].name.c_str();
56 result["key"]["config"] = gBitmapResults[i].config.c_str(); 56 result["key"]["config"] = gBitmapResults[i].config.c_str();
57 result["key"]["source_type"] = gBitmapResults[i].sourceType.c_str(); 57 result["key"]["source_type"] = gBitmapResults[i].sourceType.c_str ();
58 result["options"]["ext"] = gBitmapResults[i].ext.c_str(); 58 result["key"]["source_options"] = gBitmapResults[i].sourceOptions.c_ str();
59 result["md5"] = gBitmapResults[i].md5.c_str(); 59 result["options"]["ext"] = gBitmapResults[i].ext.c_str();
60 result["md5"] = gBitmapResults[i].md5.c_str();
60 61
61 root["results"].append(result); 62 root["results"].append(result);
62 } 63 }
63 } 64 }
64 65
65 { 66 {
66 SkAutoMutexAcquire lock(gFailureLock); 67 SkAutoMutexAcquire lock(gFailureLock);
67 for (int i = 0; i < gFailures.count(); i++) { 68 for (int i = 0; i < gFailures.count(); i++) {
68 Json::Value result; 69 Json::Value result;
69 result["file_name"] = gFailures[i].fileName; 70 result["file_name"] = gFailures[i].fileName;
(...skipping 27 matching lines...) Expand all
97 Json::Value root; 98 Json::Value root;
98 const char* data = (const char*)json->data(); 99 const char* data = (const char*)json->data();
99 if (!reader.parse(data, data+json->size(), root)) { 100 if (!reader.parse(data, data+json->size(), root)) {
100 return false; 101 return false;
101 } 102 }
102 103
103 const Json::Value& results = root["results"]; 104 const Json::Value& results = root["results"];
104 BitmapResult br; 105 BitmapResult br;
105 for (unsigned i = 0; i < results.size(); i++) { 106 for (unsigned i = 0; i < results.size(); i++) {
106 const Json::Value& r = results[i]; 107 const Json::Value& r = results[i];
107 br.name = r["key"]["name"].asCString(); 108 br.name = r["key"]["name"].asCString();
108 br.config = r["key"]["config"].asCString(); 109 br.config = r["key"]["config"].asCString();
109 br.sourceType = r["key"]["source_type"].asCString(); 110 br.sourceType = r["key"]["source_type"].asCString();
110 br.ext = r["options"]["ext"].asCString(); 111 br.sourceOptions = r["key"]["source_options"].asCString();
111 br.md5 = r["md5"].asCString(); 112 br.ext = r["options"]["ext"].asCString();
113 br.md5 = r["md5"].asCString();
112 callback(br); 114 callback(br);
113 } 115 }
114 return true; 116 return true;
115 } 117 }
116 118
117 } // namespace DM 119 } // namespace DM
OLDNEW
« no previous file with comments | « dm/DMJsonWriter.h ('k') | tools/dm_flags.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698