[SCM] WebKit Debian packaging branch, debian/unstable, updated. debian/1.1.15-1-40151-g37bb677
rjw
rjw at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 07:14:43 UTC 2009
The following commit has been merged in the debian/unstable branch:
commit 257f3ec582e93c64771a731aff1f6cdb6362c82e
Author: rjw <rjw at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Fri Dec 13 18:49:29 2002 +0000
WebFoundation:
Fixed 3127225. Provide new SPI to get available system memory.
(Also currently unused SPI to get number of processors.)
Reviewed by gramps.
* Misc.subproj/WebSystemBits.h:
* Misc.subproj/WebSystemBits.m:
(initCapabilities):
(WebSystemMainMemory):
(WebSystemProcessors):
* WebFoundation.exp:
* WebFoundation.pbproj/project.pbxproj:
WebCore:
Fixed 3127225. Set WebCore object cache size when first bridge is created.
Reviewed by gramps.
* kwq/WebCoreBridge.h:
* kwq/WebCoreBridge.mm:
(-[WebCoreBridge init]):
WebKit:
Fixed 3127225. Scale page cache based on available memory.
Also added support for setting WebCore object cache size via
a preference.
Fixed 3126267. Increase CG glyph cache size if font smoothing
is turned on.
Reviewed by gramps.
* History.subproj/WebBackForwardList.m:
(+[WebBackForwardList pageCacheSize]):
* Misc.subproj/WebKitLogging.h:
* Misc.subproj/WebKitLogging.m:
* WebCoreSupport.subproj/WebBridge.m:
(-[WebBridge getObjectCacheSize]):
* WebCoreSupport.subproj/WebTextRendererFactory.m:
(getAppDefaultValue):
(getUserDefaultValue):
(getLCDScaleParameters):
* WebView.subproj/WebPreferences.m:
(+[WebPreferences load]):
(-[WebPreferences _pageCacheSize]):
(-[WebPreferences _objectCacheSize]):
* WebView.subproj/WebPreferencesPrivate.h:
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@3036 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/ChangeLog-2003-10-25 b/WebCore/ChangeLog-2003-10-25
index a0e4bc9..0c74fb9 100644
--- a/WebCore/ChangeLog-2003-10-25
+++ b/WebCore/ChangeLog-2003-10-25
@@ -1,3 +1,13 @@
+2002-12-13 Richard Williamson <rjw at apple.com>
+
+ Fixed 3127225. Set WebCore object cache size when first bridge is created.
+
+ Reviewed by gramps.
+
+ * kwq/WebCoreBridge.h:
+ * kwq/WebCoreBridge.mm:
+ (-[WebCoreBridge init]):
+
2002-12-13 Darin Adler <darin at apple.com>
Reviewed by John.
diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23
index a0e4bc9..0c74fb9 100644
--- a/WebCore/ChangeLog-2005-08-23
+++ b/WebCore/ChangeLog-2005-08-23
@@ -1,3 +1,13 @@
+2002-12-13 Richard Williamson <rjw at apple.com>
+
+ Fixed 3127225. Set WebCore object cache size when first bridge is created.
+
+ Reviewed by gramps.
+
+ * kwq/WebCoreBridge.h:
+ * kwq/WebCoreBridge.mm:
+ (-[WebCoreBridge init]):
+
2002-12-13 Darin Adler <darin at apple.com>
Reviewed by John.
diff --git a/WebCore/kwq/WebCoreBridge.h b/WebCore/kwq/WebCoreBridge.h
index 3b15f10..5435308 100644
--- a/WebCore/kwq/WebCoreBridge.h
+++ b/WebCore/kwq/WebCoreBridge.h
@@ -244,6 +244,8 @@ enum FrameBorderStyle {
- (BOOL)saveDocumentToPageCache:(id)documentInfo;
+- (int)getObjectCacheSize;
+
@end
// This interface definition allows those who hold a WebCoreBridge * to call all the methods
diff --git a/WebCore/kwq/WebCoreBridge.mm b/WebCore/kwq/WebCoreBridge.mm
index 025545f..8cf8363 100644
--- a/WebCore/kwq/WebCoreBridge.mm
+++ b/WebCore/kwq/WebCoreBridge.mm
@@ -49,6 +49,7 @@
#import "WebCoreTextRendererFactory.h"
#import "KWQCharsets.h"
#import "KWQFrame.h"
+#import "loader.h"
#import "WebCoreDOMPrivate.h"
@@ -99,13 +100,21 @@ NSString *WebCoreElementStringKey = @"WebElementString";
@implementation WebCoreBridge
+static bool initializedObjectCacheSize = FALSE;
+
- init
{
[super init];
_part = new KWQKHTMLPart;
_part->setBridge(self);
-
+
+ if (!initializedObjectCacheSize){
+ khtml::Cache::setSize([self getObjectCacheSize]);
+ initializedObjectCacheSize = TRUE;
+ }
+
+
return self;
}
diff --git a/WebKit/ChangeLog b/WebKit/ChangeLog
index e047097..da5e5a0 100644
--- a/WebKit/ChangeLog
+++ b/WebKit/ChangeLog
@@ -1,3 +1,29 @@
+2002-12-13 Richard Williamson <rjw at apple.com>
+
+ Fixed 3127225. Scale page cache based on available memory.
+ Also added support for setting WebCore object cache size via
+ a preference.
+ Fixed 3126267. Increase CG glyph cache size if font smoothing
+ is turned on.
+
+ Reviewed by gramps.
+
+ * History.subproj/WebBackForwardList.m:
+ (+[WebBackForwardList pageCacheSize]):
+ * Misc.subproj/WebKitLogging.h:
+ * Misc.subproj/WebKitLogging.m:
+ * WebCoreSupport.subproj/WebBridge.m:
+ (-[WebBridge getObjectCacheSize]):
+ * WebCoreSupport.subproj/WebTextRendererFactory.m:
+ (getAppDefaultValue):
+ (getUserDefaultValue):
+ (getLCDScaleParameters):
+ * WebView.subproj/WebPreferences.m:
+ (+[WebPreferences load]):
+ (-[WebPreferences _pageCacheSize]):
+ (-[WebPreferences _objectCacheSize]):
+ * WebView.subproj/WebPreferencesPrivate.h:
+
2002-12-13 Chris Blumenberg <cblu at apple.com>
Fixed: 3105486 - c|net news.com site seems to have lost its favicon again
diff --git a/WebKit/History.subproj/WebBackForwardList.m b/WebKit/History.subproj/WebBackForwardList.m
index 97880b8..b39693d 100644
--- a/WebKit/History.subproj/WebBackForwardList.m
+++ b/WebKit/History.subproj/WebBackForwardList.m
@@ -4,9 +4,11 @@
*/
#import <WebKit/WebBackForwardList.h>
#import <WebKit/WebHistoryItemPrivate.h>
+#import <WebKit/WebKitLogging.h>
#import <WebKit/WebPreferencesPrivate.h>
#import <WebFoundation/WebAssertions.h>
+#import <WebFoundation/WebSystemBits.h>
@implementation WebBackForwardList
@@ -202,11 +204,32 @@ static unsigned pageCacheSize = 4;
pageCacheSize = size;
}
+#ifndef NDEBUG
+static BOOL loggedPageCacheSize = NO;
+#endif
+ (unsigned)pageCacheSize
{
- if (!pageCacheSizeModified)
- return [[WebPreferences standardPreferences] _pageCacheSize];
+ if (!pageCacheSizeModified){
+ unsigned s;
+ vm_size_t memSize = WebSystemMainMemory();
+ unsigned multiplier = 1;
+
+ s = [[WebPreferences standardPreferences] _pageCacheSize];
+ if (memSize > 1024 * 1024 * 1024)
+ multiplier = 4;
+ else if (memSize > 512 * 1024 * 1024)
+ multiplier = 2;
+
+#ifndef NDEBUG
+ if (!loggedPageCacheSize){
+ LOG (CacheSizes, "Page cache size set to %d pages.", s * multiplier);
+ loggedPageCacheSize = YES;
+ }
+#endif
+
+ return s * multiplier;
+ }
return pageCacheSize;
}
diff --git a/WebKit/Misc.subproj/WebKitLogging.h b/WebKit/Misc.subproj/WebKitLogging.h
index 7091dc4..c7a3661 100644
--- a/WebKit/Misc.subproj/WebKitLogging.h
+++ b/WebKit/Misc.subproj/WebKitLogging.h
@@ -25,4 +25,5 @@ extern WebLogChannel WebKitLogEvents;
extern WebLogChannel WebKitLogView;
extern WebLogChannel WebKitLogRedirect;
-extern WebLogChannel WebKitLogPageCache;
\ No newline at end of file
+extern WebLogChannel WebKitLogPageCache;
+extern WebLogChannel WebKitLogCacheSizes;
diff --git a/WebKit/Misc.subproj/WebKitLogging.m b/WebKit/Misc.subproj/WebKitLogging.m
index 18e61f5..e574963 100644
--- a/WebKit/Misc.subproj/WebKitLogging.m
+++ b/WebKit/Misc.subproj/WebKitLogging.m
@@ -22,3 +22,4 @@ WebLogChannel WebKitLogView = { 0x00020000, "WebKitLogLevel", WebLogCh
WebLogChannel WebKitLogRedirect = { 0x00040000, "WebKitLogLevel", WebLogChannelUninitialized };
WebLogChannel WebKitLogPageCache = { 0x00080000, "WebKitLogLevel", WebLogChannelUninitialized };
+WebLogChannel WebKitLogCacheSizes = { 0x00100000, "WebKitLogLevel", WebLogChannelUninitialized };
diff --git a/WebKit/WebCoreSupport.subproj/WebBridge.m b/WebKit/WebCoreSupport.subproj/WebBridge.m
index b3b0dec..4d72836 100644
--- a/WebKit/WebCoreSupport.subproj/WebBridge.m
+++ b/WebKit/WebCoreSupport.subproj/WebBridge.m
@@ -27,7 +27,7 @@
#import <WebKit/WebPluginError.h>
#import <WebKit/WebPluginPackage.h>
#import <WebKit/WebPluginViewFactory.h>
-#import <WebKit/WebPreferences.h>
+#import <WebKit/WebPreferencesPrivate.h>
#import <WebKit/WebResourceLoadDelegate.h>
#import <WebKit/WebSubresourceClient.h>
#import <WebKit/WebViewPrivate.h>
@@ -40,6 +40,7 @@
#import <WebFoundation/WebNSURLExtras.h>
#import <WebFoundation/WebResourceHandle.h>
#import <WebFoundation/WebResourceResponse.h>
+#import <WebFoundation/WebSystemBits.h>
@interface NSApplication (DeclarationStolenFromAppKit)
@@ -523,4 +524,30 @@
return view;
}
+#ifndef NDEBUG
+static BOOL loggedObjectCacheSize = NO;
+#endif
+
+
+-(int)getObjectCacheSize
+{
+ vm_size_t memSize = WebSystemMainMemory();
+ int cacheSize = [[WebPreferences standardPreferences] _objectCacheSize];
+ int multiplier = 1;
+ if (memSize > 1024 * 1024 * 1024)
+ multiplier = 4;
+ else if (memSize > 512 * 1024 * 1024)
+ multiplier = 2;
+
+#ifndef NDEBUG
+ if (!loggedObjectCacheSize){
+ LOG (CacheSizes, "Object cache size set to %d bytes.", cacheSize * multiplier);
+ loggedObjectCacheSize = YES;
+ }
+#endif
+
+ return cacheSize * multiplier;
+}
+
+
@end
diff --git a/WebKit/WebCoreSupport.subproj/WebTextRendererFactory.m b/WebKit/WebCoreSupport.subproj/WebTextRendererFactory.m
index db6cda1..8205d8d 100644
--- a/WebKit/WebCoreSupport.subproj/WebTextRendererFactory.m
+++ b/WebKit/WebCoreSupport.subproj/WebTextRendererFactory.m
@@ -3,12 +3,15 @@
Copyright 2002, Apple, Inc. All rights reserved.
*/
+#import <WebKit/WebKitLogging.h>
#import <WebKit/WebTextRendererFactory.h>
#import <WebKit/WebTextRenderer.h>
#import <WebFoundation/WebAssertions.h>
+#import <WebFoundation/WebSystemBits.h>
#import <CoreGraphics/CoreGraphicsPrivate.h>
+#import <CoreGraphics/CGFontLCDSupport.h>
#import <mach-o/dyld.h>
@@ -123,6 +126,87 @@
return glyphBuffer;
}
+static bool
+getAppDefaultValue(CFStringRef key, int *v)
+{
+ CFPropertyListRef value;
+
+ value = CFPreferencesCopyValue(key, kCFPreferencesCurrentApplication,
+ kCFPreferencesAnyUser,
+ kCFPreferencesAnyHost);
+ if (value == NULL) {
+ value = CFPreferencesCopyValue(key, kCFPreferencesCurrentApplication,
+ kCFPreferencesCurrentUser,
+ kCFPreferencesAnyHost);
+ if (value == NULL)
+ return false;
+ }
+
+ if (CFGetTypeID(value) == CFNumberGetTypeID()) {
+ if (v != NULL)
+ CFNumberGetValue(value, kCFNumberIntType, v);
+ } else if (CFGetTypeID(value) == CFStringGetTypeID()) {
+ if (v != NULL)
+ *v = CFStringGetIntValue(value);
+ } else {
+ CFRelease(value);
+ return false;
+ }
+
+ CFRelease(value);
+ return true;
+}
+
+static bool
+getUserDefaultValue(CFStringRef key, int *v)
+{
+ CFPropertyListRef value;
+
+ value = CFPreferencesCopyValue(key, kCFPreferencesAnyApplication,
+ kCFPreferencesCurrentUser,
+ kCFPreferencesCurrentHost);
+ if (value == NULL)
+ return false;
+
+ if (CFGetTypeID(value) == CFNumberGetTypeID()) {
+ if (v != NULL)
+ CFNumberGetValue(value, kCFNumberIntType, v);
+ } else if (CFGetTypeID(value) == CFStringGetTypeID()) {
+ if (v != NULL)
+ *v = CFStringGetIntValue(value);
+ } else {
+ CFRelease(value);
+ return false;
+ }
+
+ CFRelease(value);
+ return true;
+}
+
+static int getLCDScaleParameters(void)
+{
+ int mode;
+ CFStringRef key;
+
+ key = CFSTR("AppleFontSmoothing");
+ if (!getAppDefaultValue(key, &mode)) {
+ if (!getUserDefaultValue(key, &mode))
+ return 1;
+ }
+
+ switch (mode) {
+ case kCGFontSmoothingLCDLight:
+ case kCGFontSmoothingLCDMedium:
+ case kCGFontSmoothingLCDStrong:
+ return 4;
+ default:
+ return 1;
+ }
+
+}
+
+#define MINIMUM_GLYPH_CACHE_SIZE 1536 * 1024
+
+ (void)createSharedFactory;
{
if (![self sharedFactory]) {
@@ -141,7 +225,16 @@
CGFontCache *fontCache;
fontCache = CGFontCacheCreate();
functionPtr1 (fontCache, false);
- functionPtr2 (fontCache, 1024*1024);
+
+ size_t s;
+ if (WebSystemMainMemory() > 128 * 1024 * 1024)
+ s = MINIMUM_GLYPH_CACHE_SIZE*getLCDScaleParameters();
+ else
+ s = MINIMUM_GLYPH_CACHE_SIZE;
+#ifndef NDEBUG
+ LOG (CacheSizes, "Glyph cache size set to %d bytes.", s);
+#endif
+ functionPtr2 (fontCache, s);
CGFontCacheRelease(fontCache);
}
}
diff --git a/WebKit/WebView.subproj/WebPreferences.m b/WebKit/WebView.subproj/WebPreferences.m
index f25e611..c2edf89 100644
--- a/WebKit/WebView.subproj/WebPreferences.m
+++ b/WebKit/WebView.subproj/WebPreferences.m
@@ -34,6 +34,7 @@
#define WebKitAllowAnimatedImageLoopingPreferenceKey @"WebKitAllowAnimatedImageLoopingPreferenceKey"
#define WebKitDisplayImagesKey @"WebKitDisplayImagesKey"
#define WebKitPageCacheSizePreferenceKey @"WebKitPageCacheSizePreferenceKey"
+#define WebKitObjectCacheSizePreferenceKey @"WebKitObjectCacheSizePreferenceKey"
@implementation WebPreferences
@@ -94,14 +95,15 @@
@"1.00", WebKitInitialTimedLayoutDelayPreferenceKey,
@"4096", WebKitInitialTimedLayoutSizePreferenceKey,
@"1.00", WebKitResourceTimedLayoutDelayPreferenceKey,
- @"4", WebKitPageCacheSizePreferenceKey,
+ @"4", WebKitPageCacheSizePreferenceKey,
+ @"4194304", WebKitObjectCacheSizePreferenceKey,
[NSNumber numberWithBool:YES], WebKitInitialTimedLayoutEnabledPreferenceKey,
[NSNumber numberWithBool:YES], WebKitResourceTimedLayoutEnabledPreferenceKey,
[NSNumber numberWithBool:NO], WebKitUserStyleSheetEnabledPreferenceKey,
@"", WebKitUserStyleSheetLocationPreferenceKey,
- [NSNumber numberWithBool:YES], WebKitJavaEnabledPreferenceKey,
+ [NSNumber numberWithBool:YES], WebKitJavaEnabledPreferenceKey,
[NSNumber numberWithBool:YES], WebKitJavaScriptEnabledPreferenceKey,
- [NSNumber numberWithBool:YES], WebKitJavaScriptCanOpenWindowsAutomaticallyPreferenceKey,
+ [NSNumber numberWithBool:YES], WebKitJavaScriptCanOpenWindowsAutomaticallyPreferenceKey,
[NSNumber numberWithBool:YES], WebKitPluginsEnabledPreferenceKey,
[NSNumber numberWithBool:YES], WebKitAllowAnimatedImagesPreferenceKey,
[NSNumber numberWithBool:YES], WebKitAllowAnimatedImageLoopingPreferenceKey,
@@ -311,6 +313,11 @@
return [[NSUserDefaults standardUserDefaults] integerForKey:WebKitPageCacheSizePreferenceKey];
}
+- (int)_objectCacheSize
+{
+ return [[NSUserDefaults standardUserDefaults] integerForKey:WebKitObjectCacheSizePreferenceKey];
+}
+
- (BOOL)_initialTimedLayoutEnabled
{
return [[NSUserDefaults standardUserDefaults] boolForKey:WebKitInitialTimedLayoutEnabledPreferenceKey];
diff --git a/WebKit/WebView.subproj/WebPreferencesPrivate.h b/WebKit/WebView.subproj/WebPreferencesPrivate.h
index f74bdff..8729ac5 100644
--- a/WebKit/WebView.subproj/WebPreferencesPrivate.h
+++ b/WebKit/WebView.subproj/WebPreferencesPrivate.h
@@ -15,5 +15,6 @@
- (BOOL)_resourceTimedLayoutEnabled;
- (NSTimeInterval)_resourceTimedLayoutDelay;
- (int)_pageCacheSize;
+- (int)_objectCacheSize;
@end
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list