summaryrefslogtreecommitdiffstats
path: root/base/message_pump_glib.cc
diff options
context:
space:
mode:
authordsh@google.com <dsh@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-11-04 22:42:33 +0000
committerdsh@google.com <dsh@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-11-04 22:42:33 +0000
commit89062d330ccdcf875842ae679d59a9fcd8d14b65 (patch)
tree34ba778efaf6d81255abf939d94817596fd66b50 /base/message_pump_glib.cc
parentcac407bd57b7f7b3f9d85e1951a07d68f8400d0a (diff)
downloadchromium_src-89062d330ccdcf875842ae679d59a9fcd8d14b65.zip
chromium_src-89062d330ccdcf875842ae679d59a9fcd8d14b65.tar.gz
chromium_src-89062d330ccdcf875842ae679d59a9fcd8d14b65.tar.bz2
Review URL: http://codereview.chromium.org/8220
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@4698 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/message_pump_glib.cc')
-rw-r--r--base/message_pump_glib.cc11
1 files changed, 6 insertions, 5 deletions
diff --git a/base/message_pump_glib.cc b/base/message_pump_glib.cc
index 603c80ea..f837f597 100644
--- a/base/message_pump_glib.cc
+++ b/base/message_pump_glib.cc
@@ -54,7 +54,8 @@ static int GetTimeIntervalMilliseconds(Time from) {
MessagePumpForUI::MessagePumpForUI()
: state_(NULL),
- context_(g_main_context_default()) {
+ context_(g_main_context_default()),
+ work_source_poll_fd_(new GPollFD) {
// Create a pipe with a non-blocking read end for use by ScheduleWork to
// break us out of a poll. Create the work source and attach the file
// descriptor to it.
@@ -67,10 +68,10 @@ MessagePumpForUI::MessagePumpForUI()
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_fd_->fd = read_fd_work_scheduled_;
+ work_source_poll_fd_->events = G_IO_IN | G_IO_HUP | G_IO_ERR;
+ work_source_ = AddSource(&WorkSourceFuncs, G_PRIORITY_DEFAULT,
+ work_source_poll_fd_.get());
}
MessagePumpForUI::~MessagePumpForUI() {