Bug 1010393 - Remove aProtoDoc parameter from nsXULPrototypeScript::Compile. r=bholly

Removed aProtoDoc parameter from nsXULElement.h and nsXULElement.cpp in
content/xul/content/src. Specifically in method nsXULElement::Compile.

Removed aProtoDoc argument from XULDocument.cpp, and nsXULContentSink.cpp
in content/xul/document/src. Specifically when aProtoDoc argument used
in nsXULElement::Compile.
This commit is contained in:
Benny Mei 2014-05-27 16:15:00 +02:00
parent 944f1623f0
commit e28077ad2c
4 changed files with 4 additions and 13 deletions

View File

@ -2716,14 +2716,11 @@ OffThreadScriptReceiverCallback(void *aToken, void *aCallbackData)
nsresult
nsXULPrototypeScript::Compile(JS::SourceBufferHolder& aSrcBuf,
nsIURI* aURI,
uint32_t aLineNo,
nsIURI* aURI, uint32_t aLineNo,
nsIDocument* aDocument,
nsXULPrototypeDocument* aProtoDoc,
nsIOffThreadScriptReceiver *aOffThreadReceiver /* = nullptr */)
{
// We'll compile the script in the compilation scope.
NS_ENSURE_STATE(aProtoDoc);
NS_ENSURE_TRUE(xpc::GetCompilationScope(), NS_ERROR_UNEXPECTED);
AutoSafeJSContext cx;
JSAutoCompartment ac(cx, xpc::GetCompilationScope());
@ -2770,12 +2767,11 @@ nsXULPrototypeScript::Compile(const char16_t* aText,
nsIURI* aURI,
uint32_t aLineNo,
nsIDocument* aDocument,
nsXULPrototypeDocument* aProtoDoc,
nsIOffThreadScriptReceiver *aOffThreadReceiver /* = nullptr */)
{
JS::SourceBufferHolder srcBuf(aText, aTextLength,
JS::SourceBufferHolder::NoOwnership);
return Compile(srcBuf, aURI, aLineNo, aDocument, aProtoDoc, aOffThreadReceiver);
return Compile(srcBuf, aURI, aLineNo, aDocument, aOffThreadReceiver);
}
void

View File

@ -238,13 +238,11 @@ public:
nsresult Compile(JS::SourceBufferHolder& aSrcBuf,
nsIURI* aURI, uint32_t aLineNo,
nsIDocument* aDocument,
nsXULPrototypeDocument* aProtoDoc,
nsIOffThreadScriptReceiver *aOffThreadReceiver = nullptr);
nsresult Compile(const char16_t* aText, int32_t aTextLength,
nsIURI* aURI, uint32_t aLineNo,
nsIDocument* aDocument,
nsXULPrototypeDocument* aProtoDoc,
nsIOffThreadScriptReceiver *aOffThreadReceiver = nullptr);
void UnlinkJSObjects();

View File

@ -3549,10 +3549,7 @@ XULDocument::OnStreamComplete(nsIStreamLoader* aLoader,
mOffThreadCompileStringBuf = nullptr;
mOffThreadCompileStringLength = 0;
rv = mCurrentScriptProto->Compile(srcBuf,
uri, 1, this,
mMasterPrototype,
this);
rv = mCurrentScriptProto->Compile(srcBuf, uri, 1, this, this);
if (NS_SUCCEEDED(rv) && !mCurrentScriptProto->GetScriptObject()) {
// We will be notified via OnOffThreadCompileComplete when the
// compile finishes. Keep the contents of the compiled script

View File

@ -566,7 +566,7 @@ XULContentSinkImpl::HandleEndElement(const char16_t *aName)
script->mOutOfLine = false;
if (doc)
script->Compile(mText, mTextLength, mDocumentURL,
script->mLineNo, doc, mPrototype);
script->mLineNo, doc);
}
FlushText(false);