New DOM bindings proxy binding support in workers

NEW
Unassigned

Status

()

Core
DOM
6 years ago
6 years ago

People

(Reporter: janv, Unassigned)

Tracking

(Blocks: 1 bug)

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(4 attachments)

(Reporter)

Description

6 years ago
dom/webidl/DOMStringLis~rkers.webidl:

interface DOMStringList_workers {
  readonly attribute unsigned long length;
  // XXXvarga getters seem to be not supported in workers
  getter DOMString? item(unsigned long index);
  boolean contains(DOMString string);
};

dom/bindings/Bindings.conf:

'DOMStringList_workers': {
    'workers': True
},

it seems that the code generator produces DOMClass instead of DOMJSClass:
DOMStringList_workers.cpp
/usr/bin/clang++ -o DOMStringList_workers.o -c  -fvisibility=hidden -DMOZILLA_INTERNAL_API -D_IMPL_NS_COM -DEXPORT_XPT_API -DEXPORT_XPTC_API -D_IMPL_NS_GFX -D_IMPL_NS_WIDGET -DIMPL_XREAPI -DIMPL_NS_NET -DIMPL_THEBES  -DSTATIC_EXPORTABLE_JS_API -DNO_NSPR_10_SUPPORT -DEXCLUDE_SKIA_DEPENDENCIES  -DOS_POSIX=1 -DOS_MACOSX=1  -I/Users/varga/Sources/IPC/mozilla-central/content/base/src -I/Users/varga/Sources/IPC/mozilla-central/content/events/src -I/Users/varga/Sources/IPC/mozilla-central/dom/base -I/Users/varga/Sources/IPC/mozilla-central/dom/system -I/Users/varga/Sources/IPC/mozilla-central/xpcom/build  -I/Users/varga/Sources/IPC/mozilla-central/ipc/chromium/src -I/Users/varga/Sources/IPC/mozilla-central/ipc/glue -I../../ipc/ipdl/_ipdlheaders  -I/Users/varga/Sources/IPC/mozilla-central/dom/workers -I. -I../../dist/include  -I/Users/varga/Sources/IPC/obj-ff-dbg/dist/include/nspr -I/Users/varga/Sources/IPC/obj-ff-dbg/dist/include/nss      -fPIC -Qunused-arguments  -Qunused-arguments -Wall -Wpointer-arith -Woverloaded-virtual -Werror=return-type -Wtype-limits -Wempty-body -Wno-ctor-dtor-privacy -Wno-overlength-strings -Wno-invalid-offsetof -Wno-variadic-macros -Wno-c++0x-extensions -Wno-extended-offsetof -Wno-unknown-warning-option -Wno-return-type-c-linkage -Wno-mismatched-tags -fno-exceptions -fno-strict-aliasing -fno-rtti -ffunction-sections -fdata-sections -fno-exceptions -std=gnu++0x -pthread -DNO_X11 -pipe  -DDEBUG -D_DEBUG -DTRACING -g -fno-omit-frame-pointer  -Werror -Wno-error=uninitialized  -Qunused-arguments  -DMOZILLA_CLIENT -include ../../mozilla-config.h -MD -MF .deps/DOMStringList_workers.o.pp  /Users/varga/Sources/IPC/mozilla-central/dom/workers/DOMStringList_workers.cpp
In file included from /Users/varga/Sources/IPC/mozilla-central/dom/workers/DOMStringList_workers.cpp:9:
/Users/varga/Sources/IPC/mozilla-central/dom/workers/DOMBindingInlines.h:51:1: error: 
      no member named 'ToJSClass' in 'mozilla::dom::DOMClass'
SPECIALIZE_PROTO_TRAITS(DOMStringList_workers)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/varga/Sources/IPC/mozilla-central/dom/workers/DOMBindingInlines.h:40:45: note: 
      expanded from macro 'SPECIALIZE_PROTO_TRAITS'
      return _class##Binding_workers::Class.ToJSClass(); ...
                                            ^
1 error generated.
make[1]: *** [DOMStringList_workers.o] Error 1
make: *** [default] Error 2

I'll attach generated code for the interface with the getter and also w/o the getter.
(Reporter)

Comment 1

6 years ago
Created attachment 690827 [details]
Generated DOMStringList_workersBinding.h (w/ the getter)
(Reporter)

Comment 2

6 years ago
Created attachment 690828 [details]
Generated DOMStringList_workersBinding.cpp (w/ the getter)
(Reporter)

Comment 3

6 years ago
Created attachment 690829 [details]
Generated DOMStringList_workersBinding.h (w/o the getter)
(Reporter)

Comment 4

6 years ago
Created attachment 690830 [details]
Generated DOMStringList_workersBinding.cpp (w/o the getter)
(Reporter)

Updated

6 years ago
Attachment #690829 - Attachment mime type: application/x-fossil-artifact → text/plain
(Reporter)

Updated

6 years ago
Blocks: 798875
Yeah, that looks pretty broken. The Wrap code in DOMBindingInlines.h will need to be able to create a proxy object (and will need some way to decide whether to do a proxy or a regular object).
(Reporter)

Updated

6 years ago
OS: Mac OS X → All
Hardware: x86 → All
Summary: New DOM bindings getter support in workers → New DOM bindings proxy binding support in workers
You need to log in before you can comment on or make changes to this bug.