Chromium Code Reviews| 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..4d31dc5a422e68deda30c4102b139cb6a240f6bc 100644 |
| --- a/content/browser/devtools/protocol/system_info_handler.h |
| +++ b/content/browser/devtools/protocol/system_info_handler.h |
| @@ -8,53 +8,33 @@ |
| #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_; |
| + std::unique_ptr<SystemInfo::Frontend> frontend_; |
|
caseq
2016/11/21 23:32:33
also unused?
dgozman
2016/11/22 00:53:39
Done.
|
| DISALLOW_COPY_AND_ASSIGN(SystemInfoHandler); |
| }; |
| -} // namespace system_info |
| -} // namespace devtools |
| +} // namespace protocol |
| } // namespace content |
| #endif // CONTENT_BROWSER_DEVTOOLS_PROTOCOL_SYSTEM_INFO_HANDLER_H_ |