|
bindings: Add PropertyBag
This is a work-in-progress CL and not intended to land.
(This CL doesn't pass all layout tests now)
To implement IDL dictionaries, we need a helper class that converts
a V8 object's properties to native values. Currently DictionaryHelper
does the job, but it's very complicated and difficult to extend.
Using DictionaryHelper to implement IDL dictionaries will add
further mess and I'd like to avoid that. However, it's somewhat
difficult to clean up DictionaryHelper at this point.
So I'd like to add a new class called PropertyBag for IDL
dictionaries implementation. This class does a similar job to
DictionaryHelper, but makes use of the CG and template specialization
to reduce manually-written code.
The idea is:
- The GC generates T -> V8T conversion traits (PropertyBagTraits).
- Add template functions which convert a V8 value to a native value
in V8Binding.h (called nativeValueMayFail).
These functions are used by PropertyBag::getInternal().
- PropertyBag has one get() method and some getInternal() methods.
getInternal() will be defined for container types and types which
require special handling.
- We no longer need to add template specialization manually.
Once we implement IDL dictionaries, we should be able to remove
DictionaryHelper. However, DictionaryHelper is also used to initialize
EventInits so we need to replace it with PropertyBag.
In this CL, I added EventInitInitializer class to show how we can use
PropertyBag to initialize EventInits.
This CL removed DictionaryHelper, but I don't think we can do it now.
My current plan is:
- Add the minimum PropertyBag implementation for IDL dictionaries.
(at this point, we will have some code duplication)
- Implement all IDL dictionaries we need.
- Use PropertyBag to initialize EventInits.
- Remove Dictionary(Helper) from blink side.
WDYT? If this approach sounds reasonable, I'll create CLs for actual review.
|
Unified diffs |
Side-by-side diffs |
Delta from patch set |
Stats (+1130 lines, -1410 lines) |
Patch |
 |
M |
LayoutTests/fast/dom/idl-dictionary-unittest.html
|
View
|
|
1 chunk |
+58 lines, -23 lines |
0 comments
|
Download
|
 |
M |
LayoutTests/fast/dom/idl-dictionary-unittest-expected.txt
|
View
|
|
1 chunk |
+37 lines, -10 lines |
0 comments
|
Download
|
 |
M |
LayoutTests/fast/events/constructors/message-event-constructor-expected.txt
|
View
|
|
1 chunk |
+12 lines, -12 lines |
0 comments
|
Download
|
 |
M |
Source/bindings/core/v8/CustomElementConstructorBuilder.cpp
|
View
|
|
2 chunks |
+2 lines, -2 lines |
0 comments
|
Download
|
 |
M |
Source/bindings/core/v8/Dictionary.h
|
View
|
|
2 chunks |
+78 lines, -99 lines |
0 comments
|
Download
|
 |
M |
Source/bindings/core/v8/Dictionary.cpp
|
View
|
|
3 chunks |
+2 lines, -225 lines |
0 comments
|
Download
|
 |
D |
Source/bindings/core/v8/DictionaryHelperForBindings.h
|
View
|
|
1 chunk |
+0 lines, -70 lines |
0 comments
|
Download
|
 |
D |
Source/bindings/core/v8/DictionaryHelperForCore.cpp
|
View
|
|
1 chunk |
+0 lines, -655 lines |
0 comments
|
Download
|
 |
A |
Source/bindings/core/v8/PropertyBag.h
|
View
|
|
1 chunk |
+266 lines, -0 lines |
0 comments
|
Download
|
 |
A |
Source/bindings/core/v8/PropertyBag.cpp
|
View
|
|
1 chunk |
+87 lines, -0 lines |
0 comments
|
Download
|
 |
A + |
Source/bindings/core/v8/PropertyBagTraits.h
|
View
|
|
1 chunk |
+4 lines, -7 lines |
0 comments
|
Download
|
 |
M |
Source/bindings/core/v8/V8Binding.h
|
View
|
|
11 chunks |
+121 lines, -16 lines |
0 comments
|
Download
|
 |
M |
Source/bindings/core/v8/V8Binding.cpp
|
View
|
|
1 chunk |
+11 lines, -0 lines |
0 comments
|
Download
|
 |
M |
Source/bindings/core/v8/custom/V8BlobCustomHelpers.cpp
|
View
|
|
3 chunks |
+3 lines, -3 lines |
0 comments
|
Download
|
 |
M |
Source/bindings/core/v8/custom/V8MessageEventCustom.cpp
|
View
|
|
1 chunk |
+4 lines, -3 lines |
0 comments
|
Download
|
 |
M |
Source/bindings/core/v8/v8.gypi
|
View
|
|
2 chunks |
+3 lines, -2 lines |
0 comments
|
Download
|
 |
A |
Source/bindings/modules/v8/DictionaryForModules.h
|
View
|
|
1 chunk |
+13 lines, -0 lines |
0 comments
|
Download
|
 |
D |
Source/bindings/modules/v8/DictionaryHelperForModules.cpp
|
View
|
|
1 chunk |
+0 lines, -82 lines |
0 comments
|
Download
|
 |
M |
Source/bindings/modules/v8/v8.gypi
|
View
|
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
 |
M |
Source/bindings/scripts/idl_types.py
|
View
|
|
1 chunk |
+1 line, -0 lines |
0 comments
|
Download
|
 |
M |
Source/bindings/scripts/v8_dictionary.py
|
View
|
|
1 chunk |
+2 lines, -2 lines |
0 comments
|
Download
|
 |
M |
Source/bindings/scripts/v8_interface.py
|
View
|
|
2 chunks |
+2 lines, -1 line |
0 comments
|
Download
|
 |
M |
Source/bindings/scripts/v8_types.py
|
View
|
|
2 chunks |
+3 lines, -2 lines |
0 comments
|
Download
|
 |
M |
Source/bindings/templates/dictionary_v8.h
|
View
|
|
1 chunk |
+3 lines, -1 line |
0 comments
|
Download
|
 |
M |
Source/bindings/templates/dictionary_v8.cpp
|
View
|
|
1 chunk |
+6 lines, -5 lines |
0 comments
|
Download
|
 |
M |
Source/bindings/templates/interface.h
|
View
|
|
2 chunks |
+7 lines, -2 lines |
0 comments
|
Download
|
 |
M |
Source/bindings/templates/interface.cpp
|
View
|
|
2 chunks |
+13 lines, -12 lines |
0 comments
|
Download
|
 |
M |
Source/bindings/tests/results/V8SVGTestInterface.h
|
View
|
|
2 chunks |
+6 lines, -0 lines |
0 comments
|
Download
|
 |
M |
Source/bindings/tests/results/V8TestDictionary.h
|
View
|
|
1 chunk |
+3 lines, -1 line |
0 comments
|
Download
|
 |
M |
Source/bindings/tests/results/V8TestDictionary.cpp
|
View
|
|
1 chunk |
+20 lines, -18 lines |
0 comments
|
Download
|
 |
M |
Source/bindings/tests/results/V8TestException.h
|
View
|
|
2 chunks |
+6 lines, -0 lines |
0 comments
|
Download
|
 |
M |
Source/bindings/tests/results/V8TestInterface.h
|
View
|
|
2 chunks |
+6 lines, -0 lines |
0 comments
|
Download
|
 |
M |
Source/bindings/tests/results/V8TestInterface2.h
|
View
|
|
2 chunks |
+6 lines, -0 lines |
0 comments
|
Download
|
 |
M |
Source/bindings/tests/results/V8TestInterface3.h
|
View
|
|
2 chunks |
+6 lines, -0 lines |
0 comments
|
Download
|
 |
M |
Source/bindings/tests/results/V8TestInterfaceCheckSecurity.h
|
View
|
|
2 chunks |
+6 lines, -0 lines |
0 comments
|
Download
|
 |
M |
Source/bindings/tests/results/V8TestInterfaceConstructor.h
|
View
|
|
2 chunks |
+6 lines, -0 lines |
0 comments
|
Download
|
 |
M |
Source/bindings/tests/results/V8TestInterfaceConstructor2.h
|
View
|
|
2 chunks |
+6 lines, -0 lines |
0 comments
|
Download
|
 |
M |
Source/bindings/tests/results/V8TestInterfaceConstructor3.h
|
View
|
|
2 chunks |
+6 lines, -0 lines |
0 comments
|
Download
|
 |
M |
Source/bindings/tests/results/V8TestInterfaceConstructor4.h
|
View
|
|
2 chunks |
+6 lines, -0 lines |
0 comments
|
Download
|
 |
M |
Source/bindings/tests/results/V8TestInterfaceCustomConstructor.h
|
View
|
|
2 chunks |
+6 lines, -0 lines |
0 comments
|
Download
|
 |
M |
Source/bindings/tests/results/V8TestInterfaceDocument.h
|
View
|
|
2 chunks |
+6 lines, -0 lines |
0 comments
|
Download
|
 |
M |
Source/bindings/tests/results/V8TestInterfaceEmpty.h
|
View
|
|
2 chunks |
+6 lines, -0 lines |
0 comments
|
Download
|
 |
M |
Source/bindings/tests/results/V8TestInterfaceEventConstructor.h
|
View
|
|
3 chunks |
+8 lines, -2 lines |
0 comments
|
Download
|
 |
M |
Source/bindings/tests/results/V8TestInterfaceEventConstructor.cpp
|
View
|
|
3 chunks |
+22 lines, -21 lines |
0 comments
|
Download
|
 |
M |
Source/bindings/tests/results/V8TestInterfaceEventTarget.h
|
View
|
|
2 chunks |
+6 lines, -0 lines |
0 comments
|
Download
|
 |
M |
Source/bindings/tests/results/V8TestInterfaceGarbageCollected.h
|
View
|
|
2 chunks |
+6 lines, -0 lines |
0 comments
|
Download
|
 |
M |
Source/bindings/tests/results/V8TestInterfaceNamedConstructor.h
|
View
|
|
2 chunks |
+6 lines, -0 lines |
0 comments
|
Download
|
 |
M |
Source/bindings/tests/results/V8TestInterfaceNamedConstructor2.h
|
View
|
|
2 chunks |
+6 lines, -0 lines |
0 comments
|
Download
|
 |
M |
Source/bindings/tests/results/V8TestInterfaceNode.h
|
View
|
|
2 chunks |
+6 lines, -0 lines |
0 comments
|
Download
|
 |
M |
Source/bindings/tests/results/V8TestInterfaceNotScriptWrappable.h
|
View
|
|
2 chunks |
+6 lines, -0 lines |
0 comments
|
Download
|
 |
M |
Source/bindings/tests/results/V8TestInterfaceWillBeGarbageCollected.h
|
View
|
|
2 chunks |
+6 lines, -0 lines |
0 comments
|
Download
|
 |
M |
Source/bindings/tests/results/V8TestNode.h
|
View
|
|
2 chunks |
+6 lines, -0 lines |
0 comments
|
Download
|
 |
M |
Source/bindings/tests/results/V8TestObject.h
|
View
|
|
2 chunks |
+6 lines, -0 lines |
0 comments
|
Download
|
 |
M |
Source/bindings/tests/results/V8TestObject.cpp
|
View
|
|
1 chunk |
+2 lines, -1 line |
0 comments
|
Download
|
 |
M |
Source/bindings/tests/results/V8TestSpecialOperations.h
|
View
|
|
2 chunks |
+6 lines, -0 lines |
0 comments
|
Download
|
 |
M |
Source/bindings/tests/results/V8TestSpecialOperationsNotEnumerable.h
|
View
|
|
2 chunks |
+6 lines, -0 lines |
0 comments
|
Download
|
 |
M |
Source/bindings/tests/results/V8TestTypedefs.h
|
View
|
|
2 chunks |
+6 lines, -0 lines |
0 comments
|
Download
|
 |
M |
Source/core/animation/AnimationTest.cpp
|
View
|
|
1 chunk |
+2 lines, -2 lines |
0 comments
|
Download
|
 |
M |
Source/core/animation/EffectInput.cpp
|
View
|
|
3 chunks |
+5 lines, -5 lines |
0 comments
|
Download
|
 |
M |
Source/core/animation/TimingInput.cpp
|
View
|
|
1 chunk |
+9 lines, -9 lines |
0 comments
|
Download
|
 |
M |
Source/core/css/FontFace.cpp
|
View
|
|
1 chunk |
+6 lines, -6 lines |
0 comments
|
Download
|
 |
M |
Source/core/dom/DOMPoint.cpp
|
View
|
|
1 chunk |
+4 lines, -4 lines |
0 comments
|
Download
|
 |
M |
Source/core/dom/Element.cpp
|
View
|
|
4 chunks |
+4 lines, -4 lines |
0 comments
|
Download
|
 |
M |
Source/core/dom/MutationObserver.cpp
|
View
|
|
1 chunk |
+7 lines, -7 lines |
0 comments
|
Download
|
 |
M |
Source/core/frame/LocalDOMWindow.cpp
|
View
|
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
 |
M |
Source/core/page/EventSource.cpp
|
View
|
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
 |
M |
Source/core/testing/DictionaryTest.h
|
View
|
|
2 chunks |
+15 lines, -5 lines |
0 comments
|
Download
|
 |
M |
Source/core/testing/DictionaryTest.cpp
|
View
|
|
2 chunks |
+44 lines, -11 lines |
0 comments
|
Download
|
 |
M |
Source/core/testing/InternalDictionary.idl
|
View
|
|
1 chunk |
+10 lines, -3 lines |
0 comments
|
Download
|
 |
M |
Source/modules/crypto/CryptoResultImpl.cpp
|
View
|
|
1 chunk |
+4 lines, -0 lines |
0 comments
|
Download
|
 |
M |
Source/modules/crypto/NormalizeAlgorithm.cpp
|
View
|
|
6 chunks |
+6 lines, -6 lines |
0 comments
|
Download
|
 |
M |
Source/modules/crypto/SubtleCrypto.cpp
|
View
|
|
3 chunks |
+3 lines, -3 lines |
0 comments
|
Download
|
 |
M |
Source/modules/encoding/TextDecoder.cpp
|
View
|
|
2 chunks |
+3 lines, -3 lines |
0 comments
|
Download
|
 |
M |
Source/modules/filesystem/FileSystemFlags.h
|
View
|
|
1 chunk |
+2 lines, -2 lines |
0 comments
|
Download
|
 |
M |
Source/modules/geofencing/CircularRegion.cpp
|
View
|
|
1 chunk |
+4 lines, -4 lines |
0 comments
|
Download
|
 |
M |
Source/modules/geolocation/PositionOptions.cpp
|
View
|
|
2 chunks |
+3 lines, -3 lines |
0 comments
|
Download
|
 |
M |
Source/modules/indexeddb/IDBDatabase.cpp
|
View
|
|
1 chunk |
+2 lines, -2 lines |
0 comments
|
Download
|
 |
M |
Source/modules/indexeddb/IDBObjectStore.cpp
|
View
|
|
1 chunk |
+2 lines, -2 lines |
0 comments
|
Download
|
 |
M |
Source/modules/mediastream/MediaConstraintsImpl.cpp
|
View
|
|
2 chunks |
+2 lines, -2 lines |
0 comments
|
Download
|
 |
M |
Source/modules/mediastream/RTCIceCandidate.cpp
|
View
|
|
1 chunk |
+3 lines, -3 lines |
0 comments
|
Download
|
 |
M |
Source/modules/mediastream/RTCPeerConnection.cpp
|
View
|
|
7 chunks |
+17 lines, -17 lines |
0 comments
|
Download
|
 |
M |
Source/modules/mediastream/RTCSessionDescription.cpp
|
View
|
|
1 chunk |
+2 lines, -2 lines |
0 comments
|
Download
|
 |
M |
Source/modules/mediastream/UserMediaRequest.cpp
|
View
|
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
 |
M |
Source/modules/notifications/Notification.cpp
|
View
|
|
1 chunk |
+5 lines, -5 lines |
0 comments
|
Download
|
 |
M |
Source/modules/serviceworkers/Headers.cpp
|
View
|
|
3 chunks |
+3 lines, -3 lines |
0 comments
|
Download
|
 |
M |
Source/modules/serviceworkers/RegistrationOptionList.h
|
View
|
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
 |
M |
Source/modules/serviceworkers/RequestInit.cpp
|
View
|
|
2 chunks |
+7 lines, -7 lines |
0 comments
|
Download
|
 |
M |
Source/modules/serviceworkers/Response.h
|
View
|
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
 |
M |
Source/modules/serviceworkers/ResponseInit.h
|
View
|
|
2 chunks |
+5 lines, -5 lines |
0 comments
|
Download
|
 |
M |
Source/modules/serviceworkers/ServiceWorkerClients.cpp
|
View
|
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
 |
M |
Source/modules/webmidi/MIDIOptions.h
|
View
|
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
Total messages: 10 (5 generated)
|