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

Unified Diff: tracing/tracing/base/raf.html

Issue 2776653002: [ESLint] Fix violations when enabling curly rule in eslint. (Closed)
Patch Set: rebase Created 3 years, 9 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 | « tracing/tracing/base/multi_dimensional_view_test.html ('k') | tracing/tracing/base/raf_test.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tracing/tracing/base/raf.html
diff --git a/tracing/tracing/base/raf.html b/tracing/tracing/base/raf.html
index 7df834e496259621745dcafb8376947591f8ffe9..b5c2c20ec5f7d54414dfab3a31004fe072f2c5fb 100644
--- a/tracing/tracing/base/raf.html
+++ b/tracing/tracing/base/raf.html
@@ -30,8 +30,7 @@ tr.exportTo('tr.b', function() {
var idleWorkScheduled = false;
function scheduleRAF() {
- if (rafScheduled)
- return;
+ if (rafScheduled) return;
rafScheduled = true;
if (tr.isHeadless) {
Promise.resolve().then(function() {
@@ -56,8 +55,7 @@ tr.exportTo('tr.b', function() {
}
function scheduleIdleWork() {
- if (idleWorkScheduled)
- return;
+ if (idleWorkScheduled) return;
if (!nativeRequestIdleCallbackSupported()) {
scheduleRAF();
return;
@@ -70,16 +68,15 @@ tr.exportTo('tr.b', function() {
function onAnimationFrameError(e, opt_stack) {
console.log(e.stack);
- if (tr.isHeadless)
- throw e;
+ if (tr.isHeadless) throw e;
- if (opt_stack)
- console.log(opt_stack);
+ if (opt_stack) console.log(opt_stack);
- if (e.message)
+ if (e.message) {
console.error(e.message, e.stack);
- else
+ } else {
console.error(e);
+ }
}
function runTask(task, frameBeginTime) {
@@ -99,11 +96,13 @@ tr.exportTo('tr.b', function() {
pendingRAFs = [];
var hasRAFTasks = currentPreAFs.length || currentRAFDispatchList.length;
- for (var i = 0; i < currentPreAFs.length; i++)
+ for (var i = 0; i < currentPreAFs.length; i++) {
runTask(currentPreAFs[i], frameBeginTime);
+ }
- while (currentRAFDispatchList.length > 0)
+ while (currentRAFDispatchList.length > 0) {
runTask(currentRAFDispatchList.shift(), frameBeginTime);
+ }
currentRAFDispatchList = undefined;
if ((!hasRAFTasks && !nativeRequestIdleCallbackSupported()) ||
@@ -121,8 +120,7 @@ tr.exportTo('tr.b', function() {
);
}
- if (pendingIdleCallbacks.length > 0)
- scheduleIdleWork();
+ if (pendingIdleCallbacks.length > 0) scheduleIdleWork();
}
function processIdleWork(forceAllTasksToRun, deadline) {
@@ -138,13 +136,11 @@ tr.exportTo('tr.b', function() {
}
}
- if (pendingIdleCallbacks.length > 0)
- scheduleIdleWork();
+ if (pendingIdleCallbacks.length > 0) scheduleIdleWork();
}
function getStack_() {
- if (!recordRAFStacks)
- return '';
+ if (!recordRAFStacks) return '';
var stackLines = tr.b.stackTrace();
// Strip off getStack_.
@@ -193,14 +189,12 @@ tr.exportTo('tr.b', function() {
}
function forcePendingRAFTasksToRun(frameBeginTime) {
- if (!rafScheduled)
- return;
+ if (!rafScheduled) return;
processRequests(false, frameBeginTime);
}
function forceAllPendingTasksToRunForTest() {
- if (!rafScheduled && !idleWorkScheduled)
- return;
+ if (!rafScheduled && !idleWorkScheduled) return;
processRequests(true, 0);
}
« no previous file with comments | « tracing/tracing/base/multi_dimensional_view_test.html ('k') | tracing/tracing/base/raf_test.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698