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

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

Issue 2841463003: scheduler: Make virtual time expiration deterministic (Closed)
Patch Set: 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/platform/scheduler/renderer/web_view_scheduler_impl_unittest.cc ('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 0701c536186e1150d50181c150b94e6eb1a6126b..8ed4e45c51d6620d0698d30f86de8419e823550b 100644
--- a/third_party/WebKit/Source/web/InspectorEmulationAgent.cpp
+++ b/third_party/WebKit/Source/web/InspectorEmulationAgent.cpp
@@ -171,13 +171,12 @@ Response InspectorEmulationAgent::setVirtualTimePolicy(const String& policy,
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_ =
dgozman 2017/04/24 17:10:30 nit: remove the field.
Sami 2017/04/24 17:33:47 Done!
- 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/platform/scheduler/renderer/web_view_scheduler_impl_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698