diff options
author | tobiasjs <tobiasjs@chromium.org> | 2015-09-29 05:03:38 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-09-29 12:04:48 +0000 |
commit | b848517ac95380fe6294080bd699b04acadc301e (patch) | |
tree | a63c9cad390bdf41ed14a7b4c1d336b2dea4f786 /android_webview/common | |
parent | db6a0533e143a67ae8e58b4077482228a43c10eb (diff) | |
download | chromium_src-b848517ac95380fe6294080bd699b04acadc301e.zip chromium_src-b848517ac95380fe6294080bd699b04acadc301e.tar.gz chromium_src-b848517ac95380fe6294080bd699b04acadc301e.tar.bz2 |
Add GPU fingerprint information to breakpad microdumps.
Although strictly the GPU fingerprint is defined by the build fingerprint,
there is not currently a straightforward mapping from build fingerprint
to useful GPU / GL driver information.
In order to aid debugging of WebView crashes that occur in GL drivers,
and to better understand the range of drivers and versions for feature
blacklisting purposes, it is useful to have GPU fingerprints in breakpad
microdumps.
BUG=
Review URL: https://codereview.chromium.org/1343713002
Cr-Commit-Position: refs/heads/master@{#351289}
Diffstat (limited to 'android_webview/common')
-rw-r--r-- | android_webview/common/aw_content_client.cc | 8 | ||||
-rw-r--r-- | android_webview/common/aw_content_client.h | 10 |
2 files changed, 18 insertions, 0 deletions
diff --git a/android_webview/common/aw_content_client.cc b/android_webview/common/aw_content_client.cc index b4400ae..2e95f03 100644 --- a/android_webview/common/aw_content_client.cc +++ b/android_webview/common/aw_content_client.cc @@ -9,6 +9,7 @@ #include "base/command_line.h" #include "content/public/common/content_switches.h" #include "content/public/common/user_agent.h" +#include "gpu/config/gpu_info.h" #include "ipc/ipc_message.h" #include "ui/base/l10n/l10n_util.h" #include "ui/base/resource/resource_bundle.h" @@ -66,4 +67,11 @@ bool AwContentClient::CanSendWhileSwappedOut(const IPC::Message* message) { return message->type() == IPC_REPLY_ID; } +void AwContentClient::SetGpuInfo(const gpu::GPUInfo& gpu_info) { + gpu_fingerprint_ = gpu_info.gl_version + '|' + gpu_info.gl_vendor + '|' + + gpu_info.gl_renderer; + std::replace_if(gpu_fingerprint_.begin(), gpu_fingerprint_.end(), + [](char c) { return !::isprint(c); }, '_'); +} + } // namespace android_webview diff --git a/android_webview/common/aw_content_client.h b/android_webview/common/aw_content_client.h index 01f4ff8..28eb2fc 100644 --- a/android_webview/common/aw_content_client.h +++ b/android_webview/common/aw_content_client.h @@ -9,6 +9,10 @@ #include "base/compiler_specific.h" +namespace gpu { +struct GPUInfo; +} + namespace android_webview { std::string GetProduct(); @@ -26,6 +30,12 @@ class AwContentClient : public content::ContentClient { int resource_id, ui::ScaleFactor scale_factor) const override; bool CanSendWhileSwappedOut(const IPC::Message* message) override; + + void SetGpuInfo(const gpu::GPUInfo& gpu_info) override; + const std::string& gpu_fingerprint() const { return gpu_fingerprint_; } + + private: + std::string gpu_fingerprint_; }; } // namespace android_webview |