Skip to content

Commit

Permalink
[renderer] Add support for postIdleTaskAfterWakeup to WebSchedulerImpl.
Browse files Browse the repository at this point in the history
Adds support for postIdleTaskAfterWakeup to WebSchedulerImpl for use in
Blink.

Blink side of patch: https://codereview.chromium.org/940433005/

This will be required for implementation of long idle task - design doc:
https://docs.google.com/a/chromium.org/document/d/1yBlUdYW8VTIfB-DqhvQqUeP0kf-Ap1W4cao2yQq58Do/edit

BUG=455713

Review URL: https://codereview.chromium.org/936853002

Cr-Commit-Position: refs/heads/master@{#317814}
  • Loading branch information
rmcilroy authored and Commit bot committed Feb 24, 2015
1 parent 27eaf1e commit 80b19ce
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
12 changes: 12 additions & 0 deletions content/renderer/scheduler/web_scheduler_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,18 @@ void WebSchedulerImpl::postIdleTask(const blink::WebTraceLocation& web_location,
base::Bind(&WebSchedulerImpl::runIdleTask, base::Passed(&scoped_task)));
}

void WebSchedulerImpl::postIdleTaskAfterWakeup(
const blink::WebTraceLocation& web_location,
blink::WebScheduler::IdleTask* task) {
DCHECK(idle_task_runner_);
scoped_ptr<blink::WebScheduler::IdleTask> scoped_task(task);
tracked_objects::Location location(web_location.functionName(),
web_location.fileName(), -1, nullptr);
idle_task_runner_->PostIdleTaskAfterWakeup(
location,
base::Bind(&WebSchedulerImpl::runIdleTask, base::Passed(&scoped_task)));
}

void WebSchedulerImpl::postLoadingTask(
const blink::WebTraceLocation& web_location, blink::WebThread::Task* task) {
DCHECK(loading_task_runner_);
Expand Down
2 changes: 2 additions & 0 deletions content/renderer/scheduler/web_scheduler_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ class CONTENT_EXPORT WebSchedulerImpl : public blink::WebScheduler {
virtual bool shouldYieldForHighPriorityWork();
virtual void postIdleTask(const blink::WebTraceLocation& location,
blink::WebScheduler::IdleTask* task);
virtual void postIdleTaskAfterWakeup(const blink::WebTraceLocation& location,
blink::WebScheduler::IdleTask* task);
virtual void postLoadingTask(const blink::WebTraceLocation& location,
blink::WebThread::Task* task);
virtual void shutdown();
Expand Down

0 comments on commit 80b19ce

Please sign in to comment.