| Differences between
and this patch
- a/LayoutTests/ChangeLog +10 lines
Lines 1-3 a/LayoutTests/ChangeLog_sec1
1
2010-10-08  Andrei Popescu  <andreip@google.com>
2
3
        Reviewed by NOBODY (OOPS!).
4
5
        IndexedDB does not have a quota mechanism.
6
        https://bugs.webkit.org/show_bug.cgi?id=47389
7
8
        * storage/indexeddb/database-quota-expected.txt: Added.
9
        * storage/indexeddb/database-quota.html: Added.
10
1
2010-10-08  Renata Hodovan  <reni@inf.u-szeged.hu>
11
2010-10-08  Renata Hodovan  <reni@inf.u-szeged.hu>
2
12
3
        Reviewed by Nikolas Zimmermann.
13
        Reviewed by Nikolas Zimmermann.
- a/LayoutTests/storage/indexeddb/database-quota-expected.txt +1115 lines
Line 0 a/LayoutTests/storage/indexeddb/database-quota-expected.txt_sec1
1
Tests IndexedDB's quota enforcing mechanism.
2
3
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
4
5
6
indexedDB.open('name', 'description')
7
PASS 'onsuccess' in result is true
8
PASS 'onerror' in result is true
9
PASS 'readyState' in result is true
10
An event should fire shortly...
11
12
Success event fired:
13
PASS 'result' in event is true
14
PASS 'code' in event is false
15
PASS 'message' in event is false
16
PASS 'source' in event is true
17
PASS event.source != null is true
18
PASS 'onsuccess' in event.target is true
19
PASS 'onerror' in event.target is true
20
PASS 'readyState' in event.target is true
21
PASS event.target.readyState is event.target.DONE
22
23
db = event.result
24
db.setVersion('new version')
25
PASS 'onsuccess' in result is true
26
PASS 'onerror' in result is true
27
PASS 'readyState' in result is true
28
An event should fire shortly...
29
30
setVersionSuccess():
31
Success event fired:
32
PASS 'result' in event is true
33
PASS 'code' in event is false
34
PASS 'message' in event is false
35
PASS 'source' in event is true
36
PASS event.source != null is true
37
PASS 'onsuccess' in event.target is true
38
PASS 'onerror' in event.target is true
39
PASS 'readyState' in event.target is true
40
PASS event.target.readyState is event.target.DONE
41
42
trans = event.result
43
PASS trans !== null is true
44
Deleted all object stores.
45
Success event fired:
46
PASS 'result' in event is true
47
PASS 'code' in event is false
48
PASS 'message' in event is false
49
PASS 'source' in event is true
50
PASS event.source != null is true
51
PASS 'onsuccess' in event.target is true
52
PASS 'onerror' in event.target is true
53
PASS 'readyState' in event.target is true
54
PASS event.target.readyState is event.target.DONE
55
56
FAIL db.version should be version b. Was new version.
57
PASS db.name is "name"
58
PASS db.objectStores is []
59
PASS db.objectStores.length is 0
60
PASS db.objectStores.contains('') is false
61
db.createObjectStore("test123")
62
PASS db.objectStores is ['test123']
63
PASS db.objectStores.length is 1
64
PASS db.objectStores.contains('') is false
65
PASS db.objectStores.contains('test456') is false
66
PASS db.objectStores.contains('test123') is true
67
trans = db.transaction()
68
Creating 'data' which contains 64K of data
69
PASS data.length is 65536
70
store = trans.objectStore('test123')
71
store.add({x: data}, dataAdded)
72
Success event fired:
73
PASS 'result' in event is true
74
PASS 'code' in event is false
75
PASS 'message' in event is false
76
PASS 'source' in event is true
77
PASS event.source != null is true
78
PASS 'onsuccess' in event.target is true
79
PASS 'onerror' in event.target is true
80
PASS 'readyState' in event.target is true
81
PASS event.target.readyState is event.target.DONE
82
83
store = event.source
84
store.add({x: data}, dataAdded)
85
Success event fired:
86
PASS 'result' in event is true
87
PASS 'code' in event is false
88
PASS 'message' in event is false
89
PASS 'source' in event is true
90
PASS event.source != null is true
91
PASS 'onsuccess' in event.target is true
92
PASS 'onerror' in event.target is true
93
PASS 'readyState' in event.target is true
94
PASS event.target.readyState is event.target.DONE
95
96
store = event.source
97
store.add({x: data}, dataAdded)
98
Success event fired:
99
PASS 'result' in event is true
100
PASS 'code' in event is false
101
PASS 'message' in event is false
102
PASS 'source' in event is true
103
PASS event.source != null is true
104
PASS 'onsuccess' in event.target is true
105
PASS 'onerror' in event.target is true
106
PASS 'readyState' in event.target is true
107
PASS event.target.readyState is event.target.DONE
108
109
store = event.source
110
store.add({x: data}, dataAdded)
111
Success event fired:
112
PASS 'result' in event is true
113
PASS 'code' in event is false
114
PASS 'message' in event is false
115
PASS 'source' in event is true
116
PASS event.source != null is true
117
PASS 'onsuccess' in event.target is true
118
PASS 'onerror' in event.target is true
119
PASS 'readyState' in event.target is true
120
PASS event.target.readyState is event.target.DONE
121
122
store = event.source
123
store.add({x: data}, dataAdded)
124
Success event fired:
125
PASS 'result' in event is true
126
PASS 'code' in event is false
127
PASS 'message' in event is false
128
PASS 'source' in event is true
129
PASS event.source != null is true
130
PASS 'onsuccess' in event.target is true
131
PASS 'onerror' in event.target is true
132
PASS 'readyState' in event.target is true
133
PASS event.target.readyState is event.target.DONE
134
135
store = event.source
136
store.add({x: data}, dataAdded)
137
Success event fired:
138
PASS 'result' in event is true
139
PASS 'code' in event is false
140
PASS 'message' in event is false
141
PASS 'source' in event is true
142
PASS event.source != null is true
143
PASS 'onsuccess' in event.target is true
144
PASS 'onerror' in event.target is true
145
PASS 'readyState' in event.target is true
146
PASS event.target.readyState is event.target.DONE
147
148
store = event.source
149
store.add({x: data}, dataAdded)
150
Success event fired:
151
PASS 'result' in event is true
152
PASS 'code' in event is false
153
PASS 'message' in event is false
154
PASS 'source' in event is true
155
PASS event.source != null is true
156
PASS 'onsuccess' in event.target is true
157
PASS 'onerror' in event.target is true
158
PASS 'readyState' in event.target is true
159
PASS event.target.readyState is event.target.DONE
160
161
store = event.source
162
store.add({x: data}, dataAdded)
163
Success event fired:
164
PASS 'result' in event is true
165
PASS 'code' in event is false
166
PASS 'message' in event is false
167
PASS 'source' in event is true
168
PASS event.source != null is true
169
PASS 'onsuccess' in event.target is true
170
PASS 'onerror' in event.target is true
171
PASS 'readyState' in event.target is true
172
PASS event.target.readyState is event.target.DONE
173
174
store = event.source
175
store.add({x: data}, dataAdded)
176
Success event fired:
177
PASS 'result' in event is true
178
PASS 'code' in event is false
179
PASS 'message' in event is false
180
PASS 'source' in event is true
181
PASS event.source != null is true
182
PASS 'onsuccess' in event.target is true
183
PASS 'onerror' in event.target is true
184
PASS 'readyState' in event.target is true
185
PASS event.target.readyState is event.target.DONE
186
187
store = event.source
188
store.add({x: data}, dataAdded)
189
Success event fired:
190
PASS 'result' in event is true
191
PASS 'code' in event is false
192
PASS 'message' in event is false
193
PASS 'source' in event is true
194
PASS event.source != null is true
195
PASS 'onsuccess' in event.target is true
196
PASS 'onerror' in event.target is true
197
PASS 'readyState' in event.target is true
198
PASS event.target.readyState is event.target.DONE
199
200
store = event.source
201
store.add({x: data}, dataAdded)
202
Success event fired:
203
PASS 'result' in event is true
204
PASS 'code' in event is false
205
PASS 'message' in event is false
206
PASS 'source' in event is true
207
PASS event.source != null is true
208
PASS 'onsuccess' in event.target is true
209
PASS 'onerror' in event.target is true
210
PASS 'readyState' in event.target is true
211
PASS event.target.readyState is event.target.DONE
212
213
store = event.source
214
store.add({x: data}, dataAdded)
215
Success event fired:
216
PASS 'result' in event is true
217
PASS 'code' in event is false
218
PASS 'message' in event is false
219
PASS 'source' in event is true
220
PASS event.source != null is true
221
PASS 'onsuccess' in event.target is true
222
PASS 'onerror' in event.target is true
223
PASS 'readyState' in event.target is true
224
PASS event.target.readyState is event.target.DONE
225
226
store = event.source
227
store.add({x: data}, dataAdded)
228
Success event fired:
229
PASS 'result' in event is true
230
PASS 'code' in event is false
231
PASS 'message' in event is false
232
PASS 'source' in event is true
233
PASS event.source != null is true
234
PASS 'onsuccess' in event.target is true
235
PASS 'onerror' in event.target is true
236
PASS 'readyState' in event.target is true
237
PASS event.target.readyState is event.target.DONE
238
239
store = event.source
240
store.add({x: data}, dataAdded)
241
Success event fired:
242
PASS 'result' in event is true
243
PASS 'code' in event is false
244
PASS 'message' in event is false
245
PASS 'source' in event is true
246
PASS event.source != null is true
247
PASS 'onsuccess' in event.target is true
248
PASS 'onerror' in event.target is true
249
PASS 'readyState' in event.target is true
250
PASS event.target.readyState is event.target.DONE
251
252
store = event.source
253
store.add({x: data}, dataAdded)
254
Success event fired:
255
PASS 'result' in event is true
256
PASS 'code' in event is false
257
PASS 'message' in event is false
258
PASS 'source' in event is true
259
PASS event.source != null is true
260
PASS 'onsuccess' in event.target is true
261
PASS 'onerror' in event.target is true
262
PASS 'readyState' in event.target is true
263
PASS event.target.readyState is event.target.DONE
264
265
store = event.source
266
store.add({x: data}, dataAdded)
267
Success event fired:
268
PASS 'result' in event is true
269
PASS 'code' in event is false
270
PASS 'message' in event is false
271
PASS 'source' in event is true
272
PASS event.source != null is true
273
PASS 'onsuccess' in event.target is true
274
PASS 'onerror' in event.target is true
275
PASS 'readyState' in event.target is true
276
PASS event.target.readyState is event.target.DONE
277
278
store = event.source
279
store.add({x: data}, dataAdded)
280
Success event fired:
281
PASS 'result' in event is true
282
PASS 'code' in event is false
283
PASS 'message' in event is false
284
PASS 'source' in event is true
285
PASS event.source != null is true
286
PASS 'onsuccess' in event.target is true
287
PASS 'onerror' in event.target is true
288
PASS 'readyState' in event.target is true
289
PASS event.target.readyState is event.target.DONE
290
291
store = event.source
292
store.add({x: data}, dataAdded)
293
Success event fired:
294
PASS 'result' in event is true
295
PASS 'code' in event is false
296
PASS 'message' in event is false
297
PASS 'source' in event is true
298
PASS event.source != null is true
299
PASS 'onsuccess' in event.target is true
300
PASS 'onerror' in event.target is true
301
PASS 'readyState' in event.target is true
302
PASS event.target.readyState is event.target.DONE
303
304
store = event.source
305
store.add({x: data}, dataAdded)
306
Success event fired:
307
PASS 'result' in event is true
308
PASS 'code' in event is false
309
PASS 'message' in event is false
310
PASS 'source' in event is true
311
PASS event.source != null is true
312
PASS 'onsuccess' in event.target is true
313
PASS 'onerror' in event.target is true
314
PASS 'readyState' in event.target is true
315
PASS event.target.readyState is event.target.DONE
316
317
store = event.source
318
store.add({x: data}, dataAdded)
319
Success event fired:
320
PASS 'result' in event is true
321
PASS 'code' in event is false
322
PASS 'message' in event is false
323
PASS 'source' in event is true
324
PASS event.source != null is true
325
PASS 'onsuccess' in event.target is true
326
PASS 'onerror' in event.target is true
327
PASS 'readyState' in event.target is true
328
PASS event.target.readyState is event.target.DONE
329
330
store = event.source
331
store.add({x: data}, dataAdded)
332
Success event fired:
333
PASS 'result' in event is true
334
PASS 'code' in event is false
335
PASS 'message' in event is false
336
PASS 'source' in event is true
337
PASS event.source != null is true
338
PASS 'onsuccess' in event.target is true
339
PASS 'onerror' in event.target is true
340
PASS 'readyState' in event.target is true
341
PASS event.target.readyState is event.target.DONE
342
343
store = event.source
344
store.add({x: data}, dataAdded)
345
Success event fired:
346
PASS 'result' in event is true
347
PASS 'code' in event is false
348
PASS 'message' in event is false
349
PASS 'source' in event is true
350
PASS event.source != null is true
351
PASS 'onsuccess' in event.target is true
352
PASS 'onerror' in event.target is true
353
PASS 'readyState' in event.target is true
354
PASS event.target.readyState is event.target.DONE
355
356
store = event.source
357
store.add({x: data}, dataAdded)
358
Success event fired:
359
PASS 'result' in event is true
360
PASS 'code' in event is false
361
PASS 'message' in event is false
362
PASS 'source' in event is true
363
PASS event.source != null is true
364
PASS 'onsuccess' in event.target is true
365
PASS 'onerror' in event.target is true
366
PASS 'readyState' in event.target is true
367
PASS event.target.readyState is event.target.DONE
368
369
store = event.source
370
store.add({x: data}, dataAdded)
371
Success event fired:
372
PASS 'result' in event is true
373
PASS 'code' in event is false
374
PASS 'message' in event is false
375
PASS 'source' in event is true
376
PASS event.source != null is true
377
PASS 'onsuccess' in event.target is true
378
PASS 'onerror' in event.target is true
379
PASS 'readyState' in event.target is true
380
PASS event.target.readyState is event.target.DONE
381
382
store = event.source
383
store.add({x: data}, dataAdded)
384
Success event fired:
385
PASS 'result' in event is true
386
PASS 'code' in event is false
387
PASS 'message' in event is false
388
PASS 'source' in event is true
389
PASS event.source != null is true
390
PASS 'onsuccess' in event.target is true
391
PASS 'onerror' in event.target is true
392
PASS 'readyState' in event.target is true
393
PASS event.target.readyState is event.target.DONE
394
395
store = event.source
396
store.add({x: data}, dataAdded)
397
Success event fired:
398
PASS 'result' in event is true
399
PASS 'code' in event is false
400
PASS 'message' in event is false
401
PASS 'source' in event is true
402
PASS event.source != null is true
403
PASS 'onsuccess' in event.target is true
404
PASS 'onerror' in event.target is true
405
PASS 'readyState' in event.target is true
406
PASS event.target.readyState is event.target.DONE
407
408
store = event.source
409
store.add({x: data}, dataAdded)
410
Success event fired:
411
PASS 'result' in event is true
412
PASS 'code' in event is false
413
PASS 'message' in event is false
414
PASS 'source' in event is true
415
PASS event.source != null is true
416
PASS 'onsuccess' in event.target is true
417
PASS 'onerror' in event.target is true
418
PASS 'readyState' in event.target is true
419
PASS event.target.readyState is event.target.DONE
420
421
store = event.source
422
store.add({x: data}, dataAdded)
423
Success event fired:
424
PASS 'result' in event is true
425
PASS 'code' in event is false
426
PASS 'message' in event is false
427
PASS 'source' in event is true
428
PASS event.source != null is true
429
PASS 'onsuccess' in event.target is true
430
PASS 'onerror' in event.target is true
431
PASS 'readyState' in event.target is true
432
PASS event.target.readyState is event.target.DONE
433
434
store = event.source
435
store.add({x: data}, dataAdded)
436
Success event fired:
437
PASS 'result' in event is true
438
PASS 'code' in event is false
439
PASS 'message' in event is false
440
PASS 'source' in event is true
441
PASS event.source != null is true
442
PASS 'onsuccess' in event.target is true
443
PASS 'onerror' in event.target is true
444
PASS 'readyState' in event.target is true
445
PASS event.target.readyState is event.target.DONE
446
447
store = event.source
448
store.add({x: data}, dataAdded)
449
Success event fired:
450
PASS 'result' in event is true
451
PASS 'code' in event is false
452
PASS 'message' in event is false
453
PASS 'source' in event is true
454
PASS event.source != null is true
455
PASS 'onsuccess' in event.target is true
456
PASS 'onerror' in event.target is true
457
PASS 'readyState' in event.target is true
458
PASS event.target.readyState is event.target.DONE
459
460
store = event.source
461
store.add({x: data}, dataAdded)
462
Success event fired:
463
PASS 'result' in event is true
464
PASS 'code' in event is false
465
PASS 'message' in event is false
466
PASS 'source' in event is true
467
PASS event.source != null is true
468
PASS 'onsuccess' in event.target is true
469
PASS 'onerror' in event.target is true
470
PASS 'readyState' in event.target is true
471
PASS event.target.readyState is event.target.DONE
472
473
store = event.source
474
store.add({x: data}, dataAdded)
475
Success event fired:
476
PASS 'result' in event is true
477
PASS 'code' in event is false
478
PASS 'message' in event is false
479
PASS 'source' in event is true
480
PASS event.source != null is true
481
PASS 'onsuccess' in event.target is true
482
PASS 'onerror' in event.target is true
483
PASS 'readyState' in event.target is true
484
PASS event.target.readyState is event.target.DONE
485
486
store = event.source
487
store.add({x: data}, dataAdded)
488
Success event fired:
489
PASS 'result' in event is true
490
PASS 'code' in event is false
491
PASS 'message' in event is false
492
PASS 'source' in event is true
493
PASS event.source != null is true
494
PASS 'onsuccess' in event.target is true
495
PASS 'onerror' in event.target is true
496
PASS 'readyState' in event.target is true
497
PASS event.target.readyState is event.target.DONE
498
499
store = event.source
500
store.add({x: data}, dataAdded)
501
Success event fired:
502
PASS 'result' in event is true
503
PASS 'code' in event is false
504
PASS 'message' in event is false
505
PASS 'source' in event is true
506
PASS event.source != null is true
507
PASS 'onsuccess' in event.target is true
508
PASS 'onerror' in event.target is true
509
PASS 'readyState' in event.target is true
510
PASS event.target.readyState is event.target.DONE
511
512
store = event.source
513
store.add({x: data}, dataAdded)
514
Success event fired:
515
PASS 'result' in event is true
516
PASS 'code' in event is false
517
PASS 'message' in event is false
518
PASS 'source' in event is true
519
PASS event.source != null is true
520
PASS 'onsuccess' in event.target is true
521
PASS 'onerror' in event.target is true
522
PASS 'readyState' in event.target is true
523
PASS event.target.readyState is event.target.DONE
524
525
store = event.source
526
store.add({x: data}, dataAdded)
527
Success event fired:
528
PASS 'result' in event is true
529
PASS 'code' in event is false
530
PASS 'message' in event is false
531
PASS 'source' in event is true
532
PASS event.source != null is true
533
PASS 'onsuccess' in event.target is true
534
PASS 'onerror' in event.target is true
535
PASS 'readyState' in event.target is true
536
PASS event.target.readyState is event.target.DONE
537
538
store = event.source
539
store.add({x: data}, dataAdded)
540
Success event fired:
541
PASS 'result' in event is true
542
PASS 'code' in event is false
543
PASS 'message' in event is false
544
PASS 'source' in event is true
545
PASS event.source != null is true
546
PASS 'onsuccess' in event.target is true
547
PASS 'onerror' in event.target is true
548
PASS 'readyState' in event.target is true
549
PASS event.target.readyState is event.target.DONE
550
551
store = event.source
552
store.add({x: data}, dataAdded)
553
Success event fired:
554
PASS 'result' in event is true
555
PASS 'code' in event is false
556
PASS 'message' in event is false
557
PASS 'source' in event is true
558
PASS event.source != null is true
559
PASS 'onsuccess' in event.target is true
560
PASS 'onerror' in event.target is true
561
PASS 'readyState' in event.target is true
562
PASS event.target.readyState is event.target.DONE
563
564
store = event.source
565
store.add({x: data}, dataAdded)
566
Success event fired:
567
PASS 'result' in event is true
568
PASS 'code' in event is false
569
PASS 'message' in event is false
570
PASS 'source' in event is true
571
PASS event.source != null is true
572
PASS 'onsuccess' in event.target is true
573
PASS 'onerror' in event.target is true
574
PASS 'readyState' in event.target is true
575
PASS event.target.readyState is event.target.DONE
576
577
store = event.source
578
store.add({x: data}, dataAdded)
579
Success event fired:
580
PASS 'result' in event is true
581
PASS 'code' in event is false
582
PASS 'message' in event is false
583
PASS 'source' in event is true
584
PASS event.source != null is true
585
PASS 'onsuccess' in event.target is true
586
PASS 'onerror' in event.target is true
587
PASS 'readyState' in event.target is true
588
PASS event.target.readyState is event.target.DONE
589
590
store = event.source
591
store.add({x: data}, dataAdded)
592
Success event fired:
593
PASS 'result' in event is true
594
PASS 'code' in event is false
595
PASS 'message' in event is false
596
PASS 'source' in event is true
597
PASS event.source != null is true
598
PASS 'onsuccess' in event.target is true
599
PASS 'onerror' in event.target is true
600
PASS 'readyState' in event.target is true
601
PASS event.target.readyState is event.target.DONE
602
603
store = event.source
604
store.add({x: data}, dataAdded)
605
Success event fired:
606
PASS 'result' in event is true
607
PASS 'code' in event is false
608
PASS 'message' in event is false
609
PASS 'source' in event is true
610
PASS event.source != null is true
611
PASS 'onsuccess' in event.target is true
612
PASS 'onerror' in event.target is true
613
PASS 'readyState' in event.target is true
614
PASS event.target.readyState is event.target.DONE
615
616
store = event.source
617
store.add({x: data}, dataAdded)
618
Success event fired:
619
PASS 'result' in event is true
620
PASS 'code' in event is false
621
PASS 'message' in event is false
622
PASS 'source' in event is true
623
PASS event.source != null is true
624
PASS 'onsuccess' in event.target is true
625
PASS 'onerror' in event.target is true
626
PASS 'readyState' in event.target is true
627
PASS event.target.readyState is event.target.DONE
628
629
store = event.source
630
store.add({x: data}, dataAdded)
631
Success event fired:
632
PASS 'result' in event is true
633
PASS 'code' in event is false
634
PASS 'message' in event is false
635
PASS 'source' in event is true
636
PASS event.source != null is true
637
PASS 'onsuccess' in event.target is true
638
PASS 'onerror' in event.target is true
639
PASS 'readyState' in event.target is true
640
PASS event.target.readyState is event.target.DONE
641
642
store = event.source
643
store.add({x: data}, dataAdded)
644
Success event fired:
645
PASS 'result' in event is true
646
PASS 'code' in event is false
647
PASS 'message' in event is false
648
PASS 'source' in event is true
649
PASS event.source != null is true
650
PASS 'onsuccess' in event.target is true
651
PASS 'onerror' in event.target is true
652
PASS 'readyState' in event.target is true
653
PASS event.target.readyState is event.target.DONE
654
655
store = event.source
656
store.add({x: data}, dataAdded)
657
Success event fired:
658
PASS 'result' in event is true
659
PASS 'code' in event is false
660
PASS 'message' in event is false
661
PASS 'source' in event is true
662
PASS event.source != null is true
663
PASS 'onsuccess' in event.target is true
664
PASS 'onerror' in event.target is true
665
PASS 'readyState' in event.target is true
666
PASS event.target.readyState is event.target.DONE
667
668
store = event.source
669
store.add({x: data}, dataAdded)
670
Success event fired:
671
PASS 'result' in event is true
672
PASS 'code' in event is false
673
PASS 'message' in event is false
674
PASS 'source' in event is true
675
PASS event.source != null is true
676
PASS 'onsuccess' in event.target is true
677
PASS 'onerror' in event.target is true
678
PASS 'readyState' in event.target is true
679
PASS event.target.readyState is event.target.DONE
680
681
store = event.source
682
store.add({x: data}, dataAdded)
683
Success event fired:
684
PASS 'result' in event is true
685
PASS 'code' in event is false
686
PASS 'message' in event is false
687
PASS 'source' in event is true
688
PASS event.source != null is true
689
PASS 'onsuccess' in event.target is true
690
PASS 'onerror' in event.target is true
691
PASS 'readyState' in event.target is true
692
PASS event.target.readyState is event.target.DONE
693
694
store = event.source
695
store.add({x: data}, dataAdded)
696
Success event fired:
697
PASS 'result' in event is true
698
PASS 'code' in event is false
699
PASS 'message' in event is false
700
PASS 'source' in event is true
701
PASS event.source != null is true
702
PASS 'onsuccess' in event.target is true
703
PASS 'onerror' in event.target is true
704
PASS 'readyState' in event.target is true
705
PASS event.target.readyState is event.target.DONE
706
707
store = event.source
708
store.add({x: data}, dataAdded)
709
Success event fired:
710
PASS 'result' in event is true
711
PASS 'code' in event is false
712
PASS 'message' in event is false
713
PASS 'source' in event is true
714
PASS event.source != null is true
715
PASS 'onsuccess' in event.target is true
716
PASS 'onerror' in event.target is true
717
PASS 'readyState' in event.target is true
718
PASS event.target.readyState is event.target.DONE
719
720
store = event.source
721
store.add({x: data}, dataAdded)
722
Success event fired:
723
PASS 'result' in event is true
724
PASS 'code' in event is false
725
PASS 'message' in event is false
726
PASS 'source' in event is true
727
PASS event.source != null is true
728
PASS 'onsuccess' in event.target is true
729
PASS 'onerror' in event.target is true
730
PASS 'readyState' in event.target is true
731
PASS event.target.readyState is event.target.DONE
732
733
store = event.source
734
store.add({x: data}, dataAdded)
735
Success event fired:
736
PASS 'result' in event is true
737
PASS 'code' in event is false
738
PASS 'message' in event is false
739
PASS 'source' in event is true
740
PASS event.source != null is true
741
PASS 'onsuccess' in event.target is true
742
PASS 'onerror' in event.target is true
743
PASS 'readyState' in event.target is true
744
PASS event.target.readyState is event.target.DONE
745
746
store = event.source
747
store.add({x: data}, dataAdded)
748
Success event fired:
749
PASS 'result' in event is true
750
PASS 'code' in event is false
751
PASS 'message' in event is false
752
PASS 'source' in event is true
753
PASS event.source != null is true
754
PASS 'onsuccess' in event.target is true
755
PASS 'onerror' in event.target is true
756
PASS 'readyState' in event.target is true
757
PASS event.target.readyState is event.target.DONE
758
759
store = event.source
760
store.add({x: data}, dataAdded)
761
Success event fired:
762
PASS 'result' in event is true
763
PASS 'code' in event is false
764
PASS 'message' in event is false
765
PASS 'source' in event is true
766
PASS event.source != null is true
767
PASS 'onsuccess' in event.target is true
768
PASS 'onerror' in event.target is true
769
PASS 'readyState' in event.target is true
770
PASS event.target.readyState is event.target.DONE
771
772
store = event.source
773
store.add({x: data}, dataAdded)
774
Success event fired:
775
PASS 'result' in event is true
776
PASS 'code' in event is false
777
PASS 'message' in event is false
778
PASS 'source' in event is true
779
PASS event.source != null is true
780
PASS 'onsuccess' in event.target is true
781
PASS 'onerror' in event.target is true
782
PASS 'readyState' in event.target is true
783
PASS event.target.readyState is event.target.DONE
784
785
store = event.source
786
store.add({x: data}, dataAdded)
787
Success event fired:
788
PASS 'result' in event is true
789
PASS 'code' in event is false
790
PASS 'message' in event is false
791
PASS 'source' in event is true
792
PASS event.source != null is true
793
PASS 'onsuccess' in event.target is true
794
PASS 'onerror' in event.target is true
795
PASS 'readyState' in event.target is true
796
PASS event.target.readyState is event.target.DONE
797
798
store = event.source
799
store.add({x: data}, dataAdded)
800
Success event fired:
801
PASS 'result' in event is true
802
PASS 'code' in event is false
803
PASS 'message' in event is false
804
PASS 'source' in event is true
805
PASS event.source != null is true
806
PASS 'onsuccess' in event.target is true
807
PASS 'onerror' in event.target is true
808
PASS 'readyState' in event.target is true
809
PASS event.target.readyState is event.target.DONE
810
811
store = event.source
812
store.add({x: data}, dataAdded)
813
Success event fired:
814
PASS 'result' in event is true
815
PASS 'code' in event is false
816
PASS 'message' in event is false
817
PASS 'source' in event is true
818
PASS event.source != null is true
819
PASS 'onsuccess' in event.target is true
820
PASS 'onerror' in event.target is true
821
PASS 'readyState' in event.target is true
822
PASS event.target.readyState is event.target.DONE
823
824
store = event.source
825
store.add({x: data}, dataAdded)
826
Success event fired:
827
PASS 'result' in event is true
828
PASS 'code' in event is false
829
PASS 'message' in event is false
830
PASS 'source' in event is true
831
PASS event.source != null is true
832
PASS 'onsuccess' in event.target is true
833
PASS 'onerror' in event.target is true
834
PASS 'readyState' in event.target is true
835
PASS event.target.readyState is event.target.DONE
836
837
store = event.source
838
store.add({x: data}, dataAdded)
839
Success event fired:
840
PASS 'result' in event is true
841
PASS 'code' in event is false
842
PASS 'message' in event is false
843
PASS 'source' in event is true
844
PASS event.source != null is true
845
PASS 'onsuccess' in event.target is true
846
PASS 'onerror' in event.target is true
847
PASS 'readyState' in event.target is true
848
PASS event.target.readyState is event.target.DONE
849
850
store = event.source
851
store.add({x: data}, dataAdded)
852
Success event fired:
853
PASS 'result' in event is true
854
PASS 'code' in event is false
855
PASS 'message' in event is false
856
PASS 'source' in event is true
857
PASS event.source != null is true
858
PASS 'onsuccess' in event.target is true
859
PASS 'onerror' in event.target is true
860
PASS 'readyState' in event.target is true
861
PASS event.target.readyState is event.target.DONE
862
863
store = event.source
864
store.add({x: data}, dataAdded)
865
Success event fired:
866
PASS 'result' in event is true
867
PASS 'code' in event is false
868
PASS 'message' in event is false
869
PASS 'source' in event is true
870
PASS event.source != null is true
871
PASS 'onsuccess' in event.target is true
872
PASS 'onerror' in event.target is true
873
PASS 'readyState' in event.target is true
874
PASS event.target.readyState is event.target.DONE
875
876
store = event.source
877
store.add({x: data}, dataAdded)
878
Success event fired:
879
PASS 'result' in event is true
880
PASS 'code' in event is false
881
PASS 'message' in event is false
882
PASS 'source' in event is true
883
PASS event.source != null is true
884
PASS 'onsuccess' in event.target is true
885
PASS 'onerror' in event.target is true
886
PASS 'readyState' in event.target is true
887
PASS event.target.readyState is event.target.DONE
888
889
store = event.source
890
store.add({x: data}, dataAdded)
891
Success event fired:
892
PASS 'result' in event is true
893
PASS 'code' in event is false
894
PASS 'message' in event is false
895
PASS 'source' in event is true
896
PASS event.source != null is true
897
PASS 'onsuccess' in event.target is true
898
PASS 'onerror' in event.target is true
899
PASS 'readyState' in event.target is true
900
PASS event.target.readyState is event.target.DONE
901
902
store = event.source
903
store.add({x: data}, dataAdded)
904
Success event fired:
905
PASS 'result' in event is true
906
PASS 'code' in event is false
907
PASS 'message' in event is false
908
PASS 'source' in event is true
909
PASS event.source != null is true
910
PASS 'onsuccess' in event.target is true
911
PASS 'onerror' in event.target is true
912
PASS 'readyState' in event.target is true
913
PASS event.target.readyState is event.target.DONE
914
915
store = event.source
916
store.add({x: data}, dataAdded)
917
Success event fired:
918
PASS 'result' in event is true
919
PASS 'code' in event is false
920
PASS 'message' in event is false
921
PASS 'source' in event is true
922
PASS event.source != null is true
923
PASS 'onsuccess' in event.target is true
924
PASS 'onerror' in event.target is true
925
PASS 'readyState' in event.target is true
926
PASS event.target.readyState is event.target.DONE
927
928
store = event.source
929
store.add({x: data}, dataAdded)
930
Success event fired:
931
PASS 'result' in event is true
932
PASS 'code' in event is false
933
PASS 'message' in event is false
934
PASS 'source' in event is true
935
PASS event.source != null is true
936
PASS 'onsuccess' in event.target is true
937
PASS 'onerror' in event.target is true
938
PASS 'readyState' in event.target is true
939
PASS event.target.readyState is event.target.DONE
940
941
store = event.source
942
store.add({x: data}, dataAdded)
943
Success event fired:
944
PASS 'result' in event is true
945
PASS 'code' in event is false
946
PASS 'message' in event is false
947
PASS 'source' in event is true
948
PASS event.source != null is true
949
PASS 'onsuccess' in event.target is true
950
PASS 'onerror' in event.target is true
951
PASS 'readyState' in event.target is true
952
PASS event.target.readyState is event.target.DONE
953
954
store = event.source
955
store.add({x: data}, dataAdded)
956
Success event fired:
957
PASS 'result' in event is true
958
PASS 'code' in event is false
959
PASS 'message' in event is false
960
PASS 'source' in event is true
961
PASS event.source != null is true
962
PASS 'onsuccess' in event.target is true
963
PASS 'onerror' in event.target is true
964
PASS 'readyState' in event.target is true
965
PASS event.target.readyState is event.target.DONE
966
967
store = event.source
968
store.add({x: data}, dataAdded)
969
Success event fired:
970
PASS 'result' in event is true
971
PASS 'code' in event is false
972
PASS 'message' in event is false
973
PASS 'source' in event is true
974
PASS event.source != null is true
975
PASS 'onsuccess' in event.target is true
976
PASS 'onerror' in event.target is true
977
PASS 'readyState' in event.target is true
978
PASS event.target.readyState is event.target.DONE
979
980
store = event.source
981
store.add({x: data}, dataAdded)
982
Success event fired:
983
PASS 'result' in event is true
984
PASS 'code' in event is false
985
PASS 'message' in event is false
986
PASS 'source' in event is true
987
PASS event.source != null is true
988
PASS 'onsuccess' in event.target is true
989
PASS 'onerror' in event.target is true
990
PASS 'readyState' in event.target is true
991
PASS event.target.readyState is event.target.DONE
992
993
store = event.source
994
store.add({x: data}, dataAdded)
995
Success event fired:
996
PASS 'result' in event is true
997
PASS 'code' in event is false
998
PASS 'message' in event is false
999
PASS 'source' in event is true
1000
PASS event.source != null is true
1001
PASS 'onsuccess' in event.target is true
1002
PASS 'onerror' in event.target is true
1003
PASS 'readyState' in event.target is true
1004
PASS event.target.readyState is event.target.DONE
1005
1006
store = event.source
1007
store.add({x: data}, dataAdded)
1008
Success event fired:
1009
PASS 'result' in event is true
1010
PASS 'code' in event is false
1011
PASS 'message' in event is false
1012
PASS 'source' in event is true
1013
PASS event.source != null is true
1014
PASS 'onsuccess' in event.target is true
1015
PASS 'onerror' in event.target is true
1016
PASS 'readyState' in event.target is true
1017
PASS event.target.readyState is event.target.DONE
1018
1019
store = event.source
1020
store.add({x: data}, dataAdded)
1021
Success event fired:
1022
PASS 'result' in event is true
1023
PASS 'code' in event is false
1024
PASS 'message' in event is false
1025
PASS 'source' in event is true
1026
PASS event.source != null is true
1027
PASS 'onsuccess' in event.target is true
1028
PASS 'onerror' in event.target is true
1029
PASS 'readyState' in event.target is true
1030
PASS event.target.readyState is event.target.DONE
1031
1032
store = event.source
1033
store.add({x: data}, dataAdded)
1034
Success event fired:
1035
PASS 'result' in event is true
1036
PASS 'code' in event is false
1037
PASS 'message' in event is false
1038
PASS 'source' in event is true
1039
PASS event.source != null is true
1040
PASS 'onsuccess' in event.target is true
1041
PASS 'onerror' in event.target is true
1042
PASS 'readyState' in event.target is true
1043
PASS event.target.readyState is event.target.DONE
1044
1045
store = event.source
1046
store.add({x: data}, dataAdded)
1047
Success event fired:
1048
PASS 'result' in event is true
1049
PASS 'code' in event is false
1050
PASS 'message' in event is false
1051
PASS 'source' in event is true
1052
PASS event.source != null is true
1053
PASS 'onsuccess' in event.target is true
1054
PASS 'onerror' in event.target is true
1055
PASS 'readyState' in event.target is true
1056
PASS event.target.readyState is event.target.DONE
1057
1058
store = event.source
1059
store.add({x: data}, dataAdded)
1060
Success event fired:
1061
PASS 'result' in event is true
1062
PASS 'code' in event is false
1063
PASS 'message' in event is false
1064
PASS 'source' in event is true
1065
PASS event.source != null is true
1066
PASS 'onsuccess' in event.target is true
1067
PASS 'onerror' in event.target is true
1068
PASS 'readyState' in event.target is true
1069
PASS event.target.readyState is event.target.DONE
1070
1071
store = event.source
1072
store.add({x: data}, dataAdded)
1073
Success event fired:
1074
PASS 'result' in event is true
1075
PASS 'code' in event is false
1076
PASS 'message' in event is false
1077
PASS 'source' in event is true
1078
PASS event.source != null is true
1079
PASS 'onsuccess' in event.target is true
1080
PASS 'onerror' in event.target is true
1081
PASS 'readyState' in event.target is true
1082
PASS event.target.readyState is event.target.DONE
1083
1084
store = event.source
1085
store.add({x: data}, dataAdded)
1086
Success event fired:
1087
PASS 'result' in event is true
1088
PASS 'code' in event is false
1089
PASS 'message' in event is false
1090
PASS 'source' in event is true
1091
PASS event.source != null is true
1092
PASS 'onsuccess' in event.target is true
1093
PASS 'onerror' in event.target is true
1094
PASS 'readyState' in event.target is true
1095
PASS event.target.readyState is event.target.DONE
1096
1097
store = event.source
1098
store.add({x: data}, dataAdded)
1099
Error function called: (0) Error writing data to stable storage.
1100
Error event fired:
1101
PASS 'result' in event is false
1102
PASS 'code' in event is true
1103
PASS 'message' in event is true
1104
PASS 'source' in event is true
1105
PASS event.source != null is true
1106
PASS 'onsuccess' in event.target is true
1107
PASS 'onerror' in event.target is true
1108
PASS 'readyState' in event.target is true
1109
PASS event.target.readyState is event.target.DONE
1110
1111
PASS Adding data failed due to quota error. Data added was: 5120 KB
1112
PASS successfullyParsed is true
1113
1114
TEST COMPLETE
1115
- a/LayoutTests/storage/indexeddb/database-quota.html +126 lines
Line 0 a/LayoutTests/storage/indexeddb/database-quota.html_sec1
1
<html>
2
<head>
3
<link rel="stylesheet" href="../../fast/js/resources/js-test-style.css">
4
<script src="../../fast/js/resources/js-test-pre.js"></script>
5
<script src="../../fast/js/resources/js-test-post-function.js"></script>
6
<script src="resources/shared.js"></script>
7
</head>
8
<body>
9
<p id="description"></p>
10
<div id="console"></div>
11
<script>
12
13
description("Tests IndexedDB's quota enforcing mechanism.");
14
if (window.layoutTestController) 
15
    layoutTestController.waitUntilDone();
16
17
function test()
18
{
19
    result = evalAndLog("indexedDB.open('name', 'description')");
20
    verifyResult(result);
21
    result.onsuccess = openSuccess;
22
    result.onerror = unexpectedErrorCallback;
23
}
24
25
function openSuccess()
26
{
27
    verifySuccessEvent(event);
28
    window.db = evalAndLog("db = event.result");
29
30
    result = evalAndLog("db.setVersion('new version')");
31
    verifyResult(result);
32
    result.onsuccess = setVersionSuccess;
33
    result.onerror = unexpectedErrorCallback;
34
}
35
36
function setVersionSuccess()
37
{
38
    debug("setVersionSuccess():");
39
    verifySuccessEvent(event);
40
    window.trans = evalAndLog("trans = event.result");
41
    shouldBeTrue("trans !== null");
42
    trans.onabort = unexpectedAbortCallback;
43
44
    deleteAllObjectStores(db, createNewObjectStore);
45
}
46
47
function createNewObjectStore()
48
{
49
    verifySuccessEvent(event);
50
    shouldBeEqualToString("db.version", "version b");
51
    shouldBeEqualToString("db.name", "name");
52
    shouldBe("db.objectStores", "[]");
53
    shouldBe("db.objectStores.length", "0");
54
    shouldBe("db.objectStores.contains('')", "false");
55
56
    objectStore = evalAndLog('db.createObjectStore("test123")');
57
    checkObjectStore();
58
    commitAndContinue();
59
}
60
61
function checkObjectStore()
62
{
63
    shouldBe("db.objectStores", "['test123']");
64
    shouldBe("db.objectStores.length", "1");
65
    shouldBe("db.objectStores.contains('')", "false");
66
    shouldBe("db.objectStores.contains('test456')", "false");
67
    shouldBe("db.objectStores.contains('test123')", "true");
68
}
69
70
function commitAndContinue()
71
{
72
    window.setTimeout(checkQuotaEnforcing, 0);
73
}
74
75
function checkQuotaEnforcing()
76
{
77
    var trans = evalAndLog("trans = db.transaction()");
78
    trans.onabort = testComplete;
79
    trans.oncomplete = unexpectedCompleteCallback;
80
    debug("Creating 'data' which contains 64K of data");
81
    window.data = "X";
82
    for (var i = 0; i < 16; i++)
83
        data += data;
84
    shouldBe("data.length", "65536");
85
    window.dataAdded = 0;
86
    window.store = evalAndLog("store = trans.objectStore('test123')");
87
    addData();
88
}
89
90
function addData()
91
{
92
    if (dataAdded < 5 * 1024 * 1024) {
93
        if (dataAdded > 0) {
94
            verifySuccessEvent(event);
95
            store = evalAndLog("store = event.source");
96
        }
97
    } else {
98
        testFailed("added more than quota");
99
        done();
100
        return;
101
    }
102
    dataAdded += 65536;
103
    result = evalAndLog("store.add({x: data}, dataAdded)");
104
    result.onsuccess = addData;
105
    result.onerror = logError;
106
}
107
108
function logError()
109
{
110
    debug("Error function called: (" + event.code + ") " + event.message);
111
    verifyErrorEvent(event);
112
}
113
114
function testComplete()
115
{
116
    testPassed("Adding data failed due to quota error. Data added was: " + dataAdded / 1024 + " KB");
117
    done();
118
}
119
120
test();
121
122
var successfullyParsed = true;
123
124
</script>
125
</body>
126
</html>
- a/WebCore/ChangeLog +39 lines
Lines 1-3 a/WebCore/ChangeLog_sec1
1
2010-10-08  Andrei Popescu  <andreip@google.com>
2
3
        Reviewed by NOBODY (OOPS!).
4
5
        IndexedDB does not have a quota mechanism.
6
        https://bugs.webkit.org/show_bug.cgi?id=47389
7
8
        Test: storage/indexeddb/database-quota.html
9
10
        Add a simple mechanism for enforcing a maximum size
11
        for each origin using IndexedDB. Note that this depends
12
        on having one SQLite database file per origin, which is
13
        addressed in a separate patch.
14
15
        * page/GroupSettings.cpp:
16
        (WebCore::GroupSettings::GroupSettings):
17
        (WebCore::GroupSettings::setIndexedDBQuotaBytes):
18
        * page/GroupSettings.h:
19
        (WebCore::GroupSettings::indexedDBQuotaBytes):
20
        * storage/IDBDatabaseBackendImpl.cpp:
21
        (WebCore::IDBDatabaseBackendImpl::createObjectStore):
22
        (WebCore::IDBDatabaseBackendImpl::createObjectStoreInternal):
23
        (WebCore::IDBDatabaseBackendImpl::removeObjectStore):
24
        (WebCore::IDBDatabaseBackendImpl::setVersionInternal):
25
        * storage/IDBFactory.cpp:
26
        (WebCore::IDBFactory::open):
27
        * storage/IDBFactoryBackendImpl.cpp:
28
        (WebCore::openSQLiteDatabase):
29
        (WebCore::IDBFactoryBackendImpl::open):
30
        * storage/IDBFactoryBackendImpl.h:
31
        * storage/IDBFactoryBackendInterface.h:
32
        * storage/IDBObjectStoreBackendImpl.cpp:
33
        (WebCore::putObjectStoreData):
34
        (WebCore::putIndexData):
35
        (WebCore::IDBObjectStoreBackendImpl::put):
36
        (WebCore::IDBObjectStoreBackendImpl::putInternal):
37
        (WebCore::IDBObjectStoreBackendImpl::createIndexInternal):
38
        * storage/IDBObjectStoreBackendImpl.h:
39
1
2010-10-08  Benjamin Poulain  <benjamin.poulain@nokia.com>
40
2010-10-08  Benjamin Poulain  <benjamin.poulain@nokia.com>
2
41
3
        Reviewed by Andreas Kling.
42
        Reviewed by Andreas Kling.
- a/WebCore/page/GroupSettings.cpp +7 lines
Lines 30-35 namespace WebCore { a/WebCore/page/GroupSettings.cpp_sec1
30
30
31
GroupSettings::GroupSettings()
31
GroupSettings::GroupSettings()
32
    : m_localStorageQuotaBytes(5 * 1024 * 1024) // Suggested by the HTML5 spec.
32
    : m_localStorageQuotaBytes(5 * 1024 * 1024) // Suggested by the HTML5 spec.
33
    , m_indexedDBQuotaBytes(5 * 1024 * 1024)
33
{
34
{
34
}
35
}
35
36
Lines 43-46 void GroupSettings::setIndexedDBDatabasePath(const String& path) a/WebCore/page/GroupSettings.cpp_sec2
43
    m_indexedDBDatabasePath = path;
44
    m_indexedDBDatabasePath = path;
44
}
45
}
45
46
47
void GroupSettings::setIndexedDBQuotaBytes(int64_t quota)
48
{
49
    m_indexedDBQuotaBytes = quota;
50
}
51
52
46
} // namespace WebCore
53
} // namespace WebCore
- a/WebCore/page/GroupSettings.h +4 lines
Lines 43-48 public: a/WebCore/page/GroupSettings.h_sec1
43
    void setLocalStorageQuotaBytes(unsigned);
43
    void setLocalStorageQuotaBytes(unsigned);
44
    unsigned localStorageQuotaBytes() const { return m_localStorageQuotaBytes; }
44
    unsigned localStorageQuotaBytes() const { return m_localStorageQuotaBytes; }
45
45
46
    void setIndexedDBQuotaBytes(int64_t);
47
    int64_t indexedDBQuotaBytes() const { return m_indexedDBQuotaBytes; }
48
46
    void setIndexedDBDatabasePath(const String&);
49
    void setIndexedDBDatabasePath(const String&);
47
    const String& indexedDBDatabasePath() const { return m_indexedDBDatabasePath; }
50
    const String& indexedDBDatabasePath() const { return m_indexedDBDatabasePath; }
48
51
Lines 51-56 private: a/WebCore/page/GroupSettings.h_sec2
51
54
52
    unsigned m_localStorageQuotaBytes;
55
    unsigned m_localStorageQuotaBytes;
53
    String m_indexedDBDatabasePath;
56
    String m_indexedDBDatabasePath;
57
    int64_t m_indexedDBQuotaBytes;
54
};
58
};
55
59
56
} // namespace WebCore
60
} // namespace WebCore
- a/WebCore/storage/IDBDatabaseBackendImpl.cpp -11 / +20 lines
Lines 127-133 PassRefPtr<DOMStringList> IDBDatabaseBackendImpl::objectStores() const a/WebCore/storage/IDBDatabaseBackendImpl.cpp_sec1
127
    return objectStoreNames.release();
127
    return objectStoreNames.release();
128
}
128
}
129
129
130
PassRefPtr<IDBObjectStoreBackendInterface>  IDBDatabaseBackendImpl::createObjectStore(const String& name, const String& keyPath, bool autoIncrement, IDBTransactionBackendInterface* transaction)
130
PassRefPtr<IDBObjectStoreBackendInterface>  IDBDatabaseBackendImpl::createObjectStore(const String& name, const String& keyPath, bool autoIncrement, IDBTransactionBackendInterface* transactionPtr)
131
{
131
{
132
    if (m_objectStores.contains(name)) {
132
    if (m_objectStores.contains(name)) {
133
        // FIXME: Throw CONSTRAINT_ERR in this case.
133
        // FIXME: Throw CONSTRAINT_ERR in this case.
Lines 138-145 PassRefPtr<IDBObjectStoreBackendInterface> IDBDatabaseBackendImpl::createObject a/WebCore/storage/IDBDatabaseBackendImpl.cpp_sec2
138
    ASSERT(objectStore->name() == name);
138
    ASSERT(objectStore->name() == name);
139
139
140
    RefPtr<IDBDatabaseBackendImpl> database = this;
140
    RefPtr<IDBDatabaseBackendImpl> database = this;
141
    RefPtr<IDBTransactionBackendInterface> transactionPtr = transaction;
141
    RefPtr<IDBTransactionBackendInterface> transaction = transactionPtr;
142
    if (!transaction->scheduleTask(createCallbackTask(&IDBDatabaseBackendImpl::createObjectStoreInternal, database, objectStore, transactionPtr),
142
    if (!transaction->scheduleTask(createCallbackTask(&IDBDatabaseBackendImpl::createObjectStoreInternal, database, objectStore, transaction),
143
                                   createCallbackTask(&IDBDatabaseBackendImpl::removeObjectStoreFromMap, database, objectStore))) {
143
                                   createCallbackTask(&IDBDatabaseBackendImpl::removeObjectStoreFromMap, database, objectStore))) {
144
        return 0;
144
        return 0;
145
    }
145
    }
Lines 151-163 PassRefPtr<IDBObjectStoreBackendInterface> IDBDatabaseBackendImpl::createObject a/WebCore/storage/IDBDatabaseBackendImpl.cpp_sec3
151
void IDBDatabaseBackendImpl::createObjectStoreInternal(ScriptExecutionContext*, PassRefPtr<IDBDatabaseBackendImpl> database, PassRefPtr<IDBObjectStoreBackendImpl> objectStore,  PassRefPtr<IDBTransactionBackendInterface> transaction)
151
void IDBDatabaseBackendImpl::createObjectStoreInternal(ScriptExecutionContext*, PassRefPtr<IDBDatabaseBackendImpl> database, PassRefPtr<IDBObjectStoreBackendImpl> objectStore,  PassRefPtr<IDBTransactionBackendInterface> transaction)
152
{
152
{
153
    SQLiteStatement insert(database->sqliteDatabase(), "INSERT INTO ObjectStores (name, keyPath, doAutoIncrement) VALUES (?, ?, ?)");
153
    SQLiteStatement insert(database->sqliteDatabase(), "INSERT INTO ObjectStores (name, keyPath, doAutoIncrement) VALUES (?, ?, ?)");
154
    bool ok = insert.prepare() == SQLResultOk;
154
    if (insert.prepare() != SQLResultOk) {
155
    ASSERT_UNUSED(ok, ok); // FIXME: Better error handling.
155
        transaction->abort();
156
        return;
157
    }
156
    insert.bindText(1, objectStore->name());
158
    insert.bindText(1, objectStore->name());
157
    insert.bindText(2, objectStore->keyPath());
159
    insert.bindText(2, objectStore->keyPath());
158
    insert.bindInt(3, static_cast<int>(objectStore->autoIncrement()));
160
    insert.bindInt(3, static_cast<int>(objectStore->autoIncrement()));
159
    ok = insert.step() == SQLResultDone;
161
    if (insert.step() != SQLResultDone) {
160
    ASSERT_UNUSED(ok, ok); // FIXME: Better error handling.
162
        transaction->abort();
163
        return;
164
    }
161
    int64_t id = database->sqliteDatabase().lastInsertRowID();
165
    int64_t id = database->sqliteDatabase().lastInsertRowID();
162
    objectStore->setId(id);
166
    objectStore->setId(id);
163
    transaction->didCompleteTaskEvents();
167
    transaction->didCompleteTaskEvents();
Lines 181-187 static void doDelete(SQLiteDatabase& db, const char* sql, int64_t id) a/WebCore/storage/IDBDatabaseBackendImpl.cpp_sec4
181
    ASSERT_UNUSED(ok, ok); // FIXME: Better error handling.
185
    ASSERT_UNUSED(ok, ok); // FIXME: Better error handling.
182
}
186
}
183
187
184
void IDBDatabaseBackendImpl::removeObjectStore(const String& name, IDBTransactionBackendInterface* transaction)
188
void IDBDatabaseBackendImpl::removeObjectStore(const String& name, IDBTransactionBackendInterface* transactionPtr)
185
{
189
{
186
    RefPtr<IDBObjectStoreBackendImpl> objectStore = m_objectStores.get(name);
190
    RefPtr<IDBObjectStoreBackendImpl> objectStore = m_objectStores.get(name);
187
    if (!objectStore) {
191
    if (!objectStore) {
Lines 189-196 void IDBDatabaseBackendImpl::removeObjectStore(const String& name, IDBTransactio a/WebCore/storage/IDBDatabaseBackendImpl.cpp_sec5
189
        return;
193
        return;
190
    }
194
    }
191
    RefPtr<IDBDatabaseBackendImpl> database = this;
195
    RefPtr<IDBDatabaseBackendImpl> database = this;
192
    RefPtr<IDBTransactionBackendInterface> transactionPtr = transaction;
196
    RefPtr<IDBTransactionBackendInterface> transaction = transactionPtr;
193
    if (!transaction->scheduleTask(createCallbackTask(&IDBDatabaseBackendImpl::removeObjectStoreInternal, database, objectStore, transactionPtr),
197
    if (!transaction->scheduleTask(createCallbackTask(&IDBDatabaseBackendImpl::removeObjectStoreInternal, database, objectStore, transaction),
194
                                   createCallbackTask(&IDBDatabaseBackendImpl::addObjectStoreToMap, database, objectStore))) {
198
                                   createCallbackTask(&IDBDatabaseBackendImpl::addObjectStoreToMap, database, objectStore))) {
195
        // FIXME: Raise NOT_ALLOWED_ERR if the above fails.
199
        // FIXME: Raise NOT_ALLOWED_ERR if the above fails.
196
        return;
200
        return;
Lines 223-229 void IDBDatabaseBackendImpl::setVersion(const String& version, PassRefPtr<IDBCal a/WebCore/storage/IDBDatabaseBackendImpl.cpp_sec6
223
void IDBDatabaseBackendImpl::setVersionInternal(ScriptExecutionContext*, PassRefPtr<IDBDatabaseBackendImpl> database, const String& version, PassRefPtr<IDBCallbacks> callbacks, PassRefPtr<IDBTransactionBackendInterface> transaction)
227
void IDBDatabaseBackendImpl::setVersionInternal(ScriptExecutionContext*, PassRefPtr<IDBDatabaseBackendImpl> database, const String& version, PassRefPtr<IDBCallbacks> callbacks, PassRefPtr<IDBTransactionBackendInterface> transaction)
224
{
228
{
225
    database->m_version = version;
229
    database->m_version = version;
226
    setMetaData(database->m_sqliteDatabase.get(), database->m_name, database->m_description, database->m_version);
230
    if (!setMetaData(database->m_sqliteDatabase.get(), database->m_name, database->m_description, database->m_version)) {
231
        // FIXME: The Indexed Database specification does not have an error code dedicated to I/O errors.
232
        callbacks->onError(IDBDatabaseError::create(IDBDatabaseException::UNKNOWN_ERR, "Error writing data to stable storage."));
233
        transaction->abort();
234
        return;
235
    }
227
    callbacks->onSuccess(transaction);
236
    callbacks->onSuccess(transaction);
228
}
237
}
229
238
- a/WebCore/storage/IDBFactory.cpp -1 / +2 lines
Lines 68-74 PassRefPtr<IDBRequest> IDBFactory::open(ScriptExecutionContext* context, const S a/WebCore/storage/IDBFactory.cpp_sec1
68
        return 0;
68
        return 0;
69
69
70
    RefPtr<IDBRequest> request = IDBRequest::create(document, IDBAny::create(this), 0);
70
    RefPtr<IDBRequest> request = IDBRequest::create(document, IDBAny::create(this), 0);
71
    m_factoryBackend->open(name, description, request, document->securityOrigin(), document->frame(), document->page()->group().groupSettings()->indexedDBDatabasePath());
71
    GroupSettings* groupSettings = document->page()->group().groupSettings();
72
    m_factoryBackend->open(name, description, request, document->securityOrigin(), document->frame(), groupSettings->indexedDBDatabasePath(), groupSettings->indexedDBQuotaBytes());
72
    return request;
73
    return request;
73
}
74
}
74
75
- a/WebCore/storage/IDBFactoryBackendImpl.cpp -3 / +4 lines
Lines 52-58 IDBFactoryBackendImpl::~IDBFactoryBackendImpl() a/WebCore/storage/IDBFactoryBackendImpl.cpp_sec1
52
{
52
{
53
}
53
}
54
54
55
static PassOwnPtr<SQLiteDatabase> openSQLiteDatabase(SecurityOrigin* securityOrigin, String name, const String& pathBase)
55
static PassOwnPtr<SQLiteDatabase> openSQLiteDatabase(SecurityOrigin* securityOrigin, String name, const String& pathBase, int64_t maximumSize)
56
{
56
{
57
    String path = ":memory:";
57
    String path = ":memory:";
58
    if (!pathBase.isEmpty()) {
58
    if (!pathBase.isEmpty()) {
Lines 72-77 static PassOwnPtr<SQLiteDatabase> openSQLiteDatabase(SecurityOrigin* securityOri a/WebCore/storage/IDBFactoryBackendImpl.cpp_sec2
72
        return 0;
72
        return 0;
73
    }
73
    }
74
74
75
    sqliteDatabase->setMaximumSize(maximumSize);
75
    return sqliteDatabase.release();
76
    return sqliteDatabase.release();
76
}
77
}
77
78
Lines 117-123 static bool createTables(SQLiteDatabase* sqliteDatabase) a/WebCore/storage/IDBFactoryBackendImpl.cpp_sec3
117
    return true;
118
    return true;
118
}
119
}
119
120
120
void IDBFactoryBackendImpl::open(const String& name, const String& description, PassRefPtr<IDBCallbacks> callbacks, PassRefPtr<SecurityOrigin> securityOrigin, Frame*, const String& dataDir)
121
void IDBFactoryBackendImpl::open(const String& name, const String& description, PassRefPtr<IDBCallbacks> callbacks, PassRefPtr<SecurityOrigin> securityOrigin, Frame*, const String& dataDir, int64_t maximumSize)
121
{
122
{
122
    IDBDatabaseBackendMap::iterator it = m_databaseBackendMap.find(name);
123
    IDBDatabaseBackendMap::iterator it = m_databaseBackendMap.find(name);
123
    if (it != m_databaseBackendMap.end()) {
124
    if (it != m_databaseBackendMap.end()) {
Lines 129-135 void IDBFactoryBackendImpl::open(const String& name, const String& description, a/WebCore/storage/IDBFactoryBackendImpl.cpp_sec4
129
130
130
    // FIXME: Everything from now on should be done on another thread.
131
    // FIXME: Everything from now on should be done on another thread.
131
132
132
    OwnPtr<SQLiteDatabase> sqliteDatabase = openSQLiteDatabase(securityOrigin.get(), name, dataDir);
133
    OwnPtr<SQLiteDatabase> sqliteDatabase = openSQLiteDatabase(securityOrigin.get(), name, dataDir, maximumSize);
133
    if (!sqliteDatabase || !createTables(sqliteDatabase.get())) {
134
    if (!sqliteDatabase || !createTables(sqliteDatabase.get())) {
134
        callbacks->onError(IDBDatabaseError::create(IDBDatabaseException::UNKNOWN_ERR, "Internal error."));
135
        callbacks->onError(IDBDatabaseError::create(IDBDatabaseException::UNKNOWN_ERR, "Internal error."));
135
        return;
136
        return;
- a/WebCore/storage/IDBFactoryBackendImpl.h -1 / +1 lines
Lines 49-55 public: a/WebCore/storage/IDBFactoryBackendImpl.h_sec1
49
    }
49
    }
50
    virtual ~IDBFactoryBackendImpl();
50
    virtual ~IDBFactoryBackendImpl();
51
51
52
    virtual void open(const String& name, const String& description, PassRefPtr<IDBCallbacks>, PassRefPtr<SecurityOrigin>, Frame*, const String& dataDir);
52
    virtual void open(const String& name, const String& description, PassRefPtr<IDBCallbacks>, PassRefPtr<SecurityOrigin>, Frame*, const String& dataDir, int64_t maximumSize);
53
53
54
    static String databaseFileName(const String& name, SecurityOrigin*);
54
    static String databaseFileName(const String& name, SecurityOrigin*);
55
55
- a/WebCore/storage/IDBFactoryBackendInterface.h -1 / +1 lines
Lines 51-57 public: a/WebCore/storage/IDBFactoryBackendInterface.h_sec1
51
    static PassRefPtr<IDBFactoryBackendInterface> create();
51
    static PassRefPtr<IDBFactoryBackendInterface> create();
52
    virtual ~IDBFactoryBackendInterface() { }
52
    virtual ~IDBFactoryBackendInterface() { }
53
53
54
    virtual void open(const String& name, const String& description, PassRefPtr<IDBCallbacks>, PassRefPtr<SecurityOrigin>, Frame*, const String& dataDir) = 0;
54
    virtual void open(const String& name, const String& description, PassRefPtr<IDBCallbacks>, PassRefPtr<SecurityOrigin>, Frame*, const String& dataDir, int64_t maximumSize) = 0;
55
};
55
};
56
56
57
} // namespace WebCore
57
} // namespace WebCore
- a/WebCore/storage/IDBObjectStoreBackendImpl.cpp -25 / +42 lines
Lines 131-143 static PassRefPtr<IDBKey> fetchKeyFromKeyPath(SerializedScriptValue* value, cons a/WebCore/storage/IDBObjectStoreBackendImpl.cpp_sec1
131
    return keys[0].release();
131
    return keys[0].release();
132
}
132
}
133
133
134
static void putObjectStoreData(SQLiteDatabase& db, IDBKey* key, SerializedScriptValue* value, int64_t objectStoreId, int64_t* dataRowId)
134
static bool putObjectStoreData(SQLiteDatabase& db, IDBKey* key, SerializedScriptValue* value, int64_t objectStoreId, int64_t* dataRowId)
135
{
135
{
136
    String sql = *dataRowId != -1 ? "UPDATE ObjectStoreData SET keyString = ?, keyDate = ?, keyNumber = ?, value = ? WHERE id = ?"
136
    String sql = *dataRowId != -1 ? "UPDATE ObjectStoreData SET keyString = ?, keyDate = ?, keyNumber = ?, value = ? WHERE id = ?"
137
                                  : "INSERT INTO ObjectStoreData (keyString, keyDate, keyNumber, value, objectStoreId) VALUES (?, ?, ?, ?, ?)";
137
                                  : "INSERT INTO ObjectStoreData (keyString, keyDate, keyNumber, value, objectStoreId) VALUES (?, ?, ?, ?, ?)";
138
    SQLiteStatement query(db, sql);
138
    SQLiteStatement query(db, sql);
139
    bool ok = query.prepare() == SQLResultOk;
139
    if (query.prepare() != SQLResultOk)
140
    ASSERT_UNUSED(ok, ok); // FIXME: Better error handling?
140
        return false;
141
    key->bindWithNulls(query, 1);
141
    key->bindWithNulls(query, 1);
142
    query.bindText(4, value->toWireString());
142
    query.bindText(4, value->toWireString());
143
    if (*dataRowId != -1)
143
    if (*dataRowId != -1)
Lines 145-188 static void putObjectStoreData(SQLiteDatabase& db, IDBKey* key, SerializedScript a/WebCore/storage/IDBObjectStoreBackendImpl.cpp_sec2
145
    else
145
    else
146
        query.bindInt64(5, objectStoreId);
146
        query.bindInt64(5, objectStoreId);
147
147
148
    ok = query.step() == SQLResultDone;
148
    if (query.step() != SQLResultDone)
149
    ASSERT_UNUSED(ok, ok); // FIXME: Better error handling?
149
        return false;
150
150
151
    if (*dataRowId == -1)
151
    if (*dataRowId == -1)
152
        *dataRowId = db.lastInsertRowID();
152
        *dataRowId = db.lastInsertRowID();
153
154
    return true;
153
}
155
}
154
156
155
static void putIndexData(SQLiteDatabase& db, IDBKey* key, int64_t indexId, int64_t objectStoreDataId)
157
static int putIndexData(SQLiteDatabase& db, IDBKey* key, int64_t indexId, int64_t objectStoreDataId)
156
{
158
{
157
    SQLiteStatement deleteQuery(db, "DELETE FROM IndexData WHERE objectStoreDataId = ?");
159
    SQLiteStatement deleteQuery(db, "DELETE FROM IndexData WHERE objectStoreDataId = ?");
158
    bool ok = deleteQuery.prepare() == SQLResultOk;
160
    if (deleteQuery.prepare() != SQLResultOk)
159
    ASSERT_UNUSED(ok, ok); // FIXME: Better error handling.
161
        return false;
160
    deleteQuery.bindInt64(1, objectStoreDataId);
162
    deleteQuery.bindInt64(1, objectStoreDataId);
161
    ok = deleteQuery.step() == SQLResultDone;
163
    if (deleteQuery.step() != SQLResultDone)
162
    ASSERT_UNUSED(ok, ok); // FIXME: Better error handling.
164
        return false;
163
165
164
    SQLiteStatement putQuery(db, "INSERT INTO IndexData (keyString, keyDate, keyNumber, indexId, objectStoreDataId) VALUES (?, ?, ?, ?, ?)");
166
    SQLiteStatement putQuery(db, "INSERT INTO IndexData (keyString, keyDate, keyNumber, indexId, objectStoreDataId) VALUES (?, ?, ?, ?, ?)");
165
    ok = putQuery.prepare() == SQLResultOk;
167
    if (putQuery.prepare() != SQLResultOk)
166
    ASSERT_UNUSED(ok, ok); // FIXME: Better error handling?
168
        return false;
167
    key->bindWithNulls(putQuery, 1);
169
    key->bindWithNulls(putQuery, 1);
168
    putQuery.bindInt64(4, indexId);
170
    putQuery.bindInt64(4, indexId);
169
    putQuery.bindInt64(5, objectStoreDataId);
171
    putQuery.bindInt64(5, objectStoreDataId);
170
172
171
    ok = putQuery.step() == SQLResultDone;
173
    return putQuery.step() == SQLResultDone;
172
    ASSERT_UNUSED(ok, ok); // FIXME: Better error handling?
173
}
174
}
174
175
175
void IDBObjectStoreBackendImpl::put(PassRefPtr<SerializedScriptValue> prpValue, PassRefPtr<IDBKey> prpKey, bool addOnly, PassRefPtr<IDBCallbacks> prpCallbacks, IDBTransactionBackendInterface* transaction)
176
void IDBObjectStoreBackendImpl::put(PassRefPtr<SerializedScriptValue> prpValue, PassRefPtr<IDBKey> prpKey, bool addOnly, PassRefPtr<IDBCallbacks> prpCallbacks, IDBTransactionBackendInterface* transactionPtr)
176
{
177
{
177
    RefPtr<IDBObjectStoreBackendImpl> objectStore = this;
178
    RefPtr<IDBObjectStoreBackendImpl> objectStore = this;
178
    RefPtr<SerializedScriptValue> value = prpValue;
179
    RefPtr<SerializedScriptValue> value = prpValue;
179
    RefPtr<IDBKey> key = prpKey;
180
    RefPtr<IDBKey> key = prpKey;
180
    RefPtr<IDBCallbacks> callbacks = prpCallbacks;
181
    RefPtr<IDBCallbacks> callbacks = prpCallbacks;
181
    if (!transaction->scheduleTask(createCallbackTask(&IDBObjectStoreBackendImpl::putInternal, objectStore, value, key, addOnly, callbacks)))
182
    RefPtr<IDBTransactionBackendInterface> transaction = transactionPtr;
183
    if (!transaction->scheduleTask(createCallbackTask(&IDBObjectStoreBackendImpl::putInternal, objectStore, value, key, addOnly, callbacks, transaction)))
182
        callbacks->onError(IDBDatabaseError::create(IDBDatabaseException::NOT_ALLOWED_ERR, "put must be called in the context of a transaction."));
184
        callbacks->onError(IDBDatabaseError::create(IDBDatabaseException::NOT_ALLOWED_ERR, "put must be called in the context of a transaction."));
183
}
185
}
184
186
185
void IDBObjectStoreBackendImpl::putInternal(ScriptExecutionContext*, PassRefPtr<IDBObjectStoreBackendImpl> objectStore, PassRefPtr<SerializedScriptValue> prpValue, PassRefPtr<IDBKey> prpKey, bool addOnly, PassRefPtr<IDBCallbacks> callbacks)
187
void IDBObjectStoreBackendImpl::putInternal(ScriptExecutionContext*, PassRefPtr<IDBObjectStoreBackendImpl> objectStore, PassRefPtr<SerializedScriptValue> prpValue, PassRefPtr<IDBKey> prpKey, bool addOnly, PassRefPtr<IDBCallbacks> callbacks, PassRefPtr<IDBTransactionBackendInterface> transaction)
186
{
188
{
187
    RefPtr<SerializedScriptValue> value = prpValue;
189
    RefPtr<SerializedScriptValue> value = prpValue;
188
    RefPtr<IDBKey> key = prpKey;
190
    RefPtr<IDBKey> key = prpKey;
Lines 227-240 void IDBObjectStoreBackendImpl::putInternal(ScriptExecutionContext*, PassRefPtr< a/WebCore/storage/IDBObjectStoreBackendImpl.cpp_sec3
227
        return;
229
        return;
228
    }
230
    }
229
231
230
    // Before this point, don't do any mutation.  After this point, don't error out.
232
    // Before this point, don't do any mutation.  After this point, rollback the transaction in case of error.
231
233
232
    int64_t dataRowId = isExistingValue ? getQuery.getColumnInt(0) : -1;
234
    int64_t dataRowId = isExistingValue ? getQuery.getColumnInt(0) : -1;
233
    putObjectStoreData(objectStore->sqliteDatabase(), key.get(), value.get(), objectStore->id(), &dataRowId);
235
    if (!putObjectStoreData(objectStore->sqliteDatabase(), key.get(), value.get(), objectStore->id(), &dataRowId)) {
236
        // FIXME: The Indexed Database specification does not have an error code dedicated to I/O errors.
237
        callbacks->onError(IDBDatabaseError::create(IDBDatabaseException::UNKNOWN_ERR, "Error writing data to stable storage."));
238
        transaction->abort();
239
        return;
240
    }
234
241
235
    int i = 0;
242
    int i = 0;
236
    for (IndexMap::iterator it = objectStore->m_indexes.begin(); it != objectStore->m_indexes.end(); ++it, ++i)
243
    for (IndexMap::iterator it = objectStore->m_indexes.begin(); it != objectStore->m_indexes.end(); ++it, ++i) {
237
        putIndexData(objectStore->sqliteDatabase(), indexKeys[i].get(), it->second->id(), dataRowId);
244
        if (!putIndexData(objectStore->sqliteDatabase(), indexKeys[i].get(), it->second->id(), dataRowId)) {
245
            // FIXME: The Indexed Database specification does not have an error code dedicated to I/O errors.
246
            callbacks->onError(IDBDatabaseError::create(IDBDatabaseException::UNKNOWN_ERR, "Error writing data to stable storage."));
247
            transaction->abort();
248
            return;
249
        }
250
    }
238
251
239
    callbacks->onSuccess(key.get());
252
    callbacks->onSuccess(key.get());
240
}
253
}
Lines 287-300 PassRefPtr<IDBIndexBackendInterface> IDBObjectStoreBackendImpl::createIndex(cons a/WebCore/storage/IDBObjectStoreBackendImpl.cpp_sec4
287
void IDBObjectStoreBackendImpl::createIndexInternal(ScriptExecutionContext*, PassRefPtr<IDBObjectStoreBackendImpl> objectStore, PassRefPtr<IDBIndexBackendImpl> index, PassRefPtr<IDBTransactionBackendInterface> transaction)
300
void IDBObjectStoreBackendImpl::createIndexInternal(ScriptExecutionContext*, PassRefPtr<IDBObjectStoreBackendImpl> objectStore, PassRefPtr<IDBIndexBackendImpl> index, PassRefPtr<IDBTransactionBackendInterface> transaction)
288
{
301
{
289
    SQLiteStatement insert(objectStore->sqliteDatabase(), "INSERT INTO Indexes (objectStoreId, name, keyPath, isUnique) VALUES (?, ?, ?, ?)");
302
    SQLiteStatement insert(objectStore->sqliteDatabase(), "INSERT INTO Indexes (objectStoreId, name, keyPath, isUnique) VALUES (?, ?, ?, ?)");
290
    bool ok = insert.prepare() == SQLResultOk;
303
    if (!insert.prepare()) {
291
    ASSERT_UNUSED(ok, ok); // FIXME: Better error handling.
304
        transaction->abort();
305
        return;
306
    }
292
    insert.bindInt64(1, objectStore->m_id);
307
    insert.bindInt64(1, objectStore->m_id);
293
    insert.bindText(2, index->name());
308
    insert.bindText(2, index->name());
294
    insert.bindText(3, index->keyPath());
309
    insert.bindText(3, index->keyPath());
295
    insert.bindInt(4, static_cast<int>(index->unique()));
310
    insert.bindInt(4, static_cast<int>(index->unique()));
296
    ok = insert.step() == SQLResultDone;
311
    if (!insert.step()) {
297
    ASSERT_UNUSED(ok, ok); // FIXME: Better error handling.
312
        transaction->abort();
313
        return;
314
    }
298
    int64_t id = objectStore->sqliteDatabase().lastInsertRowID();
315
    int64_t id = objectStore->sqliteDatabase().lastInsertRowID();
299
    index->setId(id);
316
    index->setId(id);
300
    transaction->didCompleteTaskEvents();
317
    transaction->didCompleteTaskEvents();
- a/WebCore/storage/IDBObjectStoreBackendImpl.h -1 / +1 lines
Lines 83-89 private: a/WebCore/storage/IDBObjectStoreBackendImpl.h_sec1
83
    SQLiteDatabase& sqliteDatabase() const;
83
    SQLiteDatabase& sqliteDatabase() const;
84
84
85
    static void getInternal(ScriptExecutionContext*, PassRefPtr<IDBObjectStoreBackendImpl>, PassRefPtr<IDBKey> key, PassRefPtr<IDBCallbacks>);
85
    static void getInternal(ScriptExecutionContext*, PassRefPtr<IDBObjectStoreBackendImpl>, PassRefPtr<IDBKey> key, PassRefPtr<IDBCallbacks>);
86
    static void putInternal(ScriptExecutionContext*, PassRefPtr<IDBObjectStoreBackendImpl>, PassRefPtr<SerializedScriptValue> value, PassRefPtr<IDBKey> key, bool addOnly, PassRefPtr<IDBCallbacks>);
86
    static void putInternal(ScriptExecutionContext*, PassRefPtr<IDBObjectStoreBackendImpl>, PassRefPtr<SerializedScriptValue> value, PassRefPtr<IDBKey> key, bool addOnly, PassRefPtr<IDBCallbacks>, PassRefPtr<IDBTransactionBackendInterface> transaction);
87
    static void removeInternal(ScriptExecutionContext*, PassRefPtr<IDBObjectStoreBackendImpl>, PassRefPtr<IDBKey> key, PassRefPtr<IDBCallbacks>);
87
    static void removeInternal(ScriptExecutionContext*, PassRefPtr<IDBObjectStoreBackendImpl>, PassRefPtr<IDBKey> key, PassRefPtr<IDBCallbacks>);
88
    static void createIndexInternal(ScriptExecutionContext*, PassRefPtr<IDBObjectStoreBackendImpl>, PassRefPtr<IDBIndexBackendImpl>, PassRefPtr<IDBTransactionBackendInterface>);
88
    static void createIndexInternal(ScriptExecutionContext*, PassRefPtr<IDBObjectStoreBackendImpl>, PassRefPtr<IDBIndexBackendImpl>, PassRefPtr<IDBTransactionBackendInterface>);
89
    static void removeIndexInternal(ScriptExecutionContext*, PassRefPtr<IDBObjectStoreBackendImpl>, PassRefPtr<IDBIndexBackendImpl>, PassRefPtr<IDBTransactionBackendInterface>);
89
    static void removeIndexInternal(ScriptExecutionContext*, PassRefPtr<IDBObjectStoreBackendImpl>, PassRefPtr<IDBIndexBackendImpl>, PassRefPtr<IDBTransactionBackendInterface>);
- a/WebKit/chromium/ChangeLog +16 lines
Lines 1-3 a/WebKit/chromium/ChangeLog_sec1
1
2010-10-08  Andrei Popescu  <andreip@google.com>
2
3
        Reviewed by NOBODY (OOPS!).
4
5
        IndexedDB does not have a quota mechanism.
6
        https://bugs.webkit.org/show_bug.cgi?id=47389
7
8
        * public/WebIDBFactory.h:
9
        (WebKit::WebIDBFactory::open):
10
        * src/IDBFactoryBackendProxy.cpp:
11
        (WebCore::IDBFactoryBackendProxy::open):
12
        * src/IDBFactoryBackendProxy.h:
13
        * src/WebIDBFactoryImpl.cpp:
14
        (WebKit::WebIDBFactoryImpl::open):
15
        * src/WebIDBFactoryImpl.h:
16
1
2010-10-07  Zhenyao Mo  <zmo@google.com>
17
2010-10-07  Zhenyao Mo  <zmo@google.com>
2
18
3
        Unreviewed, roll chromium to r61902.
19
        Unreviewed, roll chromium to r61902.
- a/WebKit/chromium/public/WebIDBFactory.h +2 lines
Lines 52-57 public: a/WebKit/chromium/public/WebIDBFactory.h_sec1
52
    virtual ~WebIDBFactory() { }
52
    virtual ~WebIDBFactory() { }
53
53
54
    // The WebKit implementation of open ignores the WebFrame* parameter.
54
    // The WebKit implementation of open ignores the WebFrame* parameter.
55
    virtual void open(const WebString& name, const WebString& description, WebIDBCallbacks* callbacks, const WebSecurityOrigin& origin, WebFrame* webFrame, const WebString& dataDir, unsigned long long maximumSize) { WEBKIT_ASSERT_NOT_REACHED(); }
56
    // FIXME: Remove once we update Chromium side.
55
    virtual void open(const WebString& name, const WebString& description, WebIDBCallbacks* callbacks, const WebSecurityOrigin& origin, WebFrame* webFrame, const WebString& dataDir) { WEBKIT_ASSERT_NOT_REACHED(); }
57
    virtual void open(const WebString& name, const WebString& description, WebIDBCallbacks* callbacks, const WebSecurityOrigin& origin, WebFrame* webFrame, const WebString& dataDir) { WEBKIT_ASSERT_NOT_REACHED(); }
56
58
57
    // The file name that would be used for persisting a given indexed database on the file system.
59
    // The file name that would be used for persisting a given indexed database on the file system.
- a/WebKit/chromium/src/IDBFactoryBackendProxy.cpp -2 / +2 lines
Lines 59-68 IDBFactoryBackendProxy::~IDBFactoryBackendProxy() a/WebKit/chromium/src/IDBFactoryBackendProxy.cpp_sec1
59
{
59
{
60
}
60
}
61
61
62
void IDBFactoryBackendProxy::open(const String& name, const String& description, PassRefPtr<IDBCallbacks> callbacks, PassRefPtr<SecurityOrigin> origin, Frame* frame, const String& dataDir)
62
void IDBFactoryBackendProxy::open(const String& name, const String& description, PassRefPtr<IDBCallbacks> callbacks, PassRefPtr<SecurityOrigin> origin, Frame* frame, const String& dataDir, int64_t maximumSize)
63
{
63
{
64
    WebKit::WebFrame* webFrame = WebKit::WebFrameImpl::fromFrame(frame);
64
    WebKit::WebFrame* webFrame = WebKit::WebFrameImpl::fromFrame(frame);
65
    m_webIDBFactory->open(name, description, new WebIDBCallbacksImpl(callbacks), origin, webFrame, dataDir);
65
    m_webIDBFactory->open(name, description, new WebIDBCallbacksImpl(callbacks), origin, webFrame, dataDir, maximumSize);
66
}
66
}
67
67
68
} // namespace WebCore
68
} // namespace WebCore
- a/WebKit/chromium/src/IDBFactoryBackendProxy.h -1 / +1 lines
Lines 45-51 public: a/WebKit/chromium/src/IDBFactoryBackendProxy.h_sec1
45
    virtual ~IDBFactoryBackendProxy();
45
    virtual ~IDBFactoryBackendProxy();
46
46
47
    PassRefPtr<DOMStringList> databases(void) const;
47
    PassRefPtr<DOMStringList> databases(void) const;
48
    virtual void open(const String& name, const String& description, PassRefPtr<IDBCallbacks>, PassRefPtr<SecurityOrigin>, Frame*, const String& dataDir);
48
    virtual void open(const String& name, const String& description, PassRefPtr<IDBCallbacks>, PassRefPtr<SecurityOrigin>, Frame*, const String& dataDir, int64_t maximumSize);
49
49
50
private:
50
private:
51
    IDBFactoryBackendProxy();
51
    IDBFactoryBackendProxy();
- a/WebKit/chromium/src/WebIDBFactoryImpl.cpp -2 / +2 lines
Lines 58-66 WebIDBFactoryImpl::~WebIDBFactoryImpl() a/WebKit/chromium/src/WebIDBFactoryImpl.cpp_sec1
58
{
58
{
59
}
59
}
60
60
61
void WebIDBFactoryImpl::open(const WebString& name, const WebString& description, WebIDBCallbacks* callbacks, const WebSecurityOrigin& origin, WebFrame*, const WebString& dataDir)
61
void WebIDBFactoryImpl::open(const WebString& name, const WebString& description, WebIDBCallbacks* callbacks, const WebSecurityOrigin& origin, WebFrame*, const WebString& dataDir, unsigned long long maximumSize)
62
{
62
{
63
    m_idbFactoryBackend->open(name, description, IDBCallbacksProxy::create(callbacks), origin, 0, dataDir);
63
    m_idbFactoryBackend->open(name, description, IDBCallbacksProxy::create(callbacks), origin, 0, dataDir, maximumSize);
64
}
64
}
65
65
66
} // namespace WebKit
66
} // namespace WebKit
- a/WebKit/chromium/src/WebIDBFactoryImpl.h -1 / +1 lines
Lines 42-48 public: a/WebKit/chromium/src/WebIDBFactoryImpl.h_sec1
42
    WebIDBFactoryImpl();
42
    WebIDBFactoryImpl();
43
    virtual ~WebIDBFactoryImpl();
43
    virtual ~WebIDBFactoryImpl();
44
44
45
    virtual void open(const WebString& name, const WebString& description, WebIDBCallbacks*, const WebSecurityOrigin&, WebFrame*, const WebString& dataDir);
45
    virtual void open(const WebString& name, const WebString& description, WebIDBCallbacks*, const WebSecurityOrigin&, WebFrame*, const WebString& dataDir, unsigned long long maximumSize);
46
46
47
private:
47
private:
48
    WTF::RefPtr<WebCore::IDBFactoryBackendInterface> m_idbFactoryBackend;
48
    WTF::RefPtr<WebCore::IDBFactoryBackendInterface> m_idbFactoryBackend;

Return to Bug 47389