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 <windows.h> | 5 #include <windows.h> |
6 | 6 |
7 #include "chrome/browser/hang_monitor/hung_plugin_action.h" | 7 #include "chrome/browser/hang_monitor/hung_plugin_action.h" |
8 | 8 |
9 #include "base/metrics/histogram.h" | 9 #include "base/metrics/histogram.h" |
10 #include "base/version.h" | 10 #include "base/version.h" |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
116 NULL, title, message, chrome::MESSAGE_BOX_TYPE_QUESTION) == | 116 NULL, title, message, chrome::MESSAGE_BOX_TYPE_QUESTION) == |
117 chrome::MESSAGE_BOX_RESULT_YES) { | 117 chrome::MESSAGE_BOX_RESULT_YES) { |
118 *action = HungWindowNotification::HUNG_WINDOW_TERMINATE_PROCESS; | 118 *action = HungWindowNotification::HUNG_WINDOW_TERMINATE_PROCESS; |
119 } else { | 119 } else { |
120 // If the user choses to ignore the hung window warning, the | 120 // If the user choses to ignore the hung window warning, the |
121 // message timeout for this window should be doubled. We only | 121 // message timeout for this window should be doubled. We only |
122 // double the timeout property on the window if the property | 122 // double the timeout property on the window if the property |
123 // exists. The property is deleted if the window becomes | 123 // exists. The property is deleted if the window becomes |
124 // responsive. | 124 // responsive. |
125 continue_hang_detection = false; | 125 continue_hang_detection = false; |
126 #pragma warning(disable:4311) | 126 #pragma warning(disable : 4311 4302) |
Nico
2015/11/16 21:31:07
should these warning pragmas have a comment that e
brucedawson
2015/11/17 00:24:39
Yes. I copied over the warning from the previous f
Nico
2015/11/17 00:30:27
Hm, this now says that it's a truncation, but not
brucedawson
2015/11/18 01:58:11
Okay, better fix now. TetProp/GetProp take/return
| |
127 int child_window_message_timeout = | 127 int child_window_message_timeout = |
128 reinterpret_cast<int>(GetProp( | 128 reinterpret_cast<int>(GetProp( |
129 hung_window, HungWindowDetector::kHungChildWindowTimeout)); | 129 hung_window, HungWindowDetector::kHungChildWindowTimeout)); |
130 #pragma warning(default:4311) | 130 #pragma warning(default : 4311 4302) |
131 if (child_window_message_timeout) { | 131 if (child_window_message_timeout) { |
132 child_window_message_timeout *= 2; | 132 child_window_message_timeout *= 2; |
133 #pragma warning(disable:4312) | 133 #pragma warning(disable:4312) |
134 SetProp(hung_window, HungWindowDetector::kHungChildWindowTimeout, | 134 SetProp(hung_window, HungWindowDetector::kHungChildWindowTimeout, |
135 reinterpret_cast<HANDLE>(child_window_message_timeout)); | 135 reinterpret_cast<HANDLE>(child_window_message_timeout)); |
136 #pragma warning(default:4312) | 136 #pragma warning(default:4312) |
137 } | 137 } |
138 } | 138 } |
139 current_hung_plugin_window_ = NULL; | 139 current_hung_plugin_window_ = NULL; |
140 } | 140 } |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
175 void CALLBACK HungPluginAction::HungWindowResponseCallback(HWND target_window, | 175 void CALLBACK HungPluginAction::HungWindowResponseCallback(HWND target_window, |
176 UINT message, | 176 UINT message, |
177 ULONG_PTR data, | 177 ULONG_PTR data, |
178 LRESULT result) { | 178 LRESULT result) { |
179 HungPluginAction* instance = reinterpret_cast<HungPluginAction*>(data); | 179 HungPluginAction* instance = reinterpret_cast<HungPluginAction*>(data); |
180 DCHECK(NULL != instance); | 180 DCHECK(NULL != instance); |
181 if (NULL != instance) { | 181 if (NULL != instance) { |
182 instance->OnWindowResponsive(target_window); | 182 instance->OnWindowResponsive(target_window); |
183 } | 183 } |
184 } | 184 } |
OLD | NEW |