diff options
author | darin@chromium.org <darin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-02-23 08:48:30 +0000 |
---|---|---|
committer | darin@chromium.org <darin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-02-23 08:48:30 +0000 |
commit | bbe916d18774ba82f892a2e770bc16a3df45e7ed (patch) | |
tree | 92aa4bc4a90a3588da7f1a60f4ad474620acf879 /webkit/glue/webkitclient_impl.cc | |
parent | 192d8c5ea712cca42ea1d6ff692cd77d099c0a35 (diff) | |
download | chromium_src-bbe916d18774ba82f892a2e770bc16a3df45e7ed.zip chromium_src-bbe916d18774ba82f892a2e770bc16a3df45e7ed.tar.gz chromium_src-bbe916d18774ba82f892a2e770bc16a3df45e7ed.tar.bz2 |
Avoid unnecessary restarts of the webkit shared timer, and when restarting, use
the given fire time instead of the current time.
This is an attempt to isolate and fix the mac / linux intl2 page cycler
regression.
TBR=jam
BUG=36310
TEST=none
Review URL: http://codereview.chromium.org/654001
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@39701 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/glue/webkitclient_impl.cc')
-rw-r--r-- | webkit/glue/webkitclient_impl.cc | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/webkit/glue/webkitclient_impl.cc b/webkit/glue/webkitclient_impl.cc index 49f3d91..9c4b6d3 100644 --- a/webkit/glue/webkitclient_impl.cc +++ b/webkit/glue/webkitclient_impl.cc @@ -101,6 +101,7 @@ static int ToMessageID(WebLocalizedString::Name name) { WebKitClientImpl::WebKitClientImpl() : main_loop_(MessageLoop::current()), shared_timer_func_(NULL), + shared_timer_fire_time_(0.0), shared_timer_suspended_(0) { } @@ -257,6 +258,7 @@ void WebKitClientImpl::setSharedTimerFiredFunction(void (*func)()) { } void WebKitClientImpl::setSharedTimerFireTime(double fire_time) { + shared_timer_fire_time_ = fire_time; if (shared_timer_suspended_) return; @@ -403,8 +405,9 @@ void WebKitClientImpl::SuspendSharedTimer() { } void WebKitClientImpl::ResumeSharedTimer() { - if (--shared_timer_suspended_ == 0) - setSharedTimerFireTime(currentTime()); + // The shared timer may have fired or been adjusted while we were suspended. + if (--shared_timer_suspended_ == 0 && !shared_timer_.IsRunning()) + setSharedTimerFireTime(shared_timer_fire_time_); } } // namespace webkit_glue |