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

Side by Side Diff: media/blink/webmediaplayer_impl.cc

Issue 1808473002: Log a non-crash dump for 10% of Spitzer pipeline decode failures. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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 | « no previous file | 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 "media/blink/webmediaplayer_impl.h" 5 #include "media/blink/webmediaplayer_impl.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <cmath> 8 #include <cmath>
9 #include <limits> 9 #include <limits>
10 #include <string> 10 #include <string>
11 #include <utility> 11 #include <utility>
12 12
13 #include "base/bind.h" 13 #include "base/bind.h"
14 #include "base/bind_helpers.h" 14 #include "base/bind_helpers.h"
15 #include "base/callback.h" 15 #include "base/callback.h"
16 #include "base/callback_helpers.h" 16 #include "base/callback_helpers.h"
17 #include "base/command_line.h" 17 #include "base/command_line.h"
18 #include "base/debug/alias.h" 18 #include "base/debug/alias.h"
19 #include "base/debug/crash_logging.h" 19 #include "base/debug/crash_logging.h"
20 #include "base/debug/dump_without_crashing.h"
20 #include "base/metrics/histogram.h" 21 #include "base/metrics/histogram.h"
22 #include "base/rand_util.h"
21 #include "base/single_thread_task_runner.h" 23 #include "base/single_thread_task_runner.h"
22 #include "base/synchronization/waitable_event.h" 24 #include "base/synchronization/waitable_event.h"
23 #include "base/task_runner_util.h" 25 #include "base/task_runner_util.h"
24 #include "base/thread_task_runner_handle.h" 26 #include "base/thread_task_runner_handle.h"
25 #include "base/trace_event/trace_event.h" 27 #include "base/trace_event/trace_event.h"
26 #include "build/build_config.h" 28 #include "build/build_config.h"
27 #include "cc/blink/web_layer_impl.h" 29 #include "cc/blink/web_layer_impl.h"
28 #include "cc/layers/video_layer.h" 30 #include "cc/layers/video_layer.h"
29 #include "gpu/blink/webgraphicscontext3d_impl.h" 31 #include "gpu/blink/webgraphicscontext3d_impl.h"
30 #include "media/audio/null_audio_sink.h" 32 #include "media/audio/null_audio_sink.h"
(...skipping 872 matching lines...) Expand 10 before | Expand all | Expand 10 after
903 } 905 }
904 906
905 void WebMediaPlayerImpl::OnPipelineError(PipelineStatus error) { 907 void WebMediaPlayerImpl::OnPipelineError(PipelineStatus error) {
906 DVLOG(1) << __FUNCTION__; 908 DVLOG(1) << __FUNCTION__;
907 DCHECK(main_task_runner_->BelongsToCurrentThread()); 909 DCHECK(main_task_runner_->BelongsToCurrentThread());
908 DCHECK_NE(error, PIPELINE_OK); 910 DCHECK_NE(error, PIPELINE_OK);
909 911
910 if (suppress_destruction_errors_) 912 if (suppress_destruction_errors_)
911 return; 913 return;
912 914
915 #if defined(OS_ANDROID)
916 // For 10% of pipeline decode failures log the playback URL. The URL is set
917 // as the crash-key 'subresource_url' during DoLoad().
918 //
919 // TODO(dalecurtis): This is temporary to track down higher than average
920 // decode failure rates for video-only content. See http://crbug.com/595076.
921 if (base::RandDouble() <= 0.1 && error == PIPELINE_ERROR_DECODE)
922 base::debug::DumpWithoutCrashing();
923 #endif
924
913 media_log_->AddEvent(media_log_->CreatePipelineErrorEvent(error)); 925 media_log_->AddEvent(media_log_->CreatePipelineErrorEvent(error));
914 926
915 if (ready_state_ == WebMediaPlayer::ReadyStateHaveNothing) { 927 if (ready_state_ == WebMediaPlayer::ReadyStateHaveNothing) {
916 // Any error that occurs before reaching ReadyStateHaveMetadata should 928 // Any error that occurs before reaching ReadyStateHaveMetadata should
917 // be considered a format error. 929 // be considered a format error.
918 SetNetworkState(WebMediaPlayer::NetworkStateFormatError); 930 SetNetworkState(WebMediaPlayer::NetworkStateFormatError);
919 return; 931 return;
920 } 932 }
921 933
922 SetNetworkState(PipelineErrorToNetworkState(error)); 934 SetNetworkState(PipelineErrorToNetworkState(error));
(...skipping 541 matching lines...) Expand 10 before | Expand all | Expand 10 after
1464 bool WebMediaPlayerImpl::IsAutomaticResumeAllowed() { 1476 bool WebMediaPlayerImpl::IsAutomaticResumeAllowed() {
1465 #if defined(OS_ANDROID) 1477 #if defined(OS_ANDROID)
1466 return !hasVideo() || (delegate_ && !delegate_->IsHidden()); 1478 return !hasVideo() || (delegate_ && !delegate_->IsHidden());
1467 #else 1479 #else
1468 // On non-Android platforms Resume() is always allowed. 1480 // On non-Android platforms Resume() is always allowed.
1469 return true; 1481 return true;
1470 #endif 1482 #endif
1471 } 1483 }
1472 1484
1473 } // namespace media 1485 } // namespace media
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698