Add Network support for UI Loading
git-svn-id: svn://10.0.0.236/trunk@5497 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -27,6 +27,8 @@
|
||||
#include "nsISupports.h"
|
||||
#include "nsIShellInstance.h"
|
||||
#include "nsShellInstance.h"
|
||||
#include "nsITimer.h"
|
||||
#include "net.h"
|
||||
|
||||
#include "nsWidgetsCID.h"
|
||||
#include "nsGfxCIID.h"
|
||||
@@ -80,13 +82,28 @@ nsresult nsShellInstance::Init()
|
||||
return res;
|
||||
}
|
||||
|
||||
static nsITimer* gNetTimer;
|
||||
|
||||
static void
|
||||
PollNet(nsITimer *aTimer, void *aClosure)
|
||||
{
|
||||
NET_PollSockets();
|
||||
NS_IF_RELEASE(gNetTimer);
|
||||
if (NS_OK == NS_NewTimer(&gNetTimer)) {
|
||||
gNetTimer->Init(PollNet, nsnull, 1000 / 50);
|
||||
}
|
||||
}
|
||||
|
||||
nsresult nsShellInstance::Run()
|
||||
{
|
||||
|
||||
#ifdef NS_WIN32
|
||||
MSG msg;
|
||||
PollNet(0, 0);
|
||||
while (GetMessage(&msg, NULL, 0, 0)) {
|
||||
TranslateMessage(&msg);
|
||||
DispatchMessage(&msg);
|
||||
NET_PollSockets();
|
||||
}
|
||||
return ((nsresult)msg.wParam);
|
||||
#elif NS_UNIX
|
||||
|
||||
Reference in New Issue
Block a user