Backed out changeset f556245d6da1 (bug 856848) for build bustage on a CLOSED TREE.

This commit is contained in:
Ryan VanderMeulen 2013-04-11 15:42:37 -04:00
parent 4f9c053e1a
commit b53553830a
5 changed files with 26 additions and 53 deletions

View File

@ -45,12 +45,7 @@ static inline nsresult RUN_ON_THREAD(nsIEventTarget *thread, nsIRunnable *runnab
bool on;
nsresult rv;
rv = thread->IsOnCurrentThread(&on);
// If the target thread has already shut down, we don't want to assert.
if (rv != NS_ERROR_NOT_INITIALIZED) {
MOZ_ASSERT(NS_SUCCEEDED(rv));
}
NS_ENSURE_SUCCESS(rv, rv);
if(!on) {
return thread->Dispatch(runnable_ref, flags);

View File

@ -277,7 +277,7 @@ PeerConnectionImpl::PeerConnectionImpl()
, mWindow(NULL)
, mIdentity(NULL)
, mSTSThread(NULL)
, mMedia(NULL)
, mMedia(new PeerConnectionMedia(this))
, mNumAudioStreams(0)
, mNumVideoStreams(0)
, mHaveDataStream(false) {
@ -526,8 +526,6 @@ PeerConnectionImpl::Initialize(IPeerConnectionObserver* aObserver,
return NS_ERROR_FAILURE;
}
mMedia = new PeerConnectionMedia(this);
// Connect ICE slots.
mMedia->SignalIceGatheringCompleted.connect(this, &PeerConnectionImpl::IceGatheringCompleted);
mMedia->SignalIceCompleted.connect(this, &PeerConnectionImpl::IceCompleted);

View File

@ -120,17 +120,12 @@ PeerConnectionImpl* PeerConnectionImpl::CreatePeerConnection()
}
PeerConnectionMedia::PeerConnectionMedia(PeerConnectionImpl *parent)
: mParent(parent),
mLocalSourceStreamsLock("PeerConnectionMedia.mLocalSourceStreamsLock"),
mIceCtx(NULL),
mDNSResolver(new mozilla::NrIceResolver()),
mMainThread(mParent->GetMainThread()),
mSTSThread(mParent->GetSTSThread()) {}
nsresult PeerConnectionMedia::Init(const std::vector<NrIceStunServer>& stun_servers,
const std::vector<NrIceTurnServer>& turn_servers)
{
mMainThread = mParent->GetMainThread();
mSTSThread = mParent->GetSTSThread();
// TODO(ekr@rtfm.com): need some way to set not offerer later
// Looks like a bug in the NrIceCtx API.
mIceCtx = NrIceCtx::Create("PC:" + mParent->GetHandle(), true);

View File

@ -230,7 +230,12 @@ RemoteSourceStreamInfo(already_AddRefed<DOMMediaStream> aMediaStream,
class PeerConnectionMedia : public sigslot::has_slots<> {
public:
PeerConnectionMedia(PeerConnectionImpl *parent);
PeerConnectionMedia(PeerConnectionImpl *parent)
: mParent(parent),
mLocalSourceStreamsLock("PeerConnectionMedia.mLocalSourceStreamsLock"),
mIceCtx(NULL),
mDNSResolver(new mozilla::NrIceResolver()) {}
~PeerConnectionMedia() {}
nsresult Init(const std::vector<mozilla::NrIceStunServer>& stun_servers,

View File

@ -528,24 +528,25 @@ class ParsedSDP {
class SignalingAgent {
public:
SignalingAgent() : pc(nullptr) {
cfg_.addStunServer("23.21.150.121", 3478);
pc = sipcc::PeerConnectionImpl::CreatePeerConnection();
ASSERT_TRUE(pc);
}
SignalingAgent() : pc(nullptr) {}
~SignalingAgent() {
mozilla::SyncRunnable::DispatchToThread(gThread,
mozilla::SyncRunnable::DispatchToThread(pc->GetMainThread(),
WrapRunnable(this, &SignalingAgent::Close));
}
void Init_m(nsCOMPtr<nsIThread> thread)
{
pc = sipcc::PeerConnectionImpl::CreatePeerConnection();
ASSERT_TRUE(pc);
pObserver = new TestObserver(pc);
ASSERT_TRUE(pObserver);
ASSERT_EQ(pc->Initialize(pObserver, nullptr, cfg_, thread), NS_OK);
sipcc::IceConfiguration cfg;
cfg.addStunServer("23.21.150.121", 3478);
ASSERT_EQ(pc->Initialize(pObserver, nullptr, cfg, thread), NS_OK);
}
void Init(nsCOMPtr<nsIThread> thread)
@ -596,12 +597,10 @@ class SignalingAgent {
void Close()
{
if (pc) {
cout << "Close" << endl;
pc->Close(false);
pc = nullptr;
}
// Shutdown is synchronous evidently.
// ASSERT_TRUE(pObserver->WaitForObserverCall());
@ -850,7 +849,6 @@ public:
char* offer_;
char* answer_;
nsRefPtr<DOMMediaStream> domMediaStream_;
sipcc::IceConfiguration cfg_;
private:
void SDPSanityCheck(std::string sdp, uint32_t flags, bool offer)
@ -996,19 +994,6 @@ class SignalingAgentTest : public ::testing::Test {
return true;
}
void CreateAgentNoInit() {
ScopedDeletePtr<SignalingAgent> agent(new SignalingAgent());
agents_.push_back(agent.forget());
}
bool InitAgent(size_t i) {
return agents_[i]->InitAllowFail(gThread);
}
SignalingAgent *agent(size_t i) {
return agents_[i];
}
private:
std::vector<SignalingAgent *> agents_;
};
@ -1987,11 +1972,6 @@ TEST_F(SignalingAgentTest, CreateUntilFailThenWait) {
PR_Sleep(10000); // Wait to see if we crash
}
// Test for bug 856433.
TEST_F(SignalingAgentTest, CreateNoInit) {
CreateAgentNoInit();
}
/*
* Test for Bug 843595
*/