Bug 1173463 - Add MediaResource::GetContentURL(). r=cpearce

Remember the content url a MediaResource is loaded from
at ctor time and make it available for debugging purposes.

--HG--
extra : rebase_source : 4768b6a6cb6a6c43f37c8f0132e63acf59ecb80f
This commit is contained in:
Ralph Giles 2015-06-10 11:48:00 -07:00
Родитель 0e6155d5e0
Коммит 5c9b2dffc3
1 изменённых файлов: 12 добавлений и 0 удалений

Просмотреть файл

@ -428,6 +428,8 @@ public:
return aMallocSizeOf(this) + SizeOfExcludingThis(aMallocSizeOf);
}
const nsCString& GetContentURL() const { return EmptyCString(); }
protected:
virtual ~MediaResource() {};
@ -460,6 +462,12 @@ public:
return aMallocSizeOf(this) + SizeOfExcludingThis(aMallocSizeOf);
}
// Returns the url of the resource. Safe to call from any thread?
const nsCString& GetContentURL() const
{
return mContentURL;
}
protected:
BaseMediaResource(MediaDecoder* aDecoder,
nsIChannel* aChannel,
@ -473,6 +481,7 @@ protected:
{
MOZ_COUNT_CTOR(BaseMediaResource);
NS_ASSERTION(!mContentType.IsEmpty(), "Must know content type");
mURI->GetSpec(mContentURL);
}
virtual ~BaseMediaResource()
{
@ -511,6 +520,9 @@ protected:
// is safe.
const nsAutoCString mContentType;
// Copy of the url of the channel resource.
nsAutoCString mContentURL;
// True if SetLoadInBackground() has been called with
// aLoadInBackground = true, i.e. when the document load event is not
// blocked by this resource, and all channel loads will be in the