зеркало из https://github.com/mozilla/gecko-dev.git
Bug 931249 - Patch 1.1 - Set baseURI when script is obtained from cache. r=khuey
--HG-- extra : rebase_source : f8bd9b047518b3e5e220eddc3eab1f0918b83f6b
This commit is contained in:
Родитель
238374c507
Коммит
e0c3f020d5
|
@ -973,6 +973,7 @@ private:
|
|||
DataReceivedFromCache(uint32_t aIndex, const uint8_t* aString,
|
||||
uint32_t aStringLen)
|
||||
{
|
||||
AssertIsOnMainThread();
|
||||
MOZ_ASSERT(aIndex < mLoadInfos.Length());
|
||||
ScriptLoadInfo& loadInfo = mLoadInfos[aIndex];
|
||||
MOZ_ASSERT(loadInfo.mCacheStatus == ScriptLoadInfo::Cached);
|
||||
|
@ -982,11 +983,18 @@ private:
|
|||
|
||||
MOZ_ASSERT(!loadInfo.mScriptTextBuf);
|
||||
|
||||
DebugOnly<nsresult> rv =
|
||||
nsresult rv =
|
||||
nsScriptLoader::ConvertToUTF16(nullptr, aString, aStringLen,
|
||||
NS_LITERAL_STRING("UTF-8"), parentDoc,
|
||||
loadInfo.mScriptTextBuf,
|
||||
loadInfo.mScriptTextLength);
|
||||
if (NS_SUCCEEDED(rv) && IsMainWorkerScript()) {
|
||||
nsCOMPtr<nsIURI> finalURI;
|
||||
rv = NS_NewURI(getter_AddRefs(finalURI), loadInfo.mFullURL, nullptr, nullptr);
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
mWorkerPrivate->SetBaseURI(finalURI);
|
||||
}
|
||||
}
|
||||
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
DataReceived();
|
||||
|
|
Загрузка…
Ссылка в новой задаче