Don't try to access an Isolate when don't have one yet.

BUG=373385
R=jochen@chromium.org
NOTRY=true

Review URL: https://codereview.chromium.org/289033006

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@270986 0039d316-1c4b-4281-b951-d872f2087c98
parent 60dfffbd
......@@ -29,7 +29,9 @@ size_t GetMemoryUsageKB() {
v8::HeapStatistics stat;
// TODO(svenpanne) The call below doesn't take web workers into account, this
// has to be done manually by iterating over all Isolates involved.
v8::Isolate::GetCurrent()->GetHeapStatistics(&stat);
v8::Isolate* isolate = v8::Isolate::GetCurrent();
if (isolate)
isolate->GetHeapStatistics(&stat);
return mem_usage + (static_cast<uint64_t>(stat.total_heap_size()) >> 10);
}
#elif defined(OS_MACOSX)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment