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

Unified Diff: base/message_pump_glib.cc

Issue 8220: Own the GLib poll FD; it should not be on the stack. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 12 years, 1 month 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
« base/message_pump_glib.h ('K') | « base/message_pump_glib.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/message_pump_glib.cc
===================================================================
--- base/message_pump_glib.cc (revision 4621)
+++ base/message_pump_glib.cc (working copy)
@@ -67,10 +67,11 @@
flags = 0;
CHECK(0 == fcntl(read_fd_work_scheduled_, F_SETFL, flags | O_NONBLOCK)) <<
"Could not set file descriptor to non-blocking!";
- GPollFD poll_fd;
- poll_fd.fd = read_fd_work_scheduled_;
- poll_fd.events = G_IO_IN | G_IO_HUP | G_IO_ERR;
- work_source_ = AddSource(&WorkSourceFuncs, G_PRIORITY_DEFAULT, &poll_fd);
+ work_source_poll_info_ = new GPollFD;
+ work_source_poll_info_->fd = read_fd_work_scheduled_;
+ work_source_poll_info_->events = G_IO_IN | G_IO_HUP | G_IO_ERR;
+ work_source_ = AddSource(&WorkSourceFuncs, G_PRIORITY_DEFAULT,
+ work_source_poll_info_);
}
MessagePumpForUI::~MessagePumpForUI() {
@@ -78,6 +79,7 @@
close(write_fd_work_scheduled_);
g_source_destroy(work_source_);
g_source_unref(work_source_);
+ delete work_source_poll_info_;
}
struct ThreadIdTraits {
« base/message_pump_glib.h ('K') | « base/message_pump_glib.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698