Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(7374)

Unified Diff: chrome/browser/renderer_host/render_widget_host.cc

Issue 224023: Don't send tab switching/killing/creating keyboard accelerators to pages. Th... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: call Browser:IsReservedAccelerator from tab_contents_view.cc instead of each platform file Created 11 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/renderer_host/render_widget_host.cc
===================================================================
--- chrome/browser/renderer_host/render_widget_host.cc (revision 27783)
+++ chrome/browser/renderer_host/render_widget_host.cc (working copy)
@@ -400,6 +400,13 @@
if (!process_->HasConnection())
return;
+ // Tab switching/closing accelerators aren't sent to the renderer to avoid a
+ // hung/malicious renderer from interfering.
+ if (!ShouldSendToRenderer(key_event)) {
+ UnhandledKeyboardEvent(key_event);
+ return;
+ }
+
// Put all WebKeyboardEvent objects in a queue since we can't trust the
// renderer and we need to give something to the UnhandledInputEvent
// handler.
@@ -754,7 +761,7 @@
if (!message.ReadBool(&iter, &processed))
process()->ReceivedBadMessage(message.type());
- KeyQueue::value_type front_item = key_queue_.front();
+ NativeWebKeyboardEvent front_item = key_queue_.front();
key_queue_.pop();
if (!processed) {

Powered by Google App Engine
This is Rietveld 408576698