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

Unified Diff: pkg/analyzer/lib/instrumentation/instrumentation.dart

Issue 751063005: Instrumentation support (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Bump version number Created 6 years 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 | « no previous file | pkg/analyzer/pubspec.yaml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/instrumentation/instrumentation.dart
diff --git a/pkg/analyzer/lib/instrumentation/instrumentation.dart b/pkg/analyzer/lib/instrumentation/instrumentation.dart
new file mode 100644
index 0000000000000000000000000000000000000000..7557ecd3553e0934c1b77b1bafbc7090c6e81ac2
--- /dev/null
+++ b/pkg/analyzer/lib/instrumentation/instrumentation.dart
@@ -0,0 +1,44 @@
+// Copyright (c) 2014, 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 instrumentation;
+
+/**
+ * The interface used by client code to communicate with an instrumentation
+ * server.
+ */
+abstract class InstrumentationServer {
+ /**
+ * Pass the given [message] to the instrumentation server so that it will be
+ * logged with other messages.
+ */
+ void log(String message);
+
+ /**
+ * Signal that the client is done communicating with the instrumentation
+ * server. This method should be invoked exactly one time and no other methods
+ * should be invoked on this instance after this method has been invoked.
+ */
+ void shutdown();
+}
+
+/**
+ * An [InstrumentationServer] that ignores all instrumentation requests sent to
+ * it. It can be used when no instrumentation data is to be collected as a way
+ * to avoid needing to check for null values.
+ */
+class NullInstrumentationServer implements InstrumentationServer {
+ /**
+ * Initialize a newly created instance of this class.
+ */
+ const NullInstrumentationServer();
+
+ @override
+ void log(String message) {
+ }
+
+ @override
+ void shutdown() {
+ }
+}
« no previous file with comments | « no previous file | pkg/analyzer/pubspec.yaml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698