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

Side by Side Diff: content/renderer/media/webmediaplayer_ms.cc

Issue 2053133003: Always post deletion of WebMediaPlayerMSCompositor. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix unittests. Created 4 years, 6 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 | content/renderer/media/webmediaplayer_ms_unittest.cc » ('j') | 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/renderer/media/webmediaplayer_ms.h" 5 #include "content/renderer/media/webmediaplayer_ms.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <limits> 8 #include <limits>
9 #include <string> 9 #include <string>
10 #include <utility> 10 #include <utility>
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 media_log_->CreateEvent(media::MediaLogEvent::WEBMEDIAPLAYER_CREATED)); 77 media_log_->CreateEvent(media::MediaLogEvent::WEBMEDIAPLAYER_CREATED));
78 } 78 }
79 79
80 WebMediaPlayerMS::~WebMediaPlayerMS() { 80 WebMediaPlayerMS::~WebMediaPlayerMS() {
81 DVLOG(1) << __FUNCTION__; 81 DVLOG(1) << __FUNCTION__;
82 DCHECK(thread_checker_.CalledOnValidThread()); 82 DCHECK(thread_checker_.CalledOnValidThread());
83 83
84 // Always do this before posting the |compositor_| for deletion. 84 // Always do this before posting the |compositor_| for deletion.
85 get_client()->setWebLayer(nullptr); 85 get_client()->setWebLayer(nullptr);
86 86
87 if (compositor_ && !compositor_task_runner_->BelongsToCurrentThread()) 87 if (compositor_)
88 compositor_task_runner_->DeleteSoon(FROM_HERE, compositor_.release()); 88 compositor_task_runner_->DeleteSoon(FROM_HERE, compositor_.release());
89 89
90 if (video_frame_provider_) 90 if (video_frame_provider_)
91 video_frame_provider_->Stop(); 91 video_frame_provider_->Stop();
92 92
93 if (audio_renderer_) 93 if (audio_renderer_)
94 audio_renderer_->Stop(); 94 audio_renderer_->Stop();
95 95
96 media_log_->AddEvent( 96 media_log_->AddEvent(
97 media_log_->CreateEvent(media::MediaLogEvent::WEBMEDIAPLAYER_DESTROYED)); 97 media_log_->CreateEvent(media::MediaLogEvent::WEBMEDIAPLAYER_DESTROYED));
(...skipping 437 matching lines...) Expand 10 before | Expand all | Expand 10 after
535 void WebMediaPlayerMS::ResetCanvasCache() { 535 void WebMediaPlayerMS::ResetCanvasCache() {
536 DCHECK(thread_checker_.CalledOnValidThread()); 536 DCHECK(thread_checker_.CalledOnValidThread());
537 video_renderer_.ResetCache(); 537 video_renderer_.ResetCache();
538 } 538 }
539 539
540 void WebMediaPlayerMS::TriggerResize() { 540 void WebMediaPlayerMS::TriggerResize() {
541 get_client()->sizeChanged(); 541 get_client()->sizeChanged();
542 } 542 }
543 543
544 } // namespace content 544 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | content/renderer/media/webmediaplayer_ms_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698