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

Unified Diff: components/ui_devtools/devtools_base_agent.h

Issue 2470933002: Disable agents when client disconnects (Closed)
Patch Set: fix nit 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') | no next file with comments »
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..0b66d8254368657476ce58288fe2f3ad706757a7 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,25 @@ template <typename DomainMetainfo>
class UiDevToolsBaseAgent : public UiDevToolsAgent,
public DomainMetainfo::BackendClass {
public:
- void Init(protocol::UberDispatcher* dispatcher) {
+ // UiDevToolsAgent:
+ void Init(protocol::UberDispatcher* dispatcher) override {
frontend_.reset(
new typename DomainMetainfo::FrontendClass(dispatcher->channel()));
DomainMetainfo::DispatcherClass::wire(dispatcher, this);
}
+ void Disable() override { disable(); }
+
+ // Common methods between all generated Backends, subclasses may
+ // choose to override them (but not necessary).
+ ui::devtools::protocol::Response enable() override {
+ return ui::devtools::protocol::Response::OK();
+ };
+
+ ui::devtools::protocol::Response disable() override {
+ return ui::devtools::protocol::Response::OK();
+ };
+
protected:
UiDevToolsBaseAgent() {}
typename DomainMetainfo::FrontendClass* frontend() const {
« no previous file with comments | « no previous file | components/ui_devtools/devtools_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698