OLD | NEW |
1 // Copyright (c) 2014, the Dartino project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, the Dartino project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 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.md file. | 3 // BSD-style license that can be found in the LICENSE.md file. |
4 | 4 |
5 #ifdef FLETCH_ENABLE_LIVE_CODING | 5 #ifdef DARTINO_ENABLE_LIVE_CODING |
6 | 6 |
7 #include "src/shared/connection.h" | 7 #include "src/shared/connection.h" |
8 | 8 |
9 #include "src/shared/assert.h" | 9 #include "src/shared/assert.h" |
10 #include "src/shared/globals.h" | 10 #include "src/shared/globals.h" |
11 #include "src/shared/native_socket.h" | 11 #include "src/shared/native_socket.h" |
12 #include "src/shared/utils.h" | 12 #include "src/shared/utils.h" |
13 | 13 |
14 namespace fletch { | 14 namespace dartino { |
15 | 15 |
16 // TODO(ager,ajohnsen): Instead of dynamically allocating the actual | 16 // TODO(ager,ajohnsen): Instead of dynamically allocating the actual |
17 // buffer, we can get away with inline allocation of a small buffer | 17 // buffer, we can get away with inline allocation of a small buffer |
18 // and only use dynamic allocation if that inline buffer doesn't have | 18 // and only use dynamic allocation if that inline buffer doesn't have |
19 // a large enough capacity. | 19 // a large enough capacity. |
20 static const int kBufferGrowthSize = 64; | 20 static const int kBufferGrowthSize = 64; |
21 | 21 |
22 Buffer::Buffer() : buffer_(NULL), buffer_offset_(0), buffer_length_(0) {} | 22 Buffer::Buffer() : buffer_(NULL), buffer_offset_(0), buffer_length_(0) {} |
23 | 23 |
24 Buffer::~Buffer() { free(buffer_); } | 24 Buffer::~Buffer() { free(buffer_); } |
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
167 | 167 |
168 ConnectionListener::~ConnectionListener() { delete socket_; } | 168 ConnectionListener::~ConnectionListener() { delete socket_; } |
169 | 169 |
170 int ConnectionListener::Port() { return port_; } | 170 int ConnectionListener::Port() { return port_; } |
171 | 171 |
172 Connection* ConnectionListener::Accept() { | 172 Connection* ConnectionListener::Accept() { |
173 Socket* child = socket_->Accept(); | 173 Socket* child = socket_->Accept(); |
174 return new Connection("", 0, child); | 174 return new Connection("", 0, child); |
175 } | 175 } |
176 | 176 |
177 } // namespace fletch | 177 } // namespace dartino |
178 | 178 |
179 #endif // FLETCH_ENABLE_LIVE_CODING | 179 #endif // DARTINO_ENABLE_LIVE_CODING |
OLD | NEW |