Title: [117785] trunk/Source/WebKit/efl
Revision
117785
Author
[email protected]
Date
2012-05-21 08:54:58 -0700 (Mon, 21 May 2012)

Log Message

[EFL] Clients should be able to set page cache capacity.
https://bugs.webkit.org/show_bug.cgi?id=86960

Patch by Mikhail Pozdnyakov <[email protected]> on 2012-05-21
Reviewed by Csaba Osztrogonác.

Exported memory page cache capacity getter and setter functions.
Those will be used both by clients and DRT Layout Test Controller.

* ewk/ewk_settings.cpp:
(ewk_settings_page_cache_capacity_get):
(ewk_settings_page_cache_capacity_set):
* ewk/ewk_settings.h:

Modified Paths

Diff

Modified: trunk/Source/WebKit/efl/ChangeLog (117784 => 117785)


--- trunk/Source/WebKit/efl/ChangeLog	2012-05-21 15:53:52 UTC (rev 117784)
+++ trunk/Source/WebKit/efl/ChangeLog	2012-05-21 15:54:58 UTC (rev 117785)
@@ -1,3 +1,18 @@
+2012-05-21  Mikhail Pozdnyakov  <[email protected]>
+
+        [EFL] Clients should be able to set page cache capacity.
+        https://bugs.webkit.org/show_bug.cgi?id=86960
+
+        Reviewed by Csaba Osztrogonác.
+
+        Exported memory page cache capacity getter and setter functions.
+        Those will be used both by clients and DRT Layout Test Controller.
+
+        * ewk/ewk_settings.cpp:
+        (ewk_settings_page_cache_capacity_get):
+        (ewk_settings_page_cache_capacity_set):
+        * ewk/ewk_settings.h:
+
 2012-05-21  Caio Marcelo de Oliveira Filho  <[email protected]>
 
         Move setEditingBehavior() from layoutTestController to window.internals

Modified: trunk/Source/WebKit/efl/ewk/ewk_main.cpp (117784 => 117785)


--- trunk/Source/WebKit/efl/ewk/ewk_main.cpp	2012-05-21 15:53:52 UTC (rev 117784)
+++ trunk/Source/WebKit/efl/ewk/ewk_main.cpp	2012-05-21 15:54:58 UTC (rev 117785)
@@ -150,8 +150,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
-    WebCore::pageCache()->setCapacity(3);
+    // FIXME: Calculate based on available resources
+    ewk_settings_page_cache_capacity_set(3);
     WebCore::PageGroup::setShouldTrackVisitedLinks(true);
 
     String home = WebCore::homeDirectoryPath();

Modified: trunk/Source/WebKit/efl/ewk/ewk_settings.cpp (117784 => 117785)


--- trunk/Source/WebKit/efl/ewk/ewk_settings.cpp	2012-05-21 15:53:52 UTC (rev 117784)
+++ trunk/Source/WebKit/efl/ewk/ewk_settings.cpp	2012-05-21 15:54:58 UTC (rev 117785)
@@ -248,6 +248,16 @@
     WebCore::memoryCache()->setDisabled(!enable);
 }
 
+unsigned ewk_settings_page_cache_capacity_get()
+{
+    return WebCore::pageCache()->capacity();
+}
+
+void ewk_settings_page_cache_capacity_set(unsigned pages)
+{
+    WebCore::pageCache()->setCapacity(pages);
+}
+
 void ewk_settings_memory_cache_clear()
 {
     // Turn the cache on and off. Disabling the object cache will remove all

Modified: trunk/Source/WebKit/efl/ewk/ewk_settings.h (117784 => 117785)


--- trunk/Source/WebKit/efl/ewk/ewk_settings.h	2012-05-21 15:53:52 UTC (rev 117784)
+++ trunk/Source/WebKit/efl/ewk/ewk_settings.h	2012-05-21 15:54:58 UTC (rev 117785)
@@ -296,6 +296,29 @@
 EAPI void             ewk_settings_object_cache_capacity_set(unsigned min_dead_bytes, unsigned max_dead_bytes, unsigned total_bytes);
 
 /**
+ * Returns the maximum number of pages in the memory page cache.
+ *
+ * By default, maximum number of pages is 3.
+ *
+ * @return  The maximum number of pages in the memory page cache.
+ *
+ * @sa ewk_settings_page_cache_capacity_set
+ */
+EAPI unsigned         ewk_settings_page_cache_capacity_get(void);
+
+/**
+ * Defines the capacity for the memory page cache.
+ *
+ * The page cache is responsible for holding visited web pages in memory. So it improves user experience when navigating forth or back
+ * to pages in the forward/back history as the cached pages do not require to be loaded from server.
+ *
+ * By default, @p pages is 3.
+ *
+ * @param pages The maximum number of pages to keep in the memory page cache.
+ */
+EAPI void             ewk_settings_page_cache_capacity_set(unsigned pages);
+
+/**
  * Clears all memory caches.
  *
  * This function clears all memory caches, which include the object cache (for resources such as
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to