mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
Use the new struct in stylo.
This commit is contained in:
parent
f3a694a7b4
commit
737733eaae
2 changed files with 36 additions and 19 deletions
|
@ -13,6 +13,13 @@ impl<T> nsCOMPtr<T> {
|
|||
pub fn raw<U>(&self) -> *mut T {
|
||||
self.mRawPtr
|
||||
}
|
||||
|
||||
/// Set this pointer from an addrefed raw pointer.
|
||||
/// It leaks the old pointer.
|
||||
#[inline]
|
||||
pub unsafe fn set_raw_from_addrefed<U>(&mut self, ptr: *mut T) {
|
||||
self.mRawPtr = ptr;
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(not(feature = "gecko_debug"))]
|
||||
|
@ -22,4 +29,11 @@ impl nsCOMPtr {
|
|||
pub fn raw<T>(&self) -> *mut T {
|
||||
self._base.mRawPtr as *mut _
|
||||
}
|
||||
|
||||
/// Set this pointer from an addrefed raw pointer.
|
||||
/// It leaks the old pointer.
|
||||
#[inline]
|
||||
pub unsafe fn set_raw_from_addrefed<T>(&mut self, ptr: *mut T) {
|
||||
self._base.mRawPtr = ptr as *mut _;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue