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

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

Issue 2374513002: Add ui devtools server (Closed)
Patch Set: Add 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
« no previous file with comments | « ui/devtools/DEPS ('k') | ui/devtools/devtools_client.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_
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 static const int kNotConnected = -1;
27
28 UiDevToolsClient(const String& name, UiDevToolsServer* server);
sadrul 2016/10/18 20:29:37 Let's use const std::string& here. (you probably d
Sarmad Hashmi 2016/10/19 23:56:02 Done.
29 ~UiDevToolsClient() override;
30
31 void AddDOMBackend(std::unique_ptr<protocol::DOM::Backend> dom_backend);
32 void Dispatch(const String& data);
33
34 bool connected() const;
35 void set_connection_id(int connection_id);
36 std::string name() const;
sadrul 2016/10/18 20:29:37 return a const-ref as well, i.e.: const std::str
Sarmad Hashmi 2016/10/19 23:56:02 Done.
37
38 private:
39 // protocol::FrontendChannel
40 void sendProtocolResponse(int callId, const String& message) override;
41 void sendProtocolNotification(const String& message) override;
42 void flushProtocolNotifications() override;
43
44 std::string name_;
45 int connection_id_;
46
47 std::unique_ptr<protocol::DOM::Backend> dom_backend_;
48 protocol::UberDispatcher dispatcher_;
49 UiDevToolsServer* server_;
50
51 DISALLOW_COPY_AND_ASSIGN(UiDevToolsClient);
52 };
53
54 } // namespace devtools
55 } // namespace ui
56
57 #endif // UI_DEVTOOLS_DEVTOOLS_CLIENT_H_
OLDNEW
« no previous file with comments | « ui/devtools/DEPS ('k') | ui/devtools/devtools_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698