| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 81 | 81 |
| 82 //----------------------------------------------------------------------------- | 82 //----------------------------------------------------------------------------- |
| 83 // MessagePumpForUI public: | 83 // MessagePumpForUI public: |
| 84 | 84 |
| 85 MessagePumpForUI::MessagePumpForUI() { | 85 MessagePumpForUI::MessagePumpForUI() { |
| 86 InitMessageWnd(); | 86 InitMessageWnd(); |
| 87 } | 87 } |
| 88 | 88 |
| 89 MessagePumpForUI::~MessagePumpForUI() { | 89 MessagePumpForUI::~MessagePumpForUI() { |
| 90 DestroyWindow(message_hwnd_); | 90 DestroyWindow(message_hwnd_); |
| 91 UnregisterClass(kWndClass, GetModuleHandle(NULL)); |
| 91 } | 92 } |
| 92 | 93 |
| 93 void MessagePumpForUI::ScheduleWork() { | 94 void MessagePumpForUI::ScheduleWork() { |
| 94 if (InterlockedExchange(&have_work_, 1)) | 95 if (InterlockedExchange(&have_work_, 1)) |
| 95 return; // Someone else continued the pumping. | 96 return; // Someone else continued the pumping. |
| 96 | 97 |
| 97 // Make sure the MessagePump does some work for us. | 98 // Make sure the MessagePump does some work for us. |
| 98 PostMessage(message_hwnd_, kMsgHaveWork, reinterpret_cast<WPARAM>(this), 0); | 99 PostMessage(message_hwnd_, kMsgHaveWork, reinterpret_cast<WPARAM>(this), 0); |
| 99 } | 100 } |
| 100 | 101 |
| (...skipping 446 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 547 if (!filter || it->handler == filter) { | 548 if (!filter || it->handler == filter) { |
| 548 *item = *it; | 549 *item = *it; |
| 549 completed_io_.erase(it); | 550 completed_io_.erase(it); |
| 550 return true; | 551 return true; |
| 551 } | 552 } |
| 552 } | 553 } |
| 553 return false; | 554 return false; |
| 554 } | 555 } |
| 555 | 556 |
| 556 } // namespace base | 557 } // namespace base |
| OLD | NEW |