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

Side by Side Diff: runtime/bin/dbg_connection.cc

Issue 12209047: Added Socket::Close() function. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 10 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | runtime/bin/socket.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart 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 file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "bin/dbg_connection.h" 5 #include "bin/dbg_connection.h"
6 #include "bin/dbg_message.h" 6 #include "bin/dbg_message.h"
7 #include "bin/dartutils.h" 7 #include "bin/dartutils.h"
8 #include "bin/log.h" 8 #include "bin/log.h"
9 #include "bin/socket.h" 9 #include "bin/socket.h"
10 #include "bin/thread.h" 10 #include "bin/thread.h"
(...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after
257 int msg_id, 257 int msg_id,
258 const char* err_msg) { 258 const char* err_msg) {
259 dart::TextBuffer msg(64); 259 dart::TextBuffer msg(64);
260 msg.Printf("{\"id\": %d, \"error\": \"Error: %s\"}", msg_id, err_msg); 260 msg.Printf("{\"id\": %d, \"error\": \"Error: %s\"}", msg_id, err_msg);
261 SendMsg(debug_fd, &msg); 261 SendMsg(debug_fd, &msg);
262 } 262 }
263 263
264 264
265 void DebuggerConnectionHandler::CloseDbgConnection() { 265 void DebuggerConnectionHandler::CloseDbgConnection() {
266 if (debug_fd_ >= 0) { 266 if (debug_fd_ >= 0) {
267 // TODO(hausner): need a Socket::Close() function. 267 Socket::Close(debug_fd_);
268 } 268 }
269 if (msgbuf_ != NULL) { 269 if (msgbuf_ != NULL) {
270 delete msgbuf_; 270 delete msgbuf_;
271 msgbuf_ = NULL; 271 msgbuf_ = NULL;
272 } 272 }
273 // TODO(hausner): Need to tell the VM debugger object to remove all 273 // TODO(hausner): Need to tell the VM debugger object to remove all
274 // breakpoints. 274 // breakpoints.
275 } 275 }
276 276
277 277
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
431 ASSERT(singleton_handler != NULL); 431 ASSERT(singleton_handler != NULL);
432 return singleton_handler; 432 return singleton_handler;
433 } 433 }
434 434
435 435
436 bool DebuggerConnectionHandler::IsConnected() { 436 bool DebuggerConnectionHandler::IsConnected() {
437 // TODO(asiva): Support multiple debugger connections. 437 // TODO(asiva): Support multiple debugger connections.
438 // Return true if a connection has been established. 438 // Return true if a connection has been established.
439 return singleton_handler != NULL; 439 return singleton_handler != NULL;
440 } 440 }
OLDNEW
« no previous file with comments | « no previous file | runtime/bin/socket.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698