Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file | |
| 2 // for details. All rights reserved. Use of this source code is governed by a | |
| 3 // BSD-style license that can be found in the LICENSE file. | |
| 4 | |
| 5 #ifndef RUNTIME_BIN_SYNC_SOCKET_H_ | |
| 6 #define RUNTIME_BIN_SYNC_SOCKET_H_ | |
| 7 | |
| 8 #if defined(DART_IO_DISABLED) | |
| 9 #error "sync_socket.h can only be included on builds with IO enabled" | |
| 10 #endif | |
| 11 | |
| 12 #include "platform/globals.h" | |
| 13 #include "bin/socket_base.h" | |
|
zra
2017/04/11 16:19:41
Alphabetize.
bkonyi
2017/04/11 18:11:18
Done.
| |
| 14 | |
| 15 namespace dart { | |
| 16 namespace bin { | |
| 17 | |
| 18 class SynchronousSocket { | |
| 19 public: | |
| 20 explicit SynchronousSocket(intptr_t fd); | |
| 21 ~SynchronousSocket() { ASSERT(fd_ == kClosedFd); } | |
| 22 | |
| 23 intptr_t fd() const { return fd_; } | |
| 24 void SetClosedFd(); | |
| 25 | |
| 26 static bool Initialize(); | |
| 27 | |
| 28 static intptr_t CreateConnect(const RawAddr& addr); | |
| 29 | |
| 30 static void SetSocketIdNativeField(Dart_Handle handle, intptr_t id); | |
| 31 static SynchronousSocket* GetSocketIdNativeField(Dart_Handle socket); | |
| 32 | |
| 33 static void ShutdownRead(intptr_t fd); | |
| 34 static void ShutdownWrite(intptr_t fd); | |
| 35 | |
| 36 private: | |
| 37 static const int kClosedFd = -1; | |
| 38 | |
| 39 intptr_t fd_; | |
| 40 | |
| 41 DISALLOW_COPY_AND_ASSIGN(SynchronousSocket); | |
| 42 }; | |
| 43 | |
| 44 } // namespace bin | |
| 45 } // namespace dart | |
| 46 | |
| 47 #endif // RUNTIME_BIN_SYNC_SOCKET_H_ | |
| OLD | NEW |