| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "base/message_pump_win.h" | 5 #include "base/message_pump_win.h" |
| 6 | 6 |
| 7 #include <math.h> | 7 #include <math.h> |
| 8 | 8 |
| 9 #include "base/histogram.h" | 9 #include "base/histogram.h" |
| 10 #include "base/win_util.h" | 10 #include "base/win_util.h" |
| 11 | 11 |
| 12 using base::Time; |
| 13 |
| 12 namespace { | 14 namespace { |
| 13 | 15 |
| 14 class HandlerData : public base::MessagePumpForIO::Watcher { | 16 class HandlerData : public base::MessagePumpForIO::Watcher { |
| 15 public: | 17 public: |
| 16 typedef base::MessagePumpForIO::IOHandler IOHandler; | 18 typedef base::MessagePumpForIO::IOHandler IOHandler; |
| 17 HandlerData(OVERLAPPED* context, IOHandler* handler) | 19 HandlerData(OVERLAPPED* context, IOHandler* handler) |
| 18 : context_(context), handler_(handler) {} | 20 : context_(context), handler_(handler) {} |
| 19 ~HandlerData() {} | 21 ~HandlerData() {} |
| 20 | 22 |
| 21 virtual void OnObjectSignaled(HANDLE object); | 23 virtual void OnObjectSignaled(HANDLE object); |
| (...skipping 665 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 687 watchers_[object_index]->OnObjectSignaled(objects_[object_index]); | 689 watchers_[object_index]->OnObjectSignaled(objects_[object_index]); |
| 688 | 690 |
| 689 // Signaled objects tend to be removed from the watch list, and then added | 691 // Signaled objects tend to be removed from the watch list, and then added |
| 690 // back (appended). As a result, they move to the end of the objects_ array, | 692 // back (appended). As a result, they move to the end of the objects_ array, |
| 691 // and this should make their service "fair" (no HANDLEs should be starved). | 693 // and this should make their service "fair" (no HANDLEs should be starved). |
| 692 | 694 |
| 693 return true; | 695 return true; |
| 694 } | 696 } |
| 695 | 697 |
| 696 } // namespace base | 698 } // namespace base |
| OLD | NEW |