Refactor of WebGL remoting classes
Categories
(Core :: Graphics: CanvasWebGL, enhancement, P1)
Tracking
()
Tracking | Status | |
---|---|---|
firefox79 | --- | fixed |
People
(Reporter: handyman, Assigned: handyman)
References
Details
Attachments
(6 files)
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review |
Clean up some ugliness. E.g.:
- PcqParamTraits (aka QueueParamTraits) API refactor. Turn (from PcqParamTraits<WebGLActiveInfo>):
static PcqStatus Read(ConsumerView& aConsumerView, ParamType* aArg) {
aConsumerView.ReadParam(aArg ? &aArg->mElemCount : nullptr);
aConsumerView.ReadParam(aArg ? &aArg->mElemType : nullptr);
aConsumerView.ReadParam(aArg ? &aArg->mBaseUserName : nullptr);
aConsumerView.ReadParam(aArg ? &aArg->mIsArray : nullptr);
aConsumerView.ReadParam(aArg ? &aArg->mElemSize : nullptr);
aConsumerView.ReadParam(aArg ? &aArg->mBaseMappedName : nullptr);
return aConsumerView.ReadParam(aArg ? &aArg->mBaseType : nullptr);
}
into
static PcqStatus Read(ConsumerView& aConsumerView, ParamType* aArg) {
return aConsumerView.ReadParam(aArg,
&ParamType::mElemCount, &ParamType::mElemType,
&ParamType::mBaseUserName, &ParamType::mIsArray,
&ParamType::mElemSize, &ParamType::mBaseMappedName,
&ParamType::mBaseType);
}
or go even further and macro-tize the whole class specialization (including Read, Write and MinSize) so we can write the entire PcqParamTraits<WebGLActiveInfo> impl as e.g.:
BASIC_QUEUE_PARAM_TRAITS(WebGLActiveInfo,
mElemCount, mElemType, mBaseUserName, mIsArray, mElemSize, mBaseMappedName, mBaseType)
- Remove peeking from ProducerConsumerQueue.
- Use folds in ProducerConsumerQueue.
- Remove unused TypeInfo stuff from ProducerConsumerQueue.
- (Maybe) change IpdlQueue to send Shmems with ExchangeIpdlQueueData.
and so on.
Assignee | ||
Comment 1•4 years ago
|
||
Type checking these queues turned out not to be useful. It added tokens to the stream that validated the type of the data in the stream against the type of the objects that it would deserialize into. However, the IPC mechanism is already completely type safe at the source code level so it was not useful in debugging.
Assignee | ||
Comment 2•4 years ago
|
||
Removing dead code, cleaning up comments, etc.
Depends on D78539
Assignee | ||
Comment 3•4 years ago
|
||
EnumSerializers allow for easy enum validation in deserialization. The implementation is taken from IPDL's EnumSerializers and uses the IPDL EnumValidator classes and is used in exactly the same way.
Depends on D78540
Assignee | ||
Comment 4•4 years ago
|
||
Peeking or pulling entries from the queue without deserializing them into an object requires making QueueParamTraits more complex. We don't currently need the functionality; the added complexity isn't worth it.
Depends on D78541
Assignee | ||
Comment 5•4 years ago
|
||
Since we are no longer peeking or removing without copying, MinSize always gets a valid object. This converts its parameter to a reference and removes extraneous null checks.
Depends on D78542
Assignee | ||
Comment 6•4 years ago
|
||
Since we are no longer peeking or removing without copying, Read always gets a valid object. This makes its parameter a reference and removes extraneous null checks.
Depends on D78543
Comment 8•4 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/cb87087c351f
https://hg.mozilla.org/mozilla-central/rev/d03da841a4b7
https://hg.mozilla.org/mozilla-central/rev/63837251d2bb
https://hg.mozilla.org/mozilla-central/rev/d2157c578ddd
https://hg.mozilla.org/mozilla-central/rev/322db52810cb
https://hg.mozilla.org/mozilla-central/rev/b51802b6662b
Description
•