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

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

Issue 14864009: Keep track of when a socket has been destroyed (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Remove delete_handle marker. Created 7 years, 5 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.h ('k') | runtime/bin/eventhandler_linux.cc » ('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 206 matching lines...) Expand 10 before | Expand all | Expand 10 after
217 // If stdout, redirect fd to /dev/null. 217 // If stdout, redirect fd to /dev/null.
218 int null_fd = TEMP_FAILURE_RETRY(open("/dev/null", O_WRONLY)); 218 int null_fd = TEMP_FAILURE_RETRY(open("/dev/null", O_WRONLY));
219 ASSERT(null_fd >= 0); 219 ASSERT(null_fd >= 0);
220 VOID_TEMP_FAILURE_RETRY(dup2(null_fd, STDOUT_FILENO)); 220 VOID_TEMP_FAILURE_RETRY(dup2(null_fd, STDOUT_FILENO));
221 VOID_TEMP_FAILURE_RETRY(close(null_fd)); 221 VOID_TEMP_FAILURE_RETRY(close(null_fd));
222 } else { 222 } else {
223 sd->Close(); 223 sd->Close();
224 } 224 }
225 socket_map_.Remove(GetHashmapKeyFromFd(fd), GetHashmapHashFromFd(fd)); 225 socket_map_.Remove(GetHashmapKeyFromFd(fd), GetHashmapHashFromFd(fd));
226 delete sd; 226 delete sd;
227 DartUtils::PostInt32(msg.dart_port, 1 << kDestroyedEvent);
227 } else { 228 } else {
228 // Setup events to wait for. 229 // Setup events to wait for.
229 sd->SetPortAndMask(msg.dart_port, msg.data); 230 sd->SetPortAndMask(msg.dart_port, msg.data);
230 UpdateEpollInstance(epoll_fd_, sd); 231 UpdateEpollInstance(epoll_fd_, sd);
231 } 232 }
232 } 233 }
233 } 234 }
234 } 235 }
235 236
236 #ifdef DEBUG_POLL 237 #ifdef DEBUG_POLL
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after
434 435
435 uint32_t EventHandlerImplementation::GetHashmapHashFromFd(intptr_t fd) { 436 uint32_t EventHandlerImplementation::GetHashmapHashFromFd(intptr_t fd) {
436 // The hashmap does not support keys with value 0. 437 // The hashmap does not support keys with value 0.
437 return dart::Utils::WordHash(fd + 1); 438 return dart::Utils::WordHash(fd + 1);
438 } 439 }
439 440
440 } // namespace bin 441 } // namespace bin
441 } // namespace dart 442 } // namespace dart
442 443
443 #endif // defined(TARGET_OS_ANDROID) 444 #endif // defined(TARGET_OS_ANDROID)
OLDNEW
« no previous file with comments | « runtime/bin/eventhandler.h ('k') | runtime/bin/eventhandler_linux.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698