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

Unified Diff: components/ui_devtools/devtools_base_agent.h

Issue 2470933002: Disable agents when client disconnects (Closed)
Patch Set: 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
« no previous file with comments | « no previous file | components/ui_devtools/devtools_client.h » ('j') | components/ui_devtools/devtools_client.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/ui_devtools/devtools_base_agent.h
diff --git a/components/ui_devtools/devtools_base_agent.h b/components/ui_devtools/devtools_base_agent.h
index 0db95a674a377b7409882c79f2d35bcb064f4d30..5aa2a9810ff7eaaf635a188b833c0676ca0cafe5 100644
--- a/components/ui_devtools/devtools_base_agent.h
+++ b/components/ui_devtools/devtools_base_agent.h
@@ -16,6 +16,7 @@ class UiDevToolsAgent {
virtual ~UiDevToolsAgent() {}
virtual void Init(protocol::UberDispatcher*) = 0;
+ virtual void Disable() = 0;
};
// A base agent so that any Backend implementation has access to the
@@ -27,12 +28,22 @@ template <typename DomainMetainfo>
class UiDevToolsBaseAgent : public UiDevToolsAgent,
public DomainMetainfo::BackendClass {
public:
- void Init(protocol::UberDispatcher* dispatcher) {
+ void Init(protocol::UberDispatcher* dispatcher) override {
sadrul 2016/11/02 01:45:38 Before this line, add: // UiDevToolsAgent:
Sarmad Hashmi 2016/11/02 02:43:53 Done.
frontend_.reset(
new typename DomainMetainfo::FrontendClass(dispatcher->channel()));
DomainMetainfo::DispatcherClass::wire(dispatcher, this);
}
+ void Disable() override {
+ protocol::ErrorString error;
+ disable(&error);
+ }
+
+ // Common methods between all generated Backends, subclasses may
+ // choose to override them (but not necessary).
+ void enable(protocol::ErrorString*) override {}
+ void disable(protocol::ErrorString*) override {}
+
protected:
UiDevToolsBaseAgent() {}
typename DomainMetainfo::FrontendClass* frontend() const {
« no previous file with comments | « no previous file | components/ui_devtools/devtools_client.h » ('j') | components/ui_devtools/devtools_client.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698