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

Unified Diff: mojo/common/dart/lib/tracing_helper.dart

Issue 1401853005: Dart: Makes timing of sending trace events configurable. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 2 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
« no previous file with comments | « mojo/common/dart/lib/trace_provider_impl.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/common/dart/lib/tracing_helper.dart
diff --git a/mojo/common/dart/lib/tracing_helper.dart b/mojo/common/dart/lib/tracing_helper.dart
index 5d797ecec71a7769105ea3bdada7c651725c3d27..a094d393c064bea02e3909e2b02b74d62b787de2 100644
--- a/mojo/common/dart/lib/tracing_helper.dart
+++ b/mojo/common/dart/lib/tracing_helper.dart
@@ -4,14 +4,15 @@
library tracing;
-import 'trace_provider_impl.dart';
-
import 'dart:async';
import 'dart:convert';
import 'dart:core';
import 'dart:io';
import 'dart:isolate';
+import 'package:common/src/trace_provider_impl.dart';
+export 'package:common/src/trace_provider_impl.dart' show TraceSendTiming;
+
import 'package:mojo/application.dart';
import 'package:mojo/core.dart';
import 'package:mojo_services/tracing/tracing.mojom.dart';
@@ -36,12 +37,13 @@ class TracingHelper {
// |initialize()| method. |appName| will be used to form a thread identifier
// for use in trace messages. If |appName| is longer than 20 characters then
// only the last 20 characters of |appName| will be used.
- TracingHelper.fromApplication(Application app, String appName) {
+ TracingHelper.fromApplication(Application app, String appName,
+ [TraceSendTiming timing = TraceSendTiming.IMMEDIATE]) {
// Masked because the tid is expected to be a 32-bit int.
_tid = [appName, Isolate.current]
.fold(7, (hash, element) => 31 * hash + element.hashCode) &
0x7fffffff;
- _impl = new TraceProviderImpl();
+ _impl = new TraceProviderImpl(timing);
ApplicationConnection connection = app.connectToApplication("mojo:tracing");
connection.provideService(TraceProviderName, (e) {
_impl.connect(e);
« no previous file with comments | « mojo/common/dart/lib/trace_provider_impl.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698