Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(519)

Unified Diff: content/browser/devtools/protocol/tethering_handler.h

Issue 2515613006: [DevTools] Move Memory, SystemInfo and Tethering domains to new generator. (Closed)
Patch Set: fixed review comments Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/browser/devtools/protocol/tethering_handler.h
diff --git a/content/browser/devtools/protocol/tethering_handler.h b/content/browser/devtools/protocol/tethering_handler.h
index 0fb9904efe3ce868696d58b360d172a5983f8fe6..3d57b169b34ebf01f307d182a9b81bf77817894e 100644
--- a/content/browser/devtools/protocol/tethering_handler.h
+++ b/content/browser/devtools/protocol/tethering_handler.h
@@ -8,35 +8,35 @@
#include <stdint.h>
#include <string>
+#include "base/callback.h"
#include "base/macros.h"
#include "base/memory/ref_counted.h"
#include "base/memory/weak_ptr.h"
#include "base/single_thread_task_runner.h"
-#include "content/browser/devtools/protocol/devtools_protocol_dispatcher.h"
+#include "content/browser/devtools/protocol/tethering.h"
namespace net {
class ServerSocket;
}
namespace content {
-namespace devtools {
-namespace tethering {
+namespace protocol {
// This class implements reversed tethering handler.
-class TetheringHandler {
+class TetheringHandler : public Tethering::Backend {
public:
- using Response = DevToolsProtocolClient::Response;
using CreateServerSocketCallback =
base::Callback<std::unique_ptr<net::ServerSocket>(std::string*)>;
TetheringHandler(const CreateServerSocketCallback& socket_callback,
scoped_refptr<base::SingleThreadTaskRunner> task_runner);
- ~TetheringHandler();
+ ~TetheringHandler() override;
- void SetClient(std::unique_ptr<Client> client);
+ void Wire(UberDispatcher*);
+ Response Disable() override;
- Response Bind(DevToolsCommandId command_id, int port);
- Response Unbind(DevToolsCommandId command_id, int port);
+ void Bind(int port, std::unique_ptr<BindCallback> callback) override;
+ void Unbind(int port, std::unique_ptr<UnbindCallback> callback) override;
private:
class TetheringImpl;
@@ -44,12 +44,7 @@ class TetheringHandler {
void Accepted(uint16_t port, const std::string& name);
bool Activate();
- void SendBindSuccess(DevToolsCommandId command_id);
- void SendUnbindSuccess(DevToolsCommandId command_id);
- void SendInternalError(DevToolsCommandId command_id,
- const std::string& message);
-
- std::unique_ptr<Client> client_;
+ std::unique_ptr<Tethering::Frontend> frontend_;
CreateServerSocketCallback socket_callback_;
scoped_refptr<base::SingleThreadTaskRunner> task_runner_;
bool is_active_;
@@ -60,8 +55,7 @@ class TetheringHandler {
DISALLOW_COPY_AND_ASSIGN(TetheringHandler);
};
-} // namespace tethering
-} // namespace devtools
+} // namespace protocol
} // namespace content
#endif // CONTENT_BROWSER_DEVTOOLS_PROTOCOL_TETHERING_HANDLER_H_
« no previous file with comments | « content/browser/devtools/protocol/system_info_handler.cc ('k') | content/browser/devtools/protocol/tethering_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698