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

Side by Side Diff: samples/buildbot/model.dart

Issue 967883004: Replace string uses with code units in Json parser. (Closed) Base URL: git@github.com:dart-lang/fletch.git@master
Patch Set: Created 5 years, 9 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
OLDNEW
1 // Copyright (c) 2015, the Fletch project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, the Fletch project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE.md file. 3 // BSD-style license that can be found in the LICENSE.md file.
4 4
5 import 'json.dart'; 5 import 'json.dart';
6 6
7 class Resource { 7 class Resource {
8 String host; 8 String host;
9 String path; 9 String path;
10 Resource(this.host, this.path); 10 Resource(this.host, this.path);
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 53
54 JsonData _status; 54 JsonData _status;
55 JsonData _changes; 55 JsonData _changes;
56 56
57 Console(this.title, 57 Console(this.title,
58 Resource api, 58 Resource api,
59 Resource status) { 59 Resource status) {
60 _status = new JsonData(status.sub("/current?format=json")); 60 _status = new JsonData(status.sub("/current?format=json"));
61 _status.updateData(); 61 _status.updateData();
62 _changes = new JsonData(api.sub("/json/changes")); 62 _changes = new JsonData(api.sub("/json/changes"));
63 _changes.updateData();
63 } 64 }
64 65
65 String get status { 66 String get status {
66 _status.ensureData(); 67 _status.ensureData();
67 if (_status.data is Map && _status.data.containsKey("message")) { 68 if (_status.data is Map && _status.data.containsKey("message")) {
68 return _status.data['message']; 69 return _status.data['message'];
69 } 70 }
70 return "unknown status"; 71 return "unknown status";
71 } 72 }
72 } 73 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698