| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |