| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 "vm/service.h" | 5 #include "vm/service.h" |
| 6 | 6 |
| 7 #include "include/dart_api.h" | 7 #include "include/dart_api.h" |
| 8 #include "platform/globals.h" | 8 #include "platform/globals.h" |
| 9 | 9 |
| 10 #include "vm/compiler.h" | 10 #include "vm/compiler.h" |
| (...skipping 2401 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2412 intptr_t len = writer.BytesWritten(); | 2412 intptr_t len = writer.BytesWritten(); |
| 2413 if (FLAG_trace_service) { | 2413 if (FLAG_trace_service) { |
| 2414 OS::Print("Pushing event of type %" Pd ", len %" Pd "\n", eventId, len); | 2414 OS::Print("Pushing event of type %" Pd ", len %" Pd "\n", eventId, len); |
| 2415 } | 2415 } |
| 2416 // TODO(turnidge): For now we ignore failure to send an event. Revisit? | 2416 // TODO(turnidge): For now we ignore failure to send an event. Revisit? |
| 2417 PortMap::PostMessage( | 2417 PortMap::PostMessage( |
| 2418 new Message(port_, data, len, Message::kNormalPriority)); | 2418 new Message(port_, data, len, Message::kNormalPriority)); |
| 2419 } | 2419 } |
| 2420 | 2420 |
| 2421 | 2421 |
| 2422 void Service::HandleGCEvent(GCEvent* event) { |
| 2423 JSONStream js; |
| 2424 event->PrintJSON(&js); |
| 2425 const String& message = String::Handle(String::New(js.ToCString())); |
| 2426 SendEvent(kEventFamilyGC, message); |
| 2427 } |
| 2428 |
| 2429 |
| 2422 void Service::HandleDebuggerEvent(DebuggerEvent* event) { | 2430 void Service::HandleDebuggerEvent(DebuggerEvent* event) { |
| 2423 JSONStream js; | 2431 JSONStream js; |
| 2424 event->PrintJSON(&js); | 2432 event->PrintJSON(&js); |
| 2425 const String& message = String::Handle(String::New(js.ToCString())); | 2433 const String& message = String::Handle(String::New(js.ToCString())); |
| 2426 SendEvent(kEventFamilyDebug, message); | 2434 SendEvent(kEventFamilyDebug, message); |
| 2427 } | 2435 } |
| 2428 | 2436 |
| 2429 | 2437 |
| 2430 void Service::EmbedderHandleMessage(EmbedderServiceHandler* handler, | 2438 void Service::EmbedderHandleMessage(EmbedderServiceHandler* handler, |
| 2431 JSONStream* js) { | 2439 JSONStream* js) { |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2516 while (current != NULL) { | 2524 while (current != NULL) { |
| 2517 if (strcmp(name, current->name()) == 0) { | 2525 if (strcmp(name, current->name()) == 0) { |
| 2518 return current; | 2526 return current; |
| 2519 } | 2527 } |
| 2520 current = current->next(); | 2528 current = current->next(); |
| 2521 } | 2529 } |
| 2522 return NULL; | 2530 return NULL; |
| 2523 } | 2531 } |
| 2524 | 2532 |
| 2525 } // namespace dart | 2533 } // namespace dart |
| OLD | NEW |