Bug 1361900: Fix one last merge botch, and fix a false rooting hazard warning.

MozReview-Commit-ID: JpKYYEBpbQj

--HG--
extra : rebase_source : 5bbb462ed3255c631cc1c280359af8c9c2224239
extra : histedit_source : 444c4c02eb1a3ced85cef09f7b7a6e7f5b9235b5%2Cb16ca4316a1aabf5e5c1b8641a0e1818d815da76
This commit is contained in:
Kris Maglione 2017-05-12 18:14:12 -07:00
Родитель 8b0611bd37
Коммит 8d9a00892f
3 изменённых файлов: 9 добавлений и 4 удалений

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

@ -258,7 +258,8 @@ public:
public:
Elem& operator*() { return *this; }
ElemType get() {
ElemType get()
{
if (done_) {
return nullptr;
}

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

@ -433,6 +433,8 @@ ScriptPreloader::InitCacheInternal()
return Err(NS_ERROR_UNEXPECTED);
}
AutoTArray<CachedScript*, 256> scripts;
{
auto cleanup = MakeScopeExit([&] () {
mScripts.Clear();
@ -462,6 +464,7 @@ ScriptPreloader::InitCacheInternal()
script->mXDRRange.emplace(scriptData, scriptData + script->mSize);
scripts.AppendElement(script.get());
mScripts.Put(script->mCachePath, script.get());
Unused << script.release();
}
@ -482,7 +485,7 @@ ScriptPreloader::InitCacheInternal()
JS::CompileOptions options(cx, JSVERSION_LATEST);
for (auto& script : IterHash(mScripts, Match<ScriptStatus::Restored>())) {
for (auto& script : scripts) {
// Only async decode scripts which have been used in this process type.
if (script->mProcessTypes.contains(CurrentProcessType()) &&
script->AsyncDecodable() &&

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

@ -24,6 +24,7 @@
#include "nsIThread.h"
#include "jsapi.h"
#include "js/GCAnnotations.h"
#include <prio.h>
@ -207,7 +208,7 @@ private:
void UpdateLoadTime(const TimeStamp& loadTime)
{
if (!mLoadTime || loadTime < mLoadTime) {
if (mLoadTime.IsNull() || loadTime < mLoadTime) {
mLoadTime = loadTime;
}
}
@ -318,7 +319,7 @@ private:
// XDR data which was generated from a script compiled during this
// session, and will be written to the cache file.
MaybeOneOf<JS::TranscodeBuffer, nsTArray<uint8_t>> mXDRData;
};
} JS_HAZ_NON_GC_POINTER;
template <ScriptStatus status>
static Matcher<CachedScript*>* Match()