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

Unified Diff: runtime/observatory/lib/src/elements/flag_list.dart

Issue 2211603002: Centralized event streams (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Merged with master Created 4 years, 4 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 side-by-side diff with in-line comments
Download patch
Index: runtime/observatory/lib/src/elements/flag_list.dart
diff --git a/runtime/observatory/lib/src/elements/flag_list.dart b/runtime/observatory/lib/src/elements/flag_list.dart
index 19d78162e99a05c544137caab093c537a83cc2b4..1fdb3d508db0f9dcbc51a8b8c75fdec54b0525db 100644
--- a/runtime/observatory/lib/src/elements/flag_list.dart
+++ b/runtime/observatory/lib/src/elements/flag_list.dart
@@ -33,7 +33,7 @@ class FlagListElement extends HtmlElement implements Renderable {
Stream<RenderedEvent<FlagListElement>> get onRendered => _r.onRendered;
M.VMRef _vm;
- Stream<M.VMUpdateEvent> _vmUpdates;
+ M.EventRepository _events;
M.FlagsRepository _repository;
M.NotificationRepository _notifications;
Iterable<M.Flag> _flags;
@@ -41,18 +41,18 @@ class FlagListElement extends HtmlElement implements Renderable {
M.VMRef get vm => _vm;
factory FlagListElement(M.VMRef vm,
- Stream<M.VMUpdateEvent> vmUpdates,
+ M.EventRepository events,
M.FlagsRepository repository,
M.NotificationRepository notifications,
{RenderingQueue queue}) {
assert(vm != null);
- assert(vmUpdates != null);
+ assert(events != null);
assert(repository != null);
assert(notifications != null);
FlagListElement e = document.createElement(tag.name);
e._r = new RenderingScheduler(e, queue: queue);
e._vm = vm;
- e._vmUpdates = vmUpdates;
+ e._events = events;
e._repository = repository;
e._notifications = notifications;
return e;
@@ -63,8 +63,8 @@ class FlagListElement extends HtmlElement implements Renderable {
@override
void attached() {
super.attached();
- _r.enable();
_refresh();
+ _r.enable();
}
@override
@@ -103,7 +103,7 @@ class FlagListElement extends HtmlElement implements Renderable {
new NavBarElement(queue: _r.queue)
..children = [
new NavTopMenuElement(queue: _r.queue),
- new NavVMMenuElement(_vm, _vmUpdates, queue: _r.queue),
+ new NavVMMenuElement(_vm, _events, queue: _r.queue),
new NavMenuElement('flags', link: Uris.flags(), last: true,
queue: _r.queue),
new NavRefreshElement(queue: _r.queue)
@@ -124,9 +124,11 @@ class FlagListElement extends HtmlElement implements Renderable {
];
}
- Future _refresh() async {
- _flags = await _repository.list(_vm);
- _r.dirty();
+ Future _refresh() {
+ return _repository.list().then((flags) {
+ _flags = flags;
+ _r.dirty();
+ });
}
static bool _isModified(M.Flag flag) => flag.modified;
« no previous file with comments | « runtime/observatory/lib/src/elements/error_ref_wrapper.dart ('k') | runtime/observatory/lib/src/elements/function_ref.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698