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

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

Issue 207553004: Fix mac part of previous commit. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 9 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 | « no previous file | no next file » | 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_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 291 matching lines...) Expand 10 before | Expand all | Expand 10 after
302 const int kBufferSize = 1024; 302 const int kBufferSize = 1024;
303 char error_message[kBufferSize]; 303 char error_message[kBufferSize];
304 strerror_r(events[i].data, error_message, kBufferSize); 304 strerror_r(events[i].data, error_message, kBufferSize);
305 FATAL1("kevent failed %s\n", error_message); 305 FATAL1("kevent failed %s\n", error_message);
306 } 306 }
307 if (events[i].udata == NULL) { 307 if (events[i].udata == NULL) {
308 interrupt_seen = true; 308 interrupt_seen = true;
309 } else { 309 } else {
310 SocketData* sd = reinterpret_cast<SocketData*>(events[i].udata); 310 SocketData* sd = reinterpret_cast<SocketData*>(events[i].udata);
311 intptr_t event_mask = GetEvents(events + i, sd); 311 intptr_t event_mask = GetEvents(events + i, sd);
312 if (!sd->IsListeningSocket() && event_mask != 0) { 312 if (event_mask != 0) {
313 if (sd->TakeToken()) { 313 if (!sd->IsListeningSocket() && sd->TakeToken()) {
314 // Took last token, remove from epoll. 314 // Took last token, remove from epoll.
315 RemoveFromKqueue(kqueue_fd_, sd); 315 RemoveFromKqueue(kqueue_fd_, sd);
316 } 316 }
317 Dart_Port port = sd->port(); 317 Dart_Port port = sd->port();
318 ASSERT(port != 0); 318 ASSERT(port != 0);
319 DartUtils::PostInt32(port, event_mask); 319 DartUtils::PostInt32(port, event_mask);
320 } 320 }
321 } 321 }
322 } 322 }
323 if (interrupt_seen) { 323 if (interrupt_seen) {
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
418 418
419 uint32_t EventHandlerImplementation::GetHashmapHashFromFd(intptr_t fd) { 419 uint32_t EventHandlerImplementation::GetHashmapHashFromFd(intptr_t fd) {
420 // The hashmap does not support keys with value 0. 420 // The hashmap does not support keys with value 0.
421 return dart::Utils::WordHash(fd + 1); 421 return dart::Utils::WordHash(fd + 1);
422 } 422 }
423 423
424 } // namespace bin 424 } // namespace bin
425 } // namespace dart 425 } // namespace dart
426 426
427 #endif // defined(TARGET_OS_MACOS) 427 #endif // defined(TARGET_OS_MACOS)
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698