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

Side by Side Diff: base/sync_socket_nacl.cc

Issue 525313002: SyncSocket Transit Descriptor - refactoring (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: clang formatting and nits addressed Created 6 years, 3 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/sync_socket.h" 5 #include "base/sync_socket.h"
6 6
7 #include <errno.h> 7 #include <errno.h>
8 #include <limits.h> 8 #include <limits.h>
9 #include <stdio.h> 9 #include <stdio.h>
10 #include <sys/types.h> 10 #include <sys/types.h>
11 11
12 #include "base/logging.h" 12 #include "base/logging.h"
13 13
14 namespace base { 14 namespace base {
15 15
16 const SyncSocket::Handle SyncSocket::kInvalidHandle = -1; 16 const SyncSocket::Handle SyncSocket::kInvalidHandle = -1;
17 17
18 SyncSocket::SyncSocket() : handle_(kInvalidHandle) { 18 SyncSocket::SyncSocket() : handle_(kInvalidHandle) {
19 } 19 }
20 20
21 SyncSocket::~SyncSocket() { 21 SyncSocket::~SyncSocket() {
22 Close(); 22 Close();
23 } 23 }
24 24
25 // static 25 // static
26 bool SyncSocket::CreatePair(SyncSocket* socket_a, SyncSocket* socket_b) { 26 bool SyncSocket::CreatePair(SyncSocket* socket_a, SyncSocket* socket_b) {
27 return false; 27 return false;
28 } 28 }
29 29
30 // static
31 SyncSocket::Handle SyncSocket::UnwrapHandle(
32 const SyncSocket::TransitDescriptor& descriptor) {
33 // TODO(burnik): Still unclear how NaCl uses SyncSocket.
henrika (OOO until Aug 14) 2014/09/02 07:46:05 Nit, not sure if you should add put it on xians in
burnik 2014/09/02 10:02:54 If Shijing agrees, I will make it so. On 2014/09/0
34 // See http://crbug.com/409656
35 NOTIMPLEMENTED();
tommi (sloooow) - chröme 2014/09/04 11:34:09 what platforms will this run on?
burnik 2014/09/06 18:17:09 NOTIMPLEMENTED is used in the rest of this NaCl Sy
36 return SyncSocket::kInvalidHandle;
37 }
38
39 bool SyncSocket::PrepareTransitDescriptor(
40 ProcessHandle peer_process_handle,
41 SyncSocket::TransitDescriptor* descriptor) {
42 // TODO(burnik): Still unclear how NaCl uses SyncSocket.
43 // See http://crbug.com/409656
44 NOTIMPLEMENTED();
45 return false;
46 }
47
30 bool SyncSocket::Close() { 48 bool SyncSocket::Close() {
31 if (handle_ != kInvalidHandle) { 49 if (handle_ != kInvalidHandle) {
32 if (close(handle_) < 0) 50 if (close(handle_) < 0)
33 DPLOG(ERROR) << "close"; 51 DPLOG(ERROR) << "close";
34 handle_ = kInvalidHandle; 52 handle_ = kInvalidHandle;
35 } 53 }
36 return true; 54 return true;
37 } 55 }
38 56
39 size_t SyncSocket::Send(const void* buffer, size_t length) { 57 size_t SyncSocket::Send(const void* buffer, size_t length) {
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 return SyncSocket::Close(); 89 return SyncSocket::Close();
72 } 90 }
73 91
74 // static 92 // static
75 bool CancelableSyncSocket::CreatePair(CancelableSyncSocket* socket_a, 93 bool CancelableSyncSocket::CreatePair(CancelableSyncSocket* socket_a,
76 CancelableSyncSocket* socket_b) { 94 CancelableSyncSocket* socket_b) {
77 return SyncSocket::CreatePair(socket_a, socket_b); 95 return SyncSocket::CreatePair(socket_a, socket_b);
78 } 96 }
79 97
80 } // namespace base 98 } // namespace base
OLDNEW
« no previous file with comments | « base/sync_socket.h ('k') | base/sync_socket_posix.cc » ('j') | base/sync_socket_posix.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698