No bug - Add documentation about the JSPROXYSLOT_EXPANDO slot; r=bz over IRC a=KWierso to land with DONTBUILD on a CLOSED TREE.
authorMs2ger <ms2ger@gmail.com>
Wed, 01 Oct 2014 23:05:54 +0200
changeset 208160 d7ec36a775349b4d949be4bff016bdbaca6518f3
parent 208159 835ef55e175e82b47aa5fd1f71aeda7e89d5ebd6
child 208185 f771fd927304f5ee9683f7a24173e4be297735b7
push id27578
push userMs2ger@gmail.com
push dateWed, 01 Oct 2014 21:08:13 +0000
treeherderautoland@d7ec36a77534 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbz, KWierso
milestone35.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
No bug - Add documentation about the JSPROXYSLOT_EXPANDO slot; r=bz over IRC a=KWierso to land with DONTBUILD on a CLOSED TREE.
dom/bindings/DOMJSProxyHandler.h
--- a/dom/bindings/DOMJSProxyHandler.h
+++ b/dom/bindings/DOMJSProxyHandler.h
@@ -14,16 +14,35 @@
 #include "nsString.h"
 
 #define DOM_PROXY_OBJECT_SLOT js::PROXY_PRIVATE_SLOT
 
 namespace mozilla {
 namespace dom {
 
 enum {
+  /**
+   * DOM proxies have an extra slot for the expando object at index
+   * JSPROXYSLOT_EXPANDO.
+   *
+   * The expando object is a plain JSObject whose properties correspond to
+   * "expandos" (custom properties set by the script author).
+   *
+   * The exact value stored in the JSPROXYSLOT_EXPANDO slot depends on whether
+   * the interface is annotated with the [OverrideBuiltins] extended attribute.
+   *
+   * If it is, the proxy is initialized with a PrivateValue, which contains a
+   * pointer to a js::ExpandoAndGeneration object; this contains a pointer to
+   * the actual expando object as well as the "generation" of the object.
+   *
+   * If it is not, the proxy is initialized with an UndefinedValue. In
+   * EnsureExpandoObject, it is set to an ObjectValue that points to the
+   * expando object directly. (It is set back to an UndefinedValue only when
+   * the object is about to die.)
+   */
   JSPROXYSLOT_EXPANDO = 0
 };
 
 template<typename T> struct Prefable;
 
 class BaseDOMProxyHandler : public js::BaseProxyHandler
 {
 public: