| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #include "content/browser/devtools/protocol/system_info_handler.h" | 5 #include "content/browser/devtools/protocol/system_info_handler.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 | 8 |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 167 GpuDataManager::GetInstance()->RemoveObserver(this); | 167 GpuDataManager::GetInstance()->RemoveObserver(this); |
| 168 SendGetInfoResponse(std::move(callback_)); | 168 SendGetInfoResponse(std::move(callback_)); |
| 169 delete this; | 169 delete this; |
| 170 } | 170 } |
| 171 | 171 |
| 172 private: | 172 private: |
| 173 std::unique_ptr<GetInfoCallback> callback_; | 173 std::unique_ptr<GetInfoCallback> callback_; |
| 174 base::WeakPtrFactory<SystemInfoHandlerGpuObserver> weak_factory_; | 174 base::WeakPtrFactory<SystemInfoHandlerGpuObserver> weak_factory_; |
| 175 }; | 175 }; |
| 176 | 176 |
| 177 SystemInfoHandler::SystemInfoHandler() { | 177 SystemInfoHandler::SystemInfoHandler() |
| 178 : DevToolsDomainHandler(SystemInfo::Metainfo::domainName) { |
| 178 } | 179 } |
| 179 | 180 |
| 180 SystemInfoHandler::~SystemInfoHandler() { | 181 SystemInfoHandler::~SystemInfoHandler() { |
| 181 } | 182 } |
| 182 | 183 |
| 183 void SystemInfoHandler::Wire(UberDispatcher* dispatcher) { | 184 void SystemInfoHandler::Wire(UberDispatcher* dispatcher) { |
| 184 SystemInfo::Dispatcher::wire(dispatcher, this); | 185 SystemInfo::Dispatcher::wire(dispatcher, this); |
| 185 } | 186 } |
| 186 | 187 |
| 188 void SystemInfoHandler::SetRenderFrameHost(RenderFrameHostImpl* host) { |
| 189 } |
| 190 |
| 187 Response SystemInfoHandler::Disable() { | 191 Response SystemInfoHandler::Disable() { |
| 188 return Response::OK(); | 192 return Response::OK(); |
| 189 } | 193 } |
| 190 | 194 |
| 191 void SystemInfoHandler::GetInfo( | 195 void SystemInfoHandler::GetInfo( |
| 192 std::unique_ptr<GetInfoCallback> callback) { | 196 std::unique_ptr<GetInfoCallback> callback) { |
| 193 std::string reason; | 197 std::string reason; |
| 194 if (!GpuDataManager::GetInstance()->GpuAccessAllowed(&reason) || | 198 if (!GpuDataManager::GetInstance()->GpuAccessAllowed(&reason) || |
| 195 GpuDataManager::GetInstance()->IsEssentialGpuInfoAvailable() || | 199 GpuDataManager::GetInstance()->IsEssentialGpuInfoAvailable() || |
| 196 base::CommandLine::ForCurrentProcess()->HasSwitch( | 200 base::CommandLine::ForCurrentProcess()->HasSwitch( |
| (...skipping 12 matching lines...) Expand all Loading... |
| 209 } else { | 213 } else { |
| 210 // We will be able to get more information from the GpuDataManager. | 214 // We will be able to get more information from the GpuDataManager. |
| 211 // Register a transient observer with it to call us back when the | 215 // Register a transient observer with it to call us back when the |
| 212 // information is available. | 216 // information is available. |
| 213 new SystemInfoHandlerGpuObserver(std::move(callback)); | 217 new SystemInfoHandlerGpuObserver(std::move(callback)); |
| 214 } | 218 } |
| 215 } | 219 } |
| 216 | 220 |
| 217 } // namespace protocol | 221 } // namespace protocol |
| 218 } // namespace content | 222 } // namespace content |
| OLD | NEW |