| OLD | NEW |
| 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 "platform/globals.h" | 5 #include "platform/globals.h" |
| 6 #if defined(TARGET_OS_MACOS) | 6 #if defined(TARGET_OS_MACOS) |
| 7 | 7 |
| 8 #include "bin/eventhandler.h" | 8 #include "bin/eventhandler.h" |
| 9 | 9 |
| 10 #include <errno.h> // NOLINT | 10 #include <errno.h> // NOLINT |
| (...skipping 377 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 388 handler_impl->HandleTimeout(); | 388 handler_impl->HandleTimeout(); |
| 389 handler_impl->HandleEvents(events, result); | 389 handler_impl->HandleEvents(events, result); |
| 390 } | 390 } |
| 391 } | 391 } |
| 392 delete handler; | 392 delete handler; |
| 393 } | 393 } |
| 394 | 394 |
| 395 | 395 |
| 396 void EventHandlerImplementation::Start(EventHandler* handler) { | 396 void EventHandlerImplementation::Start(EventHandler* handler) { |
| 397 int result = | 397 int result = |
| 398 dart::Thread::Start(&EventHandlerImplementation::EventHandlerEntry, | 398 Thread::Start(&EventHandlerImplementation::EventHandlerEntry, |
| 399 reinterpret_cast<uword>(handler)); | 399 reinterpret_cast<uword>(handler)); |
| 400 if (result != 0) { | 400 if (result != 0) { |
| 401 FATAL1("Failed to start event handler thread %d", result); | 401 FATAL1("Failed to start event handler thread %d", result); |
| 402 } | 402 } |
| 403 } | 403 } |
| 404 | 404 |
| 405 | 405 |
| 406 void EventHandlerImplementation::Shutdown() { | 406 void EventHandlerImplementation::Shutdown() { |
| 407 SendData(kShutdownId, 0, 0); | 407 SendData(kShutdownId, 0, 0); |
| 408 } | 408 } |
| (...skipping 14 matching lines...) Expand all Loading... |
| 423 | 423 |
| 424 uint32_t EventHandlerImplementation::GetHashmapHashFromFd(intptr_t fd) { | 424 uint32_t EventHandlerImplementation::GetHashmapHashFromFd(intptr_t fd) { |
| 425 // The hashmap does not support keys with value 0. | 425 // The hashmap does not support keys with value 0. |
| 426 return dart::Utils::WordHash(fd + 1); | 426 return dart::Utils::WordHash(fd + 1); |
| 427 } | 427 } |
| 428 | 428 |
| 429 } // namespace bin | 429 } // namespace bin |
| 430 } // namespace dart | 430 } // namespace dart |
| 431 | 431 |
| 432 #endif // defined(TARGET_OS_MACOS) | 432 #endif // defined(TARGET_OS_MACOS) |
| OLD | NEW |