summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--webkit/glue/webkitclient_impl.cc13
-rw-r--r--webkit/glue/webkitclient_impl.h1
2 files changed, 12 insertions, 2 deletions
diff --git a/webkit/glue/webkitclient_impl.cc b/webkit/glue/webkitclient_impl.cc
index 70be0f3..c65d176 100644
--- a/webkit/glue/webkitclient_impl.cc
+++ b/webkit/glue/webkitclient_impl.cc
@@ -424,10 +424,11 @@ static size_t memoryUsageMBGeneric() {
}
#endif
-size_t WebKitClientImpl::memoryUsageMB() {
+static size_t getMemoryUsageMB(bool bypass_cache) {
size_t current_mem_usage = 0;
MemoryUsageCache* mem_usage_cache_singleton = MemoryUsageCache::Get();
- if (mem_usage_cache_singleton->IsCachedValueValid(&current_mem_usage))
+ if (!bypass_cache &&
+ mem_usage_cache_singleton->IsCachedValueValid(&current_mem_usage))
return current_mem_usage;
current_mem_usage =
@@ -442,6 +443,14 @@ size_t WebKitClientImpl::memoryUsageMB() {
return current_mem_usage;
}
+size_t WebKitClientImpl::memoryUsageMB() {
+ return getMemoryUsageMB(false);
+}
+
+size_t WebKitClientImpl::actualMemoryUsageMB() {
+ return getMemoryUsageMB(true);
+}
+
void WebKitClientImpl::SuspendSharedTimer() {
++shared_timer_suspended_;
}
diff --git a/webkit/glue/webkitclient_impl.h b/webkit/glue/webkitclient_impl.h
index 8c0cfa3..607677f 100644
--- a/webkit/glue/webkitclient_impl.h
+++ b/webkit/glue/webkitclient_impl.h
@@ -35,6 +35,7 @@ class WebKitClientImpl : public WebKit::WebKitClient {
unsigned key_size_index, const WebKit::WebString& challenge,
const WebKit::WebURL& url);
virtual size_t memoryUsageMB();
+ virtual size_t actualMemoryUsageMB();
virtual WebKit::WebURLLoader* createURLLoader();
virtual WebKit::WebSocketStreamHandle* createSocketStreamHandle();
virtual WebKit::WebString userAgent(const WebKit::WebURL& url);