mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-13 05:15:45 +00:00
Bug 973315 - Make code that sets PeerConnectionImpl::mName more tolerant of weird scenarios. r=jib
This commit is contained in:
parent
492c419c55
commit
09b2af1ecb
@ -728,22 +728,26 @@ PeerConnectionImpl::Initialize(PeerConnectionObserver& aObserver,
|
||||
char temp[128];
|
||||
|
||||
#ifdef MOZILLA_INTERNAL_API
|
||||
nsIDOMLocation* location = nullptr;
|
||||
mWindow->GetLocation(&location);
|
||||
MOZ_ASSERT(location);
|
||||
nsString locationAStr;
|
||||
location->ToString(locationAStr);
|
||||
location->Release();
|
||||
nsAutoCString locationCStr;
|
||||
nsIDOMLocation* location;
|
||||
res = mWindow->GetLocation(&location);
|
||||
|
||||
if (location && NS_SUCCEEDED(res)) {
|
||||
nsAutoString locationAStr;
|
||||
location->ToString(locationAStr);
|
||||
location->Release();
|
||||
|
||||
CopyUTF16toUTF8(locationAStr, locationCStr);
|
||||
}
|
||||
|
||||
PR_snprintf(
|
||||
temp,
|
||||
sizeof(temp),
|
||||
"%llu (id=%llu url=%s)",
|
||||
static_cast<unsigned long long>(timestamp),
|
||||
static_cast<unsigned long long>(mWindow ? mWindow->WindowID() : 0),
|
||||
locationCStr.get() ? locationCStr.get() : "NULL");
|
||||
|
||||
nsCString locationCStr;
|
||||
CopyUTF16toUTF8(locationAStr, locationCStr);
|
||||
MOZ_ASSERT(mWindow);
|
||||
PR_snprintf(temp,
|
||||
sizeof(temp),
|
||||
"%llu (id=%u url=%s)",
|
||||
(unsigned long long)timestamp,
|
||||
(unsigned)mWindow->WindowID(),
|
||||
locationCStr.get() ? locationCStr.get() : "NULL");
|
||||
#else
|
||||
PR_snprintf(temp, sizeof(temp), "%llu", (unsigned long long)timestamp);
|
||||
#endif // MOZILLA_INTERNAL_API
|
||||
|
Loading…
Reference in New Issue
Block a user