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: third_party/WebKit/Source/platform/exported/WebAudioBus.cpp

Issue 2811463002: Replace ASSERT, ASSERT_NOT_REACHED, and RELEASE_ASSERT in platform/exported (Closed)
Patch Set: rebase Created 3 years, 8 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2010, Google Inc. All rights reserved. 2 * Copyright (C) 2010, Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 30 matching lines...) Expand all
41 audio_bus->SetSampleRate(sample_rate); 41 audio_bus->SetSampleRate(sample_rate);
42 42
43 if (private_) 43 if (private_)
44 (static_cast<AudioBus*>(private_))->Deref(); 44 (static_cast<AudioBus*>(private_))->Deref();
45 45
46 audio_bus->Ref(); 46 audio_bus->Ref();
47 private_ = static_cast<WebAudioBusPrivate*>(audio_bus.Get()); 47 private_ = static_cast<WebAudioBusPrivate*>(audio_bus.Get());
48 } 48 }
49 49
50 void WebAudioBus::ResizeSmaller(size_t new_length) { 50 void WebAudioBus::ResizeSmaller(size_t new_length) {
51 ASSERT(private_); 51 DCHECK(private_);
52 if (private_) { 52 if (private_) {
53 ASSERT(new_length <= length()); 53 DCHECK_LE(new_length, length());
54 private_->ResizeSmaller(new_length); 54 private_->ResizeSmaller(new_length);
55 } 55 }
56 } 56 }
57 57
58 void WebAudioBus::Reset() { 58 void WebAudioBus::Reset() {
59 if (private_) { 59 if (private_) {
60 (static_cast<AudioBus*>(private_))->Deref(); 60 (static_cast<AudioBus*>(private_))->Deref();
61 private_ = 0; 61 private_ = 0;
62 } 62 }
63 } 63 }
(...skipping 12 matching lines...) Expand all
76 76
77 double WebAudioBus::SampleRate() const { 77 double WebAudioBus::SampleRate() const {
78 if (!private_) 78 if (!private_)
79 return 0; 79 return 0;
80 return private_->SampleRate(); 80 return private_->SampleRate();
81 } 81 }
82 82
83 float* WebAudioBus::ChannelData(unsigned channel_index) { 83 float* WebAudioBus::ChannelData(unsigned channel_index) {
84 if (!private_) 84 if (!private_)
85 return 0; 85 return 0;
86 ASSERT(channel_index < NumberOfChannels()); 86 DCHECK_LT(channel_index, NumberOfChannels());
87 return private_->Channel(channel_index)->MutableData(); 87 return private_->Channel(channel_index)->MutableData();
88 } 88 }
89 89
90 PassRefPtr<AudioBus> WebAudioBus::Release() { 90 PassRefPtr<AudioBus> WebAudioBus::Release() {
91 RefPtr<AudioBus> audio_bus(AdoptRef(static_cast<AudioBus*>(private_))); 91 RefPtr<AudioBus> audio_bus(AdoptRef(static_cast<AudioBus*>(private_)));
92 private_ = 0; 92 private_ = 0;
93 return audio_bus; 93 return audio_bus;
94 } 94 }
95 95
96 } // namespace blink 96 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698