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

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

Issue 319503005: Don't issue new directory reads, if we already got unhandled data. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 6 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) 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 380 matching lines...) Expand 10 before | Expand all | Expand 10 after
391 391
392 bool DirectoryWatchHandle::IsClosed() { 392 bool DirectoryWatchHandle::IsClosed() {
393 return IsClosing() && pending_read_ == NULL; 393 return IsClosing() && pending_read_ == NULL;
394 } 394 }
395 395
396 396
397 bool DirectoryWatchHandle::IssueRead() { 397 bool DirectoryWatchHandle::IssueRead() {
398 ScopedLock lock(this); 398 ScopedLock lock(this);
399 // It may have been started before, as we start the directory-handler when 399 // It may have been started before, as we start the directory-handler when
400 // we create it. 400 // we create it.
401 if (pending_read_ != NULL) return true; 401 if (pending_read_ != NULL || data_ready_ != NULL) return true;
402 OverlappedBuffer* buffer = OverlappedBuffer::AllocateReadBuffer(kBufferSize); 402 OverlappedBuffer* buffer = OverlappedBuffer::AllocateReadBuffer(kBufferSize);
403 ASSERT(completion_port_ != INVALID_HANDLE_VALUE); 403 ASSERT(completion_port_ != INVALID_HANDLE_VALUE);
404 BOOL ok = ReadDirectoryChangesW(handle_, 404 BOOL ok = ReadDirectoryChangesW(handle_,
405 buffer->GetBufferStart(), 405 buffer->GetBufferStart(),
406 buffer->GetBufferSize(), 406 buffer->GetBufferSize(),
407 recursive_, 407 recursive_,
408 events_, 408 events_,
409 NULL, 409 NULL,
410 buffer->GetCleanOverlapped(), 410 buffer->GetCleanOverlapped(),
411 NULL); 411 NULL);
(...skipping 952 matching lines...) Expand 10 before | Expand all | Expand 10 after
1364 1364
1365 1365
1366 void EventHandlerImplementation::Shutdown() { 1366 void EventHandlerImplementation::Shutdown() {
1367 SendData(kShutdownId, 0, 0); 1367 SendData(kShutdownId, 0, 0);
1368 } 1368 }
1369 1369
1370 } // namespace bin 1370 } // namespace bin
1371 } // namespace dart 1371 } // namespace dart
1372 1372
1373 #endif // defined(TARGET_OS_WINDOWS) 1373 #endif // defined(TARGET_OS_WINDOWS)
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