Chromium Code Reviews| Index: dm/DMJsonWriter.cpp |
| diff --git a/dm/DMJsonWriter.cpp b/dm/DMJsonWriter.cpp |
| index c017dde5b56c31c9e0ac3a377eecd504d372d9fe..c9952ae6bcdd228a6e49653dab6b0bf2d5315967 100644 |
| --- a/dm/DMJsonWriter.cpp |
| +++ b/dm/DMJsonWriter.cpp |
| @@ -52,11 +52,12 @@ void JsonWriter::DumpJson() { |
| SkAutoMutexAcquire lock(&gBitmapResultLock); |
| for (int i = 0; i < gBitmapResults.count(); i++) { |
| Json::Value result; |
| - result["key"]["name"] = gBitmapResults[i].name.c_str(); |
| - result["key"]["config"] = gBitmapResults[i].config.c_str(); |
| - result["key"]["source_type"] = gBitmapResults[i].sourceType.c_str(); |
| - result["options"]["ext"] = gBitmapResults[i].ext.c_str(); |
| - result["md5"] = gBitmapResults[i].md5.c_str(); |
| + result["key"]["name"] = gBitmapResults[i].name.c_str(); |
| + result["key"]["config"] = gBitmapResults[i].config.c_str(); |
| + result["key"]["source_type"] = gBitmapResults[i].sourceType.c_str(); |
| + result["options"]["source_options"] = gBitmapResults[i].sourceOptions.c_str(); |
|
mtklein
2015/04/02 17:51:38
This has to be part of key or gold will explode.
|
| + result["options"]["ext"] = gBitmapResults[i].ext.c_str(); |
| + result["md5"] = gBitmapResults[i].md5.c_str(); |
| root["results"].append(result); |
| } |
| @@ -104,11 +105,12 @@ bool JsonWriter::ReadJson(const char* path, void(*callback)(BitmapResult)) { |
| BitmapResult br; |
| for (unsigned i = 0; i < results.size(); i++) { |
| const Json::Value& r = results[i]; |
| - br.name = r["key"]["name"].asCString(); |
| - br.config = r["key"]["config"].asCString(); |
| - br.sourceType = r["key"]["source_type"].asCString(); |
| - br.ext = r["options"]["ext"].asCString(); |
| - br.md5 = r["md5"].asCString(); |
| + br.name = r["key"]["name"].asCString(); |
| + br.config = r["key"]["config"].asCString(); |
| + br.sourceType = r["key"]["source_type"].asCString(); |
| + br.sourceOptions = r["options"]["source_options"].asCString(); |
| + br.ext = r["options"]["ext"].asCString(); |
| + br.md5 = r["md5"].asCString(); |
| callback(br); |
| } |
| return true; |