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

Unified Diff: runtime/bin/eventhandler_win.cc

Issue 9104041: Added API Dart_PostCMessage for posting a Dart_CMessage structure (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Addressed review comments from asiva@ Created 8 years, 10 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
Index: runtime/bin/eventhandler_win.cc
diff --git a/runtime/bin/eventhandler_win.cc b/runtime/bin/eventhandler_win.cc
index 72311c109ed5a268a98321375b768cf9e353c64c..238b330d0d0456b853088c2031c5064590225e9d 100644
--- a/runtime/bin/eventhandler_win.cc
+++ b/runtime/bin/eventhandler_win.cc
@@ -10,6 +10,7 @@
#include <mswsock.h>
#include "bin/builtin.h"
+#include "bin/dartutils.h"
#include "bin/socket.h"
@@ -641,7 +642,7 @@ void EventHandlerImplementation::HandleInterrupt(InterruptMessage* msg) {
if ((msg->data & (1 << kInEvent)) != 0) {
if (handle->Available() > 0) {
int event_mask = (1 << kInEvent);
- Dart_PostIntArray(handle->port(), 1, &event_mask);
+ DartUtils::PostInteger(port, event_mask);
} else if (!handle->HasPendingRead() &&
!handle->IsClosedRead()) {
handle->IssueRead();
@@ -653,7 +654,7 @@ void EventHandlerImplementation::HandleInterrupt(InterruptMessage* msg) {
if ((msg->data & (1 << kOutEvent)) != 0) {
if (!handle->HasPendingWrite()) {
int event_mask = (1 << kOutEvent);
- Dart_PostIntArray(handle->port(), 1, &event_mask);
+ DartUtils::PostInteger(port, event_mask);
}
}
@@ -689,7 +690,7 @@ void EventHandlerImplementation::HandleAccept(ListenSocket* listen_socket,
if (!listen_socket->IsClosing()) {
int event_mask = 1 << kInEvent;
if ((listen_socket->mask() & event_mask) != 0) {
- Dart_PostIntArray(listen_socket->port(), 1, &event_mask);
+ DartUtils::PostInteger(port, event_mask);
}
}
@@ -702,7 +703,7 @@ void EventHandlerImplementation::HandleAccept(ListenSocket* listen_socket,
void EventHandlerImplementation::HandleClosed(Handle* handle) {
if (!handle->IsClosing()) {
int event_mask = 1 << kCloseEvent;
- Dart_PostIntArray(handle->port(), 1, &event_mask);
+ DartUtils::PostInteger(port, event_mask);
}
}
@@ -716,7 +717,7 @@ void EventHandlerImplementation::HandleRead(Handle* handle,
if (!handle->IsClosing()) {
int event_mask = 1 << kInEvent;
if ((handle->mask() & event_mask) != 0) {
- Dart_PostIntArray(handle->port(), 1, &event_mask);
+ DartUtils::PostInteger(port, event_mask);
}
}
} else {
@@ -740,7 +741,7 @@ void EventHandlerImplementation::HandleWrite(Handle* handle,
if (!handle->IsClosing()) {
int event_mask = 1 << kOutEvent;
if ((handle->mask() & event_mask) != 0) {
- Dart_PostIntArray(handle->port(), 1, &event_mask);
+ DartUtils::PostInteger(port, event_mask);
}
}
} else {
@@ -756,7 +757,7 @@ void EventHandlerImplementation::HandleWrite(Handle* handle,
void EventHandlerImplementation::HandleTimeout() {
// TODO(sgjesse) check if there actually is a timeout.
- Dart_PostIntArray(timeout_port_, 0, NULL);
+ DartUtils::PostNull(timeout_port_);
timeout_ = kInfinityTimeout;
timeout_port_ = 0;
}

Powered by Google App Engine
This is Rietveld 408576698