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

Side by Side Diff: packages/stack_trace/lib/src/lazy_chain.dart

Issue 2989763002: Update charted to 0.4.8 and roll (Closed)
Patch Set: Removed Cutch from list of reviewers Created 3 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 unified diff | Download patch
« no previous file with comments | « packages/stack_trace/lib/src/frame.dart ('k') | packages/stack_trace/lib/src/lazy_trace.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file
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 file.
4
5 import 'chain.dart';
6 import 'frame.dart';
7 import 'lazy_trace.dart';
8 import 'trace.dart';
9
10 /// A thunk for lazily constructing a [Chain].
11 typedef Chain ChainThunk();
12
13 /// A wrapper around a [ChainThunk]. This works around issue 9579 by avoiding
14 /// the conversion of native [StackTrace]s to strings until it's absolutely
15 /// necessary.
16 class LazyChain implements Chain {
17 final ChainThunk _thunk;
18 Chain _inner;
19
20 LazyChain(this._thunk);
21
22 Chain get _chain {
23 if (_inner == null) _inner = _thunk();
24 return _inner;
25 }
26
27 List<Trace> get traces => _chain.traces;
28 Chain get terse => _chain.terse;
29 Chain foldFrames(bool predicate(Frame frame), {bool terse: false}) =>
30 new LazyChain(() => _chain.foldFrames(predicate, terse: terse));
31 Trace toTrace() => new LazyTrace(() => _chain.toTrace());
32 String toString() => _chain.toString();
33 }
OLDNEW
« no previous file with comments | « packages/stack_trace/lib/src/frame.dart ('k') | packages/stack_trace/lib/src/lazy_trace.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698