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

Side by Side Diff: ui/devtools/devtools_client.h

Issue 2374513002: Add ui devtools server (Closed)
Patch Set: Address @sadrul's comments Created 4 years, 2 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef UI_DEVTOOLS_DEVTOOLS_CLIENT_H
sadrul 2016/10/17 17:44:36 There should be a _ at the end.
Sarmad Hashmi 2016/10/17 19:15:29 Done.
6 #define UI_DEVTOOLS_DEVTOOLS_CLIENT_H
7
8 #include <string>
9
10 #include "ui/devtools/DOM.h"
11 #include "ui/devtools/Forward.h"
12 #include "ui/devtools/Protocol.h"
13 #include "ui/devtools/string_util.h"
14
15 namespace ui {
16 namespace devtools {
17
18 class UiDevToolsServer;
19
20 // Every UI component that wants to be inspectable must instantiate
21 // this class and attach the corresponding backends/frontends (i.e: DOM, CSS,
22 // etc). This client is then attached to the UiDevToolsServer and all messages
23 // from this client are sent over the web socket owned by the server.
24 class UiDevToolsClient : public protocol::FrontendChannel {
25 public:
26 UiDevToolsClient(const String& name, UiDevToolsServer* server);
27 ~UiDevToolsClient() override;
28
29 void AddDOMBackend(std::unique_ptr<protocol::DOM::Backend> dom_backend);
30
31 private:
32 static const int kNotConnected = -1;
33
34 friend class UiDevToolsServer;
35 void Dispatch(const String& data);
36 bool connected();
37
38 // protocol::FrontendChannel
39 void sendProtocolResponse(int callId, const String& message) override;
40 void sendProtocolNotification(const String& message) override;
41 void flushProtocolNotifications() override;
42
43 std::string name_;
44 int connection_id_;
45
46 std::unique_ptr<protocol::DOM::Backend> dom_backend_;
47 protocol::UberDispatcher dispatcher_;
48 UiDevToolsServer* server_;
49
50 DISALLOW_COPY_AND_ASSIGN(UiDevToolsClient);
51 };
52
53 } // namespace devtools
54 } // namespace ui
55
56 #endif // UI_DEVTOOLS_DEVTOOLS_CLIENT_H_
OLDNEW
« no previous file with comments | « ui/devtools/DEPS ('k') | ui/devtools/devtools_client.cc » ('j') | ui/devtools/devtools_server.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698