mirror of
https://github.com/servo/servo.git
synced 2025-09-30 08:39:16 +01:00
Be more conservative about safety of dictionary and union values.
Mark dictionaries containing GC values as must_root, and wrap them in RootedTraceableBox in automatically-generated APIs. To accommodate union variants that are now flagged as unsafe, add RootedTraceableBox to union variants that need to be rooted, rather than wrapping the entire union value.
This commit is contained in:
parent
e481e8934a
commit
da65698c5c
5 changed files with 47 additions and 17 deletions
|
@ -13,6 +13,7 @@ use dom::bindings::js::{MutNullableJS, Root};
|
|||
use dom::bindings::refcounted::Trusted;
|
||||
use dom::bindings::reflector::{DomObject, reflect_dom_object};
|
||||
use dom::bindings::str::DOMString;
|
||||
use dom::bindings::trace::RootedTraceableBox;
|
||||
use dom::blob::Blob;
|
||||
use dom::domexception::{DOMErrorName, DOMException};
|
||||
use dom::event::{Event, EventBubbles, EventCancelable};
|
||||
|
@ -338,7 +339,8 @@ impl FileReaderMethods for FileReader {
|
|||
FileReaderResult::String(ref string) =>
|
||||
StringOrObject::String(string.clone()),
|
||||
FileReaderResult::ArrayBuffer(ref arr_buffer) => {
|
||||
StringOrObject::Object(Heap::new((*arr_buffer.ptr.get()).to_object()))
|
||||
StringOrObject::Object(RootedTraceableBox::new(
|
||||
Heap::new((*arr_buffer.ptr.get()).to_object())))
|
||||
}
|
||||
})
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue