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

Unified Diff: runtime/bin/socket.cc

Issue 109803002: Profiler Take 2 (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 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
Index: runtime/bin/socket.cc
diff --git a/runtime/bin/socket.cc b/runtime/bin/socket.cc
index 046bd1855ec6b105678c8ad7499dc0af6dd26d55..a2d0c1bb7d036e62ac032030325e432fae07d7ca 100644
--- a/runtime/bin/socket.cc
+++ b/runtime/bin/socket.cc
@@ -13,7 +13,7 @@
#include "platform/utils.h"
#include "include/dart_api.h"
-
+#include "include/dart_native_api.h"
namespace dart {
namespace bin {
@@ -148,7 +148,9 @@ void FUNCTION_NAME(Socket_Read)(Dart_NativeArguments args) {
Dart_Handle result = IOBuffer::Allocate(length, &buffer);
if (Dart_IsError(result)) Dart_PropagateError(result);
ASSERT(buffer != NULL);
+ Dart_DisableThreadInterrupter();
intptr_t bytes_read = Socket::Read(socket, buffer, length);
+ Dart_EnableThreadInterrupter();
if (bytes_read == length) {
Dart_SetReturnValue(args, result);
} else if (bytes_read < length) {
@@ -203,7 +205,9 @@ void FUNCTION_NAME(Socket_WriteList)(Dart_NativeArguments args) {
if (Dart_IsError(result)) Dart_PropagateError(result);
ASSERT((offset + length) <= len);
buffer += offset;
+ Dart_DisableThreadInterrupter();
intptr_t bytes_written = Socket::Write(socket, buffer, length);
+ Dart_EnableThreadInterrupter();
if (bytes_written >= 0) {
Dart_TypedDataReleaseData(buffer_obj);
Dart_SetReturnValue(args, Dart_NewInteger(bytes_written));
« runtime/bin/file.cc ('K') | « runtime/bin/process.cc ('k') | runtime/bin/utils_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698