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

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

Issue 273833003: Don't try to send messages, when the port is not set. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 7 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 | tests/standalone/standalone.status » ('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) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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_WINDOWS) 6 #if defined(TARGET_OS_WINDOWS)
7 7
8 #include "bin/eventhandler.h" 8 #include "bin/eventhandler.h"
9 9
10 #include <winsock2.h> // NOLINT 10 #include <winsock2.h> // NOLINT
(...skipping 326 matching lines...) Expand 10 before | Expand all | Expand 10 after
337 int event_mask = 1 << kCloseEvent; 337 int event_mask = 1 << kCloseEvent;
338 DartUtils::PostInt32(handle->port(), event_mask); 338 DartUtils::PostInt32(handle->port(), event_mask);
339 } 339 }
340 } 340 }
341 341
342 342
343 static void HandleError(Handle* handle) { 343 static void HandleError(Handle* handle) {
344 handle->set_last_error(WSAGetLastError()); 344 handle->set_last_error(WSAGetLastError());
345 handle->MarkError(); 345 handle->MarkError();
346 if (!handle->IsClosing()) { 346 if (!handle->IsClosing()) {
347 int event_mask = 1 << kErrorEvent; 347 Dart_Port port = handle->port();
348 DartUtils::PostInt32(handle->port(), event_mask); 348 if (port != ILLEGAL_PORT) {
349 DartUtils::PostInt32(port, 1 << kErrorEvent);
350 }
349 } 351 }
350 } 352 }
351 353
352 354
353 void Handle::HandleIssueError() { 355 void Handle::HandleIssueError() {
354 DWORD error = GetLastError(); 356 DWORD error = GetLastError();
355 if (error == ERROR_BROKEN_PIPE) { 357 if (error == ERROR_BROKEN_PIPE) {
356 HandleClosed(this); 358 HandleClosed(this);
357 } else { 359 } else {
358 HandleError(this); 360 HandleError(this);
(...skipping 987 matching lines...) Expand 10 before | Expand all | Expand 10 after
1346 1348
1347 1349
1348 void EventHandlerImplementation::Shutdown() { 1350 void EventHandlerImplementation::Shutdown() {
1349 SendData(kShutdownId, 0, 0); 1351 SendData(kShutdownId, 0, 0);
1350 } 1352 }
1351 1353
1352 } // namespace bin 1354 } // namespace bin
1353 } // namespace dart 1355 } // namespace dart
1354 1356
1355 #endif // defined(TARGET_OS_WINDOWS) 1357 #endif // defined(TARGET_OS_WINDOWS)
OLDNEW
« no previous file with comments | « no previous file | tests/standalone/standalone.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698