| 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_ANDROID) | 6 #if defined(TARGET_OS_ANDROID) |
| 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 304 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 315 } | 315 } |
| 316 } else { | 316 } else { |
| 317 handler->HandleTimeout(); | 317 handler->HandleTimeout(); |
| 318 handler->HandleEvents(events, result); | 318 handler->HandleEvents(events, result); |
| 319 } | 319 } |
| 320 } | 320 } |
| 321 } | 321 } |
| 322 | 322 |
| 323 | 323 |
| 324 void EventHandlerImplementation::Start(EventHandler* handler) { | 324 void EventHandlerImplementation::Start(EventHandler* handler) { |
| 325 int result = dart::Thread::Start(&EventHandlerImplementation::Poll, | 325 int result = Thread::Start(&EventHandlerImplementation::Poll, |
| 326 reinterpret_cast<uword>(handler)); | 326 reinterpret_cast<uword>(handler)); |
| 327 if (result != 0) { | 327 if (result != 0) { |
| 328 FATAL1("Failed to start event handler thread %d", result); | 328 FATAL1("Failed to start event handler thread %d", result); |
| 329 } | 329 } |
| 330 } | 330 } |
| 331 | 331 |
| 332 | 332 |
| 333 void EventHandlerImplementation::Shutdown() { | 333 void EventHandlerImplementation::Shutdown() { |
| 334 SendData(kShutdownId, 0, 0); | 334 SendData(kShutdownId, 0, 0); |
| 335 } | 335 } |
| (...skipping 14 matching lines...) Expand all Loading... |
| 350 | 350 |
| 351 uint32_t EventHandlerImplementation::GetHashmapHashFromFd(intptr_t fd) { | 351 uint32_t EventHandlerImplementation::GetHashmapHashFromFd(intptr_t fd) { |
| 352 // The hashmap does not support keys with value 0. | 352 // The hashmap does not support keys with value 0. |
| 353 return dart::Utils::WordHash(fd + 1); | 353 return dart::Utils::WordHash(fd + 1); |
| 354 } | 354 } |
| 355 | 355 |
| 356 } // namespace bin | 356 } // namespace bin |
| 357 } // namespace dart | 357 } // namespace dart |
| 358 | 358 |
| 359 #endif // defined(TARGET_OS_ANDROID) | 359 #endif // defined(TARGET_OS_ANDROID) |
| OLD | NEW |