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

Side by Side Diff: components/ui_devtools/devtools_client.h

Issue 2470933002: Disable agents when client disconnects (Closed)
Patch Set: sadruls 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 unified diff | Download patch
« no previous file with comments | « components/ui_devtools/devtools_base_agent.h ('k') | components/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
1 // Copyright 2016 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef COMPONENTS_UI_DEVTOOLS_DEVTOOLS_CLIENT_H_ 5 #ifndef COMPONENTS_UI_DEVTOOLS_DEVTOOLS_CLIENT_H_
6 #define COMPONENTS_UI_DEVTOOLS_DEVTOOLS_CLIENT_H_ 6 #define COMPONENTS_UI_DEVTOOLS_DEVTOOLS_CLIENT_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "components/ui_devtools/DOM.h" 10 #include "components/ui_devtools/DOM.h"
(...skipping 11 matching lines...) Expand all
22 // etc). This client is then attached to the UiDevToolsServer and all messages 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. 23 // from this client are sent over the web socket owned by the server.
24 class UiDevToolsClient : public protocol::FrontendChannel { 24 class UiDevToolsClient : public protocol::FrontendChannel {
25 public: 25 public:
26 static const int kNotConnected = -1; 26 static const int kNotConnected = -1;
27 27
28 UiDevToolsClient(const std::string& name, UiDevToolsServer* server); 28 UiDevToolsClient(const std::string& name, UiDevToolsServer* server);
29 ~UiDevToolsClient() override; 29 ~UiDevToolsClient() override;
30 30
31 void AddAgent(std::unique_ptr<UiDevToolsAgent> agent); 31 void AddAgent(std::unique_ptr<UiDevToolsAgent> agent);
32 void DisableAllAgents();
sadrul 2016/11/02 16:05:57 This should go into private section? Or do you exp
Sarmad Hashmi 2016/11/02 16:38:57 Done.
33 void Disconnect();
32 void Dispatch(const std::string& data); 34 void Dispatch(const std::string& data);
33 35
34 bool connected() const; 36 bool connected() const;
35 void set_connection_id(int connection_id); 37 void set_connection_id(int connection_id);
36 const std::string& name() const; 38 const std::string& name() const;
37 39
38 private: 40 private:
39 // protocol::FrontendChannel 41 // protocol::FrontendChannel
40 void sendProtocolResponse(int callId, const String& message) override; 42 void sendProtocolResponse(int callId, const String& message) override;
41 void sendProtocolNotification(const String& message) override; 43 void sendProtocolNotification(const String& message) override;
42 void flushProtocolNotifications() override; 44 void flushProtocolNotifications() override;
43 45
44 std::string name_; 46 std::string name_;
45 int connection_id_; 47 int connection_id_;
46 48
47 std::vector<std::unique_ptr<UiDevToolsAgent>> agents_; 49 std::vector<std::unique_ptr<UiDevToolsAgent>> agents_;
48 protocol::UberDispatcher dispatcher_; 50 protocol::UberDispatcher dispatcher_;
49 UiDevToolsServer* server_; 51 UiDevToolsServer* server_;
50 52
51 DISALLOW_COPY_AND_ASSIGN(UiDevToolsClient); 53 DISALLOW_COPY_AND_ASSIGN(UiDevToolsClient);
52 }; 54 };
53 55
54 } // namespace devtools 56 } // namespace devtools
55 } // namespace ui 57 } // namespace ui
56 58
57 #endif // COMPONENTS_UI_DEVTOOLS_DEVTOOLS_CLIENT_H_ 59 #endif // COMPONENTS_UI_DEVTOOLS_DEVTOOLS_CLIENT_H_
OLDNEW
« no previous file with comments | « components/ui_devtools/devtools_base_agent.h ('k') | components/ui_devtools/devtools_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698