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

Unified Diff: runtime/bin/eventhandler.cc

Issue 78103002: Simplify 0-timers to not go through the eventhandler. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | sdk/lib/io/timer_impl.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/eventhandler.cc
diff --git a/runtime/bin/eventhandler.cc b/runtime/bin/eventhandler.cc
index 8de036eb8bf0acb18526cf6b6ebe847c450b67e2..3a86b2fd7c95e3b30e7d8e87ad535dbb029a4cd3 100644
--- a/runtime/bin/eventhandler.cc
+++ b/runtime/bin/eventhandler.cc
@@ -96,7 +96,12 @@ void FUNCTION_NAME(EventHandler_SendData)(Dart_NativeArguments args) {
Dart_Port dart_port =
DartUtils::GetIntegerField(handle, DartUtils::kIdFieldName);
int64_t data = DartUtils::GetIntegerValue(Dart_GetNativeArgument(args, 2));
- event_handler->SendData(id, dart_port, data);
+ if (id == kTimerId && data == 0) {
+ // This is a 0-timer. Simply queue a 'null' on the port.
+ DartUtils::PostNull(dart_port);
+ } else {
+ event_handler->SendData(id, dart_port, data);
+ }
}
} // namespace bin
« no previous file with comments | « no previous file | sdk/lib/io/timer_impl.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698