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

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

Issue 2666023002: [Sync] Fix USS type status counters. (Closed)
Patch Set: Created 3 years, 10 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
« no previous file with comments | « no previous file | components/sync/engine_impl/cycle/non_blocking_type_debug_info_emitter.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 23 matching lines...) Expand all
34 34
35 function onAboutInfoCountersUpdated(e) { 35 function onAboutInfoCountersUpdated(e) {
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 row.num_entries = counters.numEntriesAndTombstones; 44 // There are three types of counters, only "status" counters have these
45 row.num_live = counters.numEntries; 45 // fields. Keep the old values if updated fields are not present.
46 if (counters.numEntriesAndTombstones) {
47 row.num_entries = counters.numEntriesAndTombstones;
48 }
49 if (counters.numEntries) {
50 row.num_live = counters.numEntries;
51 }
46 } 52 }
47 }); 53 });
48 jstProcess( 54 jstProcess(
49 new JsEvalContext({ type_status: type_status_array }), 55 new JsEvalContext({ type_status: type_status_array }),
50 $('typeInfo')); 56 $('typeInfo'));
51 } 57 }
52 58
53 /** 59 /**
54 * Helper to determine if an element is scrolled to its bottom limit. 60 * Helper to determine if an element is scrolled to its bottom limit.
55 * @param {Element} elem element to check 61 * @param {Element} elem element to check
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
207 213
208 return { 214 return {
209 onLoad: onLoad, 215 onLoad: onLoad,
210 addExpandListener: addExpandListener, 216 addExpandListener: addExpandListener,
211 highlightIfChanged: highlightIfChanged 217 highlightIfChanged: highlightIfChanged
212 }; 218 };
213 }); 219 });
214 220
215 document.addEventListener( 221 document.addEventListener(
216 'DOMContentLoaded', chrome.sync.about_tab.onLoad, false); 222 'DOMContentLoaded', chrome.sync.about_tab.onLoad, false);
OLDNEW
« no previous file with comments | « no previous file | components/sync/engine_impl/cycle/non_blocking_type_debug_info_emitter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698