Commit 9e9f4eb6 authored by cblume's avatar cblume Committed by Commit bot

Fixing crash in GPU memory dump. Will investigate more correct solution in a separate CL.

BUG=483467
TBR=ccameron@chromium.org,primiano@chromium.org

Review URL: https://codereview.chromium.org/1148813005

Cr-Commit-Position: refs/heads/master@{#333034}
parent 664b6eb5
......@@ -4,14 +4,11 @@
#include "content/common/gpu/gpu_channel_manager.h"
#include <algorithm>
#include "base/bind.h"
#include "base/command_line.h"
#include "base/location.h"
#include "base/single_thread_task_runner.h"
#include "base/thread_task_runner_handle.h"
#include "base/trace_event/memory_dump_manager.h"
#include "base/trace_event/process_memory_dump.h"
#include "content/common/gpu/gpu_channel.h"
#include "content/common/gpu/gpu_memory_buffer_factory.h"
#include "content/common/gpu/gpu_memory_manager.h"
......@@ -115,8 +112,6 @@ GpuChannelManager::GpuChannelManager(
DCHECK(router_);
DCHECK(io_task_runner);
DCHECK(shutdown_event);
base::trace_event::MemoryDumpManager::GetInstance()->RegisterDumpProvider(
this, io_task_runner_);
channel_->AddFilter(filter_.get());
}
......@@ -348,23 +343,6 @@ gfx::GLSurface* GpuChannelManager::GetDefaultOffscreenSurface() {
return default_offscreen_surface_.get();
}
bool GpuChannelManager::OnMemoryDump(
base::trace_event::ProcessMemoryDump* pmd) {
for (const auto& channel : gpu_channels_) {
auto dump_name = channel.second->GetChannelName();
std::replace(dump_name.begin(), dump_name.end(), '.', '_');
base::trace_event::MemoryAllocatorDump* dump = pmd->CreateAllocatorDump(
base::StringPrintf("gl/%s", dump_name.c_str()));
dump->AddScalar(base::trace_event::MemoryAllocatorDump::kNameSize,
base::trace_event::MemoryAllocatorDump::kUnitsBytes,
channel.second->GetMemoryUsage());
}
return true;
}
void GpuChannelManager::OnRelinquishResources() {
relinquish_resources_pending_ = true;
CheckRelinquishGpuResources();
......
......@@ -13,7 +13,6 @@
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
#include "base/memory/weak_ptr.h"
#include "base/trace_event/memory_dump_provider.h"
#include "build/build_config.h"
#include "content/common/content_export.h"
#include "content/common/content_param_traits.h"
......@@ -61,8 +60,7 @@ class MessageRouter;
// managing the lifetimes of GPU channels and forwarding IPC requests from the
// browser process to them based on the corresponding renderer ID.
class CONTENT_EXPORT GpuChannelManager : public IPC::Listener,
public IPC::Sender,
public base::trace_event::MemoryDumpProvider {
public IPC::Sender {
public:
GpuChannelManager(MessageRouter* router,
GpuWatchdog* watchdog,
......@@ -106,9 +104,6 @@ class CONTENT_EXPORT GpuChannelManager : public IPC::Listener,
return gpu_memory_buffer_factory_.get();
}
// base::trace_event::MemoryDumpProvider implementation.
bool OnMemoryDump(base::trace_event::ProcessMemoryDump* pmd) override;
private:
typedef base::ScopedPtrHashMap<int, scoped_ptr<GpuChannel>> GpuChannelMap;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment