Skip to content

Commit

Permalink
Replace CHECK() with UMA collection of GetLastError().
Browse files Browse the repository at this point in the history
We have a few clients who are crashing badly when unable to load
ffmpegsumo.dll. Instead of crashing, collect the error code so we
can diagnose without completely breaking these users.

BUG=443019
TBR=isherman

Review URL: https://codereview.chromium.org/808923002

Cr-Commit-Position: refs/heads/master@{#308829}
  • Loading branch information
scherkus authored and Commit bot committed Dec 17, 2014
1 parent c8a58bd commit 4bc0e1f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
6 changes: 5 additions & 1 deletion media/base/media_win.cc
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#include <delayimp.h>

#include "base/files/file_path.h"
#include "base/metrics/sparse_histogram.h"
#include "media/ffmpeg/ffmpeg_common.h"

#pragma comment(lib, "delayimp.lib")
Expand All @@ -36,7 +37,10 @@ bool InitializeMediaLibraryInternal(const base::FilePath& module_dir) {

// TODO(scherkus): Remove all the bool-ness from these functions as we no
// longer support disabling HTML5 media at runtime. http://crbug.com/440892
CHECK(initialized);
if (!initialized) {
UMA_HISTOGRAM_SPARSE_SLOWLY("Media.Initialize.Windows", GetLastError());
return false;
}

// VS2013 has a bug where FMA3 instructions will be executed on CPUs that
// support them despite them being disabled at the OS level, causing illegal
Expand Down
8 changes: 8 additions & 0 deletions tools/metrics/histograms/histograms.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12530,6 +12530,14 @@ Therefore, the affected-histogram name has to have at least one dot in it.
</summary>
</histogram>

<histogram name="Media.Initialize.Windows" units="GetLastError">
<owner>scherkus@chromium.org</owner>
<summary>
Errors returned by LoadLibraryEx on Windows while attempting to load
ffmpegsumo.dll.
</summary>
</histogram>

<histogram name="Media.InputStreamDuration" units="ms">
<owner>henrika@chromium.org</owner>
<summary>
Expand Down

0 comments on commit 4bc0e1f

Please sign in to comment.