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

Unified Diff: ui/devtools/devtools_client.h

Issue 2374513002: Add ui devtools server (Closed)
Patch Set: Initial commit for ui devtools server Created 4 years, 3 months 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: ui/devtools/devtools_client.h
diff --git a/ui/devtools/devtools_client.h b/ui/devtools/devtools_client.h
new file mode 100644
index 0000000000000000000000000000000000000000..11ef7a7d16198cd718d1e2152fa933e2dd7f32b7
--- /dev/null
+++ b/ui/devtools/devtools_client.h
@@ -0,0 +1,49 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef UI_DEVTOOLS_CLIENT_H
sadrul 2016/10/17 16:05:08 UI_DEVTOOLS_DEVTOOLS_CLIENT_H_
Sarmad Hashmi 2016/10/17 16:58:21 Done.
+#define UI_DEVTOOLS_CLIENT_H
+
+#include <string>
+
+#include "ui/devtools/DOM.h"
+#include "ui/devtools/Forward.h"
+#include "ui/devtools/Protocol.h"
+#include "ui/devtools/StringUtil.h"
+
+namespace ui {
+namespace devtools {
+
+class UiDevToolsServer;
+class UiDevToolsClient : public protocol::FrontendChannel {
sadrul 2016/10/17 16:05:08 Document.
Sarmad Hashmi 2016/10/17 16:58:21 Done.
+ public:
+ UiDevToolsClient(String name, UiDevToolsServer* server);
sadrul 2016/10/17 16:05:08 const String& name (to avoid unnecessary copy)
Sarmad Hashmi 2016/10/17 16:58:21 Done.
+ ~UiDevToolsClient() override;
+
+ void AddDOMBackend(std::unique_ptr<protocol::DOM::Backend> dom_backend);
+
+ private:
+ static const int kNotConnected = -1;
+
+ friend class UiDevToolsServer;
+ void Dispatch(const String& data);
+ bool connected();
+
+ // FrontendChannel
+ void sendProtocolResponse(int callId, const String& message) override;
+ void sendProtocolNotification(const String& message) override;
+ void flushProtocolNotifications() override;
+
+ std::string name_;
+ int connection_id;
sadrul 2016/10/17 16:05:08 connection_id_
Sarmad Hashmi 2016/10/17 16:58:21 Done.
+
+ std::unique_ptr<protocol::DOM::Backend> dom_backend_;
+ protocol::UberDispatcher dispatcher_;
+ UiDevToolsServer* server_;
+};
sadrul 2016/10/17 16:05:08 DISALLOOW_COPY_AND_ASSIGN
Sarmad Hashmi 2016/10/17 16:58:21 Done.
+
+} // namespace devtools
+} // namespace ui
+
+#endif // UI_DEVTOOLS_CLIENT_H_

Powered by Google App Engine
This is Rietveld 408576698