Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(417)

Unified Diff: content/browser/media/capture/desktop_capture_device_aura.cc

Issue 566233004: Fix a DCHECK fired when switching between screen capturing and windown capturing. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/browser/media/capture/desktop_capture_device.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/media/capture/desktop_capture_device_aura.cc
diff --git a/content/browser/media/capture/desktop_capture_device_aura.cc b/content/browser/media/capture/desktop_capture_device_aura.cc
index 7ace41b7c76fe7cc7d1602cad8be7e8649151497..7fd9426653a4c9611499b6d2935050fae43b9d0e 100644
--- a/content/browser/media/capture/desktop_capture_device_aura.cc
+++ b/content/browser/media/capture/desktop_capture_device_aura.cc
@@ -315,10 +315,14 @@ void DesktopVideoCaptureMachine::DidCopyOutput(
video_frame, start_time, capture_frame_cb, result.Pass());
base::TimeDelta capture_time = base::TimeTicks::Now() - start_time;
- UMA_HISTOGRAM_TIMES(
- window_id_.type == DesktopMediaID::TYPE_SCREEN ? kUmaScreenCaptureTime
- : kUmaWindowCaptureTime,
- capture_time);
+
+ // The two UMA_ blocks must be put in its own scope since it creates a static
+ // variable which expected constant histogram name.
+ if (window_id_.type == DesktopMediaID::TYPE_SCREEN) {
+ UMA_HISTOGRAM_TIMES(kUmaScreenCaptureTime, capture_time);
+ } else {
+ UMA_HISTOGRAM_TIMES(kUmaWindowCaptureTime, capture_time);
+ }
if (first_call) {
first_call = false;
« no previous file with comments | « content/browser/media/capture/desktop_capture_device.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698