[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc
benm at google.com
benm at google.com
Wed Dec 22 15:37:43 UTC 2010
The following commit has been merged in the debian/experimental branch:
commit 36360d232d97d494bf4a9dfd61c4b7a5c1572cc8
Author: benm at google.com <benm at google.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Tue Nov 9 17:34:57 2010 +0000
2010-11-09 Ben Murdoch <benm at google.com>
Reviewed by Steve Block.
Android is missing implementation of V8GCController::checkMemoryUsage
https://bugs.webkit.org/show_bug.cgi?id=49255
This patch adds the necessary code to WebCore to implement the
functionality. The implementation of the PlatformBridge on Android
does not live upstream yet, so not patching that here.
No new test as this is a platform specific change on Android.
* bindings/v8/V8GCController.cpp:
(WebCore::V8GCController::checkMemoryUsage): Implement on Android.
* platform/android/PlatformBridge.h: Add necessary methods to read
device specific memory usage and constraints.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@71639 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index ed5f2e0..b85e84d 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,21 @@
+2010-11-09 Ben Murdoch <benm at google.com>
+
+ Reviewed by Steve Block.
+
+ Android is missing implementation of V8GCController::checkMemoryUsage
+ https://bugs.webkit.org/show_bug.cgi?id=49255
+
+ This patch adds the necessary code to WebCore to implement the
+ functionality. The implementation of the PlatformBridge on Android
+ does not live upstream yet, so not patching that here.
+
+ No new test as this is a platform specific change on Android.
+
+ * bindings/v8/V8GCController.cpp:
+ (WebCore::V8GCController::checkMemoryUsage): Implement on Android.
+ * platform/android/PlatformBridge.h: Add necessary methods to read
+ device specific memory usage and constraints.
+
2010-11-09 Andreas Kling <kling at webkit.org>
Reviewed by Kenneth Rohde Christiansen.
diff --git a/WebCore/bindings/v8/V8GCController.cpp b/WebCore/bindings/v8/V8GCController.cpp
index 36beece..84a0cef 100644
--- a/WebCore/bindings/v8/V8GCController.cpp
+++ b/WebCore/bindings/v8/V8GCController.cpp
@@ -38,6 +38,7 @@
#include "HTMLImageElement.h"
#include "HTMLNames.h"
#include "MessagePort.h"
+#include "PlatformBridge.h"
#include "SVGElement.h"
#include "V8Binding.h"
#include "V8DOMMap.h"
@@ -399,8 +400,8 @@ namespace {
int getMemoryUsageInMB()
{
-#if PLATFORM(CHROMIUM)
- return ChromiumBridge::memoryUsageMB();
+#if PLATFORM(CHROMIUM) || PLATFORM(ANDROID)
+ return PlatformBridge::memoryUsageMB();
#else
return 0;
#endif
@@ -408,8 +409,8 @@ int getMemoryUsageInMB()
int getActualMemoryUsageInMB()
{
-#if PLATFORM(CHROMIUM)
- return ChromiumBridge::actualMemoryUsageMB();
+#if PLATFORM(CHROMIUM) || PLATFORM(ANDROID)
+ return PlatformBridge::actualMemoryUsageMB();
#else
return 0;
#endif
@@ -448,11 +449,19 @@ void V8GCController::checkMemoryUsage()
const int lowUsageMB = 256; // If memory usage is below this threshold, do not bother forcing GC.
const int highUsageMB = 1024; // If memory usage is above this threshold, force GC more aggresively.
const int highUsageDeltaMB = 128; // Delta of memory usage growth (vs. last workingSetEstimateMB) to force GC when memory usage is high.
+#elif PLATFORM(ANDROID)
+ // Query the PlatformBridge for memory thresholds as these vary device to device.
+ static const int lowUsageMB = PlatformBridge::lowMemoryUsageMB();
+ static const int highUsageMB = PlatformBridge::highMemoryUsageMB();
+ // We use a delta of -1 to ensure that when we are in a low memory situation we always trigger a GC.
+ static const int highUsageDeltaMB = -1;
+#else
+ return;
+#endif
int memoryUsageMB = getMemoryUsageInMB();
if ((memoryUsageMB > lowUsageMB && memoryUsageMB > 2 * workingSetEstimateMB) || (memoryUsageMB > highUsageMB && memoryUsageMB > workingSetEstimateMB + highUsageDeltaMB))
v8::V8::LowMemoryNotification();
-#endif
}
diff --git a/WebCore/platform/android/PlatformBridge.h b/WebCore/platform/android/PlatformBridge.h
index d961a89..2427b3a 100644
--- a/WebCore/platform/android/PlatformBridge.h
+++ b/WebCore/platform/android/PlatformBridge.h
@@ -106,6 +106,11 @@ public:
static NPObject* pluginScriptableObject(Widget*);
// Language
static String computeDefaultLanguage();
+ // Memory details for V8 GC
+ static int lowMemoryUsageMB();
+ static int highMemoryUsageMB();
+ static int memoryUsageMB();
+ static int actualMemoryUsageMB();
};
}
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list