| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_loop/message_pump_win.h" | 5 #include "base/message_loop/message_pump_win.h" |
| 6 | 6 |
| 7 #include <math.h> | 7 #include <math.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <limits> | 10 #include <limits> |
| 11 | 11 |
| 12 #include "base/debug/crash_logging.h" |
| 12 #include "base/memory/ptr_util.h" | 13 #include "base/memory/ptr_util.h" |
| 13 #include "base/message_loop/message_loop.h" | 14 #include "base/message_loop/message_loop.h" |
| 14 #include "base/metrics/histogram.h" | 15 #include "base/metrics/histogram.h" |
| 15 #include "base/strings/stringprintf.h" | 16 #include "base/strings/stringprintf.h" |
| 16 #include "base/trace_event/trace_event.h" | 17 #include "base/trace_event/trace_event.h" |
| 17 #include "base/win/current_module.h" | 18 #include "base/win/current_module.h" |
| 18 #include "base/win/wrapped_window_proc.h" | 19 #include "base/win/wrapped_window_proc.h" |
| 19 | 20 |
| 20 namespace base { | 21 namespace base { |
| 21 | 22 |
| (...skipping 607 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 629 } | 630 } |
| 630 } | 631 } |
| 631 } | 632 } |
| 632 | 633 |
| 633 bool MessagePumpForGpu::ProcessNextMessage() { | 634 bool MessagePumpForGpu::ProcessNextMessage() { |
| 634 MSG msg; | 635 MSG msg; |
| 635 if (!g_peek_message(&msg, nullptr, 0, 0, PM_REMOVE)) | 636 if (!g_peek_message(&msg, nullptr, 0, 0, PM_REMOVE)) |
| 636 return false; | 637 return false; |
| 637 | 638 |
| 638 if (msg.message == WM_QUIT) { | 639 if (msg.message == WM_QUIT) { |
| 640 // Try to figure out if we've received a WM_QUIT targeted towards a |
| 641 // window. http://crbug.com/647068 |
| 642 // TODO(jbauman): Remove once we've got some data about this. |
| 643 base::debug::SetCrashKeyValue("received_quit_message", |
| 644 base::StringPrintf("%d", !!msg.hwnd)); |
| 639 // Repost the QUIT message so that it will be retrieved by the primary | 645 // Repost the QUIT message so that it will be retrieved by the primary |
| 640 // GetMessage() loop. | 646 // GetMessage() loop. |
| 641 state_->should_quit = true; | 647 state_->should_quit = true; |
| 642 g_post_quit(static_cast<int>(msg.wParam)); | 648 g_post_quit(static_cast<int>(msg.wParam)); |
| 643 return false; | 649 return false; |
| 644 } | 650 } |
| 645 | 651 |
| 646 if (!g_call_msg_filter(const_cast<MSG*>(&msg), kMessageFilterCode)) { | 652 if (!g_call_msg_filter(const_cast<MSG*>(&msg), kMessageFilterCode)) { |
| 647 g_translate_message(&msg); | 653 g_translate_message(&msg); |
| 648 g_dispatch_message(&msg); | 654 g_dispatch_message(&msg); |
| (...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 823 if (!filter || it->handler == filter) { | 829 if (!filter || it->handler == filter) { |
| 824 *item = *it; | 830 *item = *it; |
| 825 completed_io_.erase(it); | 831 completed_io_.erase(it); |
| 826 return true; | 832 return true; |
| 827 } | 833 } |
| 828 } | 834 } |
| 829 return false; | 835 return false; |
| 830 } | 836 } |
| 831 | 837 |
| 832 } // namespace base | 838 } // namespace base |
| OLD | NEW |