mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-16 13:56:29 +00:00
Bug 886417: lock before accessing DataChannel->mState r=mcmanus
This commit is contained in:
parent
87f416aced
commit
7d6ec9b36f
@ -405,13 +405,15 @@ public:
|
||||
// Find out state
|
||||
uint16_t GetReadyState()
|
||||
{
|
||||
if (mState == WAITING_TO_OPEN)
|
||||
return CONNECTING;
|
||||
return mState;
|
||||
if (mConnection) {
|
||||
MutexAutoLock lock(mConnection->mLock);
|
||||
if (mState == WAITING_TO_OPEN)
|
||||
return CONNECTING;
|
||||
return mState;
|
||||
}
|
||||
return CLOSED;
|
||||
}
|
||||
|
||||
void SetReadyState(uint16_t aState) { mState = aState; }
|
||||
|
||||
void GetLabel(nsAString& aLabel) { CopyUTF8toUTF16(mLabel, aLabel); }
|
||||
void GetProtocol(nsAString& aProtocol) { CopyUTF8toUTF16(mProtocol, aProtocol); }
|
||||
uint16_t GetStream() { return mStream; }
|
||||
|
Loading…
x
Reference in New Issue
Block a user