Bug 1403073 - stylo: Fix some bindgen object layout issues. r=xidorn, a=sledru
authorCameron McCormack <cam@mcc.id.au>
Tue, 26 Sep 2017 15:06:33 +0800
changeset 431900 b21b199adf72fc9b208073fc887e2e50fa82681a
parent 431899 012dbe7d4f1985b8b54775237ff53d0135e50b54
child 431901 d8d8a5dde5bb7cac88081dfe5880e6c3d021f26f
push id7839
push userryanvm@gmail.com
push dateWed, 27 Sep 2017 18:39:31 +0000
treeherdermozilla-beta@b21b199adf72 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersxidorn, sledru
bugs1403073
milestone57.0
Bug 1403073 - stylo: Fix some bindgen object layout issues. r=xidorn, a=sledru MozReview-Commit-ID: CnW4J2ZlmfJ
layout/style/ServoBindings.toml
layout/style/nsCSSValue.h
--- a/layout/style/ServoBindings.toml
+++ b/layout/style/ServoBindings.toml
@@ -335,16 +335,17 @@ opaque-types = [
     "JS::Rooted",
     "mozilla::Maybe",
     "gfxSize",  # <- union { struct { T width; T height; }; T components[2] };
     "gfxSize_Super",  # Ditto.
     "mozilla::StyleAnimationValue",
     "StyleAnimationValue", # pulls in a whole bunch of stuff we don't need in the bindings
     "mozilla::dom::.*Callback", # Pulls in ErrorResult and other things that
                                 # don't align properly on Linux 32-bit
+    "mozilla::SchedulerGroup", # Non-standard-layout packing of field into superclass
 ]
 mapped-generic-types = [
     { generic = true, gecko = "mozilla::ServoUnsafeCell", servo = "::std::cell::UnsafeCell" },
     { generic = true, gecko = "mozilla::ServoCell", servo = "::std::cell::Cell" },
     { generic = false, gecko = "ServoNodeData", servo = "AtomicRefCell<ElementData>" },
     { generic = false, gecko = "mozilla::ServoWritingMode", servo = "::logical_geometry::WritingMode" },
     { generic = false, gecko = "mozilla::ServoFontComputationData", servo = "::properties::FontComputationData" },
     { generic = false, gecko = "mozilla::ServoCustomPropertiesMap", servo = "Option<::servo_arc::Arc<::custom_properties::CustomPropertiesMap>>" },
--- a/layout/style/nsCSSValue.h
+++ b/layout/style/nsCSSValue.h
@@ -194,16 +194,21 @@ private:
     : mRustString(aString) {}
     ~RustOrGeckoString() {}
     nsString mString;
     mozilla::ServoRawOffsetArc<RustString> mRustString;
   } mStrings;
   mutable bool mUsingRustString;
 
 protected:
+  // Only used by ImageValue.  Declared up here because otherwise bindgen gets
+  // confused by the non-standard-layout packing of the variable up into
+  // URLValueData.
+  bool mLoadedImage = false;
+
   virtual ~URLValueData();
 
   size_t SizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf) const;
 
 private:
   URLValueData(const URLValueData& aOther) = delete;
   URLValueData& operator=(const URLValueData& aOther) = delete;
 
@@ -262,19 +267,16 @@ struct ImageValue final : public URLValu
 
   void Initialize(nsIDocument* aDocument);
 
   size_t SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) const;
 
 protected:
   ~ImageValue();
 
-private:
-  bool mLoadedImage = false;
-
 public:
   // Inherit Equals from URLValueData
 
   nsRefPtrHashtable<nsPtrHashKey<nsIDocument>, imgRequestProxy> mRequests;
 };
 
 struct GridNamedArea {
   nsString mName;