| OLD | NEW |
| 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 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 84 'onInitializationComplete', | 84 'onInitializationComplete', |
| 85 'onStopSyncingPermanently', | 85 'onStopSyncingPermanently', |
| 86 'onClearServerDataSucceeded', | 86 'onClearServerDataSucceeded', |
| 87 'onClearServerDataFailed', | 87 'onClearServerDataFailed', |
| 88 'onEncryptionComplete', | 88 'onEncryptionComplete', |
| 89 'onActionableError' | 89 'onActionableError' |
| 90 ], | 90 ], |
| 91 | 91 |
| 92 'transaction': [ | 92 'transaction': [ |
| 93 'onTransactionStart', | 93 'onTransactionStart', |
| 94 'onTransactionMutate', | 94 'onTransactionWrite', |
| 95 'onTransactionEnd' | 95 'onTransactionEnd' |
| 96 ] | 96 ] |
| 97 }; | 97 }; |
| 98 | 98 |
| 99 for (var eventType in chrome.sync.events) { | 99 for (var eventType in chrome.sync.events) { |
| 100 var events = chrome.sync.events[eventType]; | 100 var events = chrome.sync.events[eventType]; |
| 101 for (var i = 0; i < events.length; ++i) { | 101 for (var i = 0; i < events.length; ++i) { |
| 102 var event = events[i]; | 102 var event = events[i]; |
| 103 chrome.sync[event] = new Event(); | 103 chrome.sync[event] = new Event(); |
| 104 } | 104 } |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 162 * @return {number} The number of seconds since the timer was | 162 * @return {number} The number of seconds since the timer was |
| 163 * created. | 163 * created. |
| 164 */ | 164 */ |
| 165 get elapsedSeconds() { | 165 get elapsedSeconds() { |
| 166 return ((new Date()).getTime() - start.getTime()) / 1000.0; | 166 return ((new Date()).getTime() - start.getTime()) / 1000.0; |
| 167 } | 167 } |
| 168 }; | 168 }; |
| 169 }; | 169 }; |
| 170 | 170 |
| 171 })(); | 171 })(); |
| OLD | NEW |