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

Unified Diff: base/idle_timer.cc

Issue 10610: Remove an unnecessary pointer layer in idle timer. (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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/idle_timer.cc
===================================================================
--- base/idle_timer.cc (revision 5207)
+++ base/idle_timer.cc (working copy)
@@ -62,12 +62,12 @@
have_idle_info_ = XScreenSaverQueryExtension(GDK_DISPLAY(), &event_base,
&error_base);
if (have_idle_info_)
- *idle_info_.Get() = XScreenSaverAllocInfo();
+ idle_info_.Set(XScreenSaverAllocInfo());
}
~IdleState() {
- if (*idle_info_.Get()) {
- XFree(*idle_info_.Get());
+ if (idle_info_.Get()) {
+ XFree(idle_info_.Get());
idle_info_.~ThreadLocalPointer();
}
}
@@ -75,15 +75,15 @@
int32 IdleTime() {
if (have_idle_info_ && idle_info_.Get()) {
XScreenSaverQueryInfo(GDK_DISPLAY(), GDK_ROOT_WINDOW(),
- *idle_info_.Get());
- return (*idle_info_.Get())->idle;
+ idle_info_.Get());
+ return idle_info_.Get()->idle;
}
return -1;
}
private:
bool have_idle_info_;
- ThreadLocalPointer<XScreenSaverInfo*> idle_info_;
+ ThreadLocalPointer<XScreenSaverInfo> idle_info_;
DISALLOW_COPY_AND_ASSIGN(IdleState);
};
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698