Index: gpu/ipc/client/gpu_memory_buffer_impl_shared_memory.cc |
diff --git a/gpu/ipc/client/gpu_memory_buffer_impl_shared_memory.cc b/gpu/ipc/client/gpu_memory_buffer_impl_shared_memory.cc |
index 54423d51ceef266fe271be741f8bfa1725b01c56..92b36a30d5d97bf3412de3425070376645e9af4e 100644 |
--- a/gpu/ipc/client/gpu_memory_buffer_impl_shared_memory.cc |
+++ b/gpu/ipc/client/gpu_memory_buffer_impl_shared_memory.cc |
@@ -12,7 +12,6 @@ |
#include "base/numerics/safe_math.h" |
#include "base/process/memory.h" |
#include "ui/gfx/buffer_format_util.h" |
-#include "ui/gfx/gpu_memory_buffer_tracing.h" |
#include "ui/gl/gl_bindings.h" |
namespace gpu { |
@@ -47,7 +46,8 @@ GpuMemoryBufferImplSharedMemory::Create(gfx::GpuMemoryBufferId id, |
std::unique_ptr<base::SharedMemory> shared_memory(new base::SharedMemory()); |
if (!shared_memory->CreateAndMapAnonymous(buffer_size)) |
return nullptr; |
- |
+ const int kImportance = 2; |
+ shared_memory->set_importance(kImportance); |
return base::WrapUnique(new GpuMemoryBufferImplSharedMemory( |
id, size, format, callback, std::move(shared_memory), 0, |
gfx::RowSizeForBufferFormat(size.width(), format, 0))); |
@@ -86,11 +86,13 @@ GpuMemoryBufferImplSharedMemory::CreateFromHandle( |
gfx::BufferUsage usage, |
const DestructionCallback& callback) { |
DCHECK(base::SharedMemory::IsHandleValid(handle.handle)); |
- |
+ std::unique_ptr<base::SharedMemory> shared_memory = |
+ base::MakeUnique<base::SharedMemory>(handle.handle, false); |
+ const int kImportance = 2; |
+ shared_memory->set_importance(kImportance); |
return base::WrapUnique(new GpuMemoryBufferImplSharedMemory( |
- handle.id, size, format, callback, |
- base::MakeUnique<base::SharedMemory>(handle.handle, false), handle.offset, |
- handle.stride)); |
+ handle.id, size, format, callback, std::move(shared_memory), |
+ handle.offset, handle.stride)); |
} |
// static |
@@ -215,7 +217,11 @@ gfx::GpuMemoryBufferHandle GpuMemoryBufferImplSharedMemory::GetHandle() const { |
base::trace_event::MemoryAllocatorDumpGuid |
GpuMemoryBufferImplSharedMemory::GetGUIDForTracing( |
uint64_t tracing_process_id) const { |
- return gfx::GetSharedMemoryGUIDForTracing(tracing_process_id, id_); |
+ return shared_memory_->handle().GetGUIDForTracing(); |
+} |
+ |
+base::SharedMemory* GpuMemoryBufferImplSharedMemory::GetSharedMemory() { |
+ return shared_memory_.get(); |
} |
} // namespace gpu |