| 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 | 6 |
| 7 #include "vm/dart.h" | 7 #include "vm/dart.h" |
| 8 #include "vm/lockers.h" | 8 #include "vm/lockers.h" |
| 9 #include "vm/port.h" | 9 #include "vm/port.h" |
| 10 | 10 |
| 11 namespace dart { | 11 namespace dart { |
| 12 | 12 |
| 13 DECLARE_FLAG(bool, trace_isolates); | 13 DECLARE_FLAG(bool, trace_isolates); |
| 14 DECLARE_FLAG(bool, trace_service_pause_events); | 14 DECLARE_FLAG(bool, trace_service_pause_events); |
| 15 | 15 |
| 16 class MessageHandlerTask : public ThreadPool::Task { | 16 class MessageHandlerTask : public ThreadPool::Task { |
| 17 public: | 17 public: |
| 18 explicit MessageHandlerTask(MessageHandler* handler) | 18 explicit MessageHandlerTask(MessageHandler* handler) |
| 19 : handler_(handler) { | 19 : handler_(handler) { |
| 20 ASSERT(handler != NULL); | 20 ASSERT(handler != NULL); |
| 21 } | 21 } |
| 22 | 22 |
| 23 void Run() { | 23 virtual void Run() { |
| 24 handler_->TaskCallback(); | 24 handler_->TaskCallback(); |
| 25 } | 25 } |
| 26 | 26 |
| 27 private: | 27 private: |
| 28 MessageHandler* handler_; | 28 MessageHandler* handler_; |
| 29 | 29 |
| 30 DISALLOW_COPY_AND_ASSIGN(MessageHandlerTask); | 30 DISALLOW_COPY_AND_ASSIGN(MessageHandlerTask); |
| 31 }; | 31 }; |
| 32 | 32 |
| 33 | 33 |
| (...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 319 | 319 |
| 320 void MessageHandler::decrement_control_ports() { | 320 void MessageHandler::decrement_control_ports() { |
| 321 MonitorLocker ml(&monitor_); | 321 MonitorLocker ml(&monitor_); |
| 322 #if defined(DEBUG) | 322 #if defined(DEBUG) |
| 323 CheckAccess(); | 323 CheckAccess(); |
| 324 #endif | 324 #endif |
| 325 control_ports_--; | 325 control_ports_--; |
| 326 } | 326 } |
| 327 | 327 |
| 328 } // namespace dart | 328 } // namespace dart |
| OLD | NEW |