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

Unified Diff: base/sync_socket_posix.cc

Issue 10083064: Revert 132842 - If we are using blocking write, when the renderer stop getting the data without not… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 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 | « base/sync_socket.h ('k') | base/sync_socket_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/sync_socket_posix.cc
===================================================================
--- base/sync_socket_posix.cc (revision 132887)
+++ base/sync_socket_posix.cc (working copy)
@@ -6,11 +6,10 @@
#include <errno.h>
#include <limits.h>
-#include <fcntl.h>
#include <stdio.h>
+#include <sys/types.h>
#include <sys/ioctl.h>
#include <sys/socket.h>
-#include <sys/types.h>
#if defined(OS_SOLARIS)
#include <sys/filio.h>
@@ -96,8 +95,7 @@
DCHECK_LE(length, kMaxMessageLength);
const char* charbuffer = static_cast<const char*>(buffer);
int len = file_util::WriteFileDescriptor(handle_, charbuffer, length);
-
- return (len == -1) ? 0 : static_cast<size_t>(len);
+ return static_cast<size_t>(len);
}
size_t SyncSocket::Receive(void* buffer, size_t length) {
@@ -126,25 +124,6 @@
return HANDLE_EINTR(shutdown(handle(), SHUT_RDWR)) >= 0;
}
-size_t CancelableSyncSocket::Send(const void* buffer, size_t length) {
- long flags = 0;
- flags = fcntl(handle_, F_GETFL, NULL);
- if (flags != -1 && (flags & O_NONBLOCK) == 0) {
- // Set the socket to non-blocking mode for sending if its original mode
- // is blocking.
- fcntl(handle_, F_SETFL, flags | O_NONBLOCK);
- }
-
- size_t len = SyncSocket::Send(buffer, length);
-
- if (flags != -1 && (flags & O_NONBLOCK) == 0) {
- // Restore the original flags.
- fcntl(handle_, F_SETFL, flags);
- }
-
- return len;
-}
-
// static
bool CancelableSyncSocket::CreatePair(CancelableSyncSocket* socket_a,
CancelableSyncSocket* socket_b) {
« no previous file with comments | « base/sync_socket.h ('k') | base/sync_socket_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698