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); |
} |