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

@@ -19,7 +19,7 @@
#include <cstddef>
namespace dawn_wire {
namespace dawn::wire {
// BufferConsumer is a utility class that allows reading bytes from a buffer
// 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_

View File

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

View File

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

View File

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

View File

@@ -14,7 +14,7 @@
#include "dawn_wire/ChunkedCommandSerializer.h"
namespace dawn_wire {
namespace dawn::wire {
ChunkedCommandSerializer::ChunkedCommandSerializer(CommandSerializer* serializer)
: 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 <memory>
namespace dawn_wire {
namespace dawn::wire {
class ChunkedCommandSerializer {
public:
@@ -109,6 +109,6 @@ namespace dawn_wire {
size_t mMaxAllocationSize;
};
} // namespace dawn_wire
} // namespace dawn::wire
#endif // DAWNWIRE_CHUNKEDCOMMANDSERIALIZER_H_

View File

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

View File

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

View File

@@ -14,7 +14,7 @@
#include "dawn_wire/Wire.h"
namespace dawn_wire {
namespace dawn::wire {
CommandSerializer::CommandSerializer() = default;
CommandSerializer::~CommandSerializer() = default;
@@ -25,4 +25,4 @@ namespace dawn_wire {
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/client/Client.h"
namespace dawn_wire {
namespace dawn::wire {
WireClient::WireClient(const WireClientDescriptor& descriptor)
: mImpl(new client::Client(descriptor.serializer, descriptor.memoryTransferService)) {
@@ -79,4 +79,4 @@ namespace dawn_wire {
MemoryTransferService::WriteHandle::~WriteHandle() = default;
} // namespace client
} // namespace dawn_wire
} // namespace dawn::wire

View File

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

View File

@@ -19,7 +19,7 @@
#include <vector>
namespace dawn_wire {
namespace dawn::wire {
// 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
// commands.
@@ -38,6 +38,6 @@ namespace dawn_wire {
char mStaticBuffer[2048];
std::vector<char*> mAllocations;
};
} // namespace dawn_wire
} // namespace dawn::wire
#endif // DAWNWIRE_WIREDESERIALIZEALLOCATOR_H_

View File

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

View File

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

View File

@@ -17,7 +17,7 @@
#include "common/Log.h"
#include "dawn_wire/client/Client.h"
namespace dawn_wire::client {
namespace dawn::wire::client {
Adapter::~Adapter() {
mRequestDeviceRequests.CloseAll([](RequestDeviceData* request) {
@@ -130,4 +130,4 @@ namespace dawn_wire::client {
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/RequestTracker.h"
namespace dawn_wire::client {
namespace dawn::wire::client {
class Adapter final : public ObjectBase {
public:
@@ -65,6 +65,6 @@ namespace dawn_wire::client {
RequestTracker<RequestDeviceData> mRequestDeviceRequests;
};
} // namespace dawn_wire::client
} // namespace dawn::wire::client
#endif // DAWNWIRE_CLIENT_ADAPTER_H_

View File

@@ -19,7 +19,7 @@
#include "dawn_wire/client/Client.h"
#include "dawn_wire/client/Device.h"
namespace dawn_wire::client {
namespace dawn::wire::client {
// static
WGPUBuffer Buffer::Create(Device* device, const WGPUBufferDescriptor* descriptor) {
@@ -402,4 +402,4 @@ namespace dawn_wire::client {
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/RequestTracker.h"
namespace dawn_wire::client {
namespace dawn::wire::client {
class Device;
@@ -104,6 +104,6 @@ namespace dawn_wire::client {
std::weak_ptr<bool> mDeviceIsAlive;
};
} // namespace dawn_wire::client
} // namespace dawn::wire::client
#endif // DAWNWIRE_CLIENT_BUFFER_H_

View File

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

View File

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

View File

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

View File

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

View File

@@ -17,7 +17,7 @@
#include <cstdio>
#include "common/Assert.h"
namespace dawn_wire::client {
namespace dawn::wire::client {
MockMemoryTransferService::MockReadHandle::MockReadHandle(MockMemoryTransferService* service)
: ReadHandle(), mService(service) {
@@ -102,4 +102,4 @@ namespace dawn_wire::client {
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/client/Client.h"
namespace dawn_wire::client {
namespace dawn::wire::client {
class MockMemoryTransferService : public MemoryTransferService {
public:
@@ -94,6 +94,6 @@ namespace dawn_wire::client {
MOCK_METHOD(void, OnWriteHandleDestroy, (const void* WriteHandle));
};
} // namespace dawn_wire::client
} // namespace dawn::wire::client
#endif // DAWNWIRE_CLIENT_CLIENTMEMORYTRANSFERSERVICE_MOCK_H_

View File

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

View File

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

View File

@@ -16,7 +16,7 @@
#include "dawn_wire/client/Client.h"
namespace dawn_wire::client {
namespace dawn::wire::client {
Instance::~Instance() {
mRequestAdapterRequests.CloseAll([](RequestAdapterData* request) {
@@ -98,4 +98,4 @@ namespace dawn_wire::client {
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/RequestTracker.h"
namespace dawn_wire::client {
namespace dawn::wire::client {
class Instance final : public ObjectBase {
public:
@@ -51,6 +51,6 @@ namespace dawn_wire::client {
RequestTracker<RequestAdapterData> mRequestAdapterRequests;
};
} // namespace dawn_wire::client
} // namespace dawn::wire::client
#endif // DAWNWIRE_CLIENT_INSTANCE_H_

View File

@@ -17,7 +17,7 @@
#include "common/Assert.h"
#include "dawn_wire/SupportedFeatures.h"
namespace dawn_wire::client {
namespace dawn::wire::client {
bool LimitsAndFeatures::GetLimits(WGPUSupportedLimits* limits) const {
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>
namespace dawn_wire::client {
namespace dawn::wire::client {
class LimitsAndFeatures {
public:
@@ -35,6 +35,6 @@ namespace dawn_wire::client {
std::unordered_set<WGPUFeatureName> mFeatures;
};
} // namespace dawn_wire::client
} // namespace dawn::wire::client
#endif // DAWNWIRE_CLIENT_LIMITSANDFEATURES_H_

View File

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

View File

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

View File

@@ -17,7 +17,7 @@
#include "dawn_wire/client/Client.h"
#include "dawn_wire/client/Device.h"
namespace dawn_wire::client {
namespace dawn::wire::client {
Queue::~Queue() {
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/RequestTracker.h"
namespace dawn_wire::client {
namespace dawn::wire::client {
class Queue final : public ObjectBase {
public:
@@ -52,6 +52,6 @@ namespace dawn_wire::client {
RequestTracker<OnWorkDoneData> mOnWorkDoneRequests;
};
} // namespace dawn_wire::client
} // namespace dawn::wire::client
#endif // DAWNWIRE_CLIENT_QUEUE_H_

View File

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

View File

@@ -16,7 +16,7 @@
#include "dawn_wire/client/Client.h"
namespace dawn_wire::client {
namespace dawn::wire::client {
ShaderModule::~ShaderModule() {
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/RequestTracker.h"
namespace dawn_wire::client {
namespace dawn::wire::client {
class ShaderModule final : public ObjectBase {
public:
@@ -43,6 +43,6 @@ namespace dawn_wire::client {
RequestTracker<CompilationInfoRequest> mCompilationInfoRequests;
};
} // namespace dawn_wire::client
} // namespace dawn::wire::client
#endif // DAWNWIRE_CLIENT_SHADER_MODULE_H_

View File

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

View File

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

View File

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

View File

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

View File

@@ -19,7 +19,7 @@
#include <memory>
namespace dawn_wire::server {
namespace dawn::wire::server {
bool Server::PreHandleBufferUnmap(const BufferUnmapCmd& cmd) {
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"
namespace dawn_wire::server {
namespace dawn::wire::server {
namespace {
@@ -201,4 +201,4 @@ namespace dawn_wire::server {
SerializeCommand(cmd);
}
} // namespace dawn_wire::server
} // namespace dawn::wire::server

View File

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

View File

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

View File

@@ -16,7 +16,7 @@
#include "common/Assert.h"
namespace dawn_wire::server {
namespace dawn::wire::server {
MockMemoryTransferService::MockReadHandle::MockReadHandle(MockMemoryTransferService* service)
: ReadHandle(), mService(service) {
@@ -88,4 +88,4 @@ namespace dawn_wire::server {
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/server/Server.h"
namespace dawn_wire::server {
namespace dawn::wire::server {
class MockMemoryTransferService : public MemoryTransferService {
public:
@@ -103,6 +103,6 @@ namespace dawn_wire::server {
MOCK_METHOD(void, OnWriteHandleDestroy, (const WriteHandle* writeHandle));
};
} // namespace dawn_wire::server
} // namespace dawn::wire::server
#endif // DAWNWIRE_SERVER_SERVERMEMORYTRANSFERSERVICE_MOCK_H_

View File

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

View File

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