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

Side by Side Diff: dm/DMJsonWriter.cpp

Issue 1067863002: Fix DM -r (Closed) Base URL: https://skia.googlesource.com/skia@master
Patch Set: 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 | « no previous file | no next file » | 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 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 Json::Value root; 103 Json::Value root;
104 const char* data = (const char*)json->data(); 104 const char* data = (const char*)json->data();
105 if (!reader.parse(data, data+json->size(), root)) { 105 if (!reader.parse(data, data+json->size(), root)) {
106 return false; 106 return false;
107 } 107 }
108 108
109 const Json::Value& results = root["results"]; 109 const Json::Value& results = root["results"];
110 BitmapResult br; 110 BitmapResult br;
111 for (unsigned i = 0; i < results.size(); i++) { 111 for (unsigned i = 0; i < results.size(); i++) {
112 const Json::Value& r = results[i]; 112 const Json::Value& r = results[i];
113 br.name = r["key"]["name"].asCString(); 113 br.name = r["key"]["name"].asCString();
114 br.config = r["key"]["config"].asCString(); 114 br.config = r["key"]["config"].asCString();
115 br.sourceType = r["key"]["source_type"].asCString(); 115 br.sourceType = r["key"]["source_type"].asCString();
116 br.sourceOptions = r["key"]["source_options"].asCString(); 116 br.ext = r["options"]["ext"].asCString();
117 br.ext = r["options"]["ext"].asCString(); 117 br.md5 = r["md5"].asCString();
118 br.md5 = r["md5"].asCString(); 118
119 if (!r["key"]["source_options"].isNull()) {
120 br.sourceOptions = r["key"]["source_options"].asCString();
121 }
119 callback(br); 122 callback(br);
120 } 123 }
121 return true; 124 return true;
122 } 125 }
123 126
124 } // namespace DM 127 } // namespace DM
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698