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

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

Issue 2625463002: Fuchsia: Remove overly-restrictive assert from eventhandler (Closed)
Patch Set: Format Created 3 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
« 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) 2016, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2016, 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 #if !defined(DART_IO_DISABLED) 5 #if !defined(DART_IO_DISABLED)
6 6
7 #include "platform/globals.h" 7 #include "platform/globals.h"
8 #if defined(TARGET_OS_FUCHSIA) 8 #if defined(TARGET_OS_FUCHSIA)
9 9
10 #include "bin/eventhandler.h" 10 #include "bin/eventhandler.h"
(...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after
320 delete di; 320 delete di;
321 } 321 }
322 } else { 322 } else {
323 ASSERT(new_mask == 0); 323 ASSERT(new_mask == 0);
324 socket_map_.Remove(GetHashmapKeyFromFd(fd), GetHashmapHashFromFd(fd)); 324 socket_map_.Remove(GetHashmapKeyFromFd(fd), GetHashmapHashFromFd(fd));
325 di->Close(); 325 di->Close();
326 LOG_INFO("Closed %d\n", di->fd()); 326 LOG_INFO("Closed %d\n", di->fd());
327 delete di; 327 delete di;
328 } 328 }
329 329
330 DartUtils::PostInt32(port, 1 << kDestroyedEvent); 330 bool success = DartUtils::PostInt32(port, 1 << kDestroyedEvent);
331 if (!success) {
332 LOG_ERR("Failed to post destroy event to port %ld", port);
333 }
331 } else if (IS_COMMAND(msg[i].data, kReturnTokenCommand)) { 334 } else if (IS_COMMAND(msg[i].data, kReturnTokenCommand)) {
332 int count = TOKEN_COUNT(msg[i].data); 335 int count = TOKEN_COUNT(msg[i].data);
333 intptr_t old_mask = di->Mask(); 336 intptr_t old_mask = di->Mask();
334 LOG_INFO("\t Return Token: %d: %lx\n", di->fd(), old_mask); 337 LOG_INFO("\t Return Token: %d: %lx\n", di->fd(), old_mask);
335 di->ReturnTokens(msg[i].dart_port, count); 338 di->ReturnTokens(msg[i].dart_port, count);
336 UpdateEpollInstance(old_mask, di); 339 UpdateEpollInstance(old_mask, di);
337 } else if (IS_COMMAND(msg[i].data, kSetEventMaskCommand)) { 340 } else if (IS_COMMAND(msg[i].data, kSetEventMaskCommand)) {
338 // `events` can only have kInEvent/kOutEvent flags set. 341 // `events` can only have kInEvent/kOutEvent flags set.
339 intptr_t events = msg[i].data & EVENT_MASK; 342 intptr_t events = msg[i].data & EVENT_MASK;
340 ASSERT(0 == (events & ~(1 << kInEvent | 1 << kOutEvent))); 343 ASSERT(0 == (events & ~(1 << kInEvent | 1 << kOutEvent)));
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
397 intptr_t old_mask = di->Mask(); 400 intptr_t old_mask = di->Mask();
398 Dart_Port port = di->NextNotifyDartPort(event_mask); 401 Dart_Port port = di->NextNotifyDartPort(event_mask);
399 ASSERT(port != 0); 402 ASSERT(port != 0);
400 UpdateEpollInstance(old_mask, di); 403 UpdateEpollInstance(old_mask, di);
401 LOG_INFO("HandleEvents: Posting %ld to %ld for fd=%ld\n", event_mask, 404 LOG_INFO("HandleEvents: Posting %ld to %ld for fd=%ld\n", event_mask,
402 port, di->fd()); 405 port, di->fd());
403 bool success = DartUtils::PostInt32(port, event_mask); 406 bool success = DartUtils::PostInt32(port, event_mask);
404 if (!success) { 407 if (!success) {
405 // This can happen if e.g. the isolate that owns the port has died 408 // This can happen if e.g. the isolate that owns the port has died
406 // for some reason. 409 // for some reason.
407 FATAL2("Failed to post event for fd %ld to port %ld", di->fd(), port); 410 LOG_ERR("Failed to post event for fd %ld to port %ld", di->fd(),
411 port);
408 } 412 }
409 } 413 }
410 } 414 }
411 } 415 }
412 if (interrupt_seen) { 416 if (interrupt_seen) {
413 // Handle after socket events, so we avoid closing a socket before we handle 417 // Handle after socket events, so we avoid closing a socket before we handle
414 // the current events. 418 // the current events.
415 HandleInterruptFd(); 419 HandleInterruptFd();
416 } 420 }
417 } 421 }
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
501 // The hashmap does not support keys with value 0. 505 // The hashmap does not support keys with value 0.
502 return dart::Utils::WordHash(fd + 1); 506 return dart::Utils::WordHash(fd + 1);
503 } 507 }
504 508
505 } // namespace bin 509 } // namespace bin
506 } // namespace dart 510 } // namespace dart
507 511
508 #endif // defined(TARGET_OS_FUCHSIA) 512 #endif // defined(TARGET_OS_FUCHSIA)
509 513
510 #endif // !defined(DART_IO_DISABLED) 514 #endif // !defined(DART_IO_DISABLED)
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