Remove deprecated WireClient/Server handlers functions

Remove deprecated functions and change new functions to pure
virtual since they are implemented both on dawn and chromium
side.

Bug: dawn:773
Change-Id: I5adfe42ad1155276f533660b938b869c775025bf
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/58100
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Shrek Shao <shrekshao@google.com>
This commit is contained in:
shrekshao 2021-07-15 01:13:04 +00:00 committed by Dawn LUCI CQ
parent 427a5eb9c5
commit 813a855b54
3 changed files with 7 additions and 64 deletions

View File

@ -303,9 +303,6 @@ namespace dawn_wire { namespace client {
// - Unmap locally on the client
// - Server -> Client: Result of MapRequest2
// TODO(dawn:608): mDevice->InjectError(WGPUErrorType_Validation) for map oom failure
// and separate from buffer destroyed before unmap case
// mWriteHandle can still be nullptr if buffer has been destroyed before unmap
if ((mMapState == MapState::MappedForWrite || mMapState == MapState::MappedAtCreation) &&
mWriteHandle != nullptr) {
@ -364,8 +361,6 @@ namespace dawn_wire { namespace client {
BufferUnmapCmd cmd;
cmd.self = ToAPI(this);
client->SerializeCommand(cmd);
// TODO(dawn:608): add tracking mapped status and change to return bool for returning unmap
// success/failure
}
void Buffer::Destroy() {

View File

@ -112,31 +112,17 @@ namespace dawn_wire {
// Simply return the base address of the allocation (without applying any offset)
// Returns nullptr if the allocation failed.
// The data must live at least until the ReadHandle is destructued
// TODO(dawn:773): change to pure virtual after update on chromium side.
virtual const void* GetData() {
return nullptr;
}
virtual const void* GetData() = 0;
// Gets called when a MapReadCallback resolves.
// deserialize the data update and apply
// it to the range (offset, offset + size) of allocation
// There could be nothing to be deserialized (if using shared memory)
// Needs to check potential offset/size OOB and overflow
// TODO(dawn:773): change to pure virtual after update on chromium side.
virtual bool DeserializeDataUpdate(const void* deserializePointer,
size_t deserializeSize,
size_t offset,
size_t size) {
return false;
}
// TODO(dawn:773): remove after update on chromium side.
virtual bool DeserializeInitialData(const void* deserializePointer,
size_t deserializeSize,
const void** data,
size_t* dataLength) {
return false;
}
size_t size) = 0;
private:
ReadHandle(const ReadHandle&) = delete;
@ -158,40 +144,18 @@ namespace dawn_wire {
// The data returned should be zero-initialized.
// The data returned must live at least until the WriteHandle is destructed.
// On failure, the pointer returned should be null.
// TODO(dawn:773): change to pure virtual after update on chromium side.
virtual void* GetData() {
return nullptr;
}
virtual void* GetData() = 0;
// Get the required serialization size for SerializeDataUpdate
// TODO(dawn:773): change to pure virtual after update on chromium side.
virtual size_t SizeOfSerializeDataUpdate(size_t offset, size_t size) {
return 0;
}
virtual size_t SizeOfSerializeDataUpdate(size_t offset, size_t size) = 0;
// Serialize a command to send the modified contents of
// the subrange (offset, offset + size) of the allocation at buffer unmap
// This subrange is always the whole mapped region for now
// There could be nothing to be serialized (if using shared memory)
// TODO(dawn:773): change to pure virtual after update on chromium side.
virtual void SerializeDataUpdate(void* serializePointer,
size_t offset,
size_t size) {
}
// TODO(dawn:773): remove after update on chromium side.
virtual std::pair<void*, size_t> Open() {
return std::make_pair(nullptr, 0);
}
// TODO(dawn:773): remove after update on chromium side.
virtual size_t SerializeFlushSize() {
return 0;
}
// TODO(dawn:773): remove after update on chromium side.
virtual void SerializeFlush(void* serializePointer) {
}
size_t size) = 0;
private:
WriteHandle(const WriteHandle&) = delete;

View File

@ -93,32 +93,16 @@ namespace dawn_wire {
// Return the size of the command serialized if
// SerializeDataUpdate is called with the same offset/size args
// TODO(dawn:773): change to pure virtual after update on chromium side.
virtual size_t SizeOfSerializeDataUpdate(size_t offset, size_t size) {
return 0;
}
virtual size_t SizeOfSerializeDataUpdate(size_t offset, size_t size) = 0;
// Gets called when a MapReadCallback resolves.
// Serialize the data update for the range (offset, offset + size) into
// |serializePointer| to the client There could be nothing to be serialized (if
// using shared memory)
// TODO(dawn:773): change to pure virtual after update on chromium side.
virtual void SerializeDataUpdate(const void* data,
size_t offset,
size_t size,
void* serializePointer) {
}
// TODO(dawn:773): remove after update on chromium side.
virtual size_t SerializeInitialDataSize(const void* data, size_t dataLength) {
return 0;
}
// TODO(dawn:773): remove after update on chromium side.
virtual void SerializeInitialData(const void* data,
size_t dataLength,
void* serializePointer) {
}
void* serializePointer) = 0;
private:
ReadHandle(const ReadHandle&) = delete;