mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Auto merge of #17901 - heycam:rm-empty-variables, r=emilio
style: Remove now-unused empty Variables struct. <!-- Please describe your changes on the following line: --> The `Servo_GetEmptyVariables` FFI function no longer has any callers from Gecko, so we can remove it and the code that creates/frees that struct. --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [ ] `./mach build -d` does not report any errors - [X] `./mach test-tidy` does not report any errors - [ ] These changes fix #__ (github issue number if applicable). <!-- Either: --> - [ ] There are tests for these changes OR - [ ] These changes do not require tests because _____ <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/17901) <!-- Reviewable:end -->
This commit is contained in:
commit
e95da98f5f
4 changed files with 2 additions and 40 deletions
|
@ -2866,9 +2866,6 @@ extern "C" {
|
|||
index: u32, name: *mut nsAString)
|
||||
-> bool;
|
||||
}
|
||||
extern "C" {
|
||||
pub fn Servo_GetEmptyVariables() -> *const nsStyleVariables;
|
||||
}
|
||||
extern "C" {
|
||||
pub fn Gecko_CreateCSSErrorReporter(sheet: *mut ServoStyleSheet,
|
||||
loader: *mut Loader, uri: *mut nsIURI)
|
||||
|
|
|
@ -19,13 +19,11 @@ use gecko_bindings::bindings::Gecko_Construct_Default_${style_struct.gecko_ffi_n
|
|||
use gecko_bindings::bindings::Gecko_CopyConstruct_${style_struct.gecko_ffi_name};
|
||||
use gecko_bindings::bindings::Gecko_Destroy_${style_struct.gecko_ffi_name};
|
||||
% endfor
|
||||
use gecko_bindings::bindings::Gecko_Construct_nsStyleVariables;
|
||||
use gecko_bindings::bindings::Gecko_CopyCounterStyle;
|
||||
use gecko_bindings::bindings::Gecko_CopyCursorArrayFrom;
|
||||
use gecko_bindings::bindings::Gecko_CopyFontFamilyFrom;
|
||||
use gecko_bindings::bindings::Gecko_CopyImageValueFrom;
|
||||
use gecko_bindings::bindings::Gecko_CopyListStyleImageFrom;
|
||||
use gecko_bindings::bindings::Gecko_Destroy_nsStyleVariables;
|
||||
use gecko_bindings::bindings::Gecko_EnsureImageLayersLength;
|
||||
use gecko_bindings::bindings::Gecko_FontFamilyList_AppendGeneric;
|
||||
use gecko_bindings::bindings::Gecko_FontFamilyList_AppendNamed;
|
||||
|
@ -43,7 +41,6 @@ use gecko_bindings::bindings::{Gecko_ResetFilters, Gecko_CopyFiltersFrom};
|
|||
use gecko_bindings::bindings::RawGeckoPresContextBorrowed;
|
||||
use gecko_bindings::structs;
|
||||
use gecko_bindings::structs::nsCSSPropertyID;
|
||||
use gecko_bindings::structs::nsStyleVariables;
|
||||
use gecko_bindings::sugar::ns_style_coord::{CoordDataValue, CoordData, CoordDataMut};
|
||||
use gecko::values::convert_nscolor_to_rgba;
|
||||
use gecko::values::convert_rgba_to_nscolor;
|
||||
|
@ -5030,26 +5027,3 @@ ${impl_style_struct(style_struct)}
|
|||
<%self:raw_impl_trait style_struct="${style_struct}"></%self:raw_impl_trait>
|
||||
% endif
|
||||
% endfor
|
||||
|
||||
// This is only accessed from the Gecko main thread.
|
||||
static mut EMPTY_VARIABLES_STRUCT: Option<nsStyleVariables> = None;
|
||||
|
||||
#[no_mangle]
|
||||
#[allow(non_snake_case)]
|
||||
pub unsafe extern "C" fn Servo_GetEmptyVariables()
|
||||
-> *const nsStyleVariables {
|
||||
EMPTY_VARIABLES_STRUCT.as_ref().unwrap()
|
||||
}
|
||||
|
||||
pub fn initialize() {
|
||||
unsafe {
|
||||
EMPTY_VARIABLES_STRUCT = Some(zeroed());
|
||||
Gecko_Construct_nsStyleVariables(EMPTY_VARIABLES_STRUCT.as_mut().unwrap());
|
||||
}
|
||||
}
|
||||
|
||||
pub fn shutdown() {
|
||||
unsafe {
|
||||
EMPTY_VARIABLES_STRUCT.take().as_mut().map(|v| Gecko_Destroy_nsStyleVariables(v));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue