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

Unified Diff: components/html_viewer/blink_platform_impl.cc

Issue 1078173002: Remove obsolete SharedTimer code in chromium (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 5 years, 6 months 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 | « components/html_viewer/blink_platform_impl.h ('k') | content/child/blink_platform_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/html_viewer/blink_platform_impl.cc
diff --git a/components/html_viewer/blink_platform_impl.cc b/components/html_viewer/blink_platform_impl.cc
index e054948a0734d0d8fd1a1741653d99a73a5e50b5..6a8032b3d2bf60a475eb84a552061814f3de5bbc 100644
--- a/components/html_viewer/blink_platform_impl.cc
+++ b/components/html_viewer/blink_platform_impl.cc
@@ -62,12 +62,8 @@ BlinkPlatformImpl::BlinkPlatformImpl(
mojo::ApplicationImpl* app,
scheduler::RendererScheduler* renderer_scheduler)
: main_thread_task_runner_(renderer_scheduler->DefaultTaskRunner()),
- main_thread_(
- new scheduler::WebThreadImplForRendererScheduler(renderer_scheduler)),
- 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_(new scheduler::WebThreadImplForRendererScheduler(
+ renderer_scheduler)) {
if (app) {
mojo::URLRequestPtr request(mojo::URLRequest::New());
request->url = mojo::String::From("mojo:network_service");
@@ -86,7 +82,6 @@ BlinkPlatformImpl::BlinkPlatformImpl(
app->ConnectToService(request2.Pass(), &clipboard);
clipboard_.reset(new WebClipboardImpl(clipboard.Pass()));
}
- shared_timer_.SetTaskRunner(main_thread_task_runner_);
}
BlinkPlatformImpl::~BlinkPlatformImpl() {
@@ -130,44 +125,6 @@ void BlinkPlatformImpl::cryptographicallyRandomValues(unsigned char* buffer,
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);
-}
-
-void BlinkPlatformImpl::stopSharedTimer() {
- shared_timer_.Stop();
-}
-
bool BlinkPlatformImpl::isThreadedCompositingEnabled() {
return true;
}
« no previous file with comments | « components/html_viewer/blink_platform_impl.h ('k') | content/child/blink_platform_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698