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

Unified Diff: sdk/lib/_internal/js_runtime/lib/developer_patch.dart

Issue 1299493007: Rework service extensions to be safe (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 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
« no previous file with comments | « runtime/vm/symbols.h ('k') | sdk/lib/developer/extension.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/_internal/js_runtime/lib/developer_patch.dart
diff --git a/sdk/lib/_internal/js_runtime/lib/developer_patch.dart b/sdk/lib/_internal/js_runtime/lib/developer_patch.dart
index 2b5ba7ea055e050566d4a8f8b27357cf909efd57..3dd4f665babb211bce84cc35ddb88c640a8da0ab 100644
--- a/sdk/lib/_internal/js_runtime/lib/developer_patch.dart
+++ b/sdk/lib/_internal/js_runtime/lib/developer_patch.dart
@@ -32,3 +32,15 @@ void log(String message,
StackTrace stackTrace}) {
// TODO.
}
+
+final _extensions = new Map<String, ServiceExtensionHandler>();
+
+@patch
+bool _extensionExists(String method) {
+ return _extensions[method] != null;
+}
+
+@patch
+void _registerExtension(String method, ServiceExtensionHandler handler) {
+ _extensions[method] = handler;
+}
« no previous file with comments | « runtime/vm/symbols.h ('k') | sdk/lib/developer/extension.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698