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 // This file simulates a typical background process of an offline-capable | 5 // This file simulates a typical background process of an offline-capable |
6 // authoring application. When in an "online" state it receives chunks of | 6 // authoring application. When in an "online" state it receives chunks of |
7 // data updates from a simulated server and stores them in a temporary IDB | 7 // data updates from a simulated server and stores them in a temporary IDB |
8 // data store. On a different timer, the chunks are drained from the | 8 // data store. On a different timer, the chunks are drained from the |
9 // temporary store and combined into larger records in a permanent store. | 9 // temporary store and combined into larger records in a permanent store. |
10 // When in an "offline" state, nothing else happens. | 10 // When in an "offline" state, nothing else happens. |
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
215 }; | 215 }; |
216 transaction.onabort = unexpectedAbortCallback; | 216 transaction.onabort = unexpectedAbortCallback; |
217 transaction.oncomplete = function () { | 217 transaction.oncomplete = function () { |
218 log('combine ' + combine_id + | 218 log('combine ' + combine_id + |
219 ' finished, processed ' + combine_chunk_count + ' chunks'); | 219 ' finished, processed ' + combine_chunk_count + ' chunks'); |
220 db.close(); | 220 db.close(); |
221 combineTimeoutId = setTimeout(combine, COMBINE_TIMEOUT); | 221 combineTimeoutId = setTimeout(combine, COMBINE_TIMEOUT); |
222 }; | 222 }; |
223 }; | 223 }; |
224 } | 224 } |
OLD | NEW |