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

Unified Diff: chrome/browser/ui/libgtk2ui/gtk2_event_loop.cc

Issue 610523002: linux: Fixes a racy crash by key input at termination. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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
« no previous file with comments | « chrome/browser/ui/libgtk2ui/gtk2_event_loop.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/libgtk2ui/gtk2_event_loop.cc
diff --git a/chrome/browser/ui/libgtk2ui/gtk2_event_loop.cc b/chrome/browser/ui/libgtk2ui/gtk2_event_loop.cc
index 9f711778177a5e9e5817027eff3944c96045c7d9..e48c18612d105abdcf2023fa1d398a0919b9718c 100644
--- a/chrome/browser/ui/libgtk2ui/gtk2_event_loop.cc
+++ b/chrome/browser/ui/libgtk2ui/gtk2_event_loop.cc
@@ -20,7 +20,7 @@ Gtk2EventLoop* Gtk2EventLoop::GetInstance() {
}
Gtk2EventLoop::Gtk2EventLoop() {
- gdk_event_handler_set(GdkEventTrampoline, this, NULL);
+ gdk_event_handler_set(DispatchGdkEvent, NULL, NULL);
}
Gtk2EventLoop::~Gtk2EventLoop() {
@@ -29,12 +29,7 @@ Gtk2EventLoop::~Gtk2EventLoop() {
}
// static
-void Gtk2EventLoop::GdkEventTrampoline(GdkEvent* event, gpointer data) {
- Gtk2EventLoop* loop = reinterpret_cast<Gtk2EventLoop*>(data);
- loop->DispatchGdkEvent(event);
-}
-
-void Gtk2EventLoop::DispatchGdkEvent(GdkEvent* gdk_event) {
+void Gtk2EventLoop::DispatchGdkEvent(GdkEvent* gdk_event, gpointer) {
switch (gdk_event->type) {
case GDK_KEY_PRESS:
case GDK_KEY_RELEASE:
@@ -47,6 +42,7 @@ void Gtk2EventLoop::DispatchGdkEvent(GdkEvent* gdk_event) {
gtk_main_do_event(gdk_event);
}
+// static
void Gtk2EventLoop::ProcessGdkEventKey(const GdkEventKey& gdk_event_key) {
// This function translates GdkEventKeys into XKeyEvents and puts them to
// the X event queue.
« no previous file with comments | « chrome/browser/ui/libgtk2ui/gtk2_event_loop.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698