* Added static method BWebPage::ShutdownOnce(), which the application can call

for any at-exit-cleanup. Moved the closing of the favicon database from
  BWebSettings there, since I wasn't sure if closing the icon database happened
  at the right time, or perhaps too late if it was done via global destructors.
* Temporarily disabled the native cookie support, as it only delays application
  startup time right now. We are really using the cURL cookies at the moment
  and they work just fine it seems.

git-svn-id: http://svn.haiku-os.org/webpositive/webkit/trunk@362 94f232f2-1747-11df-bad5-a5bfde151594
This commit is contained in:
stippi 2010-04-02 13:48:17 +00:00 committed by Alexandre Deckner
parent bef126e25e
commit 5a9074bc17

View File

@ -54,6 +54,9 @@ const char* kApplicationSignature = "application/x-vnd.Haiku-WebPositive";
const char* kApplicationName = "WebPositive"; const char* kApplicationName = "WebPositive";
static const uint32 PRELOAD_BROWSING_HISTORY = 'plbh'; static const uint32 PRELOAD_BROWSING_HISTORY = 'plbh';
#define ENABLE_NATIVE_COOKIES 0
BrowserApp::BrowserApp() BrowserApp::BrowserApp()
: :
BApplication(kApplicationSignature), BApplication(kApplicationSignature),
@ -62,6 +65,7 @@ BrowserApp::BrowserApp()
fLaunchRefsMessage(0), fLaunchRefsMessage(0),
fInitialized(false), fInitialized(false),
fSettings(NULL), fSettings(NULL),
fCookies(NULL),
fCookieJar(NULL), fCookieJar(NULL),
fDownloadWindow(NULL), fDownloadWindow(NULL),
fSettingsWindow(NULL) fSettingsWindow(NULL)
@ -129,6 +133,7 @@ BrowserApp::ReadyToRun()
mainSettingsPath << "/Application"; mainSettingsPath << "/Application";
fSettings = new SettingsMessage(B_USER_SETTINGS_DIRECTORY, fSettings = new SettingsMessage(B_USER_SETTINGS_DIRECTORY,
mainSettingsPath.String()); mainSettingsPath.String());
#if ENABLE_NATIVE_COOKIES
mainSettingsPath = kApplicationName; mainSettingsPath = kApplicationName;
mainSettingsPath << "/Cookies"; mainSettingsPath << "/Cookies";
fCookies = new SettingsMessage(B_USER_SETTINGS_DIRECTORY, fCookies = new SettingsMessage(B_USER_SETTINGS_DIRECTORY,
@ -137,6 +142,7 @@ BrowserApp::ReadyToRun()
cookieArchive = fCookies->GetValue("cookies", cookieArchive); cookieArchive = fCookies->GetValue("cookies", cookieArchive);
fCookieJar = new BNetworkCookieJar(cookieArchive); fCookieJar = new BNetworkCookieJar(cookieArchive);
BWebPage::SetCookieJar(fCookieJar); BWebPage::SetCookieJar(fCookieJar);
#endif
fLastWindowFrame = fSettings->GetValue("window frame", fLastWindowFrame); fLastWindowFrame = fSettings->GetValue("window frame", fLastWindowFrame);
BRect downloadWindowFrame = fSettings->GetValue("downloads window frame", BRect downloadWindowFrame = fSettings->GetValue("downloads window frame",
@ -265,6 +271,8 @@ BrowserApp::QuitRequested()
} }
} }
BWebPage::ShutdownOnce();
fSettings->SetValue("window frame", fLastWindowFrame); fSettings->SetValue("window frame", fLastWindowFrame);
if (fDownloadWindow->Lock()) { if (fDownloadWindow->Lock()) {
fSettings->SetValue("downloads window frame", fDownloadWindow->Frame()); fSettings->SetValue("downloads window frame", fDownloadWindow->Frame());
@ -277,7 +285,7 @@ BrowserApp::QuitRequested()
} }
BMessage cookieArchive; BMessage cookieArchive;
if (fCookieJar->Archive(&cookieArchive) == B_OK) if (fCookieJar != NULL && fCookieJar->Archive(&cookieArchive) == B_OK)
fCookies->SetValue("cookies", cookieArchive); fCookies->SetValue("cookies", cookieArchive);
return true; return true;