-
Notifications
You must be signed in to change notification settings - Fork 16
Add support for firefox indexeddb #53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
007cf2f
Add definitions
sydp 64de140
Update definitions
sydp 821998d
Add test data
sydp a8a931c
Whitespace
sydp 3eec24f
Add types
sydp f31ebf9
Add test external file
sydp 09abc07
Fix docstring
sydp b946be7
Add parser implementation and tests
sydp 64b1450
Update cli tool
sydp f0148a8
Update README
sydp 9fe5204
Add functionality for decoding gecko-encoded files
sydp bd82704
Merge branch 'google:main' into ffox
sydp 8538fef
Updates to gecko.py
sydp 16b7655
Merge remote-tracking branch 'origin/ffox' into ffox
sydp 9e4b696
pylint fix
sydp 90c112b
Merge branch 'google:main' into ffox
sydp e8af511
Update docstring.
sydp 13e01c1
Update definitions
sydp 885a405
Updates per review
sydp daef4cf
remove superfluous parens
sydp File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,143 @@ | ||
| # -*- coding: utf-8 -*- | ||
| # Copyright 2024 Google LLC | ||
| # | ||
| # Licensed under the Apache License, Version 2.0 (the "License"); | ||
| # you may not use this file except in compliance with the License. | ||
| # You may obtain a copy of the License at | ||
| # | ||
| # https://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, software | ||
| # distributed under the License is distributed on an "AS IS" BASIS, | ||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
| """Definitions for Firefox IndexedDB.""" | ||
| from enum import IntEnum | ||
|
|
||
|
|
||
| class IndexedDBKeyType(IntEnum): | ||
| """IndexedDB Key Types.""" | ||
| TERMINATOR = 0 | ||
| FLOAT = 0x10 | ||
| DATE = 0x20 | ||
| STRING = 0x30 | ||
| BINARY = 0x40 | ||
| ARRAY = 0x50 | ||
|
|
||
|
|
||
| MAX_ARRAY_COLLAPSE = 3 | ||
| MAX_RECURSION_DEPTH = 64 | ||
| MAX_LENGTH = (1 << 30) - 2 | ||
| ONE_BYTE_LIMIT = 0x7E | ||
| TWO_BYTE_LIMIT = 0x3FFF + 0x7F | ||
| ONE_BYTE_ADJUST = 1 | ||
| TWO_BYTE_ADJUST = -0x7F | ||
| THREE_BYTE_SHIFT = 6 | ||
|
|
||
|
|
||
| class StructuredDataType(IntEnum): | ||
| """Structured Data Types.""" | ||
| FLOAT_MAX = 0xFFF00000 | ||
| HEADER = 0xFFF10000 | ||
| NULL = 0xFFFF0000 | ||
| UNDEFINED = 0xFFFF0001 | ||
| BOOLEAN = 0xFFFF0002 | ||
| INT32 = 0xFFFF0003 | ||
| STRING = 0xFFFF0004 | ||
| DATE_OBJECT = 0xFFFF0005 | ||
| REGEXP_OBJECT = 0xFFFF0006 | ||
| ARRAY_OBJECT = 0xFFFF0007 | ||
| OBJECT_OBJECT = 0xFFFF0008 | ||
| ARRAY_BUFFER_OBJECT_V2 = 0xFFFF0009 | ||
| BOOLEAN_OBJECT = 0xFFFF000A | ||
| STRING_OBJECT = 0xFFFF000B | ||
| NUMBER_OBJECT = 0xFFFF000C | ||
| BACK_REFERENCE_OBJECT = 0xFFFF000D | ||
| DO_NOT_USE_1 = 0xFFFF000E | ||
| DO_NOT_USE_2 = 0xFFFF000F | ||
| TYPED_ARRAY_OBJECT_V2 = 0xFFFF0010 | ||
| MAP_OBJECT = 0xFFFF0011 | ||
| SET_OBJECT = 0xFFFF0012 | ||
| END_OF_KEYS = 0xFFFF0013 | ||
| DO_NOT_USE_3 = 0xFFFF0014 | ||
| DATA_VIEW_OBJECT_V2 = 0xFFFF0015 | ||
| SAVED_FRAME_OBJECT = 0xFFFF0016 | ||
| JSPRINCIPALS = 0xFFFF0017 | ||
| NULL_JSPRINCIPALS = 0xFFFF0018 | ||
| RECONSTRUCTED_SAVED_FRAME_PRINCIPALS_IS_SYSTEM = 0xFFFF0019 | ||
| RECONSTRUCTED_SAVED_FRAME_PRINCIPALS_IS_NOT_SYSTEM = 0xFFFF001A | ||
| SHARED_ARRAY_BUFFER_OBJECT = 0xFFFF001B | ||
| SHARED_WASM_MEMORY_OBJECT = 0xFFFF001C | ||
| BIGINT = 0xFFFF001D | ||
| BIGINT_OBJECT = 0xFFFF001E | ||
| ARRAY_BUFFER_OBJECT = 0xFFFF001F | ||
| TYPED_ARRAY_OBJECT = 0xFFFF0020 | ||
| DATA_VIEW_OBJECT = 0xFFFF0021 | ||
| ERROR_OBJECT = 0xFFFF0022 | ||
| RESIZABLE_ARRAY_BUFFER_OBJECT = 0xFFFF0023 | ||
| GROWABLE_SHARED_ARRAY_BUFFER_OBJECT = 0xFFFF0024 | ||
| TYPED_ARRAY_V1_INT8 = 0xFFFF0100 | ||
| TYPED_ARRAY_V1_UINT8 = 0xFFFF0101 | ||
| TYPED_ARRAY_V1_INT16 = 0xFFFF0102 | ||
| TYPED_ARRAY_V1_UINT16 = 0xFFFF0103 | ||
| TYPED_ARRAY_V1_INT32 = 0xFFFF0104 | ||
| TYPED_ARRAY_V1_UINT32 = 0xFFFF0105 | ||
| TYPED_ARRAY_V1_FLOAT32 = 0xFFFF0106 | ||
| TYPED_ARRAY_V1_FLOAT64 = 0xFFFF0107 | ||
| TYPED_ARRAY_V1_UINT8_CLAMPED = 0xFFFF0108 | ||
| TRANSFER_MAP_HEADER = 0xFFFF0200 | ||
| TRANSFER_MAP_PENDING_ENTRY = 0xFFFF0201 | ||
| TRANSFER_MAP_ARRAY_BUFFER = 0xFFFF0202 | ||
| TRANSFER_MAP_STORED_ARRAY_BUFFER = 0xFFFF0203 | ||
| TRANSFER_MAP_END_OF_BUILTIN_TYPES = 0xFFFF0204 | ||
|
|
||
|
|
||
| class StructuredCloneTags(IntEnum): | ||
| """Structured Clone Tags.""" | ||
| BLOB = 0xFFFF8001 | ||
| FILE_WITHOUT_LASTMODIFIEDDATE = 0xFFFF8002 | ||
| FILELIST = 0xFFFF8003 | ||
| MUTABLEFILE = 0xFFFF8004 | ||
| FILE = 0xFFFF8005 | ||
| WASM_MODULE = 0xFFFF8006 | ||
| IMAGEDATA = 0xFFFF8007 | ||
| DOMPOINT = 0xFFFF8008 | ||
| DOMPOINTREADONLY = 0xFFFF8009 | ||
| CRYPTOKEY = 0xFFFF800A | ||
| NULL_PRINCIPAL = 0xFFFF800B | ||
| SYSTEM_PRINCIPAL = 0xFFFF800C | ||
| CONTENT_PRINCIPAL = 0xFFFF800D | ||
| DOMQUAD = 0xFFFF800E | ||
| RTCCERTIFICATE = 0xFFFF800F | ||
| DOMRECT = 0xFFFF8010 | ||
| DOMRECTREADONLY = 0xFFFF8011 | ||
| EXPANDED_PRINCIPAL = 0xFFFF8012 | ||
| DOMMATRIX = 0xFFFF8013 | ||
| URLSEARCHPARAMS = 0xFFFF8014 | ||
| DOMMATRIXREADONLY = 0xFFFF8015 | ||
| DOMEXCEPTION = 0xFFFF80016 | ||
| EMPTY_SLOT_9 = 0xFFFF8017 | ||
| STRUCTUREDCLONETESTER = 0xFFFF8018 | ||
| FILESYSTEMHANDLE = 0xFFFF8019 | ||
| FILESYSTEMFILEHANDLE = 0xFFFF801A | ||
| FILESYSTEMDIRECTORYHANDLE = 0xFFFF801B | ||
| IMAGEBITMAP = 0xFFFF801C | ||
| MAP_MESSAGEPORT = 0xFFFF801D | ||
| FORMDATA = 0xFFFF801E | ||
| CANVAS = 0xFFFF801F # This tag is for OffscreenCanvas. | ||
| DIRECTORY = 0xFFFF8020 | ||
| INPUTSTREAM = 0xFFFF8021 | ||
| STRUCTURED_CLONE_HOLDER = 0xFFFF8022 | ||
| BROWSING_CONTEXT = 0xFFFF8023 | ||
| CLONED_ERROR_OBJECT = 0xFFFF8024 | ||
| READABLESTREAM = 0xFFFF8025 | ||
| WRITABLESTREAM = 0xFFFF8026 | ||
| TRANSFORMSTREAM = 0xFFFF8027 | ||
| VIDEOFRAME = 0xFFFF8028 | ||
| ENCODEDVIDEOCHUNK = 0xFFFF8029 | ||
| AUDIODATA = 0xFFFF8030 | ||
| ENCODEDAUDIOCHUNK = 0xFFFF8031 | ||
|
|
||
|
|
||
| FRAME_HEADER = b'\xff\x06\x00\x00sNaPpY' |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.