Name Description Size
ActorsChild.cpp Constants **************************************************************************** 121373
ActorsChild.h 24743
ActorsParent.cpp 830921
ActorsParent.h 2229
FileInfo.cpp static 4494
FileInfo.h 2048
FileManager.h 3046
FlippedOnce.h 1186
IDBCursor.cpp 26594
IDBCursor.h 9714
IDBCursorType.cpp 1453
IDBCursorType.h 4346
IDBDatabase.cpp 36171
IDBDatabase.h 7549
IDBEvents.cpp 3331
IDBEvents.h 3220
IDBFactory.cpp 27352
IDBFactory.h 7161
IDBFileHandle.cpp aWrapAsDOMRequest 18438
IDBFileHandle.h 6853
IDBFileRequest.cpp 3282
IDBFileRequest.h 2418
IDBIndex.cpp aKeysOnly 19462
IDBIndex.h 5379
IDBKeyRange.cpp 9987
IDBKeyRange.h 4609
IDBMutableFile.cpp 5857
IDBMutableFile.h 2905
IDBObjectStore.cpp 80527
IDBObjectStore.h 9869
IDBRequest.cpp 15223
IDBRequest.h 6487
IDBResult.h 5594
IDBTransaction.cpp aDummy 31636
IDBTransaction.h 10955
IndexedDatabase.h 3283
IndexedDatabaseInlines.h 4132
IndexedDatabaseManager.cpp 29961
IndexedDatabaseManager.h 5070
InitializedOnce.h aValue 3483
Key.cpp Here's how we encode keys: Basic strategy is the following Numbers: 0x10 n n n n n n n n ("n"s are encoded 64bit float) Dates: 0x20 n n n n n n n n ("n"s are encoded 64bit float) Strings: 0x30 s s s ... 0 ("s"s are encoded unicode bytes) Binaries: 0x40 s s s ... 0 ("s"s are encoded unicode bytes) Arrays: 0x50 i i i ... 0 ("i"s are encoded array items) When encoding floats, 64bit IEEE 754 are almost sortable, except that positive sort lower than negative, and negative sort descending. So we use the following encoding: value < 0 ? (-to64bitInt(value)) : (to64bitInt(value) | 0x8000000000000000) When encoding strings, we use variable-size encoding per the following table Chars 0 - 7E are encoded as 0xxxxxxx with 1 added Chars 7F - (3FFF+7F) are encoded as 10xxxxxx xxxxxxxx with 7F subtracted Chars (3FFF+80) - FFFF are encoded as 11xxxxxx xxxxxxxx xx000000 This ensures that the first byte is never encoded as 0, which means that the string terminator (per basic-strategy table) sorts before any character. The reason that (3FFF+80) - FFFF is encoded "shifted up" 6 bits is to maximize the chance that the last character is 0. See below for why. When encoding binaries, the algorithm is the same to how strings are encoded. Since each octet in binary is in the range of [0-255], it'll take 1 to 2 encoded unicode bytes. When encoding Arrays, we use an additional trick. Rather than adding a byte containing the value 0x50 to indicate type, we instead add 0x50 to the next byte. This is usually the byte containing the type of the first item in the array. So simple examples are ["foo"] 0x80 s s s 0 0 // 0x80 is 0x30 + 0x50 [1, 2] 0x60 n n n n n n n n 1 n n n n n n n n 0 // 0x60 is 0x10 + 0x50 Whe do this iteratively if the first item in the array is also an array [["foo"]] 0xA0 s s s 0 0 0 However, to avoid overflow in the byte, we only do this 3 times. If the first item in an array is an array, and that array also has an array as first item, we simply write out the total value accumulated so far and then follow the "normal" rules. [[["foo"]]] 0xF0 0x30 s s s 0 0 0 0 There is another edge case that can happen though, which is that the array doesn't have a first item to which we can add 0x50 to the type. Instead the next byte would normally be the array terminator (per basic-strategy table) so we simply add the 0x50 there. [[]] 0xA0 0 // 0xA0 is 0x50 + 0x50 + 0 [] 0x50 // 0x50 is 0x50 + 0 [[], "foo"] 0xA0 0x30 s s s 0 0 // 0xA0 is 0x50 + 0x50 + 0 Note that the max-3-times rule kicks in before we get a chance to add to the array terminator [[[]]] 0xF0 0 0 0 // 0xF0 is 0x50 + 0x50 + 0x50 As a final optimization we do a post-encoding step which drops all 0s at the end of the encoded buffer. "foo" // 0x30 s s s 1 // 0x10 bf f0 ["a", "b"] // 0x80 s 0 0x30 s [1, 2] // 0x60 bf f0 0 0 0 0 0 0 0x10 c0 [[]] // 0x80 28687
Key.h 12254
KeyPath.cpp 16553
KeyPath.h 2968
PBackgroundIDBCursor.ipdl 2083
PBackgroundIDBDatabase.ipdl 2300
PBackgroundIDBDatabaseFile.ipdl 481
PBackgroundIDBDatabaseRequest.ipdl 710
PBackgroundIDBFactory.ipdl 1429
PBackgroundIDBFactoryRequest.ipdl 981
PBackgroundIDBRequest.ipdl 3642
PBackgroundIDBSharedTypes.ipdlh 5918
PBackgroundIDBTransaction.ipdl 976
PBackgroundIDBVersionChangeTransaction.ipdl 1711
PBackgroundIndexedDBUtils.ipdl 947
PermissionRequestBase.cpp aExpireTime 6583
PermissionRequestBase.h 2225
ProfilerHelpers.h 14613
ReportInternalError.cpp no IDB in private window 1069
ReportInternalError.h Don't evaluate |res| more than once 2310
ScriptErrorHelper.cpp aSourceLine 6626
ScriptErrorHelper.h nsIScriptError::xxxFlag 1295
SerializationHelpers.h 2960
crashtests 6 2898
nsIIDBPermissionsRequest.idl Interface for IDB permission requests. This is passed as the subject for the permission request observer service notifications. 856
test 182