From 5a9074bc173ee55df43495bf0581542b38eec2e8 Mon Sep 17 00:00:00 2001 From: stippi Date: Fri, 2 Apr 2010 13:48:17 +0000 Subject: [PATCH] * 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 --- src/apps/webpositive/BrowserApp.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/apps/webpositive/BrowserApp.cpp b/src/apps/webpositive/BrowserApp.cpp index db118555b5..756970e686 100644 --- a/src/apps/webpositive/BrowserApp.cpp +++ b/src/apps/webpositive/BrowserApp.cpp @@ -54,6 +54,9 @@ const char* kApplicationSignature = "application/x-vnd.Haiku-WebPositive"; const char* kApplicationName = "WebPositive"; static const uint32 PRELOAD_BROWSING_HISTORY = 'plbh'; +#define ENABLE_NATIVE_COOKIES 0 + + BrowserApp::BrowserApp() : BApplication(kApplicationSignature), @@ -62,6 +65,7 @@ BrowserApp::BrowserApp() fLaunchRefsMessage(0), fInitialized(false), fSettings(NULL), + fCookies(NULL), fCookieJar(NULL), fDownloadWindow(NULL), fSettingsWindow(NULL) @@ -129,6 +133,7 @@ BrowserApp::ReadyToRun() mainSettingsPath << "/Application"; fSettings = new SettingsMessage(B_USER_SETTINGS_DIRECTORY, mainSettingsPath.String()); +#if ENABLE_NATIVE_COOKIES mainSettingsPath = kApplicationName; mainSettingsPath << "/Cookies"; fCookies = new SettingsMessage(B_USER_SETTINGS_DIRECTORY, @@ -137,6 +142,7 @@ BrowserApp::ReadyToRun() cookieArchive = fCookies->GetValue("cookies", cookieArchive); fCookieJar = new BNetworkCookieJar(cookieArchive); BWebPage::SetCookieJar(fCookieJar); +#endif fLastWindowFrame = fSettings->GetValue("window frame", fLastWindowFrame); BRect downloadWindowFrame = fSettings->GetValue("downloads window frame", @@ -265,6 +271,8 @@ BrowserApp::QuitRequested() } } + BWebPage::ShutdownOnce(); + fSettings->SetValue("window frame", fLastWindowFrame); if (fDownloadWindow->Lock()) { fSettings->SetValue("downloads window frame", fDownloadWindow->Frame()); @@ -277,7 +285,7 @@ BrowserApp::QuitRequested() } BMessage cookieArchive; - if (fCookieJar->Archive(&cookieArchive) == B_OK) + if (fCookieJar != NULL && fCookieJar->Archive(&cookieArchive) == B_OK) fCookies->SetValue("cookies", cookieArchive); return true;