From a1ff0ea6957a8c66b171fb7748db9f8efa0f6924 Mon Sep 17 00:00:00 2001 From: "darin@chromium.org" Date: Wed, 4 Mar 2009 07:03:07 +0000 Subject: revert r10874 since it had no impact on intl1 page cycler git-svn-id: svn://svn.chromium.org/chrome/trunk/src@10879 0039d316-1c4b-4281-b951-d872f2087c98 --- webkit/glue/webkitclient_impl.cc | 62 ---------------------------------------- 1 file changed, 62 deletions(-) (limited to 'webkit/glue/webkitclient_impl.cc') diff --git a/webkit/glue/webkitclient_impl.cc b/webkit/glue/webkitclient_impl.cc index 12a4d14..e726a6c 100644 --- a/webkit/glue/webkitclient_impl.cc +++ b/webkit/glue/webkitclient_impl.cc @@ -21,66 +21,6 @@ double WebKitClientImpl::currentTime() { return base::Time::Now().ToDoubleT(); } -// HACK to see if this code impacts the intl1 page cycler -#if defined(OS_WIN) -class SharedTimerTask; - -// We maintain a single active timer and a single active task for -// setting timers directly on the platform. -static SharedTimerTask* shared_timer_task; -static void (*shared_timer_function)(); - -// Timer task to run in the chrome message loop. -class SharedTimerTask : public Task { - public: - SharedTimerTask(void (*callback)()) : callback_(callback) {} - - virtual void Run() { - if (!callback_) - return; - // Since we only have one task running at a time, verify 'this' is it - DCHECK(shared_timer_task == this); - shared_timer_task = NULL; - callback_(); - } - - void Cancel() { - callback_ = NULL; - } - - private: - void (*callback_)(); - DISALLOW_COPY_AND_ASSIGN(SharedTimerTask); -}; - -void WebKitClientImpl::setSharedTimerFiredFunction(void (*func)()) { - shared_timer_function = func; -} - -void WebKitClientImpl::setSharedTimerFireTime(double fire_time) { - DCHECK(shared_timer_function); - int interval = static_cast((fire_time - currentTime()) * 1000); - if (interval < 0) - interval = 0; - - stopSharedTimer(); - - // Verify that we didn't leak the task or timer objects. - DCHECK(shared_timer_task == NULL); - shared_timer_task = new SharedTimerTask(shared_timer_function); - MessageLoop::current()->PostDelayedTask(FROM_HERE, shared_timer_task, - interval); -} - -void WebKitClientImpl::stopSharedTimer() { - if (!shared_timer_task) - return; - shared_timer_task->Cancel(); - shared_timer_task = NULL; -} - -#else - void WebKitClientImpl::setSharedTimerFiredFunction(void (*func)()) { shared_timer_func_ = func; } @@ -99,8 +39,6 @@ void WebKitClientImpl::stopSharedTimer() { shared_timer_.Stop(); } -#endif - void WebKitClientImpl::callOnMainThread(void (*func)()) { main_loop_->PostTask(FROM_HERE, NewRunnableFunction(func)); } -- cgit v1.1