| Index: content/child/blink_platform_impl.cc
|
| diff --git a/content/child/blink_platform_impl.cc b/content/child/blink_platform_impl.cc
|
| index 672e7cdc5632109a575d270e705ea67ee0a9b2a9..0f6608d0efc8f34945a84274039dab3808c6c579 100644
|
| --- a/content/child/blink_platform_impl.cc
|
| +++ b/content/child/blink_platform_impl.cc
|
| @@ -412,21 +412,13 @@ static int ToMessageID(WebLocalizedString::Name name) {
|
| }
|
|
|
| BlinkPlatformImpl::BlinkPlatformImpl()
|
| - : main_thread_task_runner_(base::MessageLoopProxy::current()),
|
| - shared_timer_func_(NULL),
|
| - shared_timer_fire_time_(0.0),
|
| - shared_timer_fire_time_was_set_while_suspended_(false),
|
| - shared_timer_suspended_(0) {
|
| + : main_thread_task_runner_(base::MessageLoopProxy::current()) {
|
| InternalInit();
|
| }
|
|
|
| BlinkPlatformImpl::BlinkPlatformImpl(
|
| scoped_refptr<base::SingleThreadTaskRunner> main_thread_task_runner)
|
| - : main_thread_task_runner_(main_thread_task_runner),
|
| - shared_timer_func_(NULL),
|
| - shared_timer_fire_time_(0.0),
|
| - shared_timer_fire_time_was_set_while_suspended_(false),
|
| - shared_timer_suspended_(0) {
|
| + : main_thread_task_runner_(main_thread_task_runner) {
|
| // TODO(alexclarke): Use c++11 delegated constructors when allowed.
|
| InternalInit();
|
| }
|
| @@ -443,10 +435,6 @@ void BlinkPlatformImpl::InternalInit() {
|
| ChildThreadImpl::current()->notification_dispatcher();
|
| push_dispatcher_ = ChildThreadImpl::current()->push_dispatcher();
|
| }
|
| -
|
| - if (main_thread_task_runner_.get()) {
|
| - shared_timer_.SetTaskRunner(main_thread_task_runner_);
|
| - }
|
| }
|
|
|
| void BlinkPlatformImpl::UpdateWebThreadTLS(blink::WebThread* thread) {
|
| @@ -975,45 +963,6 @@ void BlinkPlatformImpl::cryptographicallyRandomValues(
|
| base::RandBytes(buffer, length);
|
| }
|
|
|
| -void BlinkPlatformImpl::setSharedTimerFiredFunction(void (*func)()) {
|
| - shared_timer_func_ = func;
|
| -}
|
| -
|
| -void BlinkPlatformImpl::setSharedTimerFireInterval(
|
| - double interval_seconds) {
|
| - shared_timer_fire_time_ = interval_seconds + monotonicallyIncreasingTime();
|
| - if (shared_timer_suspended_) {
|
| - shared_timer_fire_time_was_set_while_suspended_ = true;
|
| - return;
|
| - }
|
| -
|
| - // By converting between double and int64 representation, we run the risk
|
| - // of losing precision due to rounding errors. Performing computations in
|
| - // microseconds reduces this risk somewhat. But there still is the potential
|
| - // of us computing a fire time for the timer that is shorter than what we
|
| - // need.
|
| - // As the event loop will check event deadlines prior to actually firing
|
| - // them, there is a risk of needlessly rescheduling events and of
|
| - // needlessly looping if sleep times are too short even by small amounts.
|
| - // This results in measurable performance degradation unless we use ceil() to
|
| - // always round up the sleep times.
|
| - int64 interval = static_cast<int64>(
|
| - ceil(interval_seconds * base::Time::kMillisecondsPerSecond)
|
| - * base::Time::kMicrosecondsPerMillisecond);
|
| -
|
| - if (interval < 0)
|
| - interval = 0;
|
| -
|
| - shared_timer_.Stop();
|
| - shared_timer_.Start(FROM_HERE, base::TimeDelta::FromMicroseconds(interval),
|
| - this, &BlinkPlatformImpl::DoTimeout);
|
| - OnStartSharedTimer(base::TimeDelta::FromMicroseconds(interval));
|
| -}
|
| -
|
| -void BlinkPlatformImpl::stopSharedTimer() {
|
| - shared_timer_.Stop();
|
| -}
|
| -
|
| void BlinkPlatformImpl::callOnMainThread(
|
| void (*func)(void*), void* context) {
|
| main_thread_task_runner_->PostTask(FROM_HERE, base::Bind(func, context));
|
| @@ -1211,23 +1160,6 @@ size_t BlinkPlatformImpl::maxDecodedImageBytes() {
|
| #endif
|
| }
|
|
|
| -void BlinkPlatformImpl::SuspendSharedTimer() {
|
| - ++shared_timer_suspended_;
|
| -}
|
| -
|
| -void BlinkPlatformImpl::ResumeSharedTimer() {
|
| - DCHECK_GT(shared_timer_suspended_, 0);
|
| -
|
| - // The shared timer may have fired or been adjusted while we were suspended.
|
| - if (--shared_timer_suspended_ == 0 &&
|
| - (!shared_timer_.IsRunning() ||
|
| - shared_timer_fire_time_was_set_while_suspended_)) {
|
| - shared_timer_fire_time_was_set_while_suspended_ = false;
|
| - setSharedTimerFireInterval(
|
| - shared_timer_fire_time_ - monotonicallyIncreasingTime());
|
| - }
|
| -}
|
| -
|
| scoped_refptr<base::SingleThreadTaskRunner>
|
| BlinkPlatformImpl::MainTaskRunnerForCurrentThread() {
|
| if (main_thread_task_runner_.get() &&
|
|
|