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> |
| 8 |
7 #include "base/bind.h" | 9 #include "base/bind.h" |
8 #include "content/browser/gpu/compositor_util.h" | 10 #include "content/browser/gpu/compositor_util.h" |
9 #include "content/public/browser/gpu_data_manager.h" | 11 #include "content/public/browser/gpu_data_manager.h" |
10 #include "gpu/config/gpu_info.h" | 12 #include "gpu/config/gpu_info.h" |
11 | 13 |
12 namespace content { | 14 namespace content { |
13 namespace devtools { | 15 namespace devtools { |
14 namespace system_info { | 16 namespace system_info { |
15 | 17 |
16 namespace { | 18 namespace { |
17 | 19 |
18 using Response = DevToolsProtocolClient::Response; | 20 using Response = DevToolsProtocolClient::Response; |
19 | 21 |
20 // Give the GPU process a few seconds to provide GPU info. | 22 // Give the GPU process a few seconds to provide GPU info. |
21 const int kGPUInfoWatchdogTimeoutMs = 5000; | 23 const int kGPUInfoWatchdogTimeoutMs = 5000; |
22 | 24 |
23 class AuxGPUInfoEnumerator : public gpu::GPUInfo::Enumerator { | 25 class AuxGPUInfoEnumerator : public gpu::GPUInfo::Enumerator { |
24 public: | 26 public: |
25 AuxGPUInfoEnumerator(base::DictionaryValue* dictionary) | 27 AuxGPUInfoEnumerator(base::DictionaryValue* dictionary) |
26 : dictionary_(dictionary), | 28 : dictionary_(dictionary), |
27 in_aux_attributes_(false) { } | 29 in_aux_attributes_(false) { } |
28 | 30 |
29 void AddInt64(const char* name, int64 value) override { | 31 void AddInt64(const char* name, int64_t value) override { |
30 if (in_aux_attributes_) | 32 if (in_aux_attributes_) |
31 dictionary_->SetDouble(name, value); | 33 dictionary_->SetDouble(name, value); |
32 } | 34 } |
33 | 35 |
34 void AddInt(const char* name, int value) override { | 36 void AddInt(const char* name, int value) override { |
35 if (in_aux_attributes_) | 37 if (in_aux_attributes_) |
36 dictionary_->SetInteger(name, value); | 38 dictionary_->SetInteger(name, value); |
37 } | 39 } |
38 | 40 |
39 void AddString(const char* name, const std::string& value) override { | 41 void AddString(const char* name, const std::string& value) override { |
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
224 SendGetInfoResponse(command_id); | 226 SendGetInfoResponse(command_id); |
225 // For the time being we want to know about this event in the test logs. | 227 // For the time being we want to know about this event in the test logs. |
226 LOG(ERROR) << "SystemInfoHandler: request for GPU info timed out!" | 228 LOG(ERROR) << "SystemInfoHandler: request for GPU info timed out!" |
227 << " Most recent info sent."; | 229 << " Most recent info sent."; |
228 } | 230 } |
229 } | 231 } |
230 | 232 |
231 } // namespace system_info | 233 } // namespace system_info |
232 } // namespace devtools | 234 } // namespace devtools |
233 } // namespace content | 235 } // namespace content |
OLD | NEW |