diff options
author | svenpanne@chromium.org <svenpanne@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-03-05 11:06:55 +0000 |
---|---|---|
committer | svenpanne@chromium.org <svenpanne@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-03-05 11:06:55 +0000 |
commit | 8f09c54fc78a4a8d5fa66f7da7b506c14edffa8c (patch) | |
tree | 964f7356dc0d16c23abb79c39b45bd91850cc3b3 /net/proxy | |
parent | 9cc846e806807e9734e0e7f83f82b75020a482d0 (diff) | |
download | chromium_src-8f09c54fc78a4a8d5fa66f7da7b506c14edffa8c.zip chromium_src-8f09c54fc78a4a8d5fa66f7da7b506c14edffa8c.tar.gz chromium_src-8f09c54fc78a4a8d5fa66f7da7b506c14edffa8c.tar.bz2 |
Replaced deprecated v8 API calls by their non-deprecated counterparts.
TBR=darin@chromium.org
BUG=v8:2487
Review URL: https://chromiumcodereview.appspot.com/12398007
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@186152 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/proxy')
-rw-r--r-- | net/proxy/proxy_resolver_v8.cc | 22 | ||||
-rw-r--r-- | net/proxy/proxy_resolver_v8.h | 6 |
2 files changed, 28 insertions, 0 deletions
diff --git a/net/proxy/proxy_resolver_v8.cc b/net/proxy/proxy_resolver_v8.cc index c28dead..2620252 100644 --- a/net/proxy/proxy_resolver_v8.cc +++ b/net/proxy/proxy_resolver_v8.cc @@ -736,4 +736,26 @@ v8::Isolate* ProxyResolverV8::GetDefaultIsolate() { v8::Isolate* ProxyResolverV8::g_default_isolate_ = NULL; +// static +size_t ProxyResolverV8::GetTotalHeapSize() { + if (!g_default_isolate_) + return 0; + + v8::Locker locked(g_default_isolate_); + v8::HeapStatistics heap_statistics; + g_default_isolate_->GetHeapStatistics(&heap_statistics); + return heap_statistics.total_heap_size(); +} + +// static +size_t ProxyResolverV8::GetUsedHeapSize() { + if (!g_default_isolate_) + return 0; + + v8::Locker locked(g_default_isolate_); + v8::HeapStatistics heap_statistics; + g_default_isolate_->GetHeapStatistics(&heap_statistics); + return heap_statistics.used_heap_size(); +} + } // namespace net diff --git a/net/proxy/proxy_resolver_v8.h b/net/proxy/proxy_resolver_v8.h index 3adc672..4b5760b 100644 --- a/net/proxy/proxy_resolver_v8.h +++ b/net/proxy/proxy_resolver_v8.h @@ -11,6 +11,7 @@ #include "net/proxy/proxy_resolver.h" namespace v8 { +class HeapStatistics; class Isolate; } // namespace v8 @@ -95,6 +96,11 @@ class NET_EXPORT_PRIVATE ProxyResolverV8 : public ProxyResolver { static void RememberDefaultIsolate(); static v8::Isolate* GetDefaultIsolate(); + // Get total/ued heap memory usage of all v8 instances used by the proxy + // resolver. + static size_t GetTotalHeapSize(); + static size_t GetUsedHeapSize(); + private: static v8::Isolate* g_default_isolate_; |