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

Unified Diff: content/browser/devtools/protocol/system_info_handler.h

Issue 2515613006: [DevTools] Move Memory, SystemInfo and Tethering domains to new generator. (Closed)
Patch Set: fixed review 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 side-by-side diff with in-line comments
Download patch
Index: content/browser/devtools/protocol/system_info_handler.h
diff --git a/content/browser/devtools/protocol/system_info_handler.h b/content/browser/devtools/protocol/system_info_handler.h
index 281d08bbc9582bf18e85addefca8075d00955f50..2abbd5913b7eadffcf93d77330df0e1232c7b8b5 100644
--- a/content/browser/devtools/protocol/system_info_handler.h
+++ b/content/browser/devtools/protocol/system_info_handler.h
@@ -8,53 +8,31 @@
#include <set>
#include "base/macros.h"
-#include "content/browser/devtools/protocol/devtools_protocol_dispatcher.h"
+#include "content/browser/devtools/protocol/system_info.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/gpu_data_manager_observer.h"
namespace content {
-namespace devtools {
-namespace system_info {
+namespace protocol {
-class SystemInfoHandler {
+class SystemInfoHandler : public SystemInfo::Backend {
public:
- using Response = DevToolsProtocolClient::Response;
SystemInfoHandler();
- ~SystemInfoHandler();
+ ~SystemInfoHandler() override;
- void SetClient(std::unique_ptr<Client> client);
+ void Wire(UberDispatcher*);
+ Response Disable() override;
- Response GetInfo(DevToolsCommandId command_id);
+ void GetInfo(std::unique_ptr<GetInfoCallback> callback) override;
private:
friend class SystemInfoHandlerGpuObserver;
- void SendGetInfoResponse(DevToolsCommandId command_id);
-
- // Bookkeeping for the active GpuObservers.
- void AddActiveObserverId(int observer_id);
- bool RemoveActiveObserverId(int observer_id);
- void ObserverWatchdogCallback(int observer_id, DevToolsCommandId command_id);
-
- // For robustness, we have to guarantee a response to getInfo requests.
- // It's very unlikely that the requests will time out. The
- // GpuDataManager's threading model is not well defined (see comments in
- // gpu_data_manager_impl.h) and it is very difficult to correctly clean
- // up its observers. For the moment, especially since these classes are
- // only used in tests, we leak a little bit of memory if we don't get a
- // callback from the GpuDataManager in time.
- mutable base::Lock lock_;
- std::set<int> active_observers_;
-
- std::unique_ptr<Client> client_;
- base::WeakPtrFactory<SystemInfoHandler> weak_factory_;
-
DISALLOW_COPY_AND_ASSIGN(SystemInfoHandler);
};
-} // namespace system_info
-} // namespace devtools
+} // namespace protocol
} // namespace content
#endif // CONTENT_BROWSER_DEVTOOLS_PROTOCOL_SYSTEM_INFO_HANDLER_H_
« no previous file with comments | « content/browser/devtools/protocol/memory_handler.cc ('k') | content/browser/devtools/protocol/system_info_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698