[haiku-webkit-commits] r362 - in webkit/trunk/WebKit/haiku: API WebPositive

  • From: webkit@xxxxxxxxxxxxxxx
  • To: haiku-webkit-commits@xxxxxxxxxxxxx
  • Date: Fri, 02 Apr 2010 13:48:17 +0000

Author: stippi
Date: Fri Apr  2 13:48:17 2010
New Revision: 362
URL: http://mmlr.dyndns.org/changeset/362

Log:
* 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.

Modified:
   webkit/trunk/WebKit/haiku/API/WebPage.cpp
   webkit/trunk/WebKit/haiku/API/WebPage.h
   webkit/trunk/WebKit/haiku/API/WebSettings.cpp
   webkit/trunk/WebKit/haiku/WebPositive/BrowserApp.cpp

Modified: webkit/trunk/WebKit/haiku/API/WebPage.cpp
==============================================================================
--- webkit/trunk/WebKit/haiku/API/WebPage.cpp   Fri Apr  2 13:44:38 2010        
(r361)
+++ webkit/trunk/WebKit/haiku/API/WebPage.cpp   Fri Apr  2 13:48:17 2010        
(r362)
@@ -48,6 +48,7 @@
 #include "FrameLoaderClientHaiku.h"
 #include "FrameView.h"
 #include "GraphicsContext.h"
+#include "IconDatabase.h"
 #include "InitializeThreading.h"
 #include "InspectorClientHaiku.h"
 #include "Logging.h"
@@ -139,6 +140,11 @@
     PageGroup::setShouldTrackVisitedLinks(true);
 }
 
+/*static*/ void BWebPage::ShutdownOnce()
+{
+    WebCore::iconDatabase()->close();
+}
+
 /*static*/ void BWebPage::SetCacheModel(BWebKitCacheModel model)
 {
     // FIXME: Add disk cache handling when CURL has the API

Modified: webkit/trunk/WebKit/haiku/API/WebPage.h
==============================================================================
--- webkit/trunk/WebKit/haiku/API/WebPage.h     Fri Apr  2 13:44:38 2010        
(r361)
+++ webkit/trunk/WebKit/haiku/API/WebPage.h     Fri Apr  2 13:48:17 2010        
(r362)
@@ -74,6 +74,7 @@
 class BWebPage : private BHandler {
 public:
        static  void                            InitializeOnce();
+       static  void                            ShutdownOnce();
        static  void                            SetCacheModel(BWebKitCacheModel 
model);
 
                        void                            Init();

Modified: webkit/trunk/WebKit/haiku/API/WebSettings.cpp
==============================================================================
--- webkit/trunk/WebKit/haiku/API/WebSettings.cpp       Fri Apr  2 13:44:38 
2010        (r361)
+++ webkit/trunk/WebKit/haiku/API/WebSettings.cpp       Fri Apr  2 13:48:17 
2010        (r362)
@@ -22,7 +22,7 @@
  * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
  * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
 #include "config.h"
@@ -96,10 +96,6 @@
                be_app->RemoveHandler(this);
                be_app->Unlock();
        }
-    if (!fData->settings) {
-        // The global settings instance manages the icon database...
-        WebCore::iconDatabase()->close();
-    }
        delete fData;
 }
 
@@ -371,6 +367,8 @@
     WebCore::Image* image = 
WebCore::iconDatabase()->iconForPageURL(url.String(),
         WebCore::IntSize(16, 16));
 
+       reply.RemoveName("url");
+       reply.RemoveName("icon");
     reply.AddString("url", url.String());
     if (image) {
         const BBitmap* bitmap = image->nativeImageForCurrentFrame();

Modified: webkit/trunk/WebKit/haiku/WebPositive/BrowserApp.cpp
==============================================================================
--- webkit/trunk/WebKit/haiku/WebPositive/BrowserApp.cpp        Fri Apr  2 
13:44:38 2010        (r361)
+++ webkit/trunk/WebKit/haiku/WebPositive/BrowserApp.cpp        Fri Apr  2 
13:48:17 2010        (r362)
@@ -54,6 +54,9 @@
 const char* kApplicationName = "WebPositive";
 static const uint32 PRELOAD_BROWSING_HISTORY = 'plbh';
 
+#define ENABLE_NATIVE_COOKIES 0
+
+
 BrowserApp::BrowserApp()
        :
        BApplication(kApplicationSignature),
@@ -62,6 +65,7 @@
        fLaunchRefsMessage(0),
        fInitialized(false),
        fSettings(NULL),
+       fCookies(NULL),
        fCookieJar(NULL),
        fDownloadWindow(NULL),
        fSettingsWindow(NULL)
@@ -129,6 +133,7 @@
        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 @@
        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 @@
                }
        }
 
+       BWebPage::ShutdownOnce();
+
        fSettings->SetValue("window frame", fLastWindowFrame);
        if (fDownloadWindow->Lock()) {
                fSettings->SetValue("downloads window frame", 
fDownloadWindow->Frame());
@@ -277,7 +285,7 @@
        }
 
        BMessage cookieArchive;
-       if (fCookieJar->Archive(&cookieArchive) == B_OK)
+       if (fCookieJar != NULL && fCookieJar->Archive(&cookieArchive) == B_OK)
                fCookies->SetValue("cookies", cookieArchive);
 
        return true;

Other related posts:

  • » [haiku-webkit-commits] r362 - in webkit/trunk/WebKit/haiku: API WebPositive - webkit