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

Unified Diff: content/browser/media/capture/desktop_capture_device.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 | « no previous file | content/browser/media/capture/desktop_capture_device_aura.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/media/capture/desktop_capture_device.cc
diff --git a/content/browser/media/capture/desktop_capture_device.cc b/content/browser/media/capture/desktop_capture_device.cc
index 246ab1b5d396557259a98af9fa6c012ae9205419..94e5084ddd42ca9e7b4b0ac2d4155d3bd528ee84 100644
--- a/content/browser/media/capture/desktop_capture_device.cc
+++ b/content/browser/media/capture/desktop_capture_device.cc
@@ -220,10 +220,14 @@ void DesktopCaptureDevice::Core::OnCaptureCompleted(
base::TimeDelta capture_time(
base::TimeDelta::FromMilliseconds(frame->capture_time_ms()));
- UMA_HISTOGRAM_TIMES(
- capturer_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 (capturer_type_ == DesktopMediaID::TYPE_SCREEN) {
+ UMA_HISTOGRAM_TIMES(kUmaScreenCaptureTime, capture_time);
+ } else {
+ UMA_HISTOGRAM_TIMES(kUmaWindowCaptureTime, capture_time);
+ }
scoped_ptr<webrtc::DesktopFrame> owned_frame(frame);
« no previous file with comments | « no previous file | content/browser/media/capture/desktop_capture_device_aura.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698