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

Side by Side Diff: components/sync/driver/resources/about.js

Issue 2834453006: [Sync] Update Type Info section of sync-internals. (Closed)
Patch Set: Reworked some of the variables in GetTypeStatusMap(). 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 cr.define('chrome.sync.about_tab', function() { 5 cr.define('chrome.sync.about_tab', function() {
6 // Contains the latest snapshot of sync about info. 6 // Contains the latest snapshot of sync about info.
7 chrome.sync.aboutInfo = {}; 7 chrome.sync.aboutInfo = {};
8 8
9 function highlightIfChanged(node, oldVal, newVal) { 9 function highlightIfChanged(node, oldVal, newVal) {
10 function clearHighlight() { 10 function clearHighlight() {
(...skipping 25 matching lines...) Expand all
36 var details = e.details; 36 var details = e.details;
37 37
38 var modelType = details.modelType; 38 var modelType = details.modelType;
39 var counters = details.counters; 39 var counters = details.counters;
40 40
41 var type_status_array = chrome.sync.aboutInfo.type_status; 41 var type_status_array = chrome.sync.aboutInfo.type_status;
42 type_status_array.forEach(function(row) { 42 type_status_array.forEach(function(row) {
43 if (row.name == modelType) { 43 if (row.name == modelType) {
44 // There are three types of counters, only "status" counters have these 44 // There are three types of counters, only "status" counters have these
45 // fields. Keep the old values if updated fields are not present. 45 // fields. Keep the old values if updated fields are not present.
46 if (counters.numEntriesAndTombstones) { 46 if (counters.numEntriesAndTombstones !== undefined) {
47 row.num_entries = counters.numEntriesAndTombstones; 47 row.num_entries = counters.numEntriesAndTombstones;
48 } 48 }
49 if (counters.numEntries) { 49 if (counters.numEntries !== undefined) {
50 row.num_live = counters.numEntries; 50 row.num_live = counters.numEntries;
51 } 51 }
52 } 52 }
53 }); 53 });
54 jstProcess( 54 jstProcess(
55 new JsEvalContext({ type_status: type_status_array }), 55 new JsEvalContext({ type_status: type_status_array }),
56 $('typeInfo')); 56 $('typeInfo'));
57 } 57 }
58 58
59 /** 59 /**
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
213 213
214 return { 214 return {
215 onLoad: onLoad, 215 onLoad: onLoad,
216 addExpandListener: addExpandListener, 216 addExpandListener: addExpandListener,
217 highlightIfChanged: highlightIfChanged 217 highlightIfChanged: highlightIfChanged
218 }; 218 };
219 }); 219 });
220 220
221 document.addEventListener( 221 document.addEventListener(
222 'DOMContentLoaded', chrome.sync.about_tab.onLoad, false); 222 'DOMContentLoaded', chrome.sync.about_tab.onLoad, false);
OLDNEW
« no previous file with comments | « components/sync/driver/resources/about.html ('k') | components/sync/engine/model_safe_worker.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698