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

Unified Diff: base/sync_socket_nacl.cc

Issue 10696217: Implement SyncSocket for untrusted NaCl builds. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 5 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/sync_socket_nacl.cc
===================================================================
--- base/sync_socket_nacl.cc (revision 146234)
+++ base/sync_socket_nacl.cc (working copy)
@@ -18,7 +18,6 @@
const SyncSocket::Handle SyncSocket::kInvalidHandle = -1;
SyncSocket::SyncSocket() : handle_(kInvalidHandle) {
- NOTREACHED();
}
SyncSocket::~SyncSocket() {
@@ -30,28 +29,34 @@
}
bool SyncSocket::Close() {
- return false;
+ if (handle_ != -1) {
brettw 2012/07/13 23:12:55 Can you use kInvalidHandle instead of -1 in this f
bbudge 2012/07/13 23:44:05 Done.
+ close(handle_);
Mark Seaborn 2012/07/13 23:18:32 Please check the return value of close()
bbudge 2012/07/13 23:44:05 Done.
+ handle_ = -1;
+ }
+ return true;
}
size_t SyncSocket::Send(const void* buffer, size_t length) {
- return 0;
+ return -1;
brettw 2012/07/13 23:12:55 Can you comment why this isn't implemented?
bbudge 2012/07/13 23:44:05 Done.
}
size_t SyncSocket::Receive(void* buffer, size_t length) {
- return 0;
+ return read(handle_, buffer, length);
}
size_t SyncSocket::Peek() {
- return 0;
+ return -1;
}
-CancelableSyncSocket::CancelableSyncSocket() {}
+CancelableSyncSocket::CancelableSyncSocket() {
+}
+
CancelableSyncSocket::CancelableSyncSocket(Handle handle)
: SyncSocket(handle) {
}
size_t CancelableSyncSocket::Send(const void* buffer, size_t length) {
- return 0;
+ return -1;
}
bool CancelableSyncSocket::Shutdown() {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698