[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-10851-g50815da

mrobinson at webkit.org mrobinson at webkit.org
Wed Dec 22 18:01:41 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 7ec3575ac85deaf252df5788861b4d29bbfaa27b
Author: mrobinson at webkit.org <mrobinson at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Mon Dec 6 11:18:20 2010 +0000

    2010-12-06  Joone Hur  <joone at kldp.org>
    
            Reviewed by Xan Lopez.
    
            [GTK] The webkit cache model needs to be set when WebFrameLoaderClient::didPerformFirstNavigation() is called
            https://bugs.webkit.org/show_bug.cgi?id=50430
    
            * WebCoreSupport/FrameLoaderClientGtk.cpp:
            (WebKit::FrameLoaderClient::didPerformFirstNavigation): Set the webview cache model.
            * webkit/webkitprivate.cpp:
            (webkit_init): Removed the code of setting the webview cache model.
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@73353 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKit/gtk/ChangeLog b/WebKit/gtk/ChangeLog
index ae0062a..f76e8ea 100644
--- a/WebKit/gtk/ChangeLog
+++ b/WebKit/gtk/ChangeLog
@@ -1,3 +1,15 @@
+2010-12-06  Joone Hur  <joone at kldp.org>
+
+        Reviewed by Xan Lopez.
+
+        [GTK] The webkit cache model needs to be set when WebFrameLoaderClient::didPerformFirstNavigation() is called
+        https://bugs.webkit.org/show_bug.cgi?id=50430
+
+        * WebCoreSupport/FrameLoaderClientGtk.cpp:
+        (WebKit::FrameLoaderClient::didPerformFirstNavigation): Set the webview cache model.
+        * webkit/webkitprivate.cpp:
+        (webkit_init): Removed the code of setting the webview cache model.
+
 2010-12-04  Antonio Gomes  <agomes at rim.com>
 
         Reviewed by Martin Robinson.
diff --git a/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.cpp b/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.cpp
index fdef9dc..3dbba12 100644
--- a/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.cpp
+++ b/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.cpp
@@ -690,6 +690,10 @@ void FrameLoaderClient::documentElementAvailable()
 
 void FrameLoaderClient::didPerformFirstNavigation() const
 {
+    WebKitCacheModel cacheModel = webkit_get_cache_model();
+    // If user agents do not determine the cache model, we use WEBKIT_CACHE_MODEL_WEB_BROWSER by default.
+    if (cacheModel == WEBKIT_CACHE_MODEL_DEFAULT)
+        webkit_set_cache_model(WEBKIT_CACHE_MODEL_WEB_BROWSER);
 }
 
 void FrameLoaderClient::registerForIconNotification(bool shouldRegister)
diff --git a/WebKit/gtk/webkit/webkitprivate.cpp b/WebKit/gtk/webkit/webkitprivate.cpp
index 212f333..52ce896 100644
--- a/WebKit/gtk/webkit/webkitprivate.cpp
+++ b/WebKit/gtk/webkit/webkitprivate.cpp
@@ -283,11 +283,6 @@ void webkit_init()
     // that may only be done by the main thread.
     atomicCanonicalTextEncodingName("UTF-8");
 
-    // Page cache capacity (in pages). Comment from Mac port:
-    // (Research indicates that value / page drops substantially after 3 pages.)
-    // FIXME: Expose this with an API and/or calculate based on available resources
-    webkit_set_cache_model(WEBKIT_CACHE_MODEL_WEB_BROWSER);
-
 #if ENABLE(DATABASE)
     gchar* databaseDirectory = g_build_filename(g_get_user_data_dir(), "webkit", "databases", NULL);
     webkit_set_web_database_directory_path(databaseDirectory);
diff --git a/WebKit/gtk/webkit/webkitwebview.cpp b/WebKit/gtk/webkit/webkitwebview.cpp
index 9e7f3c1..778a495 100644
--- a/WebKit/gtk/webkit/webkitwebview.cpp
+++ b/WebKit/gtk/webkit/webkitwebview.cpp
@@ -125,7 +125,7 @@
  */
 
 static const double defaultDPI = 96.0;
-static WebKitCacheModel cacheModel;
+static WebKitCacheModel cacheModel = WEBKIT_CACHE_MODEL_DEFAULT;
 static IntPoint globalPointForClientPoint(GdkWindow* window, const IntPoint& clientPoint);
 
 using namespace WebKit;
@@ -4994,6 +4994,8 @@ void webkit_set_cache_model(WebKitCacheModel model)
         deadDecodedDataDeletionInterval = 0;
         break;
     case WEBKIT_CACHE_MODEL_WEB_BROWSER:
+        // Page cache capacity (in pages). Comment from Mac port:
+        // (Research indicates that value / page drops substantially after 3 pages.)
         pageCacheCapacity = 3;
         cacheTotalCapacity = 32 * 1024 * 1024;
         cacheMinDeadCapacity = cacheTotalCapacity / 4;
diff --git a/WebKit/gtk/webkit/webkitwebview.h b/WebKit/gtk/webkit/webkitwebview.h
index cf8e669..453bd1a 100644
--- a/WebKit/gtk/webkit/webkitwebview.h
+++ b/WebKit/gtk/webkit/webkitwebview.h
@@ -50,8 +50,21 @@ typedef enum {
     WEBKIT_NAVIGATION_RESPONSE_DOWNLOAD
 } WebKitNavigationResponse;
 
+/*  
+ * WebKitCacheModel:
+ * @WEBKIT_CACHE_MODEL_DOCUMENT_VIEWER: Disable the cache completely, which 
+ *   substantially reduces memory usage. Useful for applications that only
+ *   access local files.
+ * @WEBKIT_CACHE_MODEL_WEB_BROWSER: Improve document load speed substantially
+ *   by caching previously viewed content. This is the default setting.
+ * 
+ * Enum values used for determining the webview cache model.
+ */
 typedef enum {
-    WEBKIT_CACHE_MODEL_DOCUMENT_VIEWER = 1,
+    /*< private >*/
+    WEBKIT_CACHE_MODEL_DEFAULT,
+    /*< public >*/
+    WEBKIT_CACHE_MODEL_DOCUMENT_VIEWER,
     WEBKIT_CACHE_MODEL_WEB_BROWSER
 } WebKitCacheModel;
 

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list