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 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
109 return { | 106 return { |
110 makeTimer: makeTimer, | 107 makeTimer: makeTimer, |
111 dispatchEvent: dispatchEvent, | 108 dispatchEvent: dispatchEvent, |
112 events: new cr.EventTarget(), | 109 events: new cr.EventTarget(), |
113 | 110 |
114 registerForEvents: registerForEvents, | 111 registerForEvents: registerForEvents, |
115 requestUpdatedAboutInfo: requestUpdatedAboutInfo, | 112 requestUpdatedAboutInfo: requestUpdatedAboutInfo, |
116 requestListOfTypes: requestListOfTypes, | 113 requestListOfTypes: requestListOfTypes, |
117 }; | 114 }; |
118 }); | 115 }); |
OLD | NEW |