#include "components/viz/service/display_embedder/server_shared_bitmap_manager.h"
#include <stdint.h>
#include <string>
#include <utility>
#include "base/containers/contains.h"
#include "base/lazy_instance.h"
#include "base/memory/read_only_shared_memory_region.h"
#include "base/memory/ref_counted.h"
#include "base/memory/shared_memory_mapping.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/stringprintf.h"
#include "base/trace_event/process_memory_dump.h"
#include "components/viz/common/resources/bitmap_allocation.h"
#include "components/viz/common/resources/resource_sizes.h"
#include "mojo/public/cpp/system/platform_handle.h"
#include "ui/gfx/geometry/size.h"
namespace viz {
class BitmapData : public base::RefCounted<BitmapData> { … };
class LocalBitmapData : public BitmapData { … };
class SharedMemoryBitmapData : public BitmapData { … };
namespace {
class ServerSharedBitmap : public SharedBitmap { … };
}
ServerSharedBitmapManager::ServerSharedBitmapManager() = default;
ServerSharedBitmapManager::~ServerSharedBitmapManager() { … }
std::unique_ptr<SharedBitmap> ServerSharedBitmapManager::GetSharedBitmapFromId(
const gfx::Size& size,
SharedImageFormat format,
const SharedBitmapId& id) { … }
base::UnguessableToken
ServerSharedBitmapManager::GetSharedBitmapTracingGUIDFromId(
const SharedBitmapId& id) { … }
bool ServerSharedBitmapManager::LocalAllocatedSharedBitmap(
SkBitmap bitmap,
const SharedBitmapId& id) { … }
bool ServerSharedBitmapManager::ChildAllocatedSharedBitmap(
base::ReadOnlySharedMemoryMapping mapping,
const SharedBitmapId& id) { … }
void ServerSharedBitmapManager::ChildDeletedSharedBitmap(
const SharedBitmapId& id) { … }
bool ServerSharedBitmapManager::OnMemoryDump(
const base::trace_event::MemoryDumpArgs& args,
base::trace_event::ProcessMemoryDump* pmd) { … }
}