| Index: content/common/gpu/gpu_channel_manager.cc
|
| diff --git a/content/common/gpu/gpu_channel_manager.cc b/content/common/gpu/gpu_channel_manager.cc
|
| index 71d0f9c358cf709fe6526c89d4cd64095fd2d61a..1ee8dd4bb4284f6e86cd54bbbc002a857fb53df8 100644
|
| --- a/content/common/gpu/gpu_channel_manager.cc
|
| +++ b/content/common/gpu/gpu_channel_manager.cc
|
| @@ -24,10 +24,6 @@
|
| #include "ipc/message_filter.h"
|
| #include "ui/gl/gl_bindings.h"
|
| #include "ui/gl/gl_share_group.h"
|
| -#if defined(USE_OZONE)
|
| -#include "ui/ozone/public/gpu_platform_support.h"
|
| -#include "ui/ozone/public/ozone_platform.h"
|
| -#endif
|
|
|
| namespace content {
|
|
|
| @@ -50,7 +46,6 @@ GpuChannelManager::GpuChannelManager(
|
| sync_point_manager_(sync_point_manager),
|
| gpu_memory_buffer_factory_(gpu_memory_buffer_factory),
|
| channel_(channel),
|
| - relinquish_resources_pending_(false),
|
| attachment_broker_(broker),
|
| weak_factory_(this) {
|
| DCHECK(router_);
|
| @@ -87,7 +82,6 @@ GpuChannelManager::shader_translator_cache() {
|
| void GpuChannelManager::RemoveChannel(int client_id) {
|
| Send(new GpuHostMsg_DestroyChannel(client_id));
|
| gpu_channels_.erase(client_id);
|
| - CheckRelinquishGpuResources();
|
| }
|
|
|
| int GpuChannelManager::GenerateRouteID() {
|
| @@ -120,7 +114,7 @@ bool GpuChannelManager::OnMessageReceived(const IPC::Message& msg) {
|
| OnCreateViewCommandBuffer)
|
| IPC_MESSAGE_HANDLER(GpuMsg_DestroyGpuMemoryBuffer, OnDestroyGpuMemoryBuffer)
|
| IPC_MESSAGE_HANDLER(GpuMsg_LoadedShader, OnLoadedShader)
|
| - IPC_MESSAGE_HANDLER(GpuMsg_RelinquishResources, OnRelinquishResources)
|
| + IPC_MESSAGE_HANDLER(GpuMsg_Finalize, OnFinalize)
|
| IPC_MESSAGE_HANDLER(GpuMsg_UpdateValueState, OnUpdateValueState)
|
| IPC_MESSAGE_UNHANDLED(handled = false)
|
| IPC_END_MESSAGE_MAP()
|
| @@ -175,7 +169,6 @@ void GpuChannelManager::OnCloseChannel(
|
| iter != gpu_channels_.end(); ++iter) {
|
| if (iter->second->GetChannelName() == channel_handle.name) {
|
| gpu_channels_.erase(iter);
|
| - CheckRelinquishGpuResources();
|
| return;
|
| }
|
| }
|
| @@ -275,7 +268,6 @@ void GpuChannelManager::LoseAllContexts() {
|
|
|
| void GpuChannelManager::OnLoseAllContexts() {
|
| gpu_channels_.clear();
|
| - CheckRelinquishGpuResources();
|
| }
|
|
|
| gfx::GLSurface* GpuChannelManager::GetDefaultOffscreenSurface() {
|
| @@ -286,32 +278,9 @@ gfx::GLSurface* GpuChannelManager::GetDefaultOffscreenSurface() {
|
| return default_offscreen_surface_.get();
|
| }
|
|
|
| -void GpuChannelManager::OnRelinquishResources() {
|
| - relinquish_resources_pending_ = true;
|
| - CheckRelinquishGpuResources();
|
| -}
|
| -
|
| -void GpuChannelManager::CheckRelinquishGpuResources() {
|
| - if (relinquish_resources_pending_ && gpu_channels_.size() <= 1) {
|
| - relinquish_resources_pending_ = false;
|
| - if (default_offscreen_surface_.get()) {
|
| - default_offscreen_surface_->DestroyAndTerminateDisplay();
|
| - default_offscreen_surface_ = NULL;
|
| - }
|
| -#if defined(USE_OZONE)
|
| - ui::OzonePlatform::GetInstance()
|
| - ->GetGpuPlatformSupport()
|
| - ->RelinquishGpuResources(
|
| - base::Bind(&GpuChannelManager::OnResourcesRelinquished,
|
| - weak_factory_.GetWeakPtr()));
|
| -#else
|
| - OnResourcesRelinquished();
|
| -#endif
|
| - }
|
| -}
|
| -
|
| -void GpuChannelManager::OnResourcesRelinquished() {
|
| - Send(new GpuHostMsg_ResourcesRelinquished());
|
| +void GpuChannelManager::OnFinalize() {
|
| + // Quit the GPU process
|
| + base::MessageLoop::current()->Quit();
|
| }
|
|
|
| } // namespace content
|
|
|