| 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 // require: cr.js | 5 // require: cr.js |
| 6 // require: cr/event_target.js | 6 // require: cr/event_target.js |
| 7 | 7 |
| 8 /** | 8 /** |
| 9 * @fileoverview This creates a log object which listens to and | 9 * @fileoverview This creates a log object which listens to and |
| 10 * records all sync events. | 10 * records all sync events. |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 'onInitializationComplete', | 31 'onInitializationComplete', |
| 32 'onPassphraseAccepted', | 32 'onPassphraseAccepted', |
| 33 'onPassphraseRequired', | 33 'onPassphraseRequired', |
| 34 'onStopSyncingPermanently', | 34 'onStopSyncingPermanently', |
| 35 'onSyncCycleCompleted', | 35 'onSyncCycleCompleted', |
| 36 ], | 36 ], |
| 37 | 37 |
| 38 transaction: [ | 38 transaction: [ |
| 39 'onTransactionWrite', | 39 'onTransactionWrite', |
| 40 ], | 40 ], |
| 41 |
| 42 protocol: [ |
| 43 'onProtocolEvent', |
| 44 ] |
| 41 }; | 45 }; |
| 42 | 46 |
| 43 /** | 47 /** |
| 44 * Creates a new log object which then immediately starts recording | 48 * Creates a new log object which then immediately starts recording |
| 45 * sync events. Recorded entries are available in the 'entries' | 49 * sync events. Recorded entries are available in the 'entries' |
| 46 * property and there is an 'append' event which can be listened to. | 50 * property and there is an 'append' event which can be listened to. |
| 47 * @constructor | 51 * @constructor |
| 48 * @extends {cr.EventTarget} | 52 * @extends {cr.EventTarget} |
| 49 */ | 53 */ |
| 50 var Log = function() { | 54 var Log = function() { |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 100 var e = cr.doc.createEvent('CustomEvent'); | 104 var e = cr.doc.createEvent('CustomEvent'); |
| 101 e.initCustomEvent('append', false, false, entry); | 105 e.initCustomEvent('append', false, false, entry); |
| 102 this.dispatchEvent(e); | 106 this.dispatchEvent(e); |
| 103 } | 107 } |
| 104 }; | 108 }; |
| 105 | 109 |
| 106 return { | 110 return { |
| 107 log: new Log() | 111 log: new Log() |
| 108 }; | 112 }; |
| 109 }); | 113 }); |
| OLD | NEW |