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

Side by Side Diff: chrome/browser/resources/sync_internals/chrome_sync.js

Issue 7033043: [Sync] Speed up sync node browser/search in about:sync (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address comments Created 9 years, 6 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 var chrome = chrome || {}; 5 var chrome = chrome || {};
6 // TODO(akalin): Add mocking code for e.g. chrome.send() so that we 6 // TODO(akalin): Add mocking code for e.g. chrome.send() so that we
7 // can test this without rebuilding chrome. 7 // can test this without rebuilding chrome.
8 chrome.sync = chrome.sync || {}; 8 chrome.sync = chrome.sync || {};
9 (function () { 9 (function () {
10 10
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 } 60 }
61 } 61 }
62 } 62 }
63 }; 63 };
64 64
65 chrome.sync.events = { 65 chrome.sync.events = {
66 'service': [ 66 'service': [
67 'onServiceStateChanged' 67 'onServiceStateChanged'
68 ], 68 ],
69 69
70 // See chrome/browser/sync/engine/syncapi.h for docs.
70 'notifier': [ 71 'notifier': [
71 'onNotificationStateChange', 72 'onNotificationStateChange',
72 'onIncomingNotification' 73 'onIncomingNotification'
73 ], 74 ],
74 75
75 'manager': [ 76 'manager': [
76 'onChangesApplied', 77 'onChangesApplied',
77 'onChangesComplete', 78 'onChangesComplete',
78 'onSyncCycleCompleted', 79 'onSyncCycleCompleted',
79 'onAuthError', 80 'onAuthError',
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
127 callback.apply(null, args); 128 callback.apply(null, args);
128 }; 129 };
129 130
130 return fn; 131 return fn;
131 } 132 }
132 133
133 var syncFunctions = [ 134 var syncFunctions = [
134 // Sync service functions. 135 // Sync service functions.
135 'getAboutInfo', 136 'getAboutInfo',
136 137
137 // Notification functions. 138 // Notification functions. See chrome/browser/sync/engine/syncapi.h
139 // for docs.
138 'getNotificationState', 140 'getNotificationState',
139 'getNotificationInfo', 141 'getNotificationInfo',
140 142
141 // Node lookup functions. 143 // Node lookup functions. See chrome/browser/sync/engine/syncapi.h
142 'getRootNode', 144 // for docs.
143 'getNodesById', 145 'getRootNodeDetails',
146 'getNodeSummariesById',
147 'getNodeDetailsById',
144 'getChildNodeIds', 148 'getChildNodeIds',
145 'findNodesContainingString' 149 'findNodesContainingString'
146 ]; 150 ];
147 151
148 for (var i = 0; i < syncFunctions.length; ++i) { 152 for (var i = 0; i < syncFunctions.length; ++i) {
149 var syncFunction = syncFunctions[i]; 153 var syncFunction = syncFunctions[i];
150 chrome.sync[syncFunction] = makeSyncFunction(syncFunction); 154 chrome.sync[syncFunction] = makeSyncFunction(syncFunction);
151 } 155 }
152 156
153 /** 157 /**
154 * Returns an object which measures elapsed time. 158 * Returns an object which measures elapsed time.
155 */ 159 */
156 chrome.sync.makeTimer = function() { 160 chrome.sync.makeTimer = function() {
157 var start = new Date(); 161 var start = new Date();
158 162
159 return { 163 return {
160 /** 164 /**
161 * @return {number} The number of seconds since the timer was 165 * @return {number} The number of seconds since the timer was
162 * created. 166 * created.
163 */ 167 */
164 get elapsedSeconds() { 168 get elapsedSeconds() {
165 return ((new Date()).getTime() - start.getTime()) / 1000.0; 169 return ((new Date()).getTime() - start.getTime()) / 1000.0;
166 } 170 }
167 }; 171 };
168 }; 172 };
169 173
170 })(); 174 })();
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/resources/sync_internals/sync_node_browser.js » ('j') | chrome/browser/sync/engine/syncapi.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698