Create wire Client and Server classes with private impl

This creates proper Client and Server interfaces which will be necessary
for adding additional features to the Wire for chrome integration

Bug: dawn:103
Change-Id: I181e95079b0bac85c2c6152ad8066a94b80c8d28
Reviewed-on: https://dawn-review.googlesource.com/c/4002
Commit-Queue: Austin Eng <enga@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
This commit is contained in:
Austin Eng
2019-02-11 21:50:16 +00:00
committed by Commit Bot service account
parent 62e83971ca
commit e2c851372a
14 changed files with 178 additions and 49 deletions

View File

@@ -35,13 +35,6 @@ namespace dawn_wire {
virtual const char* HandleCommands(const char* commands, size_t size) = 0;
};
DAWN_WIRE_EXPORT CommandHandler* NewClientDevice(dawnProcTable* procs,
dawnDevice* device,
CommandSerializer* serializer);
DAWN_WIRE_EXPORT CommandHandler* NewServerCommandHandler(dawnDevice device,
const dawnProcTable& procs,
CommandSerializer* serializer);
} // namespace dawn_wire
#endif // DAWNWIRE_WIRE_H_

View File

@@ -0,0 +1,43 @@
// Copyright 2019 The Dawn Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#ifndef DAWNWIRE_WIRECLIENT_H_
#define DAWNWIRE_WIRECLIENT_H_
#include <memory>
#include "dawn_wire/Wire.h"
namespace dawn_wire {
namespace client {
class Client;
}
class DAWN_WIRE_EXPORT WireClient : public CommandHandler {
public:
WireClient(CommandSerializer* serializer);
~WireClient();
dawnDevice GetDevice() const;
dawnProcTable GetProcs() const;
const char* HandleCommands(const char* commands, size_t size) override final;
private:
std::unique_ptr<client::Client> mImpl;
};
} // namespace dawn_wire
#endif // DAWNWIRE_WIRECLIENT_H_

View File

@@ -0,0 +1,41 @@
// Copyright 2019 The Dawn Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#ifndef DAWNWIRE_WIRESERVER_H_
#define DAWNWIRE_WIRESERVER_H_
#include <memory>
#include "dawn_wire/Wire.h"
namespace dawn_wire {
namespace server {
class Server;
}
class DAWN_WIRE_EXPORT WireServer : public CommandHandler {
public:
WireServer(dawnDevice device, const dawnProcTable& procs, CommandSerializer* serializer);
~WireServer();
const char* HandleCommands(const char* commands, size_t size) override final;
private:
std::unique_ptr<server::Server> mImpl;
};
} // namespace dawn_wire
#endif // DAWNWIRE_WIRESERVER_H_