Back out 7f81109133b5 (bug 725221), 135721f3720b (bug 726891), aef4ead175b4 (bug 726894) for orange

This commit is contained in:
Phil Ringnalda 2012-02-13 22:31:22 -08:00
parent fea5deb4c4
commit 7b77666e87
6 changed files with 18 additions and 36 deletions

View File

@ -313,9 +313,6 @@ nsGenericDOMDataNode::SetTextInternal(PRUint32 aOffset, PRUint32 aCount,
return NS_ERROR_DOM_DOMSTRING_SIZE_ERR;
}
if (aCount == aLength && mText.SubstringEquals(aOffset, aBuffer, aLength))
return NS_OK;
nsIDocument *document = GetCurrentDoc();
mozAutoDocUpdate updateBatch(document, UPDATE_CONTENT_MODEL, aNotify);

View File

@ -453,18 +453,3 @@ nsTextFragment::UpdateBidiFlag(const PRUnichar* aBuffer, PRUint32 aLength)
}
}
}
bool
nsTextFragment::SubstringEquals(PRInt32 aOffset, const PRUnichar* aString, PRInt32 aLength)
{
NS_ASSERTION(aOffset + aLength <= GetLength(), "Bad substring");
if (mState.mIs2b) {
return memcmp(aString, m2b + aOffset, sizeof(PRUnichar)*aLength) == 0;
}
const char* text = m1b + aOffset;
for (PRInt32 i = 0; i < aLength; ++i) {
if (PRUint8(text[i]) != aString[i])
return false;
}
return true;
}

View File

@ -211,8 +211,6 @@ public:
return mState.mIs2b ? m2b[aIndex] : static_cast<unsigned char>(m1b[aIndex]);
}
bool SubstringEquals(PRInt32 aOffset, const PRUnichar* aString, PRInt32 aLength);
struct FragmentBits {
// PRUint32 to ensure that the values are unsigned, because we
// want 0/1, not 0/-1!

View File

@ -117,6 +117,10 @@ class nsNativeAudioStream : public nsAudioStream
double mVolume;
void* mAudioHandle;
int mRate;
int mChannels;
SampleFormat mFormat;
// True if this audio stream is paused.
bool mPaused;
@ -151,6 +155,10 @@ class nsRemotedAudioStream : public nsAudioStream
private:
nsRefPtr<AudioChild> mAudioChild;
SampleFormat mFormat;
int mRate;
int mChannels;
PRInt32 mBytesPerFrame;
// True if this audio stream is paused.
@ -422,6 +430,9 @@ nsAudioStream::~nsAudioStream()
nsNativeAudioStream::nsNativeAudioStream() :
mVolume(1.0),
mAudioHandle(0),
mRate(0),
mChannels(0),
mFormat(FORMAT_S16_LE),
mPaused(false),
mInError(false)
{
@ -643,6 +654,9 @@ PRInt32 nsNativeAudioStream::GetMinWriteSize()
#if defined(REMOTE_AUDIO)
nsRemotedAudioStream::nsRemotedAudioStream()
: mAudioChild(nsnull),
mFormat(FORMAT_S16_LE),
mRate(0),
mChannels(0),
mBytesPerFrame(0),
mPaused(false)
{}
@ -862,6 +876,9 @@ private:
// nsAutoRef's destructor.
nsAutoRef<cubeb_stream> mCubebStream;
PRInt32 mRate;
PRInt32 mChannels;
SampleFormat mFormat;
PRUint32 mBytesPerFrame;
enum StreamState {
@ -900,7 +917,7 @@ nsAudioStream* nsAudioStream::AllocateStream()
#if defined(MOZ_CUBEB)
nsBufferedAudioStream::nsBufferedAudioStream()
: mMonitor("nsBufferedAudioStream"), mLostFrames(0), mVolume(1.0),
: mMonitor("nsBufferedAudioStream"), mLostFrames(0), mVolume(1.0), mRate(0), mChannels(0),
mBytesPerFrame(0), mState(INITIALIZED)
{
}

View File

@ -54,12 +54,6 @@ public:
FORMAT_FLOAT32
};
nsAudioStream()
: mRate(0),
mChannels(0),
mFormat(FORMAT_S16_LE)
{}
virtual ~nsAudioStream();
// Initialize Audio Library. Some Audio backends require initializing the
@ -128,15 +122,8 @@ public:
// Unsafe to call with the decoder monitor held.
virtual PRInt32 GetMinWriteSize() = 0;
int GetRate() { return mRate; }
int GetChannels() { return mChannels; }
SampleFormat GetFormat() { return mFormat; }
protected:
nsCOMPtr<nsIThread> mAudioPlaybackThread;
int mRate;
int mChannels;
SampleFormat mFormat;
};
#endif

View File

@ -78,7 +78,6 @@ struct DebugOnly
DebugOnly() {}
DebugOnly(const T& other) : value(other) {}
DebugOnly(const DebugOnly& other) : value(other.value) {}
DebugOnly& operator=(const T& rhs) {
value = rhs;
return *this;
@ -98,7 +97,6 @@ struct DebugOnly
#else
DebugOnly() {}
DebugOnly(const T&) {}
DebugOnly(const DebugOnly&) {}
DebugOnly& operator=(const T&) { return *this; }
void operator++(int) {}
void operator--(int) {}