| 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" | |
| 13 #include "base/memory/ptr_util.h" | 12 #include "base/memory/ptr_util.h" |
| 14 #include "base/message_loop/message_loop.h" | 13 #include "base/message_loop/message_loop.h" |
| 15 #include "base/metrics/histogram.h" | 14 #include "base/metrics/histogram.h" |
| 16 #include "base/strings/stringprintf.h" | 15 #include "base/strings/stringprintf.h" |
| 17 #include "base/trace_event/trace_event.h" | 16 #include "base/trace_event/trace_event.h" |
| 18 #include "base/win/current_module.h" | 17 #include "base/win/current_module.h" |
| 19 #include "base/win/wrapped_window_proc.h" | 18 #include "base/win/wrapped_window_proc.h" |
| 20 | 19 |
| 21 namespace base { | 20 namespace base { |
| 22 | 21 |
| (...skipping 607 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 630 } | 629 } |
| 631 } | 630 } |
| 632 } | 631 } |
| 633 | 632 |
| 634 bool MessagePumpForGpu::ProcessNextMessage() { | 633 bool MessagePumpForGpu::ProcessNextMessage() { |
| 635 MSG msg; | 634 MSG msg; |
| 636 if (!g_peek_message(&msg, nullptr, 0, 0, PM_REMOVE)) | 635 if (!g_peek_message(&msg, nullptr, 0, 0, PM_REMOVE)) |
| 637 return false; | 636 return false; |
| 638 | 637 |
| 639 if (msg.message == WM_QUIT) { | 638 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)); | |
| 645 // Repost the QUIT message so that it will be retrieved by the primary | 639 // Repost the QUIT message so that it will be retrieved by the primary |
| 646 // GetMessage() loop. | 640 // GetMessage() loop. |
| 647 state_->should_quit = true; | 641 state_->should_quit = true; |
| 648 g_post_quit(static_cast<int>(msg.wParam)); | 642 g_post_quit(static_cast<int>(msg.wParam)); |
| 649 return false; | 643 return false; |
| 650 } | 644 } |
| 651 | 645 |
| 652 if (!g_call_msg_filter(const_cast<MSG*>(&msg), kMessageFilterCode)) { | 646 if (!g_call_msg_filter(const_cast<MSG*>(&msg), kMessageFilterCode)) { |
| 653 g_translate_message(&msg); | 647 g_translate_message(&msg); |
| 654 g_dispatch_message(&msg); | 648 g_dispatch_message(&msg); |
| (...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 829 if (!filter || it->handler == filter) { | 823 if (!filter || it->handler == filter) { |
| 830 *item = *it; | 824 *item = *it; |
| 831 completed_io_.erase(it); | 825 completed_io_.erase(it); |
| 832 return true; | 826 return true; |
| 833 } | 827 } |
| 834 } | 828 } |
| 835 return false; | 829 return false; |
| 836 } | 830 } |
| 837 | 831 |
| 838 } // namespace base | 832 } // namespace base |
| OLD | NEW |