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

Side by Side Diff: media/base/pipeline_impl.cc

Issue 1939453002: Lock to access |statistics_| in StateTransitionTask(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/base/pipeline_impl.h" 5 #include "media/base/pipeline_impl.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 363 matching lines...) Expand 10 before | Expand all | Expand 10 after
374 text_renderer_->StartPlaying(); 374 text_renderer_->StartPlaying();
375 375
376 base::ResetAndReturn(&seek_cb_).Run(PIPELINE_OK); 376 base::ResetAndReturn(&seek_cb_).Run(PIPELINE_OK);
377 377
378 PlaybackRateChangedTask(GetPlaybackRate()); 378 PlaybackRateChangedTask(GetPlaybackRate());
379 VolumeChangedTask(GetVolume()); 379 VolumeChangedTask(GetVolume());
380 return; 380 return;
381 381
382 case kSuspended: 382 case kSuspended:
383 renderer_.reset(); 383 renderer_.reset();
384 statistics_.audio_memory_usage = 0; 384 {
385 statistics_.video_memory_usage = 0; 385 base::AutoLock auto_lock(lock_);
386 statistics_.audio_memory_usage = 0;
387 statistics_.video_memory_usage = 0;
388 }
386 base::ResetAndReturn(&suspend_cb_).Run(PIPELINE_OK); 389 base::ResetAndReturn(&suspend_cb_).Run(PIPELINE_OK);
387 return; 390 return;
388 391
389 case kStopping: 392 case kStopping:
390 case kStopped: 393 case kStopped:
391 case kCreated: 394 case kCreated:
392 case kSeeking: 395 case kSeeking:
393 case kSuspending: 396 case kSuspending:
394 case kResuming: 397 case kResuming:
395 NOTREACHED() << "State has no transition: " << state_; 398 NOTREACHED() << "State has no transition: " << state_;
(...skipping 468 matching lines...) Expand 10 before | Expand all | Expand 10 after
864 metadata_cb_.Run(metadata); 867 metadata_cb_.Run(metadata);
865 } 868 }
866 869
867 void PipelineImpl::BufferingStateChanged(BufferingState new_buffering_state) { 870 void PipelineImpl::BufferingStateChanged(BufferingState new_buffering_state) {
868 DVLOG(1) << __FUNCTION__ << "(" << new_buffering_state << ") "; 871 DVLOG(1) << __FUNCTION__ << "(" << new_buffering_state << ") ";
869 DCHECK(task_runner_->BelongsToCurrentThread()); 872 DCHECK(task_runner_->BelongsToCurrentThread());
870 buffering_state_cb_.Run(new_buffering_state); 873 buffering_state_cb_.Run(new_buffering_state);
871 } 874 }
872 875
873 } // namespace media 876 } // 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