Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(713)

Unified Diff: base/trace_event/java_heap_dump_provider_android.cc

Issue 1647803004: Move base to DEPS (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: base/trace_event/java_heap_dump_provider_android.cc
diff --git a/base/trace_event/java_heap_dump_provider_android.cc b/base/trace_event/java_heap_dump_provider_android.cc
deleted file mode 100644
index 4f5986d92ceb8ddf8f026c6d09336ba2a539a4f9..0000000000000000000000000000000000000000
--- a/base/trace_event/java_heap_dump_provider_android.cc
+++ /dev/null
@@ -1,46 +0,0 @@
-// Copyright 2015 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "base/trace_event/java_heap_dump_provider_android.h"
-
-#include "base/android/java_runtime.h"
-#include "base/trace_event/process_memory_dump.h"
-
-namespace base {
-namespace trace_event {
-
-// static
-JavaHeapDumpProvider* JavaHeapDumpProvider::GetInstance() {
- return Singleton<JavaHeapDumpProvider,
- LeakySingletonTraits<JavaHeapDumpProvider>>::get();
-}
-
-JavaHeapDumpProvider::JavaHeapDumpProvider() {
-}
-
-JavaHeapDumpProvider::~JavaHeapDumpProvider() {
-}
-
-// Called at trace dump point time. Creates a snapshot with the memory counters
-// for the current process.
-bool JavaHeapDumpProvider::OnMemoryDump(ProcessMemoryDump* pmd) {
- // These numbers come from java.lang.Runtime stats.
- long total_heap_size = 0;
- long free_heap_size = 0;
- android::JavaRuntime::GetMemoryUsage(&total_heap_size, &free_heap_size);
-
- MemoryAllocatorDump* outer_dump = pmd->CreateAllocatorDump("java_heap");
- outer_dump->AddScalar(MemoryAllocatorDump::kNameSize,
- MemoryAllocatorDump::kUnitsBytes, total_heap_size);
-
- MemoryAllocatorDump* inner_dump =
- pmd->CreateAllocatorDump("java_heap/allocated_objects");
- inner_dump->AddScalar(MemoryAllocatorDump::kNameSize,
- MemoryAllocatorDump::kUnitsBytes,
- total_heap_size - free_heap_size);
- return true;
-}
-
-} // namespace trace_event
-} // namespace base
« no previous file with comments | « base/trace_event/java_heap_dump_provider_android.h ('k') | base/trace_event/java_heap_dump_provider_android_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698