mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-26 06:11:37 +00:00
// replace nsString::Recycle with nsMemory::Free
java/dom/jni/org_mozilla_dom_events_MouseEventImpl.cpp java/dom/jni/org_mozilla_dom_events_UIEventImpl.cpp java/dom/jni/org_mozilla_dom_events_EventImpl.cpp java/dom/jni/org_mozilla_dom_ProcessingInstructionImpl.cpp java/dom/jni/org_mozilla_dom_NodeImpl.cpp java/dom/jni/org_mozilla_dom_NamedNodeMapImpl.cpp java/dom/jni/org_mozilla_dom_ElementImpl.cpp java/dom/jni/org_mozilla_dom_DOMImplementationImpl.cpp java/dom/jni/org_mozilla_dom_DocumentImpl.cpp java/dom/jni/org_mozilla_dom_CharacterDataImpl.cpp java/dom/jni/org_mozilla_dom_AttrImpl.cpp java/dom/jni/javaDOMEventsGlobals.cpp // On*DocumentLoad() now takes an nsIRequest instead of an nsIChannel. // nsIChannel extends nsIRequest. java/dom/src/nsJavaDOMImpl.cpp java/dom/src/nsJavaDOMImpl.h java/dom/src/nsIJavaDOM.h // nsIChannel instances replaced with nsIRequest. Removed ShowModal(), // ExitModalLoop(), FindNamedBrowserItem(). Parameter changes for // {Set,Get}Persistence(). Add DestroyBrowserWindow(), IsWindowModal(). // supports weak references java/webclient/src_moz/CBrowserContainer.h java/webclient/src_moz/CBrowserContainer.cpp // GetProfileList now returns an array of profile names. Need to use // nsIProfileInternal instead of nsIProfile for StartupWithArgs. java/webclient/src_moz/NativeEventThread.cpp // Remove -lxpfelocation_s java/webclient/src_moz/Makefile.in // Don't include appfilelocprovider_s java/webclient/src_moz/Makefile.win // Don't assert thread safe, cause we are thread safe java/webclient/src_moz/InputStreamShim.cpp
This commit is contained in:
parent
98342357b3
commit
0e44edc9ef
@ -237,7 +237,7 @@ jobject JavaDOMEventsGlobals::CreateEventSubtype(JNIEnv *env,
|
||||
|
||||
clazz = uiEventClass;
|
||||
}
|
||||
nsString::Recycle(&eventType);
|
||||
nsMemory::Free(&eventType);
|
||||
|
||||
event->Release();
|
||||
event = (nsIDOMEvent *) target;
|
||||
|
@ -139,7 +139,7 @@ JNIEXPORT void JNICALL Java_org_mozilla_dom_AttrImpl_setValue
|
||||
return;
|
||||
|
||||
nsresult rv = attr->SetValue(*cstr);
|
||||
nsString::Recycle(cstr);
|
||||
nsMemory::Free(cstr);
|
||||
|
||||
if (NS_FAILED(rv)) {
|
||||
PR_LOG(JavaDOMGlobals::log, PR_LOG_ERROR,
|
||||
|
@ -46,7 +46,7 @@ JNIEXPORT void JNICALL Java_org_mozilla_dom_CharacterDataImpl_appendData
|
||||
return;
|
||||
|
||||
nsresult rv = data->AppendData(*value);
|
||||
nsString::Recycle(value);
|
||||
nsMemory::Free(value);
|
||||
|
||||
if (NS_FAILED(rv)) {
|
||||
JavaDOMGlobals::ExceptionType exceptionType = JavaDOMGlobals::EXCEPTION_RUNTIME;
|
||||
@ -182,7 +182,7 @@ JNIEXPORT void JNICALL Java_org_mozilla_dom_CharacterDataImpl_insertData
|
||||
return;
|
||||
|
||||
nsresult rv = data->InsertData((PRUint32) offset, *value);
|
||||
nsString::Recycle(value);
|
||||
nsMemory::Free(value);
|
||||
|
||||
if (NS_FAILED(rv)) {
|
||||
JavaDOMGlobals::ExceptionType exceptionType = JavaDOMGlobals::EXCEPTION_RUNTIME;
|
||||
@ -226,7 +226,7 @@ JNIEXPORT void JNICALL Java_org_mozilla_dom_CharacterDataImpl_replaceData
|
||||
return;
|
||||
|
||||
nsresult rv = data->ReplaceData((PRUint32) offset, (PRUint32) count, *value);
|
||||
nsString::Recycle(value);
|
||||
nsMemory::Free(value);
|
||||
|
||||
if (NS_FAILED(rv)) {
|
||||
JavaDOMGlobals::ExceptionType exceptionType = JavaDOMGlobals::EXCEPTION_RUNTIME;
|
||||
@ -262,7 +262,7 @@ JNIEXPORT void JNICALL Java_org_mozilla_dom_CharacterDataImpl_setData
|
||||
return;
|
||||
|
||||
nsresult rv = data->SetData(*value);
|
||||
nsString::Recycle(value);
|
||||
nsMemory::Free(value);
|
||||
|
||||
if (NS_FAILED(rv)) {
|
||||
JavaDOMGlobals::ExceptionType exceptionType = JavaDOMGlobals::EXCEPTION_RUNTIME;
|
||||
|
@ -157,7 +157,7 @@ JNIEXPORT jboolean JNICALL Java_org_mozilla_dom_DOMImplementationImpl_hasFeature
|
||||
if (jversion) {
|
||||
version = JavaDOMGlobals::GetUnicode(env, jversion);
|
||||
if (!version) {
|
||||
nsString::Recycle(feature);
|
||||
nsMemory::Free(feature);
|
||||
return JNI_FALSE;
|
||||
}
|
||||
} else {
|
||||
@ -166,8 +166,8 @@ JNIEXPORT jboolean JNICALL Java_org_mozilla_dom_DOMImplementationImpl_hasFeature
|
||||
|
||||
PRBool ret = PR_FALSE;
|
||||
nsresult rv = dom->HasFeature(*feature, *version, &ret);
|
||||
nsString::Recycle(feature);
|
||||
nsString::Recycle(version);
|
||||
nsMemory::Free(feature);
|
||||
nsMemory::Free(version);
|
||||
|
||||
if (NS_FAILED(rv)) {
|
||||
PR_LOG(JavaDOMGlobals::log, PR_LOG_ERROR,
|
||||
@ -199,22 +199,22 @@ JNIEXPORT jobject JNICALL Java_org_mozilla_dom_DOMImplementationImpl_createDocum
|
||||
|
||||
nsString* publicID = JavaDOMGlobals::GetUnicode(env, jpublicID);
|
||||
if (!publicID) {
|
||||
nsString::Recycle(qualifiedName);
|
||||
nsMemory::Free(qualifiedName);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
nsString* systemID = JavaDOMGlobals::GetUnicode(env, jsystemID);
|
||||
if (!systemID) {
|
||||
nsString::Recycle(qualifiedName);
|
||||
nsString::Recycle(publicID);
|
||||
nsMemory::Free(qualifiedName);
|
||||
nsMemory::Free(publicID);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
nsIDOMDocumentType* docType = nsnull;
|
||||
nsresult rv = dom->CreateDocumentType(*qualifiedName, *publicID, *systemID, &docType);
|
||||
nsString::Recycle(qualifiedName);
|
||||
nsString::Recycle(publicID);
|
||||
nsString::Recycle(systemID);
|
||||
nsMemory::Free(qualifiedName);
|
||||
nsMemory::Free(publicID);
|
||||
nsMemory::Free(systemID);
|
||||
|
||||
if (NS_FAILED(rv)) {
|
||||
JavaDOMGlobals::ExceptionType exceptionType = JavaDOMGlobals::EXCEPTION_RUNTIME;
|
||||
@ -253,7 +253,7 @@ JNIEXPORT jobject JNICALL Java_org_mozilla_dom_DOMImplementationImpl_createDocum
|
||||
|
||||
nsString* qualifiedName = JavaDOMGlobals::GetUnicode(env, jqualifiedName);
|
||||
if (!qualifiedName) {
|
||||
nsString::Recycle(namespaceURI);
|
||||
nsMemory::Free(namespaceURI);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@ -270,8 +270,8 @@ JNIEXPORT jobject JNICALL Java_org_mozilla_dom_DOMImplementationImpl_createDocum
|
||||
|
||||
nsIDOMDocument* doc = nsnull;
|
||||
nsresult rv = dom->CreateDocument(*namespaceURI, *qualifiedName, docType, &doc);
|
||||
nsString::Recycle(namespaceURI);
|
||||
nsString::Recycle(qualifiedName);
|
||||
nsMemory::Free(namespaceURI);
|
||||
nsMemory::Free(qualifiedName);
|
||||
|
||||
if (NS_FAILED(rv)) {
|
||||
JavaDOMGlobals::ExceptionType exceptionType = JavaDOMGlobals::EXCEPTION_RUNTIME;
|
||||
|
@ -66,7 +66,7 @@ JNIEXPORT jobject JNICALL Java_org_mozilla_dom_DocumentImpl_createAttribute
|
||||
return NULL;
|
||||
|
||||
nsresult rv = doc->CreateAttribute(*name, &ret);
|
||||
nsString::Recycle(name);
|
||||
nsMemory::Free(name);
|
||||
|
||||
if (NS_FAILED(rv)) {
|
||||
JavaDOMGlobals::ExceptionType exceptionType = JavaDOMGlobals::EXCEPTION_RUNTIME;
|
||||
@ -119,7 +119,7 @@ JNIEXPORT jobject JNICALL Java_org_mozilla_dom_DocumentImpl_createCDATASection
|
||||
return NULL;
|
||||
|
||||
nsresult rv = doc->CreateCDATASection(*data, &ret);
|
||||
nsString::Recycle(data);
|
||||
nsMemory::Free(data);
|
||||
|
||||
if (NS_FAILED(rv)) {
|
||||
JavaDOMGlobals::ExceptionType exceptionType = JavaDOMGlobals::EXCEPTION_RUNTIME;
|
||||
@ -171,7 +171,7 @@ JNIEXPORT jobject JNICALL Java_org_mozilla_dom_DocumentImpl_createComment
|
||||
return NULL;
|
||||
|
||||
nsresult rv = doc->CreateComment(*data, &ret);
|
||||
nsString::Recycle(data);
|
||||
nsMemory::Free(data);
|
||||
|
||||
if (NS_FAILED(rv)) {
|
||||
JavaDOMGlobals::ThrowException(env,
|
||||
@ -260,7 +260,7 @@ JNIEXPORT jobject JNICALL Java_org_mozilla_dom_DocumentImpl_createElement
|
||||
if (!tagName)
|
||||
return NULL;
|
||||
nsresult rv = doc->CreateElement(*tagName, &ret);
|
||||
nsString::Recycle(tagName);
|
||||
nsMemory::Free(tagName);
|
||||
|
||||
if (NS_FAILED(rv)) {
|
||||
JavaDOMGlobals::ExceptionType exceptionType = JavaDOMGlobals::EXCEPTION_RUNTIME;
|
||||
@ -313,7 +313,7 @@ JNIEXPORT jobject JNICALL Java_org_mozilla_dom_DocumentImpl_createEntityReferenc
|
||||
return NULL;
|
||||
|
||||
nsresult rv = doc->CreateEntityReference(*name, &ret);
|
||||
nsString::Recycle(name);
|
||||
nsMemory::Free(name);
|
||||
|
||||
if (NS_FAILED(rv)) {
|
||||
JavaDOMGlobals::ExceptionType exceptionType = JavaDOMGlobals::EXCEPTION_RUNTIME;
|
||||
@ -369,13 +369,13 @@ JNIEXPORT jobject JNICALL Java_org_mozilla_dom_DocumentImpl_createProcessingInst
|
||||
|
||||
nsString* data = JavaDOMGlobals::GetUnicode(env, jdata);
|
||||
if (!data) {
|
||||
nsString::Recycle(target);
|
||||
nsMemory::Free(target);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
nsresult rv = doc->CreateProcessingInstruction(*target, *data, &ret);
|
||||
nsString::Recycle(target);
|
||||
nsString::Recycle(data);
|
||||
nsMemory::Free(target);
|
||||
nsMemory::Free(data);
|
||||
|
||||
if (NS_FAILED(rv)) {
|
||||
JavaDOMGlobals::ExceptionType exceptionType = JavaDOMGlobals::EXCEPTION_RUNTIME;
|
||||
@ -429,7 +429,7 @@ JNIEXPORT jobject JNICALL Java_org_mozilla_dom_DocumentImpl_createTextNode
|
||||
return NULL;
|
||||
|
||||
nsresult rv = doc->CreateTextNode(*data, &ret);
|
||||
nsString::Recycle(data);
|
||||
nsMemory::Free(data);
|
||||
|
||||
if (NS_FAILED(rv)) {
|
||||
JavaDOMGlobals::ThrowException(env,
|
||||
@ -560,7 +560,7 @@ JNIEXPORT jobject JNICALL Java_org_mozilla_dom_DocumentImpl_getElementsByTagName
|
||||
return NULL;
|
||||
|
||||
nsresult rv = doc->GetElementsByTagName(*tagName, &elements);
|
||||
nsString::Recycle(tagName);
|
||||
nsMemory::Free(tagName);
|
||||
|
||||
if (NS_FAILED(rv) || !elements) {
|
||||
JavaDOMGlobals::ThrowException(env,
|
||||
@ -658,7 +658,7 @@ JNIEXPORT jobject JNICALL Java_org_mozilla_dom_DocumentImpl_createEvent
|
||||
|
||||
nsIDOMEvent* event = nsnull;
|
||||
nsresult rv = docEvent->CreateEvent(*type, &event);
|
||||
nsString::Recycle(type);
|
||||
nsMemory::Free(type);
|
||||
|
||||
if (NS_FAILED(rv) || !event) {
|
||||
JavaDOMGlobals::ThrowException(env,
|
||||
@ -691,15 +691,15 @@ JNIEXPORT jobject JNICALL Java_org_mozilla_dom_DocumentImpl_getElementsByTagName
|
||||
|
||||
nsString* localName = JavaDOMGlobals::GetUnicode(env, jlocalName);
|
||||
if (!localName) {
|
||||
nsString::Recycle(namespaceURI);
|
||||
nsMemory::Free(namespaceURI);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
nsIDOMNodeList* elements = nsnull;
|
||||
|
||||
nsresult rv = doc->GetElementsByTagNameNS(*namespaceURI, *localName, &elements);
|
||||
nsString::Recycle(namespaceURI);
|
||||
nsString::Recycle(localName);
|
||||
nsMemory::Free(namespaceURI);
|
||||
nsMemory::Free(localName);
|
||||
|
||||
if (NS_FAILED(rv) || !elements) {
|
||||
JavaDOMGlobals::ThrowException(env,
|
||||
@ -747,7 +747,7 @@ JNIEXPORT jobject JNICALL Java_org_mozilla_dom_DocumentImpl_getElementById
|
||||
|
||||
nsIDOMElement* element = nsnull;
|
||||
nsresult rv = doc->GetElementById(*elementId, &element);
|
||||
nsString::Recycle(elementId);
|
||||
nsMemory::Free(elementId);
|
||||
|
||||
if (NS_FAILED(rv) || !element) {
|
||||
JavaDOMGlobals::ThrowException(env,
|
||||
|
@ -50,7 +50,7 @@ JNIEXPORT jstring JNICALL Java_org_mozilla_dom_ElementImpl_getAttribute
|
||||
|
||||
nsString attr;
|
||||
nsresult rv = element->GetAttribute(*cname, attr);
|
||||
nsString::Recycle(cname);
|
||||
nsMemory::Free(cname);
|
||||
|
||||
if (NS_FAILED(rv)) {
|
||||
JavaDOMGlobals::ThrowException(env,
|
||||
@ -90,7 +90,7 @@ JNIEXPORT jobject JNICALL Java_org_mozilla_dom_ElementImpl_getAttributeNode
|
||||
|
||||
nsIDOMAttr* attr = nsnull;
|
||||
nsresult rv = element->GetAttributeNode(*cname, &attr);
|
||||
nsString::Recycle(cname);
|
||||
nsMemory::Free(cname);
|
||||
|
||||
if (NS_FAILED(rv)) {
|
||||
JavaDOMGlobals::ThrowException(env,
|
||||
@ -140,7 +140,7 @@ JNIEXPORT jobject JNICALL Java_org_mozilla_dom_ElementImpl_getElementsByTagName
|
||||
|
||||
nsIDOMNodeList* nodes = nsnull;
|
||||
nsresult rv = element->GetElementsByTagName(*cname, &nodes);
|
||||
nsString::Recycle(cname);
|
||||
nsMemory::Free(cname);
|
||||
|
||||
if (NS_FAILED(rv) || !nodes) {
|
||||
JavaDOMGlobals::ThrowException(env,
|
||||
@ -245,7 +245,7 @@ JNIEXPORT void JNICALL Java_org_mozilla_dom_ElementImpl_removeAttribute
|
||||
return;
|
||||
|
||||
nsresult rv = element->RemoveAttribute(*name);
|
||||
nsString::Recycle(name);
|
||||
nsMemory::Free(name);
|
||||
|
||||
if (NS_FAILED(rv)) {
|
||||
JavaDOMGlobals::ExceptionType exceptionType = JavaDOMGlobals::EXCEPTION_RUNTIME;
|
||||
@ -336,13 +336,13 @@ JNIEXPORT void JNICALL Java_org_mozilla_dom_ElementImpl_setAttribute
|
||||
|
||||
nsString* value = JavaDOMGlobals::GetUnicode(env, jvalue);
|
||||
if (!value) {
|
||||
nsString::Recycle(name);
|
||||
nsMemory::Free(name);
|
||||
return;
|
||||
}
|
||||
|
||||
nsresult rv = element->SetAttribute(*name, *value);
|
||||
nsString::Recycle(value);
|
||||
nsString::Recycle(name);
|
||||
nsMemory::Free(value);
|
||||
nsMemory::Free(name);
|
||||
|
||||
if (NS_FAILED(rv)) {
|
||||
JavaDOMGlobals::ExceptionType exceptionType = JavaDOMGlobals::EXCEPTION_RUNTIME;
|
||||
@ -438,14 +438,14 @@ JNIEXPORT jstring JNICALL Java_org_mozilla_dom_ElementImpl_getAttributeNS
|
||||
|
||||
nsString* localName = JavaDOMGlobals::GetUnicode(env, jlocalName);
|
||||
if (!localName) {
|
||||
nsString::Recycle(namespaceURI);
|
||||
nsMemory::Free(namespaceURI);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
nsString ret;
|
||||
nsresult rv = element->GetAttributeNS(*namespaceURI, *localName, ret);
|
||||
nsString::Recycle(namespaceURI);
|
||||
nsString::Recycle(localName);
|
||||
nsMemory::Free(namespaceURI);
|
||||
nsMemory::Free(localName);
|
||||
|
||||
if (NS_FAILED(rv)) {
|
||||
JavaDOMGlobals::ThrowException(env,
|
||||
@ -484,21 +484,21 @@ JNIEXPORT void JNICALL Java_org_mozilla_dom_ElementImpl_setAttributeNS
|
||||
|
||||
nsString* qualifiedName = JavaDOMGlobals::GetUnicode(env, jqualifiedName);
|
||||
if (!qualifiedName) {
|
||||
nsString::Recycle(namespaceURI);
|
||||
nsMemory::Free(namespaceURI);
|
||||
return;
|
||||
}
|
||||
|
||||
nsString* value = JavaDOMGlobals::GetUnicode(env, jvalue);
|
||||
if (!value) {
|
||||
nsString::Recycle(namespaceURI);
|
||||
nsString::Recycle(qualifiedName);
|
||||
nsMemory::Free(namespaceURI);
|
||||
nsMemory::Free(qualifiedName);
|
||||
return;
|
||||
}
|
||||
|
||||
nsresult rv = element->SetAttributeNS(*namespaceURI, *qualifiedName, *value);
|
||||
nsString::Recycle(namespaceURI);
|
||||
nsString::Recycle(qualifiedName);
|
||||
nsString::Recycle(value);
|
||||
nsMemory::Free(namespaceURI);
|
||||
nsMemory::Free(qualifiedName);
|
||||
nsMemory::Free(value);
|
||||
|
||||
if (NS_FAILED(rv)) {
|
||||
JavaDOMGlobals::ExceptionType exceptionType = JavaDOMGlobals::EXCEPTION_RUNTIME;
|
||||
@ -535,13 +535,13 @@ JNIEXPORT void JNICALL Java_org_mozilla_dom_ElementImpl_removeAttributeNS
|
||||
|
||||
nsString* localName = JavaDOMGlobals::GetUnicode(env, jlocalName);
|
||||
if (!localName) {
|
||||
nsString::Recycle(namespaceURI);
|
||||
nsMemory::Free(namespaceURI);
|
||||
return;
|
||||
}
|
||||
|
||||
nsresult rv = element->RemoveAttributeNS(*namespaceURI, *localName);
|
||||
nsString::Recycle(namespaceURI);
|
||||
nsString::Recycle(localName);
|
||||
nsMemory::Free(namespaceURI);
|
||||
nsMemory::Free(localName);
|
||||
|
||||
if (NS_FAILED(rv)) {
|
||||
JavaDOMGlobals::ExceptionType exceptionType = JavaDOMGlobals::EXCEPTION_RUNTIME;
|
||||
@ -575,14 +575,14 @@ JNIEXPORT jobject JNICALL Java_org_mozilla_dom_ElementImpl_getAttributeNodeNS
|
||||
|
||||
nsString* localName = JavaDOMGlobals::GetUnicode(env, jlocalName);
|
||||
if (!localName) {
|
||||
nsString::Recycle(namespaceURI);
|
||||
nsMemory::Free(namespaceURI);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
nsIDOMAttr* attr = nsnull;
|
||||
nsresult rv = element->GetAttributeNodeNS(*namespaceURI, *localName, &attr);
|
||||
nsString::Recycle(namespaceURI);
|
||||
nsString::Recycle(localName);
|
||||
nsMemory::Free(namespaceURI);
|
||||
nsMemory::Free(localName);
|
||||
|
||||
if (NS_FAILED(rv)) {
|
||||
JavaDOMGlobals::ThrowException(env,
|
||||
@ -662,14 +662,14 @@ JNIEXPORT jobject JNICALL Java_org_mozilla_dom_ElementImpl_getElementsByTagNameN
|
||||
|
||||
nsString* localName = JavaDOMGlobals::GetUnicode(env, jlocalName);
|
||||
if (!localName) {
|
||||
nsString::Recycle(namespaceURI);
|
||||
nsMemory::Free(namespaceURI);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
nsIDOMNodeList* nodes = nsnull;
|
||||
nsresult rv = element->GetElementsByTagNameNS(*namespaceURI, *localName, &nodes);
|
||||
nsString::Recycle(namespaceURI);
|
||||
nsString::Recycle(localName);
|
||||
nsMemory::Free(namespaceURI);
|
||||
nsMemory::Free(localName);
|
||||
|
||||
if (NS_FAILED(rv) || !nodes) {
|
||||
JavaDOMGlobals::ThrowException(env,
|
||||
@ -717,7 +717,7 @@ JNIEXPORT jboolean JNICALL Java_org_mozilla_dom_ElementImpl_hasAttribute
|
||||
|
||||
PRBool hasAttr = PR_FALSE;
|
||||
nsresult rv = element->HasAttribute(*name, &hasAttr);
|
||||
nsString::Recycle(name);
|
||||
nsMemory::Free(name);
|
||||
|
||||
if (NS_FAILED(rv)) {
|
||||
JavaDOMGlobals::ThrowException(env,
|
||||
@ -751,14 +751,14 @@ JNIEXPORT jboolean JNICALL Java_org_mozilla_dom_ElementImpl_hasAttributeNS
|
||||
|
||||
nsString* localName = JavaDOMGlobals::GetUnicode(env, jlocalName);
|
||||
if (!localName) {
|
||||
nsString::Recycle(namespaceURI);
|
||||
nsMemory::Free(namespaceURI);
|
||||
return JNI_FALSE;
|
||||
}
|
||||
|
||||
PRBool hasAttr = PR_FALSE;
|
||||
nsresult rv = element->HasAttributeNS(*namespaceURI, *localName, &hasAttr);
|
||||
nsString::Recycle(namespaceURI);
|
||||
nsString::Recycle(localName);
|
||||
nsMemory::Free(namespaceURI);
|
||||
nsMemory::Free(localName);
|
||||
|
||||
if (NS_FAILED(rv)) {
|
||||
JavaDOMGlobals::ThrowException(env,
|
||||
|
@ -76,7 +76,7 @@ JNIEXPORT jobject JNICALL Java_org_mozilla_dom_NamedNodeMapImpl_getNamedItem
|
||||
return NULL;
|
||||
|
||||
nsresult rv = map->GetNamedItem(*name, &node);
|
||||
nsString::Recycle(name);
|
||||
nsMemory::Free(name);
|
||||
|
||||
if (NS_FAILED(rv)) {
|
||||
JavaDOMGlobals::ThrowException(env,
|
||||
@ -146,7 +146,7 @@ JNIEXPORT jobject JNICALL Java_org_mozilla_dom_NamedNodeMapImpl_removeNamedItem
|
||||
return NULL;
|
||||
|
||||
nsresult rv = map->RemoveNamedItem(*name, &node);
|
||||
nsString::Recycle(name);
|
||||
nsMemory::Free(name);
|
||||
|
||||
if (NS_FAILED(rv) || !node) {
|
||||
JavaDOMGlobals::ExceptionType exceptionType = JavaDOMGlobals::EXCEPTION_RUNTIME;
|
||||
|
@ -827,7 +827,7 @@ JNIEXPORT void JNICALL Java_org_mozilla_dom_NodeImpl_setNodeValue
|
||||
return;
|
||||
|
||||
nsresult rv = node->SetNodeValue(*value);
|
||||
nsString::Recycle(value);
|
||||
nsMemory::Free(value);
|
||||
|
||||
if (NS_FAILED(rv)) {
|
||||
JavaDOMGlobals::ExceptionType exceptionType = JavaDOMGlobals::EXCEPTION_RUNTIME;
|
||||
@ -876,7 +876,7 @@ JNIEXPORT jlong JNICALL Java_org_mozilla_dom_NodeImpl_addNativeEventListener
|
||||
|
||||
nsresult rv = target->AddEventListener(*type, listener, useCapture);
|
||||
target->Release();
|
||||
nsString::Recycle(type);
|
||||
nsMemory::Free(type);
|
||||
|
||||
if (NS_FAILED(rv)) {
|
||||
JavaDOMGlobals::ThrowException(env,
|
||||
@ -923,7 +923,7 @@ JNIEXPORT void JNICALL Java_org_mozilla_dom_NodeImpl_removeNativeEventListener
|
||||
nsresult rv = target->RemoveEventListener(*type,
|
||||
(nsIDOMEventListener*) jlistener, useCapture);
|
||||
target->Release();
|
||||
nsString::Recycle(type);
|
||||
nsMemory::Free(type);
|
||||
|
||||
if (NS_FAILED(rv)) {
|
||||
JavaDOMGlobals::ThrowException(env,
|
||||
@ -956,7 +956,7 @@ JNIEXPORT jboolean JNICALL Java_org_mozilla_dom_NodeImpl_supports
|
||||
if (jversion) {
|
||||
version = JavaDOMGlobals::GetUnicode(env, jversion);
|
||||
if (!version) {
|
||||
nsString::Recycle(feature);
|
||||
nsMemory::Free(feature);
|
||||
return JNI_FALSE;
|
||||
}
|
||||
} else {
|
||||
@ -965,8 +965,8 @@ JNIEXPORT jboolean JNICALL Java_org_mozilla_dom_NodeImpl_supports
|
||||
|
||||
PRBool ret = PR_FALSE;
|
||||
nsresult rv = node->IsSupported(*feature, *version, &ret);
|
||||
nsString::Recycle(feature);
|
||||
nsString::Recycle(version);
|
||||
nsMemory::Free(feature);
|
||||
nsMemory::Free(version);
|
||||
|
||||
if (NS_FAILED(rv)) {
|
||||
PR_LOG(JavaDOMGlobals::log, PR_LOG_ERROR,
|
||||
@ -1065,7 +1065,7 @@ JNIEXPORT void JNICALL Java_org_mozilla_dom_NodeImpl_setPrefix
|
||||
return;
|
||||
|
||||
nsresult rv = node->SetPrefix(*prefix);
|
||||
nsString::Recycle(prefix);
|
||||
nsMemory::Free(prefix);
|
||||
|
||||
if (NS_FAILED(rv)) {
|
||||
JavaDOMGlobals::ExceptionType exceptionType = JavaDOMGlobals::EXCEPTION_RUNTIME;
|
||||
|
@ -115,7 +115,7 @@ JNIEXPORT void JNICALL Java_org_mozilla_dom_ProcessingInstructionImpl_setData
|
||||
return;
|
||||
|
||||
nsresult rv = pi->SetData(*data);
|
||||
nsString::Recycle(data);
|
||||
nsMemory::Free(data);
|
||||
|
||||
if (NS_FAILED(rv)) {
|
||||
JavaDOMGlobals::ExceptionType exceptionType = JavaDOMGlobals::EXCEPTION_RUNTIME;
|
||||
|
@ -324,7 +324,7 @@ JNIEXPORT void JNICALL Java_org_mozilla_dom_events_EventImpl_initEvent
|
||||
PRBool cancelable = jcancelableArg == JNI_TRUE ? PR_TRUE : PR_FALSE;
|
||||
|
||||
nsresult rv = event->InitEvent(*cvalue, canBubble, cancelable);
|
||||
nsString::Recycle(cvalue);
|
||||
nsMemory::Free(cvalue);
|
||||
|
||||
if (NS_FAILED(rv)) {
|
||||
PR_LOG(JavaDOMGlobals::log, PR_LOG_ERROR,
|
||||
|
@ -362,7 +362,7 @@ JNIEXPORT void JNICALL Java_org_mozilla_dom_events_MouseEventImpl_initMouseEvent
|
||||
(PRUint16)jbuttonArg,
|
||||
(PRUint16)jdetailArg);
|
||||
|
||||
nsString::Recycle(cvalue);
|
||||
nsMemory::Free(cvalue);
|
||||
|
||||
if (NS_FAILED(rv)) {
|
||||
JavaDOMGlobals::ThrowException(env,
|
||||
|
@ -112,7 +112,7 @@ JNIEXPORT void JNICALL Java_org_mozilla_dom_events_UIEventImpl_initUIEvent
|
||||
// REMIND: need to deal with AbstractView
|
||||
// NS_IMETHOD InitUIEvent(const nsString& aTypeArg, PRBool aCanBubbleArg, PRBool aCancelableArg, nsIDOMAbstractView* aViewArg, PRInt32 aDetailArg)=0;
|
||||
nsresult rv = event->InitUIEvent(*cvalue, canBubble, cancelable, NULL, (PRUint32)jdetailArg);
|
||||
nsString::Recycle(cvalue);
|
||||
nsMemory::Free(cvalue);
|
||||
|
||||
if (NS_FAILED(rv)) {
|
||||
JavaDOMGlobals::ThrowException(env,
|
||||
|
@ -48,23 +48,23 @@ class nsIJavaDOM : public nsIDocumentLoaderObserver {
|
||||
const char* aCommand) = 0;
|
||||
|
||||
NS_IMETHOD OnEndDocumentLoad(nsIDocumentLoader* loader,
|
||||
nsIChannel* channel,
|
||||
nsIRequest* request,
|
||||
nsresult aStatus) = 0;
|
||||
|
||||
NS_IMETHOD OnStartURLLoad(nsIDocumentLoader* loader,
|
||||
nsIChannel* channel) = 0;
|
||||
nsIRequest* request) = 0;
|
||||
|
||||
NS_IMETHOD OnProgressURLLoad(nsIDocumentLoader* loader,
|
||||
nsIChannel* channel,
|
||||
nsIRequest* request,
|
||||
PRUint32 aProgress,
|
||||
PRUint32 aProgressMax) = 0;
|
||||
|
||||
NS_IMETHOD OnStatusURLLoad(nsIDocumentLoader* loader,
|
||||
nsIChannel* channel,
|
||||
nsIRequest* request,
|
||||
nsString& aMsg) = 0;
|
||||
|
||||
NS_IMETHOD OnEndURLLoad(nsIDocumentLoader* loader,
|
||||
nsIChannel* channel,
|
||||
nsIRequest* request,
|
||||
nsresult aStatus) = 0;
|
||||
|
||||
NS_IMETHOD HandleUnknownContentType(nsIDocumentLoader* loader,
|
||||
|
@ -274,7 +274,7 @@ NS_IMETHODIMP nsJavaDOMImpl::OnStartDocumentLoad(nsIDocumentLoader* loader,
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsJavaDOMImpl::OnEndDocumentLoad(nsIDocumentLoader* loader,
|
||||
nsIChannel* channel,
|
||||
nsIRequest* request,
|
||||
nsresult aStatus)
|
||||
{
|
||||
JNIEnv* env = NULL;
|
||||
@ -282,6 +282,7 @@ NS_IMETHODIMP nsJavaDOMImpl::OnEndDocumentLoad(nsIDocumentLoader* loader,
|
||||
|
||||
char* urlSpec = (char*) "";
|
||||
nsIURI* url = nsnull;
|
||||
nsCOMPtr<nsIChannel> channel = do_QueryInterface(request);
|
||||
if (channel && NS_SUCCEEDED(channel->GetURI(&url)))
|
||||
url->GetSpec(&urlSpec);
|
||||
jstring jURL = env->NewStringUTF(urlSpec);
|
||||
@ -298,13 +299,14 @@ NS_IMETHODIMP nsJavaDOMImpl::OnEndDocumentLoad(nsIDocumentLoader* loader,
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsJavaDOMImpl::OnStartURLLoad(nsIDocumentLoader* loader,
|
||||
nsIChannel* channel)
|
||||
nsIRequest* request)
|
||||
{
|
||||
JNIEnv* env = NULL;
|
||||
if (Init(&env) == PR_FALSE) return NS_ERROR_FAILURE;
|
||||
|
||||
char* urlSpec = (char*) "";
|
||||
nsIURI* url = nsnull;
|
||||
nsCOMPtr<nsIChannel> channel = do_QueryInterface(request);
|
||||
if (channel && NS_SUCCEEDED(channel->GetURI(&url)))
|
||||
url->GetSpec(&urlSpec);
|
||||
jstring jURL = env->NewStringUTF(urlSpec);
|
||||
@ -329,7 +331,7 @@ NS_IMETHODIMP nsJavaDOMImpl::OnStartURLLoad(nsIDocumentLoader* loader,
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsJavaDOMImpl::OnProgressURLLoad(nsIDocumentLoader* loader,
|
||||
nsIChannel* channel,
|
||||
nsIRequest* request,
|
||||
PRUint32 aProgress,
|
||||
PRUint32 aProgressMax)
|
||||
{
|
||||
@ -338,6 +340,7 @@ NS_IMETHODIMP nsJavaDOMImpl::OnProgressURLLoad(nsIDocumentLoader* loader,
|
||||
|
||||
char* urlSpec = (char*) "";
|
||||
nsIURI* url = nsnull;
|
||||
nsCOMPtr<nsIChannel> channel = do_QueryInterface(request);
|
||||
if (channel && NS_SUCCEEDED(channel->GetURI(&url)))
|
||||
url->GetSpec(&urlSpec);
|
||||
jstring jURL = env->NewStringUTF(urlSpec);
|
||||
@ -355,7 +358,7 @@ NS_IMETHODIMP nsJavaDOMImpl::OnProgressURLLoad(nsIDocumentLoader* loader,
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsJavaDOMImpl::OnStatusURLLoad(nsIDocumentLoader* loader,
|
||||
nsIChannel* channel,
|
||||
nsIRequest* request,
|
||||
nsString& aMsg)
|
||||
{
|
||||
JNIEnv* env = NULL;
|
||||
@ -363,6 +366,7 @@ NS_IMETHODIMP nsJavaDOMImpl::OnStatusURLLoad(nsIDocumentLoader* loader,
|
||||
|
||||
char* urlSpec = (char*) "";
|
||||
nsIURI* url = nsnull;
|
||||
nsCOMPtr<nsIChannel> channel = do_QueryInterface(request);
|
||||
if (channel && NS_SUCCEEDED(channel->GetURI(&url)))
|
||||
url->GetSpec(&urlSpec);
|
||||
jstring jURL = env->NewStringUTF(urlSpec);
|
||||
@ -383,7 +387,7 @@ NS_IMETHODIMP nsJavaDOMImpl::OnStatusURLLoad(nsIDocumentLoader* loader,
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsJavaDOMImpl::OnEndURLLoad(nsIDocumentLoader* loader,
|
||||
nsIChannel* channel,
|
||||
nsIRequest* request,
|
||||
nsresult aStatus)
|
||||
{
|
||||
JNIEnv* env = NULL;
|
||||
@ -391,6 +395,7 @@ NS_IMETHODIMP nsJavaDOMImpl::OnEndURLLoad(nsIDocumentLoader* loader,
|
||||
|
||||
char* urlSpec = (char*) "";
|
||||
nsIURI* url = nsnull;
|
||||
nsCOMPtr<nsIChannel> channel = do_QueryInterface(request);
|
||||
if (channel && NS_SUCCEEDED(channel->GetURI(&url)))
|
||||
url->GetSpec(&urlSpec);
|
||||
jstring jURL = env->NewStringUTF(urlSpec);
|
||||
|
@ -25,23 +25,23 @@ class nsJavaDOMImpl : public nsIJavaDOM {
|
||||
const char* aCommand);
|
||||
|
||||
NS_IMETHOD OnEndDocumentLoad(nsIDocumentLoader* loader,
|
||||
nsIChannel* channel,
|
||||
nsIRequest* request,
|
||||
nsresult aStatus);
|
||||
|
||||
NS_IMETHOD OnStartURLLoad(nsIDocumentLoader* loader,
|
||||
nsIChannel* channel);
|
||||
nsIRequest* channel);
|
||||
|
||||
NS_IMETHOD OnProgressURLLoad(nsIDocumentLoader* loader,
|
||||
nsIChannel* channel,
|
||||
nsIRequest* request,
|
||||
PRUint32 aProgress,
|
||||
PRUint32 aProgressMax);
|
||||
|
||||
NS_IMETHOD OnStatusURLLoad(nsIDocumentLoader* loader,
|
||||
nsIChannel* channel,
|
||||
nsIRequest* request,
|
||||
nsString& aMsg);
|
||||
|
||||
NS_IMETHOD OnEndURLLoad(nsIDocumentLoader* loader,
|
||||
nsIChannel* channel,
|
||||
nsIRequest* request,
|
||||
nsresult aStatus);
|
||||
|
||||
NS_IMETHOD HandleUnknownContentType(nsIDocumentLoader* loader,
|
||||
|
@ -431,7 +431,7 @@ NS_IMETHODIMP CBrowserContainer::GetProtocolHandler(nsIURI *aURI, nsIProtocolHan
|
||||
|
||||
|
||||
/* void doContent (in string aContentType, in nsURILoadCommand aCommand, in string aWindowTarget, in nsIChannel aOpenedChannel, out nsIStreamListener aContentHandler, out boolean aAbortProcess); */
|
||||
NS_IMETHODIMP CBrowserContainer::DoContent(const char *aContentType, nsURILoadCommand aCommand, const char *aWindowTarget, nsIChannel *aOpenedChannel, nsIStreamListener **aContentHandler, PRBool *aAbortProcess)
|
||||
NS_IMETHODIMP CBrowserContainer::DoContent(const char *aContentType, nsURILoadCommand aCommand, const char *aWindowTarget, nsIRequest *request, nsIStreamListener **aContentHandler, PRBool *aAbortProcess)
|
||||
{
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
@ -480,6 +480,24 @@ NS_IMETHODIMP CBrowserContainer::SetParentContentListener(nsIURIContentListener
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// nsIDocShellTreeOwner
|
||||
|
||||
NS_IMETHODIMP
|
||||
CBrowserContainer::SetPersistence(PRBool aPersistPosition,
|
||||
PRBool aPersistSize, PRBool aPersistSizeMode)
|
||||
{
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
CBrowserContainer::GetPersistence(PRBool *aPersistPosition,
|
||||
PRBool *aPersistSize,
|
||||
PRBool *aPersistSizeMode)
|
||||
{
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
NS_IMETHODIMP
|
||||
CBrowserContainer::FindItemWithName(const PRUnichar* aName,
|
||||
@ -516,22 +534,6 @@ CBrowserContainer::SizeShellTo(nsIDocShellTreeItem* aShell,
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
NS_IMETHODIMP
|
||||
CBrowserContainer::ShowModal()
|
||||
{
|
||||
// Ignore request to be shown modally
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
CBrowserContainer::ExitModalLoop(nsresult aStatus)
|
||||
{
|
||||
// Ignore request to be shown modally
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
NS_IMETHODIMP CBrowserContainer::GetNewWindow(PRInt32 aChromeFlags,
|
||||
nsIDocShellTreeItem** aDocShellTreeItem)
|
||||
{
|
||||
@ -693,6 +695,23 @@ CBrowserContainer::SetTitle(const PRUnichar * aTitle)
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// nsIWebBrowserChrome implementation
|
||||
|
||||
NS_IMETHODIMP
|
||||
CBrowserContainer::DestroyBrowserWindow()
|
||||
{
|
||||
PR_ASSERT(PR_FALSE);
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
CBrowserContainer::IsWindowModal(PRBool *retVal)
|
||||
{
|
||||
if (!retVal) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
*retVal = PR_FALSE;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
CBrowserContainer::SetStatus(PRUint32 statusType, const PRUnichar *status)
|
||||
{
|
||||
@ -733,13 +752,6 @@ nsIWebBrowser **aWebBrowser)
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
CBrowserContainer::FindNamedBrowserItem(const PRUnichar *aName, nsIDocShellTreeItem **_retval)
|
||||
{
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
|
||||
NS_IMETHODIMP
|
||||
CBrowserContainer::SizeBrowserTo(PRInt32 aCX, PRInt32 aCY)
|
||||
{
|
||||
@ -759,26 +771,13 @@ CBrowserContainer::ExitModalEventLoop(nsresult aStatus)
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
CBrowserContainer::SetPersistence(PRBool persistX, PRBool persistY, PRBool persistCX, PRBool persistCY, PRBool persistSizeMode)
|
||||
{
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
CBrowserContainer::GetPersistence(PRBool *persistX, PRBool *persistY, PRBool *persistCX, PRBool *persistCY, PRBool *persistSizeMode)
|
||||
{
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// nsIStreamObserver implementation
|
||||
|
||||
|
||||
NS_IMETHODIMP
|
||||
CBrowserContainer::OnStartRequest(nsIChannel* aChannel, nsISupports* aContext)
|
||||
CBrowserContainer::OnStartRequest(nsIRequest* aRequest, nsISupports* aContext)
|
||||
{
|
||||
|
||||
return NS_OK;
|
||||
@ -786,7 +785,7 @@ CBrowserContainer::OnStartRequest(nsIChannel* aChannel, nsISupports* aContext)
|
||||
|
||||
|
||||
NS_IMETHODIMP
|
||||
CBrowserContainer::OnStopRequest(nsIChannel* aChannel, nsISupports* aContext, nsresult aStatus, const PRUnichar* aMsg)
|
||||
CBrowserContainer::OnStopRequest(nsIRequest* aRequest, nsISupports* aContext, nsresult aStatus, const PRUnichar* aMsg)
|
||||
{
|
||||
return NS_OK;
|
||||
}
|
||||
@ -850,7 +849,7 @@ CBrowserContainer::OnStartDocumentLoad(nsIDocumentLoader* loader, nsIURI* aURL,
|
||||
|
||||
// we need this to fire the document complete
|
||||
NS_IMETHODIMP
|
||||
CBrowserContainer::OnEndDocumentLoad(nsIDocumentLoader* loader, nsIChannel *aChannel, nsresult aStatus)
|
||||
CBrowserContainer::OnEndDocumentLoad(nsIDocumentLoader* loader, nsIRequest *aRequest, nsresult aStatus)
|
||||
{
|
||||
if (nsnull != loader) {
|
||||
if (mInitContext->currentDocument = dom_getDocumentFromLoader(loader)){
|
||||
@ -890,7 +889,8 @@ CBrowserContainer::OnEndDocumentLoad(nsIDocumentLoader* loader, nsIChannel *aCha
|
||||
|
||||
|
||||
NS_IMETHODIMP
|
||||
CBrowserContainer::OnStartURLLoad(nsIDocumentLoader* loader, nsIChannel* aChannel)
|
||||
CBrowserContainer::OnStartURLLoad(nsIDocumentLoader* loader,
|
||||
nsIRequest* aRequest)
|
||||
{
|
||||
//NOTE: This appears to get fired once for each individual item on a page.
|
||||
if (!mDocTarget) {
|
||||
@ -914,7 +914,10 @@ CBrowserContainer::OnStartURLLoad(nsIDocumentLoader* loader, nsIChannel* aChanne
|
||||
|
||||
|
||||
NS_IMETHODIMP
|
||||
CBrowserContainer::OnProgressURLLoad(nsIDocumentLoader* loader, nsIChannel* aChannel, PRUint32 aProgress, PRUint32 aProgressMax)
|
||||
CBrowserContainer::OnProgressURLLoad(nsIDocumentLoader* loader,
|
||||
nsIRequest* aRequest,
|
||||
PRUint32 aProgress,
|
||||
PRUint32 aProgressMax)
|
||||
{
|
||||
if (!mDocTarget) {
|
||||
return NS_OK;
|
||||
@ -939,7 +942,7 @@ CBrowserContainer::OnProgressURLLoad(nsIDocumentLoader* loader, nsIChannel* aCha
|
||||
|
||||
NS_IMETHODIMP
|
||||
CBrowserContainer::OnStatusURLLoad(nsIDocumentLoader* loader,
|
||||
nsIChannel* channel, nsString& aMsg)
|
||||
nsIRequest* request, nsString& aMsg)
|
||||
{
|
||||
|
||||
//NOTE: This appears to get fired for each individual item on a page, indicating the status of that item.
|
||||
@ -976,7 +979,7 @@ CBrowserContainer::OnStatusURLLoad(nsIDocumentLoader* loader,
|
||||
|
||||
|
||||
NS_IMETHODIMP
|
||||
CBrowserContainer::OnEndURLLoad(nsIDocumentLoader* loader, nsIChannel* channel, nsresult aStatus)
|
||||
CBrowserContainer::OnEndURLLoad(nsIDocumentLoader* loader, nsIRequest* request, nsresult aStatus)
|
||||
{
|
||||
//NOTE: This appears to get fired once for each individual item on a page.
|
||||
if (!mDocTarget) {
|
||||
|
@ -33,7 +33,6 @@
|
||||
#include "nsIDOMEventTarget.h"
|
||||
#include "nsIWebBrowserChrome.h"
|
||||
#include "nsIWebProgressListener.h"
|
||||
#include "nsWeakReference.h"
|
||||
#include "nsIWebShell.h" // We still have to implement nsIWebShellContainer
|
||||
// in order to receveive some DocumentLoaderObserver
|
||||
// events. edburns
|
||||
@ -44,6 +43,7 @@
|
||||
#include "nsIInterfaceRequestor.h"
|
||||
#include "nsIPrompt.h"
|
||||
#include "nsCWebBrowser.h"
|
||||
#include "nsWeakReference.h"
|
||||
|
||||
#include "wcIBrowserContainer.h"
|
||||
|
||||
|
@ -68,7 +68,7 @@ InputStreamShim::~InputStreamShim()
|
||||
NS_IMETHODIMP_(nsrefcnt) InputStreamShim::AddRef(void)
|
||||
{
|
||||
NS_PRECONDITION(PRInt32(mRefCnt) >= 0, "illegal refcnt");
|
||||
NS_ASSERT_OWNINGTHREAD(InputStreamShim);
|
||||
// Note that we intentionally don't check for owning thread safety.
|
||||
++mRefCnt;
|
||||
NS_LOG_ADDREF(this, mRefCnt, "InputStreamShim", sizeof(*this));
|
||||
return mRefCnt;
|
||||
@ -77,7 +77,7 @@ NS_IMETHODIMP_(nsrefcnt) InputStreamShim::AddRef(void)
|
||||
NS_IMETHODIMP_(nsrefcnt) InputStreamShim::Release(void)
|
||||
{
|
||||
NS_PRECONDITION(0 != mRefCnt, "dup release");
|
||||
NS_ASSERT_OWNINGTHREAD(_class);
|
||||
// Note that we intentionally don't check for owning thread safety.
|
||||
--mRefCnt;
|
||||
NS_LOG_RELEASE(this, mRefCnt, "InputStreamShim");
|
||||
if (mRefCnt == 0) {
|
||||
|
@ -99,11 +99,11 @@ ifdef MOZ_ENABLE_GTK
|
||||
ifndef MOZ_MONOLITHIC_TOOLKIT
|
||||
CXXFLAGS += $(MOZ_GTK_CFLAGS)
|
||||
CFLAGS += $(MOZ_GTK_CFLAGS)
|
||||
EXTRA_DSO_LDOPTS += -lgtkxtbin -lgtksuperwin -lwc_share -lembed_base_s -lxpfelocation_s -L/usr/X11R6/lib -lXt
|
||||
EXTRA_DSO_LDOPTS += -lgtkxtbin -lgtksuperwin -lwc_share -lembed_base_s -L/usr/X11R6/lib -lXt
|
||||
else
|
||||
CXXFLAGS += $(TK_CFLAGS)
|
||||
CFLAGS += $(TK_CFLAGS)
|
||||
EXTRA_DSO_LDOPTS += -lgtkxtbin -lgtksuperwin -lwc_share -lembed_base_s -lxpfelocation_s -L/usr/X11R6/lib -lXt
|
||||
EXTRA_DSO_LDOPTS += -lgtkxtbin -lgtksuperwin -lwc_share -lembed_base_s -L/usr/X11R6/lib -lXt
|
||||
endif
|
||||
endif
|
||||
|
||||
|
@ -77,7 +77,6 @@ DLL=.\$(OBJDIR)\$(DLLNAME).dll
|
||||
|
||||
LLIBS = \
|
||||
$(DIST)\lib\baseembed_s.lib \
|
||||
$(DIST)\lib\appfilelocprovider_s.lib \
|
||||
$(DIST)\lib\raptorbasewidget_s.lib \
|
||||
$(DIST)\lib\gkwidget.lib \
|
||||
$(DIST)\lib\xpcom.lib \
|
||||
|
@ -35,6 +35,7 @@
|
||||
#include "nsEmbedAPI.h" // for NS_InitEmbedding
|
||||
|
||||
#include "nsIProfile.h" // for the profile manager
|
||||
#include "nsIProfileInternal.h" // for the profile manager
|
||||
#include "nsICmdLineService.h" // for the cmdline service to give to the
|
||||
// profile manager.
|
||||
|
||||
@ -510,24 +511,26 @@ void DoMozInitialization(WebShellInitContext * initContext)
|
||||
int i, argc = 0;
|
||||
argv[0] = strdup(gBinDir);
|
||||
if (numProfiles > 1) {
|
||||
PRUnichar * Names;
|
||||
rv = profile->GetProfileList(&Names);
|
||||
PRUnichar **Names;
|
||||
PRUint32 NamesLen = 0;
|
||||
rv = profile->GetProfileList(&NamesLen, &Names);
|
||||
argv[1] = strdup("-p");
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
PR_ASSERT(NamesLen >= 1);
|
||||
// PENDING(edburns): fix for 70656. Really we should have a way
|
||||
// for the embedding app to specify which profile to use.
|
||||
// For now we just get the name of the first profile.
|
||||
argv[1] = strdup("-p");
|
||||
char * temp = new char[100]; // de-allocated in following for loop
|
||||
for (i = 0; i<100; i++) {
|
||||
if ((char) Names[i] != ',')
|
||||
temp[i] = (char) Names[i];
|
||||
else {
|
||||
temp[i] = '\0';
|
||||
break;
|
||||
for (i = 0; Names[0][i] != '\0'; i++) {
|
||||
temp[i] = (char) Names[0][i];
|
||||
}
|
||||
}
|
||||
nsCRT::free(Names);
|
||||
nsMemory::Free(Names);
|
||||
argv[2] = temp;
|
||||
argc = 3;
|
||||
}
|
||||
else {
|
||||
argv[2] = strdup("default");
|
||||
}
|
||||
printf("debug: edburns: argv[1]: %s argv[2]: %s\n", argv[1],
|
||||
argv[2]);
|
||||
}
|
||||
@ -542,12 +545,19 @@ void DoMozInitialization(WebShellInitContext * initContext)
|
||||
::util_ThrowExceptionToJava(env, "Can't initialize nsICmdLineService.");
|
||||
return;
|
||||
}
|
||||
rv = profile->StartupWithArgs(cmdLine);
|
||||
nsCOMPtr<nsIProfileInternal> profileInt = do_QueryInterface(profile);
|
||||
if (profileInt) {
|
||||
rv = profileInt->StartupWithArgs(cmdLine);
|
||||
if (NS_FAILED(rv)) {
|
||||
::util_ThrowExceptionToJava(env, "Can't statrup nsIProfile service.");
|
||||
return;
|
||||
}
|
||||
}
|
||||
else {
|
||||
::util_ThrowExceptionToJava(env, "Can't statrup nsIProfile service.");
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user