Remove HeapGraph.type_names.

Change-Id: I88a1495569247014b6de9b2d39b43a938e834852
diff --git a/protos/perfetto/trace/perfetto_trace.proto b/protos/perfetto/trace/perfetto_trace.proto
index 1cbe411..8b4da24 100644
--- a/protos/perfetto/trace/perfetto_trace.proto
+++ b/protos/perfetto/trace/perfetto_trace.proto
@@ -6511,7 +6511,7 @@
 message HeapGraphObject {
   optional uint64 id = 1;
 
-  // Index for InternedData.type_names for the name of the type of this object.
+  // Index for InternedData.types for the name of the type of this object.
   optional uint64 type_id = 2;
 
   // Bytes occupied by this objects.
@@ -6544,12 +6544,7 @@
   // Types used in HeapGraphObjects.
   repeated HeapGraphType types = 9;
 
-  // Legacy way to encode types. Names here are emitted by old perfetto_hprof,
-  // which do not include the class_name. Handle like a HeapGraphType with
-  // no location_id.
-  // TODO(b/153552977): Remove this. This was was not used in any publicly
-  // available release.
-  repeated InternedString type_names = 3;
+  reserved 3;
 
   // Field names for references in managed heap graph.
   repeated InternedString field_names = 4;
diff --git a/protos/perfetto/trace/profiling/heap_graph.proto b/protos/perfetto/trace/profiling/heap_graph.proto
index eeb5bec..4c423dc 100644
--- a/protos/perfetto/trace/profiling/heap_graph.proto
+++ b/protos/perfetto/trace/profiling/heap_graph.proto
@@ -81,7 +81,7 @@
 message HeapGraphObject {
   optional uint64 id = 1;
 
-  // Index for InternedData.type_names for the name of the type of this object.
+  // Index for InternedData.types for the name of the type of this object.
   optional uint64 type_id = 2;
 
   // Bytes occupied by this objects.
@@ -114,12 +114,7 @@
   // Types used in HeapGraphObjects.
   repeated HeapGraphType types = 9;
 
-  // Legacy way to encode types. Names here are emitted by old perfetto_hprof,
-  // which do not include the class_name. Handle like a HeapGraphType with
-  // no location_id.
-  // TODO(b/153552977): Remove this. This was was not used in any publicly
-  // available release.
-  repeated InternedString type_names = 3;
+  reserved 3;
 
   // Field names for references in managed heap graph.
   repeated InternedString field_names = 4;
diff --git a/src/trace_processor/importers/proto/heap_graph_module.cc b/src/trace_processor/importers/proto/heap_graph_module.cc
index dc0914d..c952884 100644
--- a/src/trace_processor/importers/proto/heap_graph_module.cc
+++ b/src/trace_processor/importers/proto/heap_graph_module.cc
@@ -168,14 +168,6 @@
         seq_id, entry.id(), context_->storage->InternString(str_view),
         entry.location_id());
   }
-  for (auto it = heap_graph.type_names(); it; ++it) {
-    protos::pbzero::InternedString::Decoder entry(*it);
-    const char* str = reinterpret_cast<const char*>(entry.str().data);
-    auto str_view = base::StringView(str, entry.str().size);
-
-    heap_graph_tracker->AddInternedType(
-        seq_id, entry.iid(), context_->storage->InternString(str_view));
-  }
   for (auto it = heap_graph.field_names(); it; ++it) {
     protos::pbzero::InternedString::Decoder entry(*it);
     const char* str = reinterpret_cast<const char*>(entry.str().data);
diff --git a/test/cts/heapprofd_java_test_cts.cc b/test/cts/heapprofd_java_test_cts.cc
index e8d4701..8d89b32 100644
--- a/test/cts/heapprofd_java_test_cts.cc
+++ b/test/cts/heapprofd_java_test_cts.cc
@@ -107,7 +107,7 @@
   for (const auto& packet : packets) {
     ASSERT_EQ(packet.heap_graph().roots_size(), 0);
     ASSERT_EQ(packet.heap_graph().objects_size(), 0);
-    ASSERT_EQ(packet.heap_graph().type_names_size(), 0);
+    ASSERT_EQ(packet.heap_graph().types_size(), 0);
     ASSERT_EQ(packet.heap_graph().field_names_size(), 0);
   }
 }
diff --git a/test/trace_processor/profiling/heap_graph_branching.textproto b/test/trace_processor/profiling/heap_graph_branching.textproto
index d876fd0..7690c77 100644
--- a/test/trace_processor/profiling/heap_graph_branching.textproto
+++ b/test/trace_processor/profiling/heap_graph_branching.textproto
@@ -64,25 +64,25 @@
   trusted_packet_sequence_id: 999
   heap_graph {
     pid: 2
-    type_names {
-      iid: 1
-      str: "RootNode"
+    types {
+      id: 1
+      class_name: "RootNode"
     }
-    type_names {
-      iid: 2
-      str: "LeftChild0"
+    types {
+      id: 2
+      class_name: "LeftChild0"
     }
-    type_names {
-      iid: 3
-      str: "LeftChild1"
+    types {
+      id: 3
+      class_name: "LeftChild1"
     }
-    type_names {
-      iid: 4
-      str: "RightChild0"
+    types {
+      id: 4
+      class_name: "RightChild0"
     }
-    type_names {
-      iid: 5
-      str: "RightChild1"
+    types {
+      id: 5
+      class_name: "RightChild1"
     }
     field_names {
       iid: 1
diff --git a/test/trace_processor/profiling/heap_graph_flamegraph_system-server-heap-graph.out b/test/trace_processor/profiling/heap_graph_flamegraph_system-server-heap-graph.out
index c31c986..810924b 100644
--- a/test/trace_processor/profiling/heap_graph_flamegraph_system-server-heap-graph.out
+++ b/test/trace_processor/profiling/heap_graph_flamegraph_system-server-heap-graph.out
@@ -1,11 +1,11 @@
 "id","depth","name","map_name","count","cumulative_count","size","cumulative_size","parent_id"
-0,0,"java.lang.Class<java.util.concurrent.locks.AbstractQueuedSynchronizer$Node>","JAVA",1,3,316,356,"[NULL]"
-1,1,"java.lang.Object[]","JAVA",1,1,12,12,0
-2,1,"java.util.concurrent.locks.AbstractQueuedSynchronizer$Node","JAVA",1,1,28,28,0
-3,0,"java.util.concurrent.locks.AbstractQueuedSynchronizer$Node","JAVA",2,2,56,56,"[NULL]"
-4,0,"java.lang.Thread","JAVA",41,2854,4838,122801,"[NULL]"
-5,1,"dalvik.system.PathClassLoader","JAVA",1,42,48,1312,4
-6,2,"java.util.HashMap","JAVA",2,2,80,80,5
-7,2,"dalvik.system.DexPathList","JAVA",1,39,32,1184,5
-8,3,"dalvik.system.DexPathList$Element[]","JAVA",1,21,28,672,7
-9,4,"dalvik.system.DexPathList$Element","JAVA",4,20,100,644,8
+0,0,"java.lang.Class<java.lang.Object[]>","JAVA",1,3,224,292,"[NULL]"
+1,1,"java.lang.Object[]","JAVA",1,1,28,28,0
+2,1,"java.lang.String","JAVA",1,1,40,40,0
+3,0,"java.lang.String","JAVA",41233,41233,1846824,1846824,"[NULL]"
+4,0,"java.lang.Class<android.content.pm.ApplicationInfo>","JAVA",1,5,1152,1268,"[NULL]"
+5,1,"java.lang.String","JAVA",1,1,56,56,4
+6,1,"android.content.pm.ApplicationInfo$1","JAVA",1,1,8,8,4
+7,1,"java.lang.Object[]","JAVA",1,2,20,52,4
+8,2,"long[]","JAVA",1,1,32,32,7
+9,0,"java.lang.Class<java.io.File>","JAVA",1,11,645,997,"[NULL]"
diff --git a/test/trace_processor/profiling/heap_graph_legacy.textproto b/test/trace_processor/profiling/heap_graph_legacy.textproto
index 13fc018..68a8e54 100644
--- a/test/trace_processor/profiling/heap_graph_legacy.textproto
+++ b/test/trace_processor/profiling/heap_graph_legacy.textproto
@@ -91,25 +91,25 @@
   timestamp: 10
   heap_graph {
     pid: 2
-    type_names {
-      iid: 1
-      str: "FactoryProducerDelegateImplActor"
+    types {
+      id: 1
+      class_name: "FactoryProducerDelegateImplActor"
     }
-    type_names {
-      iid: 2
-      str: "Foo"
+    types {
+      id: 2
+      class_name: "Foo"
     }
-    type_names {
-      iid: 3
-      str: "a"
+    types {
+      id: 3
+      class_name: "a"
     }
-    type_names {
-      iid: 4
-      str: "a[]"
+    types {
+      id: 4
+      class_name: "a[]"
     }
-    type_names {
-      iid: 5
-      str: "java.lang.Class<a[]>"
+    types {
+      id: 5
+      class_name: "java.lang.Class<a[]>"
     }
     field_names {
       iid: 1
diff --git a/test/trace_processor/profiling/index b/test/trace_processor/profiling/index
index 5f82730..10ac765 100644
--- a/test/trace_processor/profiling/index
+++ b/test/trace_processor/profiling/index
@@ -18,7 +18,7 @@
 heap_graph_legacy.textproto heap_graph_reference.sql heap_graph_reference.out
 heap_graph_interleaved.textproto heap_graph_object.sql heap_graph_interleaved_object.out
 heap_graph_interleaved.textproto heap_graph_reference.sql heap_graph_interleaved_reference.out
-../../data/system-server-heap-graph.pftrace heap_graph_flamegraph.sql heap_graph_flamegraph_system-server-heap-graph.out
+../../data/system-server-heap-graph-new.pftrace heap_graph_flamegraph.sql heap_graph_flamegraph_system-server-heap-graph.out
 ../../data/system-server-native-profile heap_profile_flamegraph.sql heap_profile_flamegraph_system-server-native-profile.out
 heap_profile_tracker_new_stack.textproto heap_profile_tracker_new_stack.sql heap_profile_tracker_new_stack.out
 heap_profile_tracker_twoheaps.textproto heap_profile_tracker_twoheaps.sql heap_profile_tracker_twoheaps.out
diff --git a/test/trace_processor/profiling/obfuscated_heap_graph.textproto b/test/trace_processor/profiling/obfuscated_heap_graph.textproto
index 4eb9ecf..2e0c626 100644
--- a/test/trace_processor/profiling/obfuscated_heap_graph.textproto
+++ b/test/trace_processor/profiling/obfuscated_heap_graph.textproto
@@ -50,17 +50,17 @@
   trusted_packet_sequence_id: 999
   heap_graph {
     pid: 2
-    type_names {
-      iid: 1
-      str: "FactoryProducerDelegateImplActor"
+    types {
+      id: 1
+      class_name: "FactoryProducerDelegateImplActor"
     }
-    type_names {
-      iid: 2
-      str: "a"
+    types {
+      id: 2
+      class_name: "a"
     }
-    type_names {
-      iid: 3
-      str: "java.lang.Class<abc[]>"
+    types {
+      id: 3
+      class_name: "java.lang.Class<abc[]>"
     }
     field_names {
       iid: 1
diff --git a/tools/install-build-deps b/tools/install-build-deps
index e323f3c..73a537a 100755
--- a/tools/install-build-deps
+++ b/tools/install-build-deps
@@ -163,8 +163,8 @@
     # Example traces for regression tests.
     Dependency(
         'buildtools/test_data.zip',
-        'https://storage.googleapis.com/perfetto/test-data-20200716-213947.zip',
-        'ed6a14fd5196479bb9e0c18805fd45b79fcbee8f',
+        'https://storage.googleapis.com/perfetto/test-data-20200730-163541.zip',
+        '21531fb582e98c8c459f3e7a90bce5b6dedd1035',
         'all',
     ),