Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, 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/message_handler.h" | 5 #include "vm/message_handler.h" |
| 6 #include "vm/port.h" | 6 #include "vm/port.h" |
| 7 #include "vm/dart.h" | 7 #include "vm/dart.h" |
| 8 | 8 |
| 9 namespace dart { | 9 namespace dart { |
| 10 | 10 |
| 11 DECLARE_FLAG(bool, trace_isolates); | 11 DECLARE_FLAG(bool, trace_isolates); |
| 12 | 12 DECLARE_FLAG(bool, trace_service_pause_events); |
| 13 | 13 |
| 14 class MessageHandlerTask : public ThreadPool::Task { | 14 class MessageHandlerTask : public ThreadPool::Task { |
| 15 public: | 15 public: |
| 16 explicit MessageHandlerTask(MessageHandler* handler) | 16 explicit MessageHandlerTask(MessageHandler* handler) |
| 17 : handler_(handler) { | 17 : handler_(handler) { |
| 18 ASSERT(handler != NULL); | 18 ASSERT(handler != NULL); |
| 19 } | 19 } |
| 20 | 20 |
| 21 void Run() { | 21 void Run() { |
| 22 handler_->TaskCallback(); | 22 handler_->TaskCallback(); |
| (...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 224 } | 224 } |
| 225 | 225 |
| 226 // Handle any pending messages for this message handler. | 226 // Handle any pending messages for this message handler. |
| 227 if (ok) { | 227 if (ok) { |
| 228 ok = HandleMessages(true, true); | 228 ok = HandleMessages(true, true); |
| 229 } | 229 } |
| 230 task_ = NULL; // No task in queue. | 230 task_ = NULL; // No task in queue. |
| 231 | 231 |
| 232 if (!ok || !HasLivePorts()) { | 232 if (!ok || !HasLivePorts()) { |
| 233 if (pause_on_exit()) { | 233 if (pause_on_exit()) { |
| 234 if (FLAG_trace_service_pause_events && !paused_on_exit_) { | |
| 235 OS::PrintErr("Isolate %s paused before exiting.\n", name()); | |
|
keertip
2014/05/08 17:18:12
Would it be possible to print out a url too? eg. h
Cutch
2014/05/08 21:54:55
At startup, yes. At the pause event, it's not poss
| |
| 236 } | |
| 234 paused_on_exit_ = true; | 237 paused_on_exit_ = true; |
| 235 } else { | 238 } else { |
| 236 if (FLAG_trace_isolates) { | 239 if (FLAG_trace_isolates) { |
| 237 OS::Print("[-] Stopping message handler (%s):\n" | 240 OS::Print("[-] Stopping message handler (%s):\n" |
| 238 "\thandler: %s\n", | 241 "\thandler: %s\n", |
| 239 (ok ? "no live ports" : "error"), | 242 (ok ? "no live ports" : "error"), |
| 240 name()); | 243 name()); |
| 241 } | 244 } |
| 242 pool_ = NULL; | 245 pool_ = NULL; |
| 243 run_end_callback = true; | 246 run_end_callback = true; |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 305 | 308 |
| 306 void MessageHandler::decrement_control_ports() { | 309 void MessageHandler::decrement_control_ports() { |
| 307 MonitorLocker ml(&monitor_); | 310 MonitorLocker ml(&monitor_); |
| 308 #if defined(DEBUG) | 311 #if defined(DEBUG) |
| 309 CheckAccess(); | 312 CheckAccess(); |
| 310 #endif | 313 #endif |
| 311 control_ports_--; | 314 control_ports_--; |
| 312 } | 315 } |
| 313 | 316 |
| 314 } // namespace dart | 317 } // namespace dart |
| OLD | NEW |