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

Unified Diff: runtime/bin/sync_socket.cc

Issue 2830273002: [dart:io][windows] Implements RawSynchronousSocket (Closed)
Patch Set: Fix Linux build Created 3 years, 8 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/bin/sync_socket.h ('k') | runtime/bin/sync_socket_android.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/sync_socket.cc
diff --git a/runtime/bin/sync_socket.cc b/runtime/bin/sync_socket.cc
index 9dde966cfa2396de31a23f72b8271839b7c7e279..c391a12cf146cddd6455e88259207c7f0527aa2c 100644
--- a/runtime/bin/sync_socket.cc
+++ b/runtime/bin/sync_socket.cc
@@ -143,7 +143,8 @@ void FUNCTION_NAME(SynchronousSocket_WriteList)(Dart_NativeArguments args) {
DART_CHECK_ERROR(result);
ASSERT((offset + length) <= len);
buffer += offset;
- intptr_t bytes_written = SocketBase::Write(socket->fd(), buffer, length);
+ intptr_t bytes_written =
+ SynchronousSocket::Write(socket->fd(), buffer, length);
if (bytes_written >= 0) {
Dart_SetIntegerReturnValue(args, bytes_written);
} else {
@@ -174,7 +175,7 @@ void FUNCTION_NAME(SynchronousSocket_ReadList)(Dart_NativeArguments args) {
DART_CHECK_ERROR(result);
uint8_t* buffer = Dart_ScopeAllocate(bytes);
- intptr_t bytes_read = SocketBase::Read(socket->fd(), buffer, bytes);
+ intptr_t bytes_read = SynchronousSocket::Read(socket->fd(), buffer, bytes);
if (bytes_read < 0) {
Dart_SetReturnValue(args, DartUtils::NewDartOSError());
return;
@@ -193,7 +194,7 @@ void FUNCTION_NAME(SynchronousSocket_Available)(Dart_NativeArguments args) {
Dart_GetNativeArgument(args, 0), &socket);
DART_CHECK_ERROR(result);
- intptr_t available = SocketBase::Available(socket->fd());
+ intptr_t available = SynchronousSocket::Available(socket->fd());
if (available >= 0) {
Dart_SetIntegerReturnValue(args, available);
} else {
@@ -208,7 +209,7 @@ void FUNCTION_NAME(SynchronousSocket_CloseSync)(Dart_NativeArguments args) {
Dart_GetNativeArgument(args, 0), &socket);
DART_CHECK_ERROR(result);
- SocketBase::Close(socket->fd());
+ SynchronousSocket::Close(socket->fd());
socket->SetClosedFd();
}
@@ -228,7 +229,7 @@ void FUNCTION_NAME(SynchronousSocket_Read)(Dart_NativeArguments args) {
uint8_t* buffer = NULL;
result = IOBuffer::Allocate(length, &buffer);
ASSERT(buffer != NULL);
- intptr_t bytes_read = SocketBase::Read(socket->fd(), buffer, length);
+ intptr_t bytes_read = SynchronousSocket::Read(socket->fd(), buffer, length);
if (bytes_read == length) {
Dart_SetReturnValue(args, result);
} else if (bytes_read > 0) {
@@ -269,7 +270,7 @@ void FUNCTION_NAME(SynchronousSocket_GetPort)(Dart_NativeArguments args) {
Dart_GetNativeArgument(args, 0), &socket);
DART_CHECK_ERROR(result);
- intptr_t port = SocketBase::GetPort(socket->fd());
+ intptr_t port = SynchronousSocket::GetPort(socket->fd());
if (port > 0) {
Dart_SetReturnValue(args, Dart_NewInteger(port));
} else {
@@ -285,7 +286,7 @@ void FUNCTION_NAME(SynchronousSocket_GetRemotePeer)(Dart_NativeArguments args) {
DART_CHECK_ERROR(result);
intptr_t port = 0;
- SocketAddress* addr = SocketBase::GetRemotePeer(socket->fd(), &port);
+ SocketAddress* addr = SynchronousSocket::GetRemotePeer(socket->fd(), &port);
if (addr == NULL) {
Dart_SetReturnValue(args, DartUtils::NewDartOSError());
return;
@@ -321,7 +322,7 @@ static void SynchronousSocketFinalizer(void* isolate_data,
void* data) {
SynchronousSocket* socket = reinterpret_cast<SynchronousSocket*>(data);
if (socket->fd() >= 0) {
- SocketBase::Close(socket->fd());
+ SynchronousSocket::Close(socket->fd());
socket->SetClosedFd();
}
delete socket;
« no previous file with comments | « runtime/bin/sync_socket.h ('k') | runtime/bin/sync_socket_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698