зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1137250 - Fix incorrect initialization of Request object. r=bz
This commit is contained in:
Родитель
1f905f489d
Коммит
65badaa73f
|
@ -1941,15 +1941,15 @@ struct FakeString {
|
|||
return reinterpret_cast<const nsString*>(this);
|
||||
}
|
||||
|
||||
nsAString* ToAStringPtr() {
|
||||
return reinterpret_cast<nsString*>(this);
|
||||
}
|
||||
|
||||
operator const nsAString& () const {
|
||||
operator const nsAString& () const {
|
||||
return *reinterpret_cast<const nsString*>(this);
|
||||
}
|
||||
|
||||
private:
|
||||
nsAString* ToAStringPtr() {
|
||||
return reinterpret_cast<nsString*>(this);
|
||||
}
|
||||
|
||||
nsString::char_type* mData;
|
||||
nsString::size_type mLength;
|
||||
uint32_t mFlags;
|
||||
|
@ -1965,6 +1965,8 @@ private:
|
|||
mData = const_cast<nsString::char_type*>(aData);
|
||||
}
|
||||
|
||||
friend class NonNull<nsAString>;
|
||||
|
||||
// A class to use for our static asserts to ensure our object layout
|
||||
// matches that of nsString.
|
||||
class StringAsserter;
|
||||
|
|
|
@ -2229,8 +2229,9 @@ private:
|
|||
MOZ_ASSERT(aWorkerPrivate->IsServiceWorker());
|
||||
GlobalObject globalObj(aCx, aWorkerPrivate->GlobalScope()->GetWrapper());
|
||||
|
||||
NS_ConvertUTF8toUTF16 local(mSpec);
|
||||
RequestOrUSVString requestInfo;
|
||||
*requestInfo.SetAsUSVString().ToAStringPtr() = NS_ConvertUTF8toUTF16(mSpec);
|
||||
requestInfo.SetAsUSVString().Rebind(local.Data(), local.Length());
|
||||
|
||||
RootedDictionary<RequestInit> reqInit(aCx);
|
||||
reqInit.mMethod.Construct(mMethod);
|
||||
|
|
Загрузка…
Ссылка в новой задаче