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

Side by Side Diff: benchmarks/dart_startup/lib/main.dart

Issue 1443433002: Dart: Use dart:developer for tracing in startup benchmark. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Roll binary sdk Created 5 years, 1 month 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 | « benchmarks/dart_handler_running/lib/main.dart ('k') | mojo/tools/data/benchmarks » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!mojo mojo:dart_content_handler 1 #!mojo mojo:dart_content_handler
2 // Copyright 2015 The Chromium Authors. All rights reserved. 2 // Copyright 2015 The Chromium Authors. All rights reserved.
3 // Use of this source code is governed by a BSD-style license that can be 3 // Use of this source code is governed by a BSD-style license that can be
4 // found in the LICENSE file. 4 // found in the LICENSE file.
5 5
6 import 'dart:async'; 6 import 'dart:async';
7 import 'dart:developer';
7 8
8 import 'package:common/tracing_helper.dart';
9 import 'package:mojo/application.dart'; 9 import 'package:mojo/application.dart';
10 import 'package:mojo/core.dart'; 10 import 'package:mojo/core.dart';
11 11
12 class StartupBenchmarkApp extends Application { 12 class StartupBenchmarkApp extends Application {
13 TracingHelper _tracing;
14 Timer _timer;
15
16 StartupBenchmarkApp.fromHandle(MojoHandle handle) : super.fromHandle(handle); 13 StartupBenchmarkApp.fromHandle(MojoHandle handle) : super.fromHandle(handle);
17 14
18 void initialize(List<String> args, String url) { 15 void initialize(List<String> args, String url) {
19 // This sets up a connection between this application and the Mojo 16 Timeline.instantSync("initialized");
20 // tracing service.
21 _tracing = new TracingHelper.fromApplication(
22 this, "example_traced_application", TraceSendTiming.AT_END);
23 _tracing.traceInstant("initialized", "traced_application");
24 } 17 }
25 18
26 @override 19 @override
27 void acceptConnection(String requestorUrl, String resolvedUrl, 20 void acceptConnection(String requestorUrl, String resolvedUrl,
28 ApplicationConnection connection) { 21 ApplicationConnection connection) {
29 _tracing.traceInstant("connected", "traced_application"); 22 Timeline.instantSync("connected");
30 } 23 }
31 } 24 }
32 25
33 main(List args) { 26 main(List args) {
34 MojoHandle appHandle = new MojoHandle(args[0]); 27 MojoHandle appHandle = new MojoHandle(args[0]);
35 new StartupBenchmarkApp.fromHandle(appHandle); 28 new StartupBenchmarkApp.fromHandle(appHandle);
36 } 29 }
OLDNEW
« no previous file with comments | « benchmarks/dart_handler_running/lib/main.dart ('k') | mojo/tools/data/benchmarks » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698