Rename namespace dawn_wire to dawn::wire.

But keep a namespace alias to avoid breaking project that depend on the
previous namespace name while they get updated.

Bug: dawn:824
Change-Id: I1e99c4d0d2acf7644a225a88d07806d1a64478e6
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/75540
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
This commit is contained in:
Corentin Wallez 2022-01-11 09:57:33 +00:00 committed by Dawn LUCI CQ
parent f07477a1ce
commit 5d846ab503
91 changed files with 202 additions and 198 deletions

View File

@ -86,8 +86,8 @@ static utils::BackendBinding* binding = nullptr;
static GLFWwindow* window = nullptr; static GLFWwindow* window = nullptr;
static dawn_wire::WireServer* wireServer = nullptr; static dawn::wire::WireServer* wireServer = nullptr;
static dawn_wire::WireClient* wireClient = nullptr; static dawn::wire::WireClient* wireClient = nullptr;
static utils::TerribleCommandBuffer* c2sBuf = nullptr; static utils::TerribleCommandBuffer* c2sBuf = nullptr;
static utils::TerribleCommandBuffer* s2cBuf = nullptr; static utils::TerribleCommandBuffer* s2cBuf = nullptr;
@ -149,18 +149,18 @@ wgpu::Device CreateCppDawnDevice() {
c2sBuf = new utils::TerribleCommandBuffer(); c2sBuf = new utils::TerribleCommandBuffer();
s2cBuf = new utils::TerribleCommandBuffer(); s2cBuf = new utils::TerribleCommandBuffer();
dawn_wire::WireServerDescriptor serverDesc = {}; dawn::wire::WireServerDescriptor serverDesc = {};
serverDesc.procs = &backendProcs; serverDesc.procs = &backendProcs;
serverDesc.serializer = s2cBuf; serverDesc.serializer = s2cBuf;
wireServer = new dawn_wire::WireServer(serverDesc); wireServer = new dawn::wire::WireServer(serverDesc);
c2sBuf->SetHandler(wireServer); c2sBuf->SetHandler(wireServer);
dawn_wire::WireClientDescriptor clientDesc = {}; dawn::wire::WireClientDescriptor clientDesc = {};
clientDesc.serializer = c2sBuf; clientDesc.serializer = c2sBuf;
wireClient = new dawn_wire::WireClient(clientDesc); wireClient = new dawn::wire::WireClient(clientDesc);
procs = dawn_wire::client::GetProcs(); procs = dawn::wire::client::GetProcs();
s2cBuf->SetHandler(wireClient); s2cBuf->SetHandler(wireClient);
auto deviceReservation = wireClient->ReserveDevice(); auto deviceReservation = wireClient->ReserveDevice();

View File

@ -17,7 +17,7 @@
#include "common/ityp_array.h" #include "common/ityp_array.h"
namespace dawn_wire { namespace dawn::wire {
enum class ObjectType : uint32_t { enum class ObjectType : uint32_t {
{% for type in by_category["object"] %} {% for type in by_category["object"] %}
@ -28,7 +28,7 @@ namespace dawn_wire {
template <typename T> template <typename T>
using PerObjectType = ityp::array<ObjectType, T, {{len(by_category["object"])}}>; using PerObjectType = ityp::array<ObjectType, T, {{len(by_category["object"])}}>;
} // namespace dawn_wire } // namespace dawn::wire
#endif // DAWNWIRE_OBJECTTPYE_AUTOGEN_H_ #endif // DAWNWIRE_OBJECTTPYE_AUTOGEN_H_

View File

@ -649,7 +649,7 @@
} }
{% endmacro %} {% endmacro %}
namespace dawn_wire { namespace dawn::wire {
ObjectHandle::ObjectHandle() = default; ObjectHandle::ObjectHandle() = default;
ObjectHandle::ObjectHandle(ObjectId id, ObjectGeneration generation) ObjectHandle::ObjectHandle(ObjectId id, ObjectGeneration generation)
@ -852,4 +852,4 @@ namespace dawn_wire {
nullptr, resolver) == WireResult::Success; nullptr, resolver) == WireResult::Success;
} }
} // namespace dawn_wire } // namespace dawn::wire

View File

@ -21,7 +21,7 @@
#include "dawn_wire/ObjectType_autogen.h" #include "dawn_wire/ObjectType_autogen.h"
#include "dawn_wire/WireResult.h" #include "dawn_wire/WireResult.h"
namespace dawn_wire { namespace dawn::wire {
using ObjectId = uint32_t; using ObjectId = uint32_t;
using ObjectGeneration = uint32_t; using ObjectGeneration = uint32_t;
@ -133,6 +133,6 @@ namespace dawn_wire {
{{write_command_struct(command, True)}} {{write_command_struct(command, True)}}
{% endfor %} {% endfor %}
} // namespace dawn_wire } // namespace dawn::wire
#endif // DAWNWIRE_WIRECMD_AUTOGEN_H_ #endif // DAWNWIRE_WIRECMD_AUTOGEN_H_

View File

@ -18,7 +18,7 @@
#include "dawn_wire/ObjectType_autogen.h" #include "dawn_wire/ObjectType_autogen.h"
#include "dawn_wire/client/ObjectBase.h" #include "dawn_wire/client/ObjectBase.h"
namespace dawn_wire::client { namespace dawn::wire::client {
template <typename T> template <typename T>
struct ObjectTypeToTypeEnum { struct ObjectTypeToTypeEnum {
@ -48,6 +48,6 @@ namespace dawn_wire::client {
}; };
{% endfor %} {% endfor %}
} // namespace dawn_wire::client } // namespace dawn::wire::client
#endif // DAWNWIRE_CLIENT_APIOBJECTS_AUTOGEN_H_ #endif // DAWNWIRE_CLIENT_APIOBJECTS_AUTOGEN_H_

View File

@ -21,7 +21,7 @@
#include <string> #include <string>
#include <vector> #include <vector>
namespace dawn_wire::client { namespace dawn::wire::client {
//* Outputs an rvalue that's the number of elements a pointer member points to. //* Outputs an rvalue that's the number of elements a pointer member points to.
{% macro member_length(member, accessor) -%} {% macro member_length(member, accessor) -%}
@ -175,4 +175,4 @@ namespace dawn_wire::client {
const {{Prefix}}ProcTable& GetProcs() { const {{Prefix}}ProcTable& GetProcs() {
return gProcTable; return gProcTable;
} }
} // namespace dawn_wire::client } // namespace dawn::wire::client

View File

@ -20,7 +20,7 @@
#include "dawn_wire/client/ApiObjects.h" #include "dawn_wire/client/ApiObjects.h"
#include "dawn_wire/client/ObjectAllocator.h" #include "dawn_wire/client/ObjectAllocator.h"
namespace dawn_wire::client { namespace dawn::wire::client {
class ClientBase : public ChunkedCommandHandler, public ObjectIdProvider { class ClientBase : public ChunkedCommandHandler, public ObjectIdProvider {
public: public:
@ -69,6 +69,6 @@ namespace dawn_wire::client {
{% endfor %} {% endfor %}
}; };
} // namespace dawn_wire::client } // namespace dawn::wire::client
#endif // DAWNWIRE_CLIENT_CLIENTBASE_AUTOGEN_H_ #endif // DAWNWIRE_CLIENT_CLIENTBASE_AUTOGEN_H_

View File

@ -17,7 +17,7 @@
#include <string> #include <string>
namespace dawn_wire::client { namespace dawn::wire::client {
{% for command in cmd_records["return command"] %} {% for command in cmd_records["return command"] %}
bool Client::Handle{{command.name.CamelCase()}}(DeserializeBuffer* deserializeBuffer) { bool Client::Handle{{command.name.CamelCase()}}(DeserializeBuffer* deserializeBuffer) {
Return{{command.name.CamelCase()}}Cmd cmd; Return{{command.name.CamelCase()}}Cmd cmd;
@ -94,4 +94,4 @@ namespace dawn_wire::client {
return commands; return commands;
} }
} // namespace dawn_wire::client } // namespace dawn::wire::client

View File

@ -22,7 +22,7 @@
#include "dawn_wire/WireDeserializeAllocator.h" #include "dawn_wire/WireDeserializeAllocator.h"
#include "dawn_wire/server/ObjectStorage.h" #include "dawn_wire/server/ObjectStorage.h"
namespace dawn_wire::server { namespace dawn::wire::server {
class ServerBase : public ChunkedCommandHandler, public ObjectIdResolver { class ServerBase : public ChunkedCommandHandler, public ObjectIdResolver {
public: public:
@ -100,6 +100,6 @@ namespace dawn_wire::server {
{% endfor %} {% endfor %}
}; };
} // namespace dawn_wire::server } // namespace dawn::wire::server
#endif // DAWNWIRE_SERVER_SERVERBASE_H_ #endif // DAWNWIRE_SERVER_SERVERBASE_H_

View File

@ -15,7 +15,7 @@
#include "common/Assert.h" #include "common/Assert.h"
#include "dawn_wire/server/Server.h" #include "dawn_wire/server/Server.h"
namespace dawn_wire::server { namespace dawn::wire::server {
//* Implementation of the command doers //* Implementation of the command doers
{% for command in cmd_records["command"] %} {% for command in cmd_records["command"] %}
{% set type = command.derived_object %} {% set type = command.derived_object %}
@ -118,4 +118,4 @@ namespace dawn_wire::server {
} }
} }
} // namespace dawn_wire::server } // namespace dawn::wire::server

View File

@ -15,7 +15,7 @@
#include "common/Assert.h" #include "common/Assert.h"
#include "dawn_wire/server/Server.h" #include "dawn_wire/server/Server.h"
namespace dawn_wire::server { namespace dawn::wire::server {
{% for command in cmd_records["command"] %} {% for command in cmd_records["command"] %}
{% set method = command.derived_method %} {% set method = command.derived_method %}
{% set is_method = method != None %} {% set is_method = method != None %}
@ -147,4 +147,4 @@ namespace dawn_wire::server {
return commands; return commands;
} }
} // namespace dawn_wire::server } // namespace dawn::wire::server

View File

@ -19,7 +19,7 @@
#include <cstddef> #include <cstddef>
namespace dawn_wire { namespace dawn::wire {
// BufferConsumer is a utility class that allows reading bytes from a buffer // BufferConsumer is a utility class that allows reading bytes from a buffer
// while simultaneously decrementing the amount of remaining space by exactly // while simultaneously decrementing the amount of remaining space by exactly
@ -80,6 +80,6 @@ namespace dawn_wire {
} }
}; };
} // namespace dawn_wire } // namespace dawn::wire
#endif // DAWNWIRE_BUFFERCONSUMER_H_ #endif // DAWNWIRE_BUFFERCONSUMER_H_

View File

@ -20,7 +20,7 @@
#include <limits> #include <limits>
#include <type_traits> #include <type_traits>
namespace dawn_wire { namespace dawn::wire {
template <typename BufferT> template <typename BufferT>
template <typename T> template <typename T>
@ -68,6 +68,6 @@ namespace dawn_wire {
return WireResult::Success; return WireResult::Success;
} }
} // namespace dawn_wire } // namespace dawn::wire
#endif // DAWNWIRE_BUFFERCONSUMER_IMPL_H_ #endif // DAWNWIRE_BUFFERCONSUMER_IMPL_H_

View File

@ -19,7 +19,7 @@
#include <algorithm> #include <algorithm>
#include <cstring> #include <cstring>
namespace dawn_wire { namespace dawn::wire {
ChunkedCommandHandler::~ChunkedCommandHandler() = default; ChunkedCommandHandler::~ChunkedCommandHandler() = default;
@ -76,4 +76,4 @@ namespace dawn_wire {
return ChunkedCommandsResult::Consumed; return ChunkedCommandsResult::Consumed;
} }
} // namespace dawn_wire } // namespace dawn::wire

View File

@ -22,7 +22,7 @@
#include <cstdint> #include <cstdint>
#include <memory> #include <memory>
namespace dawn_wire { namespace dawn::wire {
class ChunkedCommandHandler : public CommandHandler { class ChunkedCommandHandler : public CommandHandler {
public: public:
@ -66,6 +66,6 @@ namespace dawn_wire {
std::unique_ptr<char[]> mChunkedCommandData; std::unique_ptr<char[]> mChunkedCommandData;
}; };
} // namespace dawn_wire } // namespace dawn::wire
#endif // DAWNWIRE_CHUNKEDCOMMANDHANDLER_H_ #endif // DAWNWIRE_CHUNKEDCOMMANDHANDLER_H_

View File

@ -14,7 +14,7 @@
#include "dawn_wire/ChunkedCommandSerializer.h" #include "dawn_wire/ChunkedCommandSerializer.h"
namespace dawn_wire { namespace dawn::wire {
ChunkedCommandSerializer::ChunkedCommandSerializer(CommandSerializer* serializer) ChunkedCommandSerializer::ChunkedCommandSerializer(CommandSerializer* serializer)
: mSerializer(serializer), mMaxAllocationSize(serializer->GetMaximumAllocationSize()) { : mSerializer(serializer), mMaxAllocationSize(serializer->GetMaximumAllocationSize()) {
@ -35,4 +35,4 @@ namespace dawn_wire {
} }
} }
} // namespace dawn_wire } // namespace dawn::wire

View File

@ -24,7 +24,7 @@
#include <cstring> #include <cstring>
#include <memory> #include <memory>
namespace dawn_wire { namespace dawn::wire {
class ChunkedCommandSerializer { class ChunkedCommandSerializer {
public: public:
@ -109,6 +109,6 @@ namespace dawn_wire {
size_t mMaxAllocationSize; size_t mMaxAllocationSize;
}; };
} // namespace dawn_wire } // namespace dawn::wire
#endif // DAWNWIRE_CHUNKEDCOMMANDSERIALIZER_H_ #endif // DAWNWIRE_CHUNKEDCOMMANDSERIALIZER_H_

View File

@ -14,7 +14,7 @@
#include "dawn_wire/SupportedFeatures.h" #include "dawn_wire/SupportedFeatures.h"
namespace dawn_wire { namespace dawn::wire {
// Note: Upon updating this list, please also update serialization/deserialization // Note: Upon updating this list, please also update serialization/deserialization
// of limit structs on Adapter/Device initialization. // of limit structs on Adapter/Device initialization.
@ -46,4 +46,4 @@ namespace dawn_wire {
return false; return false;
} }
} // namespace dawn_wire } // namespace dawn::wire

View File

@ -17,10 +17,10 @@
#include <dawn/webgpu.h> #include <dawn/webgpu.h>
namespace dawn_wire { namespace dawn::wire {
bool IsFeatureSupported(WGPUFeatureName feature); bool IsFeatureSupported(WGPUFeatureName feature);
} // namespace dawn_wire } // namespace dawn::wire
#endif // DAWNWIRE_SUPPORTEDFEATURES_H_ #endif // DAWNWIRE_SUPPORTEDFEATURES_H_

View File

@ -14,7 +14,7 @@
#include "dawn_wire/Wire.h" #include "dawn_wire/Wire.h"
namespace dawn_wire { namespace dawn::wire {
CommandSerializer::CommandSerializer() = default; CommandSerializer::CommandSerializer() = default;
CommandSerializer::~CommandSerializer() = default; CommandSerializer::~CommandSerializer() = default;
@ -25,4 +25,4 @@ namespace dawn_wire {
CommandHandler::CommandHandler() = default; CommandHandler::CommandHandler() = default;
CommandHandler::~CommandHandler() = default; CommandHandler::~CommandHandler() = default;
} // namespace dawn_wire } // namespace dawn::wire

View File

@ -15,7 +15,7 @@
#include "dawn_wire/WireClient.h" #include "dawn_wire/WireClient.h"
#include "dawn_wire/client/Client.h" #include "dawn_wire/client/Client.h"
namespace dawn_wire { namespace dawn::wire {
WireClient::WireClient(const WireClientDescriptor& descriptor) WireClient::WireClient(const WireClientDescriptor& descriptor)
: mImpl(new client::Client(descriptor.serializer, descriptor.memoryTransferService)) { : mImpl(new client::Client(descriptor.serializer, descriptor.memoryTransferService)) {
@ -79,4 +79,4 @@ namespace dawn_wire {
MemoryTransferService::WriteHandle::~WriteHandle() = default; MemoryTransferService::WriteHandle::~WriteHandle() = default;
} // namespace client } // namespace client
} // namespace dawn_wire } // namespace dawn::wire

View File

@ -16,7 +16,7 @@
#include <algorithm> #include <algorithm>
namespace dawn_wire { namespace dawn::wire {
WireDeserializeAllocator::WireDeserializeAllocator() { WireDeserializeAllocator::WireDeserializeAllocator() {
Reset(); Reset();
} }
@ -57,4 +57,4 @@ namespace dawn_wire {
mCurrentBuffer = mStaticBuffer; mCurrentBuffer = mStaticBuffer;
mRemainingSize = sizeof(mStaticBuffer); mRemainingSize = sizeof(mStaticBuffer);
} }
} // namespace dawn_wire } // namespace dawn::wire

View File

@ -19,7 +19,7 @@
#include <vector> #include <vector>
namespace dawn_wire { namespace dawn::wire {
// A really really simple implementation of the DeserializeAllocator. It's main feature // A really really simple implementation of the DeserializeAllocator. It's main feature
// is that it has some inline storage so as to avoid allocations for the majority of // is that it has some inline storage so as to avoid allocations for the majority of
// commands. // commands.
@ -38,6 +38,6 @@ namespace dawn_wire {
char mStaticBuffer[2048]; char mStaticBuffer[2048];
std::vector<char*> mAllocations; std::vector<char*> mAllocations;
}; };
} // namespace dawn_wire } // namespace dawn::wire
#endif // DAWNWIRE_WIREDESERIALIZEALLOCATOR_H_ #endif // DAWNWIRE_WIREDESERIALIZEALLOCATOR_H_

View File

@ -17,7 +17,7 @@
#include "common/Compiler.h" #include "common/Compiler.h"
namespace dawn_wire { namespace dawn::wire {
enum class [[nodiscard]] WireResult{ enum class [[nodiscard]] WireResult{
Success, Success,
@ -33,6 +33,6 @@ namespace dawn_wire {
} \ } \
} while (0) } while (0)
} // namespace dawn_wire } // namespace dawn::wire
#endif // DAWNWIRE_WIRERESULT_H_ #endif // DAWNWIRE_WIRERESULT_H_

View File

@ -15,7 +15,7 @@
#include "dawn_wire/WireServer.h" #include "dawn_wire/WireServer.h"
#include "dawn_wire/server/Server.h" #include "dawn_wire/server/Server.h"
namespace dawn_wire { namespace dawn::wire {
WireServer::WireServer(const WireServerDescriptor& descriptor) WireServer::WireServer(const WireServerDescriptor& descriptor)
: mImpl(new server::Server(*descriptor.procs, : mImpl(new server::Server(*descriptor.procs,
@ -80,4 +80,4 @@ namespace dawn_wire {
} }
} // namespace server } // namespace server
} // namespace dawn_wire } // namespace dawn::wire

View File

@ -17,7 +17,7 @@
#include "common/Log.h" #include "common/Log.h"
#include "dawn_wire/client/Client.h" #include "dawn_wire/client/Client.h"
namespace dawn_wire::client { namespace dawn::wire::client {
Adapter::~Adapter() { Adapter::~Adapter() {
mRequestDeviceRequests.CloseAll([](RequestDeviceData* request) { mRequestDeviceRequests.CloseAll([](RequestDeviceData* request) {
@ -130,4 +130,4 @@ namespace dawn_wire::client {
return nullptr; return nullptr;
} }
} // namespace dawn_wire::client } // namespace dawn::wire::client

View File

@ -23,7 +23,7 @@
#include "dawn_wire/client/ObjectBase.h" #include "dawn_wire/client/ObjectBase.h"
#include "dawn_wire/client/RequestTracker.h" #include "dawn_wire/client/RequestTracker.h"
namespace dawn_wire::client { namespace dawn::wire::client {
class Adapter final : public ObjectBase { class Adapter final : public ObjectBase {
public: public:
@ -65,6 +65,6 @@ namespace dawn_wire::client {
RequestTracker<RequestDeviceData> mRequestDeviceRequests; RequestTracker<RequestDeviceData> mRequestDeviceRequests;
}; };
} // namespace dawn_wire::client } // namespace dawn::wire::client
#endif // DAWNWIRE_CLIENT_ADAPTER_H_ #endif // DAWNWIRE_CLIENT_ADAPTER_H_

View File

@ -19,7 +19,7 @@
#include "dawn_wire/client/Client.h" #include "dawn_wire/client/Client.h"
#include "dawn_wire/client/Device.h" #include "dawn_wire/client/Device.h"
namespace dawn_wire::client { namespace dawn::wire::client {
// static // static
WGPUBuffer Buffer::Create(Device* device, const WGPUBufferDescriptor* descriptor) { WGPUBuffer Buffer::Create(Device* device, const WGPUBufferDescriptor* descriptor) {
@ -402,4 +402,4 @@ namespace dawn_wire::client {
mMappedData = nullptr; mMappedData = nullptr;
} }
} // namespace dawn_wire::client } // namespace dawn::wire::client

View File

@ -21,7 +21,7 @@
#include "dawn_wire/client/ObjectBase.h" #include "dawn_wire/client/ObjectBase.h"
#include "dawn_wire/client/RequestTracker.h" #include "dawn_wire/client/RequestTracker.h"
namespace dawn_wire::client { namespace dawn::wire::client {
class Device; class Device;
@ -104,6 +104,6 @@ namespace dawn_wire::client {
std::weak_ptr<bool> mDeviceIsAlive; std::weak_ptr<bool> mDeviceIsAlive;
}; };
} // namespace dawn_wire::client } // namespace dawn::wire::client
#endif // DAWNWIRE_CLIENT_BUFFER_H_ #endif // DAWNWIRE_CLIENT_BUFFER_H_

View File

@ -17,7 +17,7 @@
#include "common/Compiler.h" #include "common/Compiler.h"
#include "dawn_wire/client/Device.h" #include "dawn_wire/client/Device.h"
namespace dawn_wire::client { namespace dawn::wire::client {
namespace { namespace {
@ -168,4 +168,4 @@ namespace dawn_wire::client {
return mDisconnected; return mDisconnected;
} }
} // namespace dawn_wire::client } // namespace dawn::wire::client

View File

@ -26,7 +26,7 @@
#include "dawn_wire/WireDeserializeAllocator.h" #include "dawn_wire/WireDeserializeAllocator.h"
#include "dawn_wire/client/ClientBase_autogen.h" #include "dawn_wire/client/ClientBase_autogen.h"
namespace dawn_wire::client { namespace dawn::wire::client {
class Device; class Device;
class MemoryTransferService; class MemoryTransferService;
@ -90,6 +90,6 @@ namespace dawn_wire::client {
std::unique_ptr<MemoryTransferService> CreateInlineMemoryTransferService(); std::unique_ptr<MemoryTransferService> CreateInlineMemoryTransferService();
} // namespace dawn_wire::client } // namespace dawn::wire::client
#endif // DAWNWIRE_CLIENT_CLIENT_H_ #endif // DAWNWIRE_CLIENT_CLIENT_H_

View File

@ -18,7 +18,7 @@
#include <limits> #include <limits>
namespace dawn_wire::client { namespace dawn::wire::client {
bool Client::DoDeviceUncapturedErrorCallback(Device* device, bool Client::DoDeviceUncapturedErrorCallback(Device* device,
WGPUErrorType errorType, WGPUErrorType errorType,
@ -130,4 +130,4 @@ namespace dawn_wire::client {
return shaderModule->GetCompilationInfoCallback(requestSerial, status, info); return shaderModule->GetCompilationInfoCallback(requestSerial, status, info);
} }
} // namespace dawn_wire::client } // namespace dawn::wire::client

View File

@ -19,7 +19,7 @@
#include <cstring> #include <cstring>
namespace dawn_wire::client { namespace dawn::wire::client {
class InlineMemoryTransferService : public MemoryTransferService { class InlineMemoryTransferService : public MemoryTransferService {
class ReadHandleImpl : public ReadHandle { class ReadHandleImpl : public ReadHandle {
@ -128,4 +128,4 @@ namespace dawn_wire::client {
return std::make_unique<InlineMemoryTransferService>(); return std::make_unique<InlineMemoryTransferService>();
} }
} // namespace dawn_wire::client } // namespace dawn::wire::client

View File

@ -17,7 +17,7 @@
#include <cstdio> #include <cstdio>
#include "common/Assert.h" #include "common/Assert.h"
namespace dawn_wire::client { namespace dawn::wire::client {
MockMemoryTransferService::MockReadHandle::MockReadHandle(MockMemoryTransferService* service) MockMemoryTransferService::MockReadHandle::MockReadHandle(MockMemoryTransferService* service)
: ReadHandle(), mService(service) { : ReadHandle(), mService(service) {
@ -102,4 +102,4 @@ namespace dawn_wire::client {
return new MockWriteHandle(this); return new MockWriteHandle(this);
} }
} // namespace dawn_wire::client } // namespace dawn::wire::client

View File

@ -20,7 +20,7 @@
#include "dawn_wire/WireClient.h" #include "dawn_wire/WireClient.h"
#include "dawn_wire/client/Client.h" #include "dawn_wire/client/Client.h"
namespace dawn_wire::client { namespace dawn::wire::client {
class MockMemoryTransferService : public MemoryTransferService { class MockMemoryTransferService : public MemoryTransferService {
public: public:
@ -94,6 +94,6 @@ namespace dawn_wire::client {
MOCK_METHOD(void, OnWriteHandleDestroy, (const void* WriteHandle)); MOCK_METHOD(void, OnWriteHandleDestroy, (const void* WriteHandle));
}; };
} // namespace dawn_wire::client } // namespace dawn::wire::client
#endif // DAWNWIRE_CLIENT_CLIENTMEMORYTRANSFERSERVICE_MOCK_H_ #endif // DAWNWIRE_CLIENT_CLIENTMEMORYTRANSFERSERVICE_MOCK_H_

View File

@ -20,7 +20,7 @@
#include "dawn_wire/client/Client.h" #include "dawn_wire/client/Client.h"
#include "dawn_wire/client/ObjectAllocator.h" #include "dawn_wire/client/ObjectAllocator.h"
namespace dawn_wire::client { namespace dawn::wire::client {
Device::Device(Client* clientIn, uint32_t initialRefcount, uint32_t initialId) Device::Device(Client* clientIn, uint32_t initialRefcount, uint32_t initialId)
: ObjectBase(clientIn, initialRefcount, initialId), mIsAlive(std::make_shared<bool>()) { : ObjectBase(clientIn, initialRefcount, initialId), mIsAlive(std::make_shared<bool>()) {
@ -339,4 +339,4 @@ namespace dawn_wire::client {
return true; return true;
} }
} // namespace dawn_wire::client } // namespace dawn::wire::client

View File

@ -26,7 +26,7 @@
#include <memory> #include <memory>
namespace dawn_wire::client { namespace dawn::wire::client {
class Client; class Client;
class Queue; class Queue;
@ -107,6 +107,6 @@ namespace dawn_wire::client {
std::shared_ptr<bool> mIsAlive; std::shared_ptr<bool> mIsAlive;
}; };
} // namespace dawn_wire::client } // namespace dawn::wire::client
#endif // DAWNWIRE_CLIENT_DEVICE_H_ #endif // DAWNWIRE_CLIENT_DEVICE_H_

View File

@ -16,7 +16,7 @@
#include "dawn_wire/client/Client.h" #include "dawn_wire/client/Client.h"
namespace dawn_wire::client { namespace dawn::wire::client {
Instance::~Instance() { Instance::~Instance() {
mRequestAdapterRequests.CloseAll([](RequestAdapterData* request) { mRequestAdapterRequests.CloseAll([](RequestAdapterData* request) {
@ -98,4 +98,4 @@ namespace dawn_wire::client {
return true; return true;
} }
} // namespace dawn_wire::client } // namespace dawn::wire::client

View File

@ -22,7 +22,7 @@
#include "dawn_wire/client/ObjectBase.h" #include "dawn_wire/client/ObjectBase.h"
#include "dawn_wire/client/RequestTracker.h" #include "dawn_wire/client/RequestTracker.h"
namespace dawn_wire::client { namespace dawn::wire::client {
class Instance final : public ObjectBase { class Instance final : public ObjectBase {
public: public:
@ -51,6 +51,6 @@ namespace dawn_wire::client {
RequestTracker<RequestAdapterData> mRequestAdapterRequests; RequestTracker<RequestAdapterData> mRequestAdapterRequests;
}; };
} // namespace dawn_wire::client } // namespace dawn::wire::client
#endif // DAWNWIRE_CLIENT_INSTANCE_H_ #endif // DAWNWIRE_CLIENT_INSTANCE_H_

View File

@ -17,7 +17,7 @@
#include "common/Assert.h" #include "common/Assert.h"
#include "dawn_wire/SupportedFeatures.h" #include "dawn_wire/SupportedFeatures.h"
namespace dawn_wire::client { namespace dawn::wire::client {
bool LimitsAndFeatures::GetLimits(WGPUSupportedLimits* limits) const { bool LimitsAndFeatures::GetLimits(WGPUSupportedLimits* limits) const {
ASSERT(limits != nullptr); ASSERT(limits != nullptr);
@ -60,4 +60,4 @@ namespace dawn_wire::client {
} }
} }
} // namespace dawn_wire::client } // namespace dawn::wire::client

View File

@ -19,7 +19,7 @@
#include <unordered_set> #include <unordered_set>
namespace dawn_wire::client { namespace dawn::wire::client {
class LimitsAndFeatures { class LimitsAndFeatures {
public: public:
@ -35,6 +35,6 @@ namespace dawn_wire::client {
std::unordered_set<WGPUFeatureName> mFeatures; std::unordered_set<WGPUFeatureName> mFeatures;
}; };
} // namespace dawn_wire::client } // namespace dawn::wire::client
#endif // DAWNWIRE_CLIENT_LIMITSANDFEATURES_H_ #endif // DAWNWIRE_CLIENT_LIMITSANDFEATURES_H_

View File

@ -23,7 +23,7 @@
#include <memory> #include <memory>
#include <vector> #include <vector>
namespace dawn_wire::client { namespace dawn::wire::client {
template <typename T> template <typename T>
class ObjectAllocator { class ObjectAllocator {
@ -105,6 +105,6 @@ namespace dawn_wire::client {
std::vector<uint32_t> mFreeIds; std::vector<uint32_t> mFreeIds;
std::vector<ObjectAndSerial> mObjects; std::vector<ObjectAndSerial> mObjects;
}; };
} // namespace dawn_wire::client } // namespace dawn::wire::client
#endif // DAWNWIRE_CLIENT_OBJECTALLOCATOR_H_ #endif // DAWNWIRE_CLIENT_OBJECTALLOCATOR_H_

View File

@ -20,7 +20,7 @@
#include "common/LinkedList.h" #include "common/LinkedList.h"
#include "dawn_wire/ObjectType_autogen.h" #include "dawn_wire/ObjectType_autogen.h"
namespace dawn_wire::client { namespace dawn::wire::client {
class Client; class Client;
@ -46,6 +46,6 @@ namespace dawn_wire::client {
const uint32_t id; const uint32_t id;
}; };
} // namespace dawn_wire::client } // namespace dawn::wire::client
#endif // DAWNWIRE_CLIENT_OBJECTBASE_H_ #endif // DAWNWIRE_CLIENT_OBJECTBASE_H_

View File

@ -17,7 +17,7 @@
#include "dawn_wire/client/Client.h" #include "dawn_wire/client/Client.h"
#include "dawn_wire/client/Device.h" #include "dawn_wire/client/Device.h"
namespace dawn_wire::client { namespace dawn::wire::client {
Queue::~Queue() { Queue::~Queue() {
ClearAllCallbacks(WGPUQueueWorkDoneStatus_Unknown); ClearAllCallbacks(WGPUQueueWorkDoneStatus_Unknown);
@ -95,4 +95,4 @@ namespace dawn_wire::client {
}); });
} }
} // namespace dawn_wire::client } // namespace dawn::wire::client

View File

@ -21,7 +21,7 @@
#include "dawn_wire/client/ObjectBase.h" #include "dawn_wire/client/ObjectBase.h"
#include "dawn_wire/client/RequestTracker.h" #include "dawn_wire/client/RequestTracker.h"
namespace dawn_wire::client { namespace dawn::wire::client {
class Queue final : public ObjectBase { class Queue final : public ObjectBase {
public: public:
@ -52,6 +52,6 @@ namespace dawn_wire::client {
RequestTracker<OnWorkDoneData> mOnWorkDoneRequests; RequestTracker<OnWorkDoneData> mOnWorkDoneRequests;
}; };
} // namespace dawn_wire::client } // namespace dawn::wire::client
#endif // DAWNWIRE_CLIENT_QUEUE_H_ #endif // DAWNWIRE_CLIENT_QUEUE_H_

View File

@ -21,7 +21,7 @@
#include <cstdint> #include <cstdint>
#include <map> #include <map>
namespace dawn_wire::client { namespace dawn::wire::client {
class Device; class Device;
class MemoryTransferService; class MemoryTransferService;
@ -77,6 +77,6 @@ namespace dawn_wire::client {
std::map<uint64_t, Request> mRequests; std::map<uint64_t, Request> mRequests;
}; };
} // namespace dawn_wire::client } // namespace dawn::wire::client
#endif // DAWNWIRE_CLIENT_REQUESTTRACKER_H_ #endif // DAWNWIRE_CLIENT_REQUESTTRACKER_H_

View File

@ -16,7 +16,7 @@
#include "dawn_wire/client/Client.h" #include "dawn_wire/client/Client.h"
namespace dawn_wire::client { namespace dawn::wire::client {
ShaderModule::~ShaderModule() { ShaderModule::~ShaderModule() {
ClearAllCallbacks(WGPUCompilationInfoRequestStatus_Unknown); ClearAllCallbacks(WGPUCompilationInfoRequestStatus_Unknown);
@ -61,4 +61,4 @@ namespace dawn_wire::client {
}); });
} }
} // namespace dawn_wire::client } // namespace dawn::wire::client

View File

@ -20,7 +20,7 @@
#include "dawn_wire/client/ObjectBase.h" #include "dawn_wire/client/ObjectBase.h"
#include "dawn_wire/client/RequestTracker.h" #include "dawn_wire/client/RequestTracker.h"
namespace dawn_wire::client { namespace dawn::wire::client {
class ShaderModule final : public ObjectBase { class ShaderModule final : public ObjectBase {
public: public:
@ -43,6 +43,6 @@ namespace dawn_wire::client {
RequestTracker<CompilationInfoRequest> mCompilationInfoRequests; RequestTracker<CompilationInfoRequest> mCompilationInfoRequests;
}; };
} // namespace dawn_wire::client } // namespace dawn::wire::client
#endif // DAWNWIRE_CLIENT_SHADER_MODULE_H_ #endif // DAWNWIRE_CLIENT_SHADER_MODULE_H_

View File

@ -22,7 +22,7 @@
#include <map> #include <map>
#include <unordered_set> #include <unordered_set>
namespace dawn_wire::server { namespace dawn::wire::server {
struct DeviceInfo { struct DeviceInfo {
std::unordered_set<uint64_t> childObjectTypesAndIds; std::unordered_set<uint64_t> childObjectTypesAndIds;
@ -223,6 +223,6 @@ namespace dawn_wire::server {
std::map<T, ObjectId> mTable; std::map<T, ObjectId> mTable;
}; };
} // namespace dawn_wire::server } // namespace dawn::wire::server
#endif // DAWNWIRE_SERVER_OBJECTSTORAGE_H_ #endif // DAWNWIRE_SERVER_OBJECTSTORAGE_H_

View File

@ -15,7 +15,7 @@
#include "dawn_wire/server/Server.h" #include "dawn_wire/server/Server.h"
#include "dawn_wire/WireServer.h" #include "dawn_wire/WireServer.h"
namespace dawn_wire::server { namespace dawn::wire::server {
Server::Server(const DawnProcTable& procs, Server::Server(const DawnProcTable& procs,
CommandSerializer* serializer, CommandSerializer* serializer,
@ -210,4 +210,4 @@ namespace dawn_wire::server {
return true; return true;
} }
} // namespace dawn_wire::server } // namespace dawn::wire::server

View File

@ -18,7 +18,7 @@
#include "dawn_wire/ChunkedCommandSerializer.h" #include "dawn_wire/ChunkedCommandSerializer.h"
#include "dawn_wire/server/ServerBase_autogen.h" #include "dawn_wire/server/ServerBase_autogen.h"
namespace dawn_wire::server { namespace dawn::wire::server {
class Server; class Server;
class MemoryTransferService; class MemoryTransferService;
@ -238,6 +238,6 @@ namespace dawn_wire::server {
std::unique_ptr<MemoryTransferService> CreateInlineMemoryTransferService(); std::unique_ptr<MemoryTransferService> CreateInlineMemoryTransferService();
} // namespace dawn_wire::server } // namespace dawn::wire::server
#endif // DAWNWIRE_SERVER_SERVER_H_ #endif // DAWNWIRE_SERVER_SERVER_H_

View File

@ -16,7 +16,7 @@
#include "dawn_wire/SupportedFeatures.h" #include "dawn_wire/SupportedFeatures.h"
namespace dawn_wire::server { namespace dawn::wire::server {
bool Server::DoAdapterRequestDevice(ObjectId adapterId, bool Server::DoAdapterRequestDevice(ObjectId adapterId,
uint64_t requestSerial, uint64_t requestSerial,
@ -107,4 +107,4 @@ namespace dawn_wire::server {
SerializeCommand(cmd); SerializeCommand(cmd);
} }
} // namespace dawn_wire::server } // namespace dawn::wire::server

View File

@ -19,7 +19,7 @@
#include <memory> #include <memory>
namespace dawn_wire::server { namespace dawn::wire::server {
bool Server::PreHandleBufferUnmap(const BufferUnmapCmd& cmd) { bool Server::PreHandleBufferUnmap(const BufferUnmapCmd& cmd) {
auto* buffer = BufferObjects().Get(cmd.selfId); auto* buffer = BufferObjects().Get(cmd.selfId);
@ -279,4 +279,4 @@ namespace dawn_wire::server {
}); });
} }
} // namespace dawn_wire::server } // namespace dawn::wire::server

View File

@ -14,7 +14,7 @@
#include "dawn_wire/server/Server.h" #include "dawn_wire/server/Server.h"
namespace dawn_wire::server { namespace dawn::wire::server {
namespace { namespace {
@ -201,4 +201,4 @@ namespace dawn_wire::server {
SerializeCommand(cmd); SerializeCommand(cmd);
} }
} // namespace dawn_wire::server } // namespace dawn::wire::server

View File

@ -18,7 +18,7 @@
#include <cstring> #include <cstring>
namespace dawn_wire::server { namespace dawn::wire::server {
class InlineMemoryTransferService : public MemoryTransferService { class InlineMemoryTransferService : public MemoryTransferService {
public: public:
@ -91,4 +91,4 @@ namespace dawn_wire::server {
return std::make_unique<InlineMemoryTransferService>(); return std::make_unique<InlineMemoryTransferService>();
} }
} // namespace dawn_wire::server } // namespace dawn::wire::server

View File

@ -18,7 +18,7 @@
#include <algorithm> #include <algorithm>
namespace dawn_wire::server { namespace dawn::wire::server {
bool Server::DoInstanceRequestAdapter(ObjectId instanceId, bool Server::DoInstanceRequestAdapter(ObjectId instanceId,
uint64_t requestSerial, uint64_t requestSerial,
@ -97,4 +97,4 @@ namespace dawn_wire::server {
SerializeCommand(cmd); SerializeCommand(cmd);
} }
} // namespace dawn_wire::server } // namespace dawn::wire::server

View File

@ -16,7 +16,7 @@
#include "common/Assert.h" #include "common/Assert.h"
namespace dawn_wire::server { namespace dawn::wire::server {
MockMemoryTransferService::MockReadHandle::MockReadHandle(MockMemoryTransferService* service) MockMemoryTransferService::MockReadHandle::MockReadHandle(MockMemoryTransferService* service)
: ReadHandle(), mService(service) { : ReadHandle(), mService(service) {
@ -88,4 +88,4 @@ namespace dawn_wire::server {
return new MockWriteHandle(this); return new MockWriteHandle(this);
} }
} // namespace dawn_wire::server } // namespace dawn::wire::server

View File

@ -20,7 +20,7 @@
#include "dawn_wire/WireServer.h" #include "dawn_wire/WireServer.h"
#include "dawn_wire/server/Server.h" #include "dawn_wire/server/Server.h"
namespace dawn_wire::server { namespace dawn::wire::server {
class MockMemoryTransferService : public MemoryTransferService { class MockMemoryTransferService : public MemoryTransferService {
public: public:
@ -103,6 +103,6 @@ namespace dawn_wire::server {
MOCK_METHOD(void, OnWriteHandleDestroy, (const WriteHandle* writeHandle)); MOCK_METHOD(void, OnWriteHandleDestroy, (const WriteHandle* writeHandle));
}; };
} // namespace dawn_wire::server } // namespace dawn::wire::server
#endif // DAWNWIRE_SERVER_SERVERMEMORYTRANSFERSERVICE_MOCK_H_ #endif // DAWNWIRE_SERVER_SERVERMEMORYTRANSFERSERVICE_MOCK_H_

View File

@ -15,7 +15,7 @@
#include "common/Assert.h" #include "common/Assert.h"
#include "dawn_wire/server/Server.h" #include "dawn_wire/server/Server.h"
namespace dawn_wire::server { namespace dawn::wire::server {
void Server::OnQueueWorkDone(QueueWorkDoneUserdata* data, WGPUQueueWorkDoneStatus status) { void Server::OnQueueWorkDone(QueueWorkDoneUserdata* data, WGPUQueueWorkDoneStatus status) {
ReturnQueueWorkDoneCallbackCmd cmd; ReturnQueueWorkDoneCallbackCmd cmd;
@ -100,4 +100,4 @@ namespace dawn_wire::server {
return true; return true;
} }
} // namespace dawn_wire::server } // namespace dawn::wire::server

View File

@ -16,7 +16,7 @@
#include <memory> #include <memory>
namespace dawn_wire::server { namespace dawn::wire::server {
bool Server::DoShaderModuleGetCompilationInfo(ObjectId shaderModuleId, uint64_t requestSerial) { bool Server::DoShaderModuleGetCompilationInfo(ObjectId shaderModuleId, uint64_t requestSerial) {
auto* shaderModule = ShaderModuleObjects().Get(shaderModuleId); auto* shaderModule = ShaderModuleObjects().Get(shaderModuleId);
@ -46,4 +46,4 @@ namespace dawn_wire::server {
SerializeCommand(cmd); SerializeCommand(cmd);
} }
} // namespace dawn_wire::server } // namespace dawn::wire::server

View File

@ -28,7 +28,7 @@
namespace { namespace {
class DevNull : public dawn_wire::CommandSerializer { class DevNull : public dawn::wire::CommandSerializer {
public: public:
size_t GetMaximumAllocationSize() const override { size_t GetMaximumAllocationSize() const override {
// Some fuzzer bots have a 2GB allocation limit. Pick a value reasonably below that. // Some fuzzer bots have a 2GB allocation limit. Pick a value reasonably below that.
@ -116,11 +116,11 @@ int DawnWireServerFuzzer::Run(const uint8_t* data,
} }
DevNull devNull; DevNull devNull;
dawn_wire::WireServerDescriptor serverDesc = {}; dawn::wire::WireServerDescriptor serverDesc = {};
serverDesc.procs = &procs; serverDesc.procs = &procs;
serverDesc.serializer = &devNull; serverDesc.serializer = &devNull;
std::unique_ptr<dawn_wire::WireServer> wireServer(new dawn_wire::WireServer(serverDesc)); std::unique_ptr<dawn::wire::WireServer> wireServer(new dawn_wire::WireServer(serverDesc));
wireServer->InjectDevice(device.Get(), 1, 0); wireServer->InjectDevice(device.Get(), 1, 0);
wireServer->HandleCommands(reinterpret_cast<const char*>(data), size); wireServer->HandleCommands(reinterpret_cast<const char*>(data), size);

View File

@ -113,6 +113,7 @@ namespace dawn::platform {
} // namespace dawn::platform } // namespace dawn::platform
// TODO(dawn:824): Remove once the deprecation period is passed.
namespace dawn_platform = dawn::platform; namespace dawn_platform = dawn::platform;
#endif // DAWNPLATFORM_DAWNPLATFORM_H_ #endif // DAWNPLATFORM_DAWNPLATFORM_H_

View File

@ -21,7 +21,7 @@
#include "dawn/webgpu.h" #include "dawn/webgpu.h"
#include "dawn_wire/dawn_wire_export.h" #include "dawn_wire/dawn_wire_export.h"
namespace dawn_wire { namespace dawn::wire {
class DAWN_WIRE_EXPORT CommandSerializer { class DAWN_WIRE_EXPORT CommandSerializer {
public: public:
@ -71,6 +71,9 @@ namespace dawn_wire {
const volatile char* deserializeBuffer, const volatile char* deserializeBuffer,
size_t deserializeBufferSize); size_t deserializeBufferSize);
} // namespace dawn_wire } // namespace dawn::wire
// TODO(dawn:824): Remove once the deprecation period is passed.
namespace dawn_wire = dawn::wire;
#endif // DAWNWIRE_WIRE_H_ #endif // DAWNWIRE_WIRE_H_

View File

@ -21,7 +21,7 @@
#include <memory> #include <memory>
#include <vector> #include <vector>
namespace dawn_wire { namespace dawn::wire {
namespace client { namespace client {
class Client; class Client;
@ -178,6 +178,6 @@ namespace dawn_wire {
// Backdoor to get the order of the ProcMap for testing // Backdoor to get the order of the ProcMap for testing
DAWN_WIRE_EXPORT std::vector<const char*> GetProcMapNamesForTesting(); DAWN_WIRE_EXPORT std::vector<const char*> GetProcMapNamesForTesting();
} // namespace client } // namespace client
} // namespace dawn_wire } // namespace dawn::wire
#endif // DAWNWIRE_WIRECLIENT_H_ #endif // DAWNWIRE_WIRECLIENT_H_

View File

@ -21,7 +21,7 @@
struct DawnProcTable; struct DawnProcTable;
namespace dawn_wire { namespace dawn::wire {
namespace server { namespace server {
class Server; class Server;
@ -145,6 +145,6 @@ namespace dawn_wire {
}; };
} // namespace server } // namespace server
} // namespace dawn_wire } // namespace dawn::wire
#endif // DAWNWIRE_WIRESERVER_H_ #endif // DAWNWIRE_WIRESERVER_H_

View File

@ -201,11 +201,11 @@ namespace detail {
class ExpectBetweenColors; class ExpectBetweenColors;
} // namespace detail } // namespace detail
namespace dawn_wire { namespace dawn::wire {
class CommandHandler; class CommandHandler;
class WireClient; class WireClient;
class WireServer; class WireServer;
} // namespace dawn_wire } // namespace dawn::wire
void InitDawnEnd2EndTestEnvironment(int argc, char** argv); void InitDawnEnd2EndTestEnvironment(int argc, char** argv);

View File

@ -67,12 +67,12 @@ namespace {
case DawnFlavor::Wire: { case DawnFlavor::Wire: {
mC2sBuf = std::make_unique<utils::TerribleCommandBuffer>(); mC2sBuf = std::make_unique<utils::TerribleCommandBuffer>();
dawn_wire::WireClientDescriptor clientDesc = {}; dawn::wire::WireClientDescriptor clientDesc = {};
clientDesc.serializer = mC2sBuf.get(); clientDesc.serializer = mC2sBuf.get();
mWireClient = std::make_unique<dawn_wire::WireClient>(clientDesc); mWireClient = std::make_unique<dawn::wire::WireClient>(clientDesc);
mDevice = wgpu::Device::Acquire(mWireClient->ReserveDevice().device); mDevice = wgpu::Device::Acquire(mWireClient->ReserveDevice().device);
mProcs = dawn_wire::client::GetProcs(); mProcs = dawn::wire::client::GetProcs();
break; break;
} }
@ -94,7 +94,7 @@ namespace {
dawn_native::null::Adapter mNativeAdapter; dawn_native::null::Adapter mNativeAdapter;
std::unique_ptr<utils::TerribleCommandBuffer> mC2sBuf; std::unique_ptr<utils::TerribleCommandBuffer> mC2sBuf;
std::unique_ptr<dawn_wire::WireClient> mWireClient; std::unique_ptr<dawn::wire::WireClient> mWireClient;
wgpu::Device mDevice; wgpu::Device mDevice;
DawnProcTable mProcs; DawnProcTable mProcs;
@ -162,7 +162,7 @@ namespace {
} }
TEST(GetProcAddressInternalTests, CheckDawnWireClientProcMapOrder) { TEST(GetProcAddressInternalTests, CheckDawnWireClientProcMapOrder) {
std::vector<const char*> names = dawn_wire::client::GetProcMapNamesForTesting(); std::vector<const char*> names = dawn::wire::client::GetProcMapNamesForTesting();
for (size_t i = 1; i < names.size(); i++) { for (size_t i = 1; i < names.size(); i++) {
ASSERT_LT(std::string(names[i - 1]), std::string(names[i])); ASSERT_LT(std::string(names[i - 1]), std::string(names[i]));
} }

View File

@ -25,7 +25,7 @@
namespace { namespace {
using namespace testing; using namespace testing;
using namespace dawn_wire; using namespace dawn::wire;
class WireAdapterTests : public WireTest { class WireAdapterTests : public WireTest {
protected: protected:

View File

@ -19,7 +19,7 @@
#include <array> #include <array>
using namespace testing; using namespace testing;
using namespace dawn_wire; using namespace dawn::wire;
class WireArgumentTests : public WireTest { class WireArgumentTests : public WireTest {
public: public:

View File

@ -15,7 +15,7 @@
#include "tests/unittests/wire/WireTest.h" #include "tests/unittests/wire/WireTest.h"
using namespace testing; using namespace testing;
using namespace dawn_wire; using namespace dawn::wire;
class WireBasicTests : public WireTest { class WireBasicTests : public WireTest {
public: public:

View File

@ -17,7 +17,7 @@
#include "dawn_wire/WireClient.h" #include "dawn_wire/WireClient.h"
using namespace testing; using namespace testing;
using namespace dawn_wire; using namespace dawn::wire;
namespace { namespace {

View File

@ -17,7 +17,7 @@
#include "dawn_wire/WireClient.h" #include "dawn_wire/WireClient.h"
using namespace testing; using namespace testing;
using namespace dawn_wire; using namespace dawn::wire;
namespace { namespace {

View File

@ -16,7 +16,7 @@
#include "tests/unittests/wire/WireTest.h" #include "tests/unittests/wire/WireTest.h"
using namespace testing; using namespace testing;
using namespace dawn_wire; using namespace dawn::wire;
class WireDestroyObjectTests : public WireTest {}; class WireDestroyObjectTests : public WireTest {};

View File

@ -19,7 +19,7 @@
#include "tests/MockCallback.h" #include "tests/MockCallback.h"
using namespace testing; using namespace testing;
using namespace dawn_wire; using namespace dawn::wire;
namespace { namespace {

View File

@ -17,7 +17,7 @@
#include "dawn_wire/WireClient.h" #include "dawn_wire/WireClient.h"
using namespace testing; using namespace testing;
using namespace dawn_wire; using namespace dawn::wire;
namespace { namespace {

View File

@ -15,7 +15,7 @@
#include "tests/unittests/wire/WireTest.h" #include "tests/unittests/wire/WireTest.h"
using namespace testing; using namespace testing;
using namespace dawn_wire; using namespace dawn::wire;
class WireExtensionTests : public WireTest { class WireExtensionTests : public WireTest {
public: public:

View File

@ -18,7 +18,7 @@
#include "dawn_wire/WireServer.h" #include "dawn_wire/WireServer.h"
using namespace testing; using namespace testing;
using namespace dawn_wire; using namespace dawn::wire;
class WireInjectDeviceTests : public WireTest { class WireInjectDeviceTests : public WireTest {
public: public:

View File

@ -18,7 +18,7 @@
#include "dawn_wire/WireServer.h" #include "dawn_wire/WireServer.h"
using namespace testing; using namespace testing;
using namespace dawn_wire; using namespace dawn::wire;
namespace { namespace {

View File

@ -18,7 +18,7 @@
#include "dawn_wire/WireServer.h" #include "dawn_wire/WireServer.h"
using namespace testing; using namespace testing;
using namespace dawn_wire; using namespace dawn::wire;
class WireInjectSwapChainTests : public WireTest { class WireInjectSwapChainTests : public WireTest {
public: public:

View File

@ -18,7 +18,7 @@
#include "dawn_wire/WireServer.h" #include "dawn_wire/WireServer.h"
using namespace testing; using namespace testing;
using namespace dawn_wire; using namespace dawn::wire;
class WireInjectTextureTests : public WireTest { class WireInjectTextureTests : public WireTest {
public: public:

View File

@ -25,7 +25,7 @@
namespace { namespace {
using namespace testing; using namespace testing;
using namespace dawn_wire; using namespace dawn::wire;
class WireInstanceBasicTest : public WireTest {}; class WireInstanceBasicTest : public WireTest {};
class WireInstanceTests : public WireTest { class WireInstanceTests : public WireTest {

View File

@ -18,7 +18,7 @@
#include "dawn_wire/server/ServerMemoryTransferService_mock.h" #include "dawn_wire/server/ServerMemoryTransferService_mock.h"
using namespace testing; using namespace testing;
using namespace dawn_wire; using namespace dawn::wire;
namespace { namespace {
@ -314,8 +314,8 @@ class WireMemoryTransferServiceTests : public WireTest {
// mUpdatedBufferContent| after all writes are flushed. // mUpdatedBufferContent| after all writes are flushed.
static uint32_t mUpdatedBufferContent; static uint32_t mUpdatedBufferContent;
testing::StrictMock<dawn_wire::server::MockMemoryTransferService> serverMemoryTransferService; testing::StrictMock<dawn::wire::server::MockMemoryTransferService> serverMemoryTransferService;
testing::StrictMock<dawn_wire::client::MockMemoryTransferService> clientMemoryTransferService; testing::StrictMock<dawn::wire::client::MockMemoryTransferService> clientMemoryTransferService;
}; };
uint32_t WireMemoryTransferServiceTests::mBufferContent = 1337; uint32_t WireMemoryTransferServiceTests::mBufferContent = 1337;

View File

@ -15,7 +15,7 @@
#include "tests/unittests/wire/WireTest.h" #include "tests/unittests/wire/WireTest.h"
using namespace testing; using namespace testing;
using namespace dawn_wire; using namespace dawn::wire;
class WireOptionalTests : public WireTest { class WireOptionalTests : public WireTest {
public: public:

View File

@ -17,7 +17,7 @@
#include "dawn_wire/WireClient.h" #include "dawn_wire/WireClient.h"
using namespace testing; using namespace testing;
using namespace dawn_wire; using namespace dawn::wire;
class MockQueueWorkDoneCallback { class MockQueueWorkDoneCallback {
public: public:

View File

@ -17,7 +17,7 @@
#include "dawn_wire/WireClient.h" #include "dawn_wire/WireClient.h"
using namespace testing; using namespace testing;
using namespace dawn_wire; using namespace dawn::wire;
namespace { namespace {

View File

@ -20,7 +20,7 @@
#include "utils/TerribleCommandBuffer.h" #include "utils/TerribleCommandBuffer.h"
using namespace testing; using namespace testing;
using namespace dawn_wire; using namespace dawn::wire;
WireTest::WireTest() { WireTest::WireTest() {
} }
@ -65,7 +65,7 @@ void WireTest::SetUp() {
mWireClient.reset(new WireClient(clientDesc)); mWireClient.reset(new WireClient(clientDesc));
mS2cBuf->SetHandler(mWireClient.get()); mS2cBuf->SetHandler(mWireClient.get());
dawnProcSetProcs(&dawn_wire::client::GetProcs()); dawnProcSetProcs(&dawn::wire::client::GetProcs());
auto deviceReservation = mWireClient->ReserveDevice(); auto deviceReservation = mWireClient->ReserveDevice();
EXPECT_CALL(api, DeviceReference(mockDevice)); EXPECT_CALL(api, DeviceReference(mockDevice));
@ -120,11 +120,11 @@ void WireTest::FlushServer(bool success) {
ASSERT_EQ(mS2cBuf->Flush(), success); ASSERT_EQ(mS2cBuf->Flush(), success);
} }
dawn_wire::WireServer* WireTest::GetWireServer() { dawn::wire::WireServer* WireTest::GetWireServer() {
return mWireServer.get(); return mWireServer.get();
} }
dawn_wire::WireClient* WireTest::GetWireClient() { dawn::wire::WireClient* WireTest::GetWireClient() {
return mWireClient.get(); return mWireClient.get();
} }

View File

@ -97,7 +97,7 @@ inline testing::Matcher<const char*> ValidStringMessage() {
return MakeMatcher(new StringMessageMatcher()); return MakeMatcher(new StringMessageMatcher());
} }
namespace dawn_wire { namespace dawn::wire {
class WireClient; class WireClient;
class WireServer; class WireServer;
namespace client { namespace client {
@ -106,7 +106,7 @@ namespace dawn_wire {
namespace server { namespace server {
class MemoryTransferService; class MemoryTransferService;
} // namespace server } // namespace server
} // namespace dawn_wire } // namespace dawn::wire
namespace utils { namespace utils {
class TerribleCommandBuffer; class TerribleCommandBuffer;
@ -131,8 +131,8 @@ class WireTest : public testing::Test {
WGPUDevice device; WGPUDevice device;
WGPUQueue queue; WGPUQueue queue;
dawn_wire::WireServer* GetWireServer(); dawn::wire::WireServer* GetWireServer();
dawn_wire::WireClient* GetWireClient(); dawn::wire::WireClient* GetWireClient();
void DeleteServer(); void DeleteServer();
void DeleteClient(); void DeleteClient();
@ -140,11 +140,11 @@ class WireTest : public testing::Test {
private: private:
void SetupIgnoredCallExpectations(); void SetupIgnoredCallExpectations();
virtual dawn_wire::client::MemoryTransferService* GetClientMemoryTransferService(); virtual dawn::wire::client::MemoryTransferService* GetClientMemoryTransferService();
virtual dawn_wire::server::MemoryTransferService* GetServerMemoryTransferService(); virtual dawn::wire::server::MemoryTransferService* GetServerMemoryTransferService();
std::unique_ptr<dawn_wire::WireServer> mWireServer; std::unique_ptr<dawn::wire::WireServer> mWireServer;
std::unique_ptr<dawn_wire::WireClient> mWireClient; std::unique_ptr<dawn::wire::WireClient> mWireClient;
std::unique_ptr<utils::TerribleCommandBuffer> mS2cBuf; std::unique_ptr<utils::TerribleCommandBuffer> mS2cBuf;
std::unique_ptr<utils::TerribleCommandBuffer> mC2sBuf; std::unique_ptr<utils::TerribleCommandBuffer> mC2sBuf;
}; };

View File

@ -28,14 +28,14 @@ TEST_F(WireWGPUDevicePropertiesTests, SerializeWGPUDeviceProperties) {
sentWGPUDeviceProperties.timestampQuery = true; sentWGPUDeviceProperties.timestampQuery = true;
size_t sentWGPUDevicePropertiesSize = size_t sentWGPUDevicePropertiesSize =
dawn_wire::SerializedWGPUDevicePropertiesSize(&sentWGPUDeviceProperties); dawn::wire::SerializedWGPUDevicePropertiesSize(&sentWGPUDeviceProperties);
std::vector<char> buffer; std::vector<char> buffer;
buffer.resize(sentWGPUDevicePropertiesSize); buffer.resize(sentWGPUDevicePropertiesSize);
dawn_wire::SerializeWGPUDeviceProperties(&sentWGPUDeviceProperties, buffer.data()); dawn::wire::SerializeWGPUDeviceProperties(&sentWGPUDeviceProperties, buffer.data());
WGPUDeviceProperties receivedWGPUDeviceProperties; WGPUDeviceProperties receivedWGPUDeviceProperties;
ASSERT_TRUE(dawn_wire::DeserializeWGPUDeviceProperties(&receivedWGPUDeviceProperties, ASSERT_TRUE(dawn::wire::DeserializeWGPUDeviceProperties(&receivedWGPUDeviceProperties,
buffer.data(), buffer.size())); buffer.data(), buffer.size()));
ASSERT_TRUE(receivedWGPUDeviceProperties.textureCompressionBC); ASSERT_TRUE(receivedWGPUDeviceProperties.textureCompressionBC);
ASSERT_FALSE(receivedWGPUDeviceProperties.pipelineStatisticsQuery); ASSERT_FALSE(receivedWGPUDeviceProperties.pipelineStatisticsQuery);
ASSERT_TRUE(receivedWGPUDeviceProperties.timestampQuery); ASSERT_TRUE(receivedWGPUDeviceProperties.timestampQuery);
@ -46,12 +46,12 @@ TEST_F(WireWGPUDevicePropertiesTests, DeserializeBufferTooSmall) {
WGPUDeviceProperties sentWGPUDeviceProperties = {}; WGPUDeviceProperties sentWGPUDeviceProperties = {};
size_t sentWGPUDevicePropertiesSize = size_t sentWGPUDevicePropertiesSize =
dawn_wire::SerializedWGPUDevicePropertiesSize(&sentWGPUDeviceProperties); dawn::wire::SerializedWGPUDevicePropertiesSize(&sentWGPUDeviceProperties);
std::vector<char> buffer; std::vector<char> buffer;
buffer.resize(sentWGPUDevicePropertiesSize); buffer.resize(sentWGPUDevicePropertiesSize);
dawn_wire::SerializeWGPUDeviceProperties(&sentWGPUDeviceProperties, buffer.data()); dawn::wire::SerializeWGPUDeviceProperties(&sentWGPUDeviceProperties, buffer.data());
WGPUDeviceProperties receivedWGPUDeviceProperties; WGPUDeviceProperties receivedWGPUDeviceProperties;
ASSERT_FALSE(dawn_wire::DeserializeWGPUDeviceProperties(&receivedWGPUDeviceProperties, ASSERT_FALSE(dawn::wire::DeserializeWGPUDeviceProperties(&receivedWGPUDeviceProperties,
buffer.data(), buffer.size() - 1)); buffer.data(), buffer.size() - 1));
} }

View File

@ -21,11 +21,11 @@ namespace utils {
TerribleCommandBuffer::TerribleCommandBuffer() { TerribleCommandBuffer::TerribleCommandBuffer() {
} }
TerribleCommandBuffer::TerribleCommandBuffer(dawn_wire::CommandHandler* handler) TerribleCommandBuffer::TerribleCommandBuffer(dawn::wire::CommandHandler* handler)
: mHandler(handler) { : mHandler(handler) {
} }
void TerribleCommandBuffer::SetHandler(dawn_wire::CommandHandler* handler) { void TerribleCommandBuffer::SetHandler(dawn::wire::CommandHandler* handler) {
mHandler = handler; mHandler = handler;
} }

View File

@ -19,12 +19,12 @@
namespace utils { namespace utils {
class TerribleCommandBuffer : public dawn_wire::CommandSerializer { class TerribleCommandBuffer : public dawn::wire::CommandSerializer {
public: public:
TerribleCommandBuffer(); TerribleCommandBuffer();
TerribleCommandBuffer(dawn_wire::CommandHandler* handler); TerribleCommandBuffer(dawn::wire::CommandHandler* handler);
void SetHandler(dawn_wire::CommandHandler* handler); void SetHandler(dawn::wire::CommandHandler* handler);
size_t GetMaximumAllocationSize() const override; size_t GetMaximumAllocationSize() const override;
@ -32,7 +32,7 @@ namespace utils {
bool Flush() override; bool Flush() override;
private: private:
dawn_wire::CommandHandler* mHandler = nullptr; dawn::wire::CommandHandler* mHandler = nullptr;
size_t mOffset = 0; size_t mOffset = 0;
char mBuffer[1000000]; char mBuffer[1000000];
}; };

View File

@ -34,10 +34,10 @@ namespace utils {
namespace { namespace {
class WireServerTraceLayer : public dawn_wire::CommandHandler { class WireServerTraceLayer : public dawn::wire::CommandHandler {
public: public:
WireServerTraceLayer(const char* dir, dawn_wire::CommandHandler* handler) WireServerTraceLayer(const char* dir, dawn::wire::CommandHandler* handler)
: dawn_wire::CommandHandler(), mDir(dir), mHandler(handler) { : dawn::wire::CommandHandler(), mDir(dir), mHandler(handler) {
const char* sep = GetPathSeparator(); const char* sep = GetPathSeparator();
if (mDir.size() > 0 && mDir.back() != *sep) { if (mDir.size() > 0 && mDir.back() != *sep) {
mDir += sep; mDir += sep;
@ -75,7 +75,7 @@ namespace utils {
private: private:
std::string mDir; std::string mDir;
dawn_wire::CommandHandler* mHandler; dawn::wire::CommandHandler* mHandler;
std::ofstream mFile; std::ofstream mFile;
}; };
@ -108,11 +108,11 @@ namespace utils {
mC2sBuf = std::make_unique<utils::TerribleCommandBuffer>(); mC2sBuf = std::make_unique<utils::TerribleCommandBuffer>();
mS2cBuf = std::make_unique<utils::TerribleCommandBuffer>(); mS2cBuf = std::make_unique<utils::TerribleCommandBuffer>();
dawn_wire::WireServerDescriptor serverDesc = {}; dawn::wire::WireServerDescriptor serverDesc = {};
serverDesc.procs = &dawn_native::GetProcs(); serverDesc.procs = &dawn_native::GetProcs();
serverDesc.serializer = mS2cBuf.get(); serverDesc.serializer = mS2cBuf.get();
mWireServer.reset(new dawn_wire::WireServer(serverDesc)); mWireServer.reset(new dawn::wire::WireServer(serverDesc));
mC2sBuf->SetHandler(mWireServer.get()); mC2sBuf->SetHandler(mWireServer.get());
if (wireTraceDir != nullptr && strlen(wireTraceDir) > 0) { if (wireTraceDir != nullptr && strlen(wireTraceDir) > 0) {
@ -121,12 +121,12 @@ namespace utils {
mC2sBuf->SetHandler(mWireServerTraceLayer.get()); mC2sBuf->SetHandler(mWireServerTraceLayer.get());
} }
dawn_wire::WireClientDescriptor clientDesc = {}; dawn::wire::WireClientDescriptor clientDesc = {};
clientDesc.serializer = mC2sBuf.get(); clientDesc.serializer = mC2sBuf.get();
mWireClient.reset(new dawn_wire::WireClient(clientDesc)); mWireClient.reset(new dawn::wire::WireClient(clientDesc));
mS2cBuf->SetHandler(mWireClient.get()); mS2cBuf->SetHandler(mWireClient.get());
dawnProcSetProcs(&dawn_wire::client::GetProcs()); dawnProcSetProcs(&dawn::wire::client::GetProcs());
} }
std::pair<wgpu::Device, WGPUDevice> RegisterDevice(WGPUDevice backendDevice) override { std::pair<wgpu::Device, WGPUDevice> RegisterDevice(WGPUDevice backendDevice) override {
@ -157,8 +157,8 @@ namespace utils {
std::unique_ptr<utils::TerribleCommandBuffer> mC2sBuf; std::unique_ptr<utils::TerribleCommandBuffer> mC2sBuf;
std::unique_ptr<utils::TerribleCommandBuffer> mS2cBuf; std::unique_ptr<utils::TerribleCommandBuffer> mS2cBuf;
std::unique_ptr<WireServerTraceLayer> mWireServerTraceLayer; std::unique_ptr<WireServerTraceLayer> mWireServerTraceLayer;
std::unique_ptr<dawn_wire::WireServer> mWireServer; std::unique_ptr<dawn::wire::WireServer> mWireServer;
std::unique_ptr<dawn_wire::WireClient> mWireClient; std::unique_ptr<dawn::wire::WireClient> mWireClient;
}; };
} // anonymous namespace } // anonymous namespace