Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(792)

Side by Side Diff: chrome/test/data/indexeddb/endure/app-worker.js

Issue 11415083: Remove references to IDBDatabaseException and IDBRequest.errorCode (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix error propagation from workers in endure test Created 8 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/test/data/indexeddb/endure/app.js ('k') | content/test/data/indexeddb/key_types_test.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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.
11 11
12 self.indexedDB = self.indexedDB || self.webkitIndexedDB || 12 self.indexedDB = self.indexedDB || self.webkitIndexedDB ||
13 self.mozIndexedDB; 13 self.mozIndexedDB;
14 self.IDBKeyRange = self.IDBKeyRange || self.webkitIDBKeyRange; 14 self.IDBKeyRange = self.IDBKeyRange || self.webkitIDBKeyRange;
15 15
16 function unexpectedErrorCallback(e) { 16 function unexpectedErrorCallback(e) {
17 self.postMessage({type: 'ERROR', errorCode: e.target.errorCode, 17 self.postMessage({type: 'ERROR', error: { name: e.target.error.name },
18 webkitErrorMessage: e.target.webkitErrorMessage}); 18 webkitErrorMessage: e.target.webkitErrorMessage});
19 } 19 }
20 20
21 function unexpectedAbortCallback(e) { 21 function unexpectedAbortCallback(e) {
22 self.postMessage({type: 'ABORT', errorCode: e.target.errorCode, 22 self.postMessage({type: 'ABORT', error: { name: e.target.error.name },
23 webkitErrorMessage: e.target.webkitErrorMessage}); 23 webkitErrorMessage: e.target.webkitErrorMessage});
24 } 24 }
25 25
26 function log(message) { 26 function log(message) {
27 self.postMessage({type: 'LOG', message: message}); 27 self.postMessage({type: 'LOG', message: message});
28 } 28 }
29 29
30 function error(message) { 30 function error(message) {
31 self.postMessage({type: 'ERROR', message: message}); 31 self.postMessage({type: 'ERROR', message: message});
32 } 32 }
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 }
OLDNEW
« no previous file with comments | « chrome/test/data/indexeddb/endure/app.js ('k') | content/test/data/indexeddb/key_types_test.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698