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

Side by Side Diff: dm/DMJsonWriter.cpp

Issue 925523003: DM: move ext into key (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: now, options Created 5 years, 10 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 "SkCommonFlags.h" 10 #include "SkCommonFlags.h"
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 root["key"][FLAGS_key[i-1]] = FLAGS_key[i]; 47 root["key"][FLAGS_key[i-1]] = FLAGS_key[i];
48 } 48 }
49 49
50 { 50 {
51 SkAutoMutexAcquire lock(&gBitmapResultLock); 51 SkAutoMutexAcquire lock(&gBitmapResultLock);
52 for (int i = 0; i < gBitmapResults.count(); i++) { 52 for (int i = 0; i < gBitmapResults.count(); i++) {
53 Json::Value result; 53 Json::Value result;
54 result["key"]["name"] = gBitmapResults[i].name.c_str(); 54 result["key"]["name"] = gBitmapResults[i].name.c_str();
55 result["key"]["config"] = gBitmapResults[i].config.c_str(); 55 result["key"]["config"] = gBitmapResults[i].config.c_str();
56 result["key"]["source_type"] = gBitmapResults[i].sourceType.c_str(); 56 result["key"]["source_type"] = gBitmapResults[i].sourceType.c_str();
57 result["ext"] = gBitmapResults[i].ext.c_str(); 57 result["options"]["ext"] = gBitmapResults[i].ext.c_str();
58 result["md5"] = gBitmapResults[i].md5.c_str(); 58 result["md5"] = gBitmapResults[i].md5.c_str();
59 59
60 root["results"].append(result); 60 root["results"].append(result);
61 } 61 }
62 } 62 }
63 63
64 { 64 {
65 SkAutoMutexAcquire lock(gFailureLock); 65 SkAutoMutexAcquire lock(gFailureLock);
66 for (int i = 0; i < gFailures.count(); i++) { 66 for (int i = 0; i < gFailures.count(); i++) {
67 Json::Value result; 67 Json::Value result;
(...skipping 26 matching lines...) Expand all
94 return false; 94 return false;
95 } 95 }
96 96
97 const Json::Value& results = root["results"]; 97 const Json::Value& results = root["results"];
98 BitmapResult br; 98 BitmapResult br;
99 for (unsigned i = 0; i < results.size(); i++) { 99 for (unsigned i = 0; i < results.size(); i++) {
100 const Json::Value& r = results[i]; 100 const Json::Value& r = results[i];
101 br.name = r["key"]["name"].asCString(); 101 br.name = r["key"]["name"].asCString();
102 br.config = r["key"]["config"].asCString(); 102 br.config = r["key"]["config"].asCString();
103 br.sourceType = r["key"]["source_type"].asCString(); 103 br.sourceType = r["key"]["source_type"].asCString();
104 br.ext = r["ext"].asCString(); 104 br.ext = r["options"]["ext"].asCString();
105 br.md5 = r["md5"].asCString(); 105 br.md5 = r["md5"].asCString();
106 callback(br); 106 callback(br);
107 } 107 }
108 return true; 108 return true;
109 } 109 }
110 110
111 } // namespace DM 111 } // 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