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

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

Issue 9270039: Fix Mac OS build (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 11 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 <errno.h> 5 #include <errno.h>
6 #include <poll.h> 6 #include <poll.h>
7 #include <pthread.h> 7 #include <pthread.h>
8 #include <stdio.h> 8 #include <stdio.h>
9 #include <string.h> 9 #include <string.h>
10 #include <sys/time.h> 10 #include <sys/time.h>
11 #include <unistd.h> 11 #include <unistd.h>
12 12
13 #include "bin/eventhandler.h" 13 #include "bin/eventhandler.h"
14 #include "bin/fdutils.h" 14 #include "bin/fdutils.h"
15 #include "bin/hashmap.h" 15 #include "bin/hashmap.h"
16 #include "bin/utils.h" 16 #include "platform/utils.h"
17 17
18 18
19 int64_t GetCurrentTimeMilliseconds() { 19 int64_t GetCurrentTimeMilliseconds() {
20 struct timeval tv; 20 struct timeval tv;
21 if (gettimeofday(&tv, NULL) < 0) { 21 if (gettimeofday(&tv, NULL) < 0) {
22 UNREACHABLE(); 22 UNREACHABLE();
23 return 0; 23 return 0;
24 } 24 }
25 return ((static_cast<int64_t>(tv.tv_sec) * 1000000) + tv.tv_usec) / 1000; 25 return ((static_cast<int64_t>(tv.tv_sec) * 1000000) + tv.tv_usec) / 1000;
26 } 26 }
(...skipping 353 matching lines...) Expand 10 before | Expand all | Expand 10 after
380 void* EventHandlerImplementation::GetHashmapKeyFromFd(intptr_t fd) { 380 void* EventHandlerImplementation::GetHashmapKeyFromFd(intptr_t fd) {
381 // The hashmap does not support keys with value 0. 381 // The hashmap does not support keys with value 0.
382 return reinterpret_cast<void*>(fd + 1); 382 return reinterpret_cast<void*>(fd + 1);
383 } 383 }
384 384
385 385
386 uint32_t EventHandlerImplementation::GetHashmapHashFromFd(intptr_t fd) { 386 uint32_t EventHandlerImplementation::GetHashmapHashFromFd(intptr_t fd) {
387 // The hashmap does not support keys with value 0. 387 // The hashmap does not support keys with value 0.
388 return dart::Utils::WordHash(fd + 1); 388 return dart::Utils::WordHash(fd + 1);
389 } 389 }
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