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

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

Issue 2277543004: Converted Observatory script-inset & source-inset elements (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Converted Observatory eval-box element 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/source_inset.dart
diff --git a/runtime/observatory/lib/src/elements/source_inset.dart b/runtime/observatory/lib/src/elements/source_inset.dart
new file mode 100644
index 0000000000000000000000000000000000000000..b62376aba216744767f31db5e346bdd64aa2a5b2
--- /dev/null
+++ b/runtime/observatory/lib/src/elements/source_inset.dart
@@ -0,0 +1,89 @@
+// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+library source_inset_element;
+
+import 'dart:html';
+import 'dart:async';
+import 'package:observatory/models.dart' as M;
+import 'package:observatory/src/elements/helpers/rendering_scheduler.dart';
+import 'package:observatory/src/elements/helpers/tag.dart';
+import 'package:observatory/src/elements/script_inset.dart';
+
+class SourceInsetElement extends HtmlElement implements Renderable {
+ static const tag = const Tag<SourceInsetElement>('source-inset-wrapped');
+
+ RenderingScheduler _r;
+
+ Stream<RenderedEvent<SourceInsetElement>> get onRendered => _r.onRendered;
+
+
+ M.IsolateRef _isolate;
+ M.SourceLocation _location;
+ M.ScriptRepository _scripts;
+ M.InstanceRepository _instances;
+ M.EventRepository _events;
+ int _currentPos;
+ bool _inDebuggerContext;
+ Iterable _variables;
+
+ M.IsolateRef get isolate => _isolate;
+ M.SourceLocation get location => _location;
+
+ factory SourceInsetElement(M.IsolateRef isolate, M.SourceLocation location,
+ M.ScriptRepository scripts,
+ M.InstanceRepository instances,
+ M.EventRepository events,
+ {int currentPos,
+ bool inDebuggerContext: false,
+ Iterable variables: const [],
+ RenderingQueue queue}) {
+ assert(isolate != null);
+ assert(location != null);
+ assert(scripts != null);
+ assert(instances != null);
+ assert(events != null);
+ assert(inDebuggerContext != null);
+ assert(variables != null);
+ SourceInsetElement e = document.createElement(tag.name);
+ e._r = new RenderingScheduler(e, queue: queue);
+ e._isolate = isolate;
+ e._location = location;
+ e._scripts = scripts;
+ e._instances = instances;
+ e._events = events;
+ e._currentPos = currentPos;
+ e._inDebuggerContext = inDebuggerContext;
+ e._variables = variables;
+ return e;
+ }
+
+ SourceInsetElement.created() : super.created();
+
+ @override
+ void attached() {
+ super.attached();
+ _r.enable();
+ }
+
+ @override
+ void detached() {
+ super.detached();
+ children = [];
+ _r.disable(notify: true);
+ }
+
+ void render() {
+ children = [
+ new ScriptInsetElement(_isolate, _location.script,
+ _scripts, _instances, _events,
+ startPos: _location.tokenPos,
+ endPos: _location.endTokenPos,
+ currentPos: _currentPos,
+ inDebuggerContext: _inDebuggerContext,
+ variables: _variables,
+ queue: _r.queue)
+ ];
+ }
+}

Powered by Google App Engine
This is Rietveld 408576698