Index: chrome/browser/resources/sync_internals/sync_node_browser.js |
diff --git a/chrome/browser/resources/sync_internals/sync_node_browser.js b/chrome/browser/resources/sync_internals/sync_node_browser.js |
index 3ce44697e01b8178c190c762c0ea0bce149b5a10..431acabcca45e554207c0c9dbf3922c3418e2c9e 100644 |
--- a/chrome/browser/resources/sync_internals/sync_node_browser.js |
+++ b/chrome/browser/resources/sync_internals/sync_node_browser.js |
@@ -7,33 +7,6 @@ |
// require: cr/ui/tree.js |
cr.define('chrome.sync', function() { |
- // Allow platform specific CSS rules. |
- // |
- // TODO(akalin): BMM and options page does something similar, too. |
- // Move this to util.js. |
- if (cr.isWindows) |
- document.documentElement.setAttribute('os', 'win'); |
- |
- // TODO(akalin): Create SyncNodeTree/SyncNodeTreeItem classes that |
- // hide all these details. |
- |
- /** |
- * Returns an object which measures elapsed time. |
- */ |
- var makeTimer = function() { |
- var start = new Date(); |
- |
- return { |
- /** |
- * @return {number} The number of seconds since the timer was |
- * created. |
- */ |
- get elapsedSeconds() { |
- return ((new Date()).getTime() - start.getTime()) / 1000.0; |
- } |
- }; |
- }; |
- |
/** |
* Gets all children of the given node and passes it to the given |
* callback. |
@@ -43,12 +16,12 @@ cr.define('chrome.sync', function() { |
* children. |
*/ |
function getSyncNodeChildren(nodeInfo, callback) { |
- var timer = makeTimer(); |
+ var timer = chrome.sync.makeTimer(); |
chrome.sync.getChildNodeIds(nodeInfo.id, function(childNodeIds) { |
console.debug('getChildNodeIds took ' + |
timer.elapsedSeconds + 's to retrieve ' + |
childNodeIds.length + ' ids'); |
- timer = makeTimer(); |
+ timer = chrome.sync.makeTimer(); |
chrome.sync.getNodesById(childNodeIds, function(children) { |
console.debug('getNodesById took ' + |
timer.elapsedSeconds + 's to retrieve ' + |
@@ -79,7 +52,7 @@ cr.define('chrome.sync', function() { |
treeItem.addEventListener('expand', function(event) { |
if (!treeItem.triggeredLoad_) { |
getSyncNodeChildren(nodeInfo, function(children) { |
- var timer = makeTimer(); |
+ var timer = chrome.sync.makeTimer(); |
for (var i = 0; i < children.length; ++i) { |
var childTreeItem = makeNodeTreeItem(children[i]); |
treeItem.add(childTreeItem); |