OLD | NEW |
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 // require cr.js | 5 // require cr.js |
6 // require cr/event_target.js | 6 // require cr/event_target.js |
7 // require cr/util.js | 7 // require cr/util.js |
8 | 8 |
9 cr.define('chrome.sync', function() { | 9 cr.define('chrome.sync', function() { |
10 'use strict'; | 10 'use strict'; |
(...skipping 16 matching lines...) Expand all Loading... |
27 // Remove the callback before we call it since the callback may | 27 // Remove the callback before we call it since the callback may |
28 // throw. | 28 // throw. |
29 var callback = callbacks.shift(); | 29 var callback = callbacks.shift(); |
30 callback.apply(null, args); | 30 callback.apply(null, args); |
31 }; | 31 }; |
32 | 32 |
33 return fn; | 33 return fn; |
34 } | 34 } |
35 | 35 |
36 var syncFunctions = [ | 36 var syncFunctions = [ |
37 // Client server communication logging functions. | |
38 'getClientServerTraffic', | |
39 | |
40 // Get an array containing a JSON representations of all known sync nodes. | 37 // Get an array containing a JSON representations of all known sync nodes. |
41 'getAllNodes', | 38 'getAllNodes', |
42 ]; | 39 ]; |
43 | 40 |
44 for (var i = 0; i < syncFunctions.length; ++i) { | 41 for (var i = 0; i < syncFunctions.length; ++i) { |
45 var syncFunction = syncFunctions[i]; | 42 var syncFunction = syncFunctions[i]; |
46 chrome.sync[syncFunction] = makeSyncFunction(syncFunction); | 43 chrome.sync[syncFunction] = makeSyncFunction(syncFunction); |
47 } | 44 } |
48 | 45 |
49 /** | 46 /** |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 | 97 |
101 return { | 98 return { |
102 makeTimer: makeTimer, | 99 makeTimer: makeTimer, |
103 dispatchEvent: dispatchEvent, | 100 dispatchEvent: dispatchEvent, |
104 events: new cr.EventTarget(), | 101 events: new cr.EventTarget(), |
105 | 102 |
106 requestUpdatedAboutInfo: requestUpdatedAboutInfo, | 103 requestUpdatedAboutInfo: requestUpdatedAboutInfo, |
107 requestListOfTypes: requestListOfTypes, | 104 requestListOfTypes: requestListOfTypes, |
108 }; | 105 }; |
109 }); | 106 }); |
OLD | NEW |