Currently there is a glib and CoreFoundation implementation of KeyedEncoder and KeyedDecoder. There should be a generic implementation of this available for platforms not using glib and CoreFoundation.
It seems that WebCore/platform/generic/KeyedDecoderGeneric.cpp can be implemented by using wtf/persistence/PersistentDecoder.h.
Created attachment 367619 [details]
Created attachment 367621 [details]
Created attachment 367622 [details]
Comment on attachment 367622 [details]
View in context: https://bugs.webkit.org/attachment.cgi?id=367622&action=review
> + BeginObject,
> + EndObject,
> + BeginArray,
> + BeginArrayElement,
> + EndArrayElement,
> + EndArray,
We actually only need Object and Array here, but removing the others would require changing the CF version. Maybe we should just update both versions in the future. Then we could use recursion instead of having our own stacks, too. What do you think?
(In reply to Alex Christensen from comment #5)
> We actually only need Object and Array here, but removing the others would
> require changing the CF version. Maybe we should just update both versions
> in the future. Then we could use recursion instead of having our own
> stacks, too. What do you think?
I agreed on your opinion. KeyedDecoder interface is badly designed.
We can take two approaches in this case, SAX approach and DOM approach.
In DOM approach, KeyedDecoder should have a iterator which indicates the current node.
In SAX approach, KeyedDecoder should only have event driven callbacks.
Anyway, we need to rewrite all clients in order to do the refactoring.
* deserializeIDBKeyPath in IDBSerialization.cpp
I guess those tasks are not so easy.
Regarding having own stack, I'm not sure how we shoud do.
Because I observes stack overflow in the 2500-level nested array
in storage/indexeddb/key-type-array.html in WinCairo port.
Committed r244450: <https://trac.webkit.org/changeset/244450>