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

Side by Side Diff: dm/DMJsonWriter.cpp

Issue 1063713002: DM: set source options only when non-empty. (Closed) Base URL: https://skia.googlesource.com/skia.git@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 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["key"]["source_options"] = gBitmapResults[i].sourceOptions.c_ str(); 58 result["options"]["ext"] = gBitmapResults[i].ext.c_str();
59 result["options"]["ext"] = gBitmapResults[i].ext.c_str(); 59 result["md5"] = gBitmapResults[i].md5.c_str();
60 result["md5"] = gBitmapResults[i].md5.c_str(); 60
61 // Source options only need to be part of the key if they exist.
62 // Source type by source type, we either always set options or never set options.
63 if (!gBitmapResults[i].sourceOptions.isEmpty()) {
64 result["key"]["source_options"] = gBitmapResults[i].sourceOption s.c_str();
65 }
61 66
62 root["results"].append(result); 67 root["results"].append(result);
63 } 68 }
64 } 69 }
65 70
66 { 71 {
67 SkAutoMutexAcquire lock(gFailureLock); 72 SkAutoMutexAcquire lock(gFailureLock);
68 for (int i = 0; i < gFailures.count(); i++) { 73 for (int i = 0; i < gFailures.count(); i++) {
69 Json::Value result; 74 Json::Value result;
70 result["file_name"] = gFailures[i].fileName; 75 result["file_name"] = gFailures[i].fileName;
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 br.sourceType = r["key"]["source_type"].asCString(); 115 br.sourceType = r["key"]["source_type"].asCString();
111 br.sourceOptions = r["key"]["source_options"].asCString(); 116 br.sourceOptions = r["key"]["source_options"].asCString();
112 br.ext = r["options"]["ext"].asCString(); 117 br.ext = r["options"]["ext"].asCString();
113 br.md5 = r["md5"].asCString(); 118 br.md5 = r["md5"].asCString();
114 callback(br); 119 callback(br);
115 } 120 }
116 return true; 121 return true;
117 } 122 }
118 123
119 } // namespace DM 124 } // 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