servo: Merge #18590 - Use Atom::from(nsIAtom) to increment reference count in case of dynam… (from hiikezoe:increment-ref-count-for-will-change); r=xidorn
authorHiroyuki Ikezoe <hikezoe@mozilla.com>
Thu, 21 Sep 2017 04:18:28 -0500
changeset 431702 77ce63ef82717bca47fae1f602d8208ba9f38b09
parent 431701 b77ab1b8e557ad180b1ccd124b59779c4e672783
child 431703 9caeafcec9982be90820e30bc699e851cb6af907
push id7785
push userryanvm@gmail.com
push dateThu, 21 Sep 2017 13:39:55 +0000
treeherdermozilla-beta@06d4034a8a03 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersxidorn
bugs18590, 1401809
milestone57.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
servo: Merge #18590 - Use Atom::from(nsIAtom) to increment reference count in case of dynam… (from hiikezoe:increment-ref-count-for-will-change); r=xidorn …ic atom for will-change. If we don't increment the reference count for the Atom in servo side, it's possible to try to release the Atom in servo side even if we have already released in gecko side. When it happens, nsIAtom::mKind is no longer reliable. https://bugzilla.mozilla.org/show_bug.cgi?id=1401809 <!-- Please describe your changes on the following line: --> --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [X] `./mach build -d` does not report any errors - [X] `./mach test-tidy` does not report any errors Source-Repo: https://github.com/servo/servo Source-Revision: 581f0bf09a8ec35dadd5de207777f79138255e1a
servo/components/style/properties/gecko.mako.rs
--- a/servo/components/style/properties/gecko.mako.rs
+++ b/servo/components/style/properties/gecko.mako.rs
@@ -3477,27 +3477,24 @@ fn static_assert() {
 
     pub fn reset_will_change(&mut self, other: &Self) {
         self.copy_will_change_from(other)
     }
 
     pub fn clone_will_change(&self) -> longhands::will_change::computed_value::T {
         use properties::longhands::will_change::computed_value::T;
         use gecko_bindings::structs::nsIAtom;
-        use gecko_string_cache::Atom;
         use values::CustomIdent;
 
         if self.gecko.mWillChange.mBuffer.len() == 0 {
             T::Auto
         } else {
             T::AnimateableFeatures(
                 self.gecko.mWillChange.mBuffer.iter().map(|gecko_atom| {
-                    CustomIdent(
-                        unsafe { Atom::from_addrefed(*gecko_atom as *mut nsIAtom) }
-                    )
+                    CustomIdent((*gecko_atom as *mut nsIAtom).into())
                 }).collect()
             )
         }
     }
 
     <% impl_shape_source("shape_outside", "mShapeOutside") %>
 
     pub fn set_contain(&mut self, v: longhands::contain::computed_value::T) {