mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Don't slice a sliced blob (#36866)
When slicing a blob that is already sliced we should reference it's parent's data instead of creating a subview into the sliced blob. This keeps the blob ancestry chain small and reduces the number of blobs that we have to resolve. Testing: Includes a new crashtest Fixes: https://github.com/servo/servo/issues/36843 [try run](https://github.com/simonwuelker/servo/actions/runs/14844873660) --------- Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
This commit is contained in:
parent
3b806ca424
commit
54c2818974
7 changed files with 76 additions and 69 deletions
|
@ -221,9 +221,9 @@ impl BlobImpl {
|
|||
}
|
||||
|
||||
/// Construct a BlobImpl from a slice of a parent.
|
||||
pub fn new_sliced(rel_pos: RelativePos, parent: BlobId, type_string: String) -> BlobImpl {
|
||||
pub fn new_sliced(range: RelativePos, parent: BlobId, type_string: String) -> BlobImpl {
|
||||
let blob_id = BlobId::new();
|
||||
let blob_data = BlobData::Sliced(parent, rel_pos);
|
||||
let blob_data = BlobData::Sliced(parent, range);
|
||||
BlobImpl {
|
||||
blob_id,
|
||||
type_string,
|
||||
|
|
|
@ -39,7 +39,7 @@ pub enum FileTokenCheck {
|
|||
/// Relative slice positions of a sequence,
|
||||
/// whose semantic should be consistent with (start, end) parameters in
|
||||
/// <https://w3c.github.io/FileAPI/#dfn-slice>
|
||||
#[derive(Clone, Debug, Deserialize, MallocSizeOf, Serialize)]
|
||||
#[derive(Clone, Copy, Debug, Deserialize, MallocSizeOf, Serialize)]
|
||||
pub struct RelativePos {
|
||||
/// Relative to first byte if non-negative,
|
||||
/// relative to one past last byte if negative,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue