зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1874803 - Add sentinel invalid recorded event type. r=gfx-reviewers,lsalzman
RecordedEvent::EventType::INVALID should never be seen in a recording and so can be used as a sentinel value that we can assert against. If it is seen, then the recording should fail gracefully. Differential Revision: https://phabricator.services.mozilla.com/D198649
This commit is contained in:
Родитель
2fa4750e87
Коммит
2d90dfa6d7
|
@ -42,7 +42,7 @@ bool InlineTranslator::TranslateRecording(char* aData, size_t aLen) {
|
|||
return false;
|
||||
}
|
||||
|
||||
uint8_t eventType;
|
||||
uint8_t eventType = RecordedEvent::EventType::INVALID;
|
||||
ReadElement(reader, eventType);
|
||||
while (reader.good()) {
|
||||
bool success = RecordedEvent::DoWithEvent(
|
||||
|
|
|
@ -367,7 +367,8 @@ class EventStream {
|
|||
class RecordedEvent {
|
||||
public:
|
||||
enum EventType : uint8_t {
|
||||
DRAWTARGETCREATION = 0,
|
||||
INVALID = 0,
|
||||
DRAWTARGETCREATION,
|
||||
DRAWTARGETDESTRUCTION,
|
||||
SETCURRENTDRAWTARGET,
|
||||
FILLRECT,
|
||||
|
|
|
@ -538,7 +538,7 @@ void CanvasTranslator::TranslateRecording() {
|
|||
});
|
||||
|
||||
mHeader->readerState = State::Processing;
|
||||
EventType eventType;
|
||||
EventType eventType = EventType::INVALID;
|
||||
while (ReadNextEvent(eventType)) {
|
||||
bool success = RecordedEvent::DoWithEventFromReader(
|
||||
mCurrentMemReader, eventType,
|
||||
|
|
|
@ -48,7 +48,7 @@ bool PrintTranslator::TranslateRecording(PRFileDescStream& aRecording) {
|
|||
return false;
|
||||
}
|
||||
|
||||
uint8_t eventType;
|
||||
uint8_t eventType = RecordedEvent::EventType::INVALID;
|
||||
ReadElement(aRecording, eventType);
|
||||
while (aRecording.good()) {
|
||||
bool success = RecordedEvent::DoWithEventFromStream(
|
||||
|
|
Загрузка…
Ссылка в новой задаче