46
46
//! Note: WebRender has a reduced fork of this crate, so that we can avoid
47
47
//! publishing this crate on crates.io.
48
48
49
- #[ cfg( feature = "servo" ) ]
50
- extern crate accountable_refcell;
51
49
extern crate app_units;
52
- #[ cfg( feature = "servo" ) ]
53
- extern crate content_security_policy;
54
- #[ cfg( feature = "servo" ) ]
55
- extern crate crossbeam_channel;
56
50
extern crate cssparser;
57
51
extern crate euclid;
58
- #[ cfg( feature = "servo" ) ]
59
- extern crate http;
60
- #[ cfg( feature = "servo" ) ]
61
- extern crate keyboard_types;
62
52
extern crate selectors;
63
- #[ cfg( feature = "servo" ) ]
64
- extern crate serde;
65
- #[ cfg( feature = "servo" ) ]
66
- extern crate serde_bytes;
67
53
extern crate servo_arc;
68
54
extern crate smallbitvec;
69
55
extern crate smallvec;
70
- #[ cfg( feature = "servo" ) ]
71
- extern crate string_cache;
72
- #[ cfg( feature = "url" ) ]
73
- extern crate url;
74
- #[ cfg( feature = "servo" ) ]
75
- extern crate uuid;
76
56
extern crate void;
77
- #[ cfg( feature = "webrender_api" ) ]
78
- extern crate webrender_api;
79
- #[ cfg( feature = "servo" ) ]
80
- extern crate xml5ever;
81
57
82
- #[ cfg( feature = "servo" ) ]
83
- use content_security_policy as csp;
84
- #[ cfg( feature = "servo" ) ]
85
- use serde_bytes:: ByteBuf ;
86
58
use std:: hash:: { BuildHasher , Hash } ;
87
59
use std:: mem:: size_of;
88
60
use std:: ops:: Range ;
89
61
use std:: ops:: { Deref , DerefMut } ;
90
62
use std:: os:: raw:: c_void;
91
- #[ cfg( feature = "servo" ) ]
92
- use uuid:: Uuid ;
93
63
use void:: Void ;
94
64
95
65
/// A C function that takes a pointer to a heap allocation and returns its size.
@@ -338,24 +308,6 @@ impl<T: MallocSizeOf> MallocSizeOf for [T] {
338
308
}
339
309
}
340
310
341
- #[ cfg( feature = "servo" ) ]
342
- impl MallocShallowSizeOf for ByteBuf {
343
- fn shallow_size_of ( & self , ops : & mut MallocSizeOfOps ) -> usize {
344
- unsafe { ops. malloc_size_of ( self . as_ptr ( ) ) }
345
- }
346
- }
347
-
348
- #[ cfg( feature = "servo" ) ]
349
- impl MallocSizeOf for ByteBuf {
350
- fn size_of ( & self , ops : & mut MallocSizeOfOps ) -> usize {
351
- let mut n = self . shallow_size_of ( ops) ;
352
- for elem in self . iter ( ) {
353
- n += elem. size_of ( ops) ;
354
- }
355
- n
356
- }
357
- }
358
-
359
311
impl < T > MallocShallowSizeOf for Vec < T > {
360
312
fn shallow_size_of ( & self , ops : & mut MallocSizeOfOps ) -> usize {
361
313
unsafe { ops. malloc_size_of ( self . as_ptr ( ) ) }
@@ -863,115 +815,8 @@ malloc_size_of_is_0!(app_units::Au);
863
815
864
816
malloc_size_of_is_0 ! ( cssparser:: TokenSerializationType , cssparser:: SourceLocation , cssparser:: SourcePosition ) ;
865
817
866
- malloc_size_of_is_0 ! ( dom:: ElementState , dom:: DocumentState ) ;
867
-
868
818
malloc_size_of_is_0 ! ( selectors:: OpaqueElement ) ;
869
819
870
- #[ cfg( feature = "servo" ) ]
871
- malloc_size_of_is_0 ! ( csp:: Destination ) ;
872
-
873
- #[ cfg( feature = "servo" ) ]
874
- malloc_size_of_is_0 ! ( Uuid ) ;
875
-
876
- #[ cfg( feature = "url" ) ]
877
- impl MallocSizeOf for url:: Host {
878
- fn size_of ( & self , ops : & mut MallocSizeOfOps ) -> usize {
879
- match * self {
880
- url:: Host :: Domain ( ref s) => s. size_of ( ops) ,
881
- _ => 0 ,
882
- }
883
- }
884
- }
885
- #[ cfg( feature = "webrender_api" ) ]
886
- malloc_size_of_is_0 ! ( webrender_api:: BorderRadius ) ;
887
- #[ cfg( feature = "webrender_api" ) ]
888
- malloc_size_of_is_0 ! ( webrender_api:: BorderStyle ) ;
889
- #[ cfg( feature = "webrender_api" ) ]
890
- malloc_size_of_is_0 ! ( webrender_api:: BoxShadowClipMode ) ;
891
- #[ cfg( feature = "webrender_api" ) ]
892
- malloc_size_of_is_0 ! ( webrender_api:: ColorF ) ;
893
- #[ cfg( feature = "webrender_api" ) ]
894
- malloc_size_of_is_0 ! ( webrender_api:: ComplexClipRegion ) ;
895
- #[ cfg( feature = "webrender_api" ) ]
896
- malloc_size_of_is_0 ! ( webrender_api:: ExtendMode ) ;
897
- #[ cfg( feature = "webrender_api" ) ]
898
- malloc_size_of_is_0 ! ( webrender_api:: FilterOp ) ;
899
- #[ cfg( feature = "webrender_api" ) ]
900
- malloc_size_of_is_0 ! ( webrender_api:: ExternalScrollId ) ;
901
- #[ cfg( feature = "webrender_api" ) ]
902
- malloc_size_of_is_0 ! ( webrender_api:: FontInstanceKey ) ;
903
- #[ cfg( feature = "webrender_api" ) ]
904
- malloc_size_of_is_0 ! ( webrender_api:: GradientStop ) ;
905
- #[ cfg( feature = "webrender_api" ) ]
906
- malloc_size_of_is_0 ! ( webrender_api:: GlyphInstance ) ;
907
- #[ cfg( feature = "webrender_api" ) ]
908
- malloc_size_of_is_0 ! ( webrender_api:: NinePatchBorder ) ;
909
- #[ cfg( feature = "webrender_api" ) ]
910
- malloc_size_of_is_0 ! ( webrender_api:: ImageKey ) ;
911
- #[ cfg( feature = "webrender_api" ) ]
912
- malloc_size_of_is_0 ! ( webrender_api:: ImageRendering ) ;
913
- #[ cfg( feature = "webrender_api" ) ]
914
- malloc_size_of_is_0 ! ( webrender_api:: LineStyle ) ;
915
- #[ cfg( feature = "webrender_api" ) ]
916
- malloc_size_of_is_0 ! ( webrender_api:: MixBlendMode ) ;
917
- #[ cfg( feature = "webrender_api" ) ]
918
- malloc_size_of_is_0 ! ( webrender_api:: NormalBorder ) ;
919
- #[ cfg( feature = "webrender_api" ) ]
920
- malloc_size_of_is_0 ! ( webrender_api:: RepeatMode ) ;
921
- #[ cfg( feature = "webrender_api" ) ]
922
- malloc_size_of_is_0 ! ( webrender_api:: StickyOffsetBounds ) ;
923
- #[ cfg( feature = "webrender_api" ) ]
924
- malloc_size_of_is_0 ! ( webrender_api:: TransformStyle ) ;
925
-
926
- #[ cfg( feature = "servo" ) ]
927
- impl MallocSizeOf for keyboard_types:: Key {
928
- fn size_of ( & self , ops : & mut MallocSizeOfOps ) -> usize {
929
- match self {
930
- keyboard_types:: Key :: Character ( ref s) => s. size_of ( ops) ,
931
- _ => 0 ,
932
- }
933
- }
934
- }
935
-
936
- #[ cfg( feature = "servo" ) ]
937
- malloc_size_of_is_0 ! ( keyboard_types:: Modifiers ) ;
938
-
939
- #[ cfg( feature = "servo" ) ]
940
- impl MallocSizeOf for xml5ever:: QualName {
941
- fn size_of ( & self , ops : & mut MallocSizeOfOps ) -> usize {
942
- self . prefix . size_of ( ops) + self . ns . size_of ( ops) + self . local . size_of ( ops)
943
- }
944
- }
945
-
946
- #[ cfg( feature = "servo" ) ]
947
- malloc_size_of_is_0 ! ( std:: time:: Duration ) ;
948
- #[ cfg( feature = "servo" ) ]
949
- malloc_size_of_is_0 ! ( std:: time:: SystemTime ) ;
950
- #[ cfg( feature = "servo" ) ]
951
- malloc_size_of_is_0 ! ( std:: time:: Instant ) ;
952
- #[ cfg( feature = "servo" ) ]
953
- malloc_size_of_hash_set ! ( indexmap:: IndexSet <T , S >) ;
954
- #[ cfg( feature = "servo" ) ]
955
- malloc_size_of_hash_map ! ( indexmap:: IndexMap <K , V , S >) ;
956
- #[ cfg( feature = "servo" ) ]
957
- malloc_size_of_is_0 ! ( http:: StatusCode ) ;
958
-
959
- // Placeholder for unique case where internals of Sender cannot be measured.
960
- // malloc size of is 0 macro complains about type supplied!
961
- #[ cfg( feature = "servo" ) ]
962
- impl < T > MallocSizeOf for crossbeam_channel:: Sender < T > {
963
- fn size_of ( & self , _ops : & mut MallocSizeOfOps ) -> usize {
964
- 0
965
- }
966
- }
967
-
968
- #[ cfg( feature = "servo" ) ]
969
- impl < T > MallocSizeOf for tokio:: sync:: mpsc:: UnboundedSender < T > {
970
- fn size_of ( & self , _ops : & mut MallocSizeOfOps ) -> usize {
971
- 0
972
- }
973
- }
974
-
975
820
/// Measurable that defers to inner value and used to verify MallocSizeOf implementation in a
976
821
/// struct.
977
822
#[ derive( Clone ) ]
@@ -990,10 +835,3 @@ impl<T: MallocSizeOf> DerefMut for Measurable<T> {
990
835
& mut self . 0
991
836
}
992
837
}
993
-
994
- #[ cfg( feature = "servo" ) ]
995
- impl < T : MallocSizeOf > MallocSizeOf for accountable_refcell:: RefCell < T > {
996
- fn size_of ( & self , ops : & mut MallocSizeOfOps ) -> usize {
997
- self . borrow ( ) . size_of ( ops)
998
- }
999
- }
0 commit comments