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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « content/browser/media/capture/desktop_capture_device.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/media/capture/desktop_capture_device_aura.h" 5 #include "content/browser/media/capture/desktop_capture_device_aura.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/metrics/histogram.h" 8 #include "base/metrics/histogram.h"
9 #include "base/timer/timer.h" 9 #include "base/timer/timer.h"
10 #include "cc/output/copy_output_request.h" 10 #include "cc/output/copy_output_request.h"
(...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after
308 scoped_refptr<media::VideoFrame> video_frame, 308 scoped_refptr<media::VideoFrame> video_frame,
309 base::TimeTicks start_time, 309 base::TimeTicks start_time,
310 const ThreadSafeCaptureOracle::CaptureFrameCallback& capture_frame_cb, 310 const ThreadSafeCaptureOracle::CaptureFrameCallback& capture_frame_cb,
311 scoped_ptr<cc::CopyOutputResult> result) { 311 scoped_ptr<cc::CopyOutputResult> result) {
312 static bool first_call = true; 312 static bool first_call = true;
313 313
314 bool succeeded = ProcessCopyOutputResponse( 314 bool succeeded = ProcessCopyOutputResponse(
315 video_frame, start_time, capture_frame_cb, result.Pass()); 315 video_frame, start_time, capture_frame_cb, result.Pass());
316 316
317 base::TimeDelta capture_time = base::TimeTicks::Now() - start_time; 317 base::TimeDelta capture_time = base::TimeTicks::Now() - start_time;
318 UMA_HISTOGRAM_TIMES( 318
319 window_id_.type == DesktopMediaID::TYPE_SCREEN ? kUmaScreenCaptureTime 319 // The two UMA_ blocks must be put in its own scope since it creates a static
320 : kUmaWindowCaptureTime, 320 // variable which expected constant histogram name.
321 capture_time); 321 if (window_id_.type == DesktopMediaID::TYPE_SCREEN) {
322 UMA_HISTOGRAM_TIMES(kUmaScreenCaptureTime, capture_time);
323 } else {
324 UMA_HISTOGRAM_TIMES(kUmaWindowCaptureTime, capture_time);
325 }
322 326
323 if (first_call) { 327 if (first_call) {
324 first_call = false; 328 first_call = false;
325 if (window_id_.type == DesktopMediaID::TYPE_SCREEN) { 329 if (window_id_.type == DesktopMediaID::TYPE_SCREEN) {
326 IncrementDesktopCaptureCounter(succeeded ? FIRST_SCREEN_CAPTURE_SUCCEEDED 330 IncrementDesktopCaptureCounter(succeeded ? FIRST_SCREEN_CAPTURE_SUCCEEDED
327 : FIRST_SCREEN_CAPTURE_FAILED); 331 : FIRST_SCREEN_CAPTURE_FAILED);
328 } else { 332 } else {
329 IncrementDesktopCaptureCounter(succeeded 333 IncrementDesktopCaptureCounter(succeeded
330 ? FIRST_WINDOW_CAPTURE_SUCCEEDED 334 ? FIRST_WINDOW_CAPTURE_SUCCEEDED
331 : FIRST_WINDOW_CAPTURE_FAILED); 335 : FIRST_WINDOW_CAPTURE_FAILED);
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after
529 scoped_ptr<Client> client) { 533 scoped_ptr<Client> client) {
530 DVLOG(1) << "Allocating " << params.requested_format.frame_size.ToString(); 534 DVLOG(1) << "Allocating " << params.requested_format.frame_size.ToString();
531 core_->AllocateAndStart(params, client.Pass()); 535 core_->AllocateAndStart(params, client.Pass());
532 } 536 }
533 537
534 void DesktopCaptureDeviceAura::StopAndDeAllocate() { 538 void DesktopCaptureDeviceAura::StopAndDeAllocate() {
535 core_->StopAndDeAllocate(); 539 core_->StopAndDeAllocate();
536 } 540 }
537 541
538 } // namespace content 542 } // namespace content
OLDNEW
« 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