mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
refactor: add CanGc as argument to DataBlock::view (#35610)
Signed-off-by: Yerkebulan Tulibergenov <yerkebulan@gmail.com>
This commit is contained in:
parent
b0b0289014
commit
dd13342f18
3 changed files with 4 additions and 3 deletions
|
@ -429,7 +429,7 @@ impl DataBlock {
|
|||
}
|
||||
|
||||
/// Returns error if requested range is already mapped
|
||||
pub(crate) fn view(&mut self, range: Range<usize>) -> Result<&DataView, ()> {
|
||||
pub(crate) fn view(&mut self, range: Range<usize>, _can_gc: CanGc) -> Result<&DataView, ()> {
|
||||
if self
|
||||
.data_views
|
||||
.iter()
|
||||
|
|
|
@ -297,6 +297,7 @@ impl GPUBufferMethods<crate::DomTypeHolder> for GPUBuffer {
|
|||
_cx: JSContext,
|
||||
offset: GPUSize64,
|
||||
size: Option<GPUSize64>,
|
||||
can_gc: CanGc,
|
||||
) -> Fallible<ArrayBuffer> {
|
||||
let range_size = if let Some(s) = size {
|
||||
s
|
||||
|
@ -321,7 +322,7 @@ impl GPUBufferMethods<crate::DomTypeHolder> for GPUBuffer {
|
|||
let rebased_offset = (offset - mapping.range.start) as usize;
|
||||
mapping
|
||||
.data
|
||||
.view(rebased_offset..rebased_offset + range_size as usize)
|
||||
.view(rebased_offset..rebased_offset + range_size as usize, can_gc)
|
||||
.map(|view| view.array_buffer())
|
||||
.map_err(|()| Error::Operation)
|
||||
}
|
||||
|
|
|
@ -217,7 +217,7 @@ DOMInterfaces = {
|
|||
|
||||
'GPUBuffer': {
|
||||
'inRealms': ['MapAsync'],
|
||||
'canGc': ['MapAsync'],
|
||||
'canGc': ['GetMappedRange', 'MapAsync'],
|
||||
},
|
||||
|
||||
'GPUCanvasContext': {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue