diff options
author | antonm@chromium.org <antonm@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-09-01 09:26:32 +0000 |
---|---|---|
committer | antonm@chromium.org <antonm@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-09-01 09:26:32 +0000 |
commit | aceb071dc7168831838168506871c1aa828998cb (patch) | |
tree | f82d95291d713b6f339b04f6704660142d5b5b8f /webkit/glue/webkitclient_impl.cc | |
parent | 93b465b434ab417046575d30a09da35819768bc6 (diff) | |
download | chromium_src-aceb071dc7168831838168506871c1aa828998cb.zip chromium_src-aceb071dc7168831838168506871c1aa828998cb.tar.gz chromium_src-aceb071dc7168831838168506871c1aa828998cb.tar.bz2 |
Introduce a flag to bypass the cache when retrieving current memory usage.
We need the most fresh value when giving an estimate to current working set, for
example, after major GC in V8 happened.
Review URL: http://codereview.chromium.org/3285003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@58153 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/glue/webkitclient_impl.cc')
-rw-r--r-- | webkit/glue/webkitclient_impl.cc | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/webkit/glue/webkitclient_impl.cc b/webkit/glue/webkitclient_impl.cc index 70be0f3..5bfd43a5 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() { +size_t WebKitClientImpl::memoryUsageMB(bool no_cache) { size_t current_mem_usage = 0; MemoryUsageCache* mem_usage_cache_singleton = MemoryUsageCache::Get(); - if (mem_usage_cache_singleton->IsCachedValueValid(¤t_mem_usage)) + if (!no_cache + && mem_usage_cache_singleton->IsCachedValueValid(¤t_mem_usage)) return current_mem_usage; current_mem_usage = |