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

Side by Side Diff: dm/DMJsonWriter.cpp

Issue 873723007: DM::NullSink (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: changes 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 | « dm/DM.cpp ('k') | dm/DMSrcSink.h » ('j') | 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 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 result["file_name"] = gFailures[i].fileName; 68 result["file_name"] = gFailures[i].fileName;
69 result["line_no"] = gFailures[i].lineNo; 69 result["line_no"] = gFailures[i].lineNo;
70 result["condition"] = gFailures[i].condition; 70 result["condition"] = gFailures[i].condition;
71 result["message"] = gFailures[i].message.c_str(); 71 result["message"] = gFailures[i].message.c_str();
72 72
73 root["test_results"]["failures"].append(result); 73 root["test_results"]["failures"].append(result);
74 } 74 }
75 } 75 }
76 76
77 SkString path = SkOSPath::Join(FLAGS_writePath[0], "dm.json"); 77 SkString path = SkOSPath::Join(FLAGS_writePath[0], "dm.json");
78 sk_mkdir(FLAGS_writePath[0]);
78 SkFILEWStream stream(path.c_str()); 79 SkFILEWStream stream(path.c_str());
79 stream.writeText(Json::StyledWriter().write(root).c_str()); 80 stream.writeText(Json::StyledWriter().write(root).c_str());
80 stream.flush(); 81 stream.flush();
81 } 82 }
82 83
83 bool JsonWriter::ReadJson(const char* path, void(*callback)(BitmapResult)) { 84 bool JsonWriter::ReadJson(const char* path, void(*callback)(BitmapResult)) {
84 SkAutoTUnref<SkData> json(SkData::NewFromFileName(path)); 85 SkAutoTUnref<SkData> json(SkData::NewFromFileName(path));
85 if (!json) { 86 if (!json) {
86 return false; 87 return false;
87 } 88 }
(...skipping 13 matching lines...) Expand all
101 br.config = r["key"]["config"].asCString(); 102 br.config = r["key"]["config"].asCString();
102 br.sourceType = r["key"]["source_type"].asCString(); 103 br.sourceType = r["key"]["source_type"].asCString();
103 br.ext = r["ext"].asCString(); 104 br.ext = r["ext"].asCString();
104 br.md5 = r["md5"].asCString(); 105 br.md5 = r["md5"].asCString();
105 callback(br); 106 callback(br);
106 } 107 }
107 return true; 108 return true;
108 } 109 }
109 110
110 } // namespace DM 111 } // namespace DM
OLDNEW
« no previous file with comments | « dm/DM.cpp ('k') | dm/DMSrcSink.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698