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

Unified Diff: third_party/WebKit/Source/web/InspectorEmulationAgent.cpp

Issue 2841463003: scheduler: Make virtual time expiration deterministic (Closed)
Patch Set: Rebased Created 3 years, 8 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 | « third_party/WebKit/Source/web/InspectorEmulationAgent.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/web/InspectorEmulationAgent.cpp
diff --git a/third_party/WebKit/Source/web/InspectorEmulationAgent.cpp b/third_party/WebKit/Source/web/InspectorEmulationAgent.cpp
index 3dde0059e1c509331750bcb0e42dcf0a61d74979..56971836e2b96f25bea33a156076482f6521d506 100644
--- a/third_party/WebKit/Source/web/InspectorEmulationAgent.cpp
+++ b/third_party/WebKit/Source/web/InspectorEmulationAgent.cpp
@@ -169,15 +169,12 @@ Response InspectorEmulationAgent::setVirtualTimePolicy(const String& policy,
web_local_frame_impl_->View()->Scheduler()->EnableVirtualTime();
if (budget.isJust()) {
- RefPtr<WebTaskRunner> task_runner =
- Platform::Current()->CurrentThread()->GetWebTaskRunner();
- long long delay_millis = static_cast<long long>(budget.fromJust());
- virtual_time_budget_expired_task_handle_ =
- task_runner->PostDelayedCancellableTask(
- BLINK_FROM_HERE,
- WTF::Bind(&InspectorEmulationAgent::VirtualTimeBudgetExpired,
- WrapWeakPersistent(this)),
- delay_millis);
+ base::TimeDelta budget_amount =
+ base::TimeDelta::FromMilliseconds(budget.fromJust());
+ web_local_frame_impl_->View()->Scheduler()->GrantVirtualTimeBudget(
+ budget_amount,
+ WTF::Bind(&InspectorEmulationAgent::VirtualTimeBudgetExpired,
+ WrapWeakPersistent(this)));
}
return Response::OK();
}
« no previous file with comments | « third_party/WebKit/Source/web/InspectorEmulationAgent.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698