Bug 1290061 - stylo: Mark nsStyleUnion/Unit fields as unsafe and private for bindgen; r?bholley draft
authorManish Goregaokar <manishearth@gmail.com>
Thu, 28 Jul 2016 17:53:19 +0530
changeset 393751 c5ca3be699888e5d640d0a858fba9b1e46d2bb38
parent 393484 db3ed1fdbbeaf5ab1e8fe454780146e7499be3db
child 526663 c0edb1bf459a19e2c65dd4eab94c43ce06721a3d
push id24407
push usermanishearth@gmail.com
push dateThu, 28 Jul 2016 12:22:45 +0000
reviewersbholley
bugs1290061
milestone50.0a1
Bug 1290061 - stylo: Mark nsStyleUnion/Unit fields as unsafe and private for bindgen; r?bholley MozReview-Commit-ID: 6K38Gvbn4vn
layout/style/nsStyleCoord.h
--- a/layout/style/nsStyleCoord.h
+++ b/layout/style/nsStyleCoord.h
@@ -67,16 +67,17 @@ typedef union {
 /**
  * Class that hold a single size specification used by the style
  * system.  The size specification consists of two parts -- a number
  * and a unit.  The number is an integer, a floating point value, an
  * nscoord, or undefined, and the unit is an nsStyleUnit.  Checking
  * the unit is a must before asking for the value in any particular
  * form.
  */
+ /** <div rustbindgen private accessor="unsafe"></div> */
 class nsStyleCoord {
 public:
   // Non-reference counted calc() value.  See nsStyleStruct.h for some uses
   // of this.
   struct CalcValue {
     // Every calc() expression evaluates to a length plus a percentage.
     nscoord mLength;
     float mPercent;
@@ -257,16 +258,17 @@ private:
   nsStyleUnion  mValue;
 };
 
 /**
  * Class that represents a set of top/right/bottom/left nsStyleCoords.
  * This is commonly used to hold the widths of the borders, margins,
  * or paddings of a box.
  */
+ /** <div rustbindgen private accessor="unsafe"></div> */
 class nsStyleSides {
 public:
   nsStyleSides();
   nsStyleSides(const nsStyleSides&);
   ~nsStyleSides();
 
   nsStyleSides&  operator=(const nsStyleSides& aCopy);
   bool           operator==(const nsStyleSides& aOther) const;
@@ -335,16 +337,17 @@ protected:
   nsStyleUnion  mValues[4];
 };
 
 /**
  * Class that represents a set of top-left/top-right/bottom-left/bottom-right
  * nsStyleCoord pairs.  This is used to hold the dimensions of the
  * corners of a box (for, e.g., border-radius and outline-radius).
  */
+ /** <div rustbindgen private accessor="unsafe"></div> */
 class nsStyleCorners {
 public:
   nsStyleCorners();
   nsStyleCorners(const nsStyleCorners&);
   ~nsStyleCorners();
 
   // use compiler's version
   nsStyleCorners& operator=(const nsStyleCorners& aCopy);