xref: /aosp_15_r20/external/cronet/base/profiler/native_unwinder_android_memory_regions_map.h (revision 6777b5387eb2ff775bb5750e3f5d96f37fb7352b)
1 // Copyright 2020 The Chromium Authors
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 #ifndef BASE_PROFILER_NATIVE_UNWINDER_ANDROID_MEMORY_REGIONS_MAP_H_
6 #define BASE_PROFILER_NATIVE_UNWINDER_ANDROID_MEMORY_REGIONS_MAP_H_
7 
8 namespace base {
9 
10 // NativeUnwinderAndroidMemoryRegionsMap is an opaque interface that hides
11 // concrete libunwindstack types, i.e. `unwindstack::Maps` and
12 // `unwindstack::Memory`. By introducing the interface, chrome code can
13 // pass the underlying instances around without referencing libunwindstack.
14 // NativeUnwinderAndroidMemoryRegionsMap's implementation must live in the
15 // stack_unwinder dynamic feature module.
16 //
17 // Code within the dynamic feature module is expected to downcast to the
18 // derived type to access the unwindstack types.
19 class NativeUnwinderAndroidMemoryRegionsMap {
20  public:
21   NativeUnwinderAndroidMemoryRegionsMap() = default;
22   virtual ~NativeUnwinderAndroidMemoryRegionsMap() = default;
23 
24   NativeUnwinderAndroidMemoryRegionsMap(
25       const NativeUnwinderAndroidMemoryRegionsMap&) = delete;
26   NativeUnwinderAndroidMemoryRegionsMap& operator=(
27       const NativeUnwinderAndroidMemoryRegionsMap&) = delete;
28 };
29 
30 }  // namespace base
31 
32 #endif  // BASE_PROFILER_NATIVE_UNWINDER_ANDROID_MEMORY_REGIONS_MAP_H_
33