r=edburns

bugfix from Kyle.  Prep for future work.
This commit is contained in:
edburns%acm.org 2003-05-14 15:54:45 +00:00
Родитель 83a3ee7978
Коммит 93a716412a
4 изменённых файлов: 15 добавлений и 16 удалений

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

@ -598,7 +598,6 @@ NS_IMETHODIMP CBrowserContainer::OnStateChange(nsIWebProgress *aWebProgress,
return rv;
}
domWin->GetDocument(getter_AddRefs(mInitContext->currentDocument));
doStartDocumentLoad(uname.get());
}
if ((aStateFlags & STATE_STOP) && (aStateFlags & STATE_IS_DOCUMENT)) {

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

@ -230,11 +230,7 @@ JNIEXPORT void JNICALL Java_org_mozilla_webclient_wrapper_1native_NativeEventThr
return;
}
void* threadId = PR_GetCurrentThread();
if (threadId == (void *) gEmbeddedThread) {
// printf("--------- Thread ID ---- %p\n",gEmbeddedThread);
processEventLoop(initContext);
}
processEventLoop(initContext);
}
/**
@ -400,6 +396,12 @@ Java_org_mozilla_webclient_wrapper_1native_NativeEventThread_nativeRemoveAllList
int processEventLoop(WebShellInitContext * initContext)
{
if (PR_GetCurrentThread() != gEmbeddedThread)
return 0;
if (nsnull == initContext)
return 0;
#ifdef XP_UNIX
while(gtk_events_pending()) {
gtk_main_iteration();
@ -778,11 +780,7 @@ nsresult InitMozillaStuff (WebShellInitContext * initContext)
}
#endif
// PENDING(kyle): not sure if we need to check this, but it does prevent some crash from happening
void* threadId = PR_GetCurrentThread();
if (threadId == (void *) gEmbeddedThread)
// Just need to loop once to clear out events before returning
processEventLoop(initContext);
processEventLoop(initContext);
return rv;
}

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

@ -102,8 +102,9 @@ wsRealizeBrowserEvent::handleEvent ()
}
// create our BrowserContainer, which implements many many things.
CBrowserContainer *browserContainer;
mInitContext->browserContainer =
mInitContext->browserContainer = browserContainer =
new CBrowserContainer(mInitContext->webBrowser, mInitContext->env,
mInitContext);
@ -121,6 +122,10 @@ wsRealizeBrowserEvent::handleEvent ()
// set the docloaderobserver PENDING(edburns): how to we make our
// presence as a nsIWebProgressListener know?n
nsWeakPtr weakling(
dont_AddRef(NS_GetWeakReference(NS_STATIC_CAST(nsIWebProgressListener*, browserContainer))));
webBrowser->AddWebBrowserListener(weakling, NS_GET_IID(nsIWebProgressListener));
printf("Creation Done.....\n");
// Get the WebNavigation Object from the DocShell

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

@ -65,11 +65,8 @@ WindowCreator::CreateChromeWindow(nsIWebBrowserChrome *parent,
0);
// check gNewWindowInitContext to see if the initialization had completed
void* threadId = PR_GetCurrentThread();
while (!gNewWindowInitContext) {
if (threadId == (void *) gEmbeddedThread) {
processEventLoop(mInitContext);
}
processEventLoop(mInitContext);
::PR_Sleep(PR_INTERVAL_NO_WAIT);
}