Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(248)

Side by Side Diff: runtime/bin/eventhandler_android.cc

Issue 171503009: Remove SocketData and now only pass the dart port to epoll. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « runtime/bin/eventhandler_android.h ('k') | runtime/bin/eventhandler_linux.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 326 matching lines...) Expand 10 before | Expand all | Expand 10 after
337 void EventHandlerImplementation::Start(EventHandler* handler) { 337 void EventHandlerImplementation::Start(EventHandler* handler) {
338 int result = dart::Thread::Start(&EventHandlerImplementation::Poll, 338 int result = dart::Thread::Start(&EventHandlerImplementation::Poll,
339 reinterpret_cast<uword>(handler)); 339 reinterpret_cast<uword>(handler));
340 if (result != 0) { 340 if (result != 0) {
341 FATAL1("Failed to start event handler thread %d", result); 341 FATAL1("Failed to start event handler thread %d", result);
342 } 342 }
343 } 343 }
344 344
345 345
346 void EventHandlerImplementation::Shutdown() { 346 void EventHandlerImplementation::Shutdown() {
347 SendData(kShutdownId, 0, 0); 347 Notify(kShutdownId, 0, 0);
348 } 348 }
349 349
350 350
351 void EventHandlerImplementation::SendData(intptr_t id, 351 void EventHandlerImplementation::Notify(intptr_t id,
352 Dart_Port dart_port, 352 Dart_Port dart_port,
353 intptr_t data) { 353 intptr_t data) {
354 WakeupHandler(id, dart_port, data); 354 WakeupHandler(id, dart_port, data);
355 } 355 }
356 356
357 357
358 void* EventHandlerImplementation::GetHashmapKeyFromFd(intptr_t fd) { 358 void* EventHandlerImplementation::GetHashmapKeyFromFd(intptr_t fd) {
359 // The hashmap does not support keys with value 0. 359 // The hashmap does not support keys with value 0.
360 return reinterpret_cast<void*>(fd + 1); 360 return reinterpret_cast<void*>(fd + 1);
361 } 361 }
362 362
363 363
364 uint32_t EventHandlerImplementation::GetHashmapHashFromFd(intptr_t fd) { 364 uint32_t EventHandlerImplementation::GetHashmapHashFromFd(intptr_t fd) {
365 // The hashmap does not support keys with value 0. 365 // The hashmap does not support keys with value 0.
366 return dart::Utils::WordHash(fd + 1); 366 return dart::Utils::WordHash(fd + 1);
367 } 367 }
368 368
369 } // namespace bin 369 } // namespace bin
370 } // namespace dart 370 } // namespace dart
371 371
372 #endif // defined(TARGET_OS_ANDROID) 372 #endif // defined(TARGET_OS_ANDROID)
OLDNEW
« no previous file with comments | « runtime/bin/eventhandler_android.h ('k') | runtime/bin/eventhandler_linux.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698