Do not wrappercache root class in webidl-example if wrapperCache: False

NEW
Unassigned

Status

()

Core
DOM
3 years ago
3 years ago

People

(Reporter: Axel Nennker, Unassigned)

Tracking

38 Branch
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

3 years ago
User Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:38.0) Gecko/20100101 Firefox/38.0
Build ID: 20150511103818

Steps to reproduce:

git clone https://github.com/AxelNennker/firefox_credentials
fix path in addcredentials.sh for your setup
The script will add patches to your mozilla-central tree if executed.

Create a webidl with an interface and put wrapperCache: False in Bindings.conf for that interface.
mach webidl-example InterfaceName
will nevertheless output a class stub that is wrappercached.


Actual results:



#ifndef mozilla_dom_Credential_h
#define mozilla_dom_Credential_h

#include "mozilla/Attributes.h"
#include "mozilla/ErrorResult.h"
#include "nsCycleCollectionParticipant.h"
#include "nsWrapperCache.h"

struct JSContext;

namespace mozilla {
namespace dom {

class Credential : public nsISupports /* or NonRefcountedDOMObject if this is a non-refcounted object */
{
public:
  NS_DECL_CYCLE_COLLECTING_ISUPPORTS
  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(Credential)

public:
  Credential();

protected:
  ~Credential();

public:
  bool WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto, JS::MutableHandle<JSObject*> aReflector);

  void GetId(nsString& aRetVal) const;

  void GetType(nsString& aRetVal) const;
};

} // namespace dom
} // namespace mozilla

#endif // mozilla_dom_Credential_h



Expected results:


Do not add nsWrapperCache.h to the includes if wrapperCache: False
http://mxr.mozilla.org/mozilla-central/source/dom/bindings/Codegen.py#13572

Do not generate WrapObject if wrapperCache:False
http://mxr.mozilla.org/mozilla-central/source/dom/bindings/Codegen.py#13409
You need a WrapObject, assuming you're concrete.

But what we should do is skip the #include and not use the SCRIPT_HOLDER_CLASS version of the CC macro.
Status: UNCONFIRMED → NEW
Component: Untriaged → DOM
Ever confirmed: true
Product: Firefox → Core
You need to log in before you can comment on or make changes to this bug.