Bug 1290061 - stylo: Mark nsStyleUnion/Unit fields as unsafe and private for bindgen; r=bholley
authorManish Goregaokar <manishearth@gmail.com>
Thu, 28 Jul 2016 17:53:19 +0530
changeset 332110 c70e8c8d0a79ff6cb88d2fcffd165506a1fd388e
parent 332109 915257f0f74c8f124904cbcf8ca8204ada4370c7
child 332111 ddeb0295df692695b36295177d6790e5393e1f9a
push id9858
push userjlund@mozilla.com
push dateMon, 01 Aug 2016 14:37:10 +0000
treeherdermozilla-aurora@203106ef6cb6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
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);