Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1293)

Unified Diff: content/browser/gpu/gpu_process_host_ui_shim.cc

Issue 1249313004: Remove GPU relinquish resources infrastructure and stop GPU process. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove gpu_crash_recorded_. Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/browser/gpu/gpu_process_host_ui_shim.h ('k') | content/common/gpu/gpu_channel_manager.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/gpu/gpu_process_host_ui_shim.cc
diff --git a/content/browser/gpu/gpu_process_host_ui_shim.cc b/content/browser/gpu/gpu_process_host_ui_shim.cc
index 6c7aa9c11b710656da2a03ff3d3eaa7bed25b0e5..637f4bc5bf70052b23b27cb3531dfa5b5dad696d 100644
--- a/content/browser/gpu/gpu_process_host_ui_shim.cc
+++ b/content/browser/gpu/gpu_process_host_ui_shim.cc
@@ -60,6 +60,12 @@ void SendOnIOThreadTask(int host_id, IPC::Message* msg) {
delete msg;
}
+void StopGpuProcessOnIO(int host_id) {
+ GpuProcessHost* host = GpuProcessHost::FromID(host_id);
+ if (host)
+ host->StopGpuProcess();
+}
+
class ScopedSendOnIOThread {
public:
ScopedSendOnIOThread(int host_id, IPC::Message* msg)
@@ -192,11 +198,11 @@ bool GpuProcessHostUIShim::OnMessageReceived(const IPC::Message& message) {
return OnControlMessageReceived(message);
}
-void GpuProcessHostUIShim::RelinquishGpuResources(
- const base::Closure& callback) {
- DCHECK(relinquish_callback_.is_null());
- relinquish_callback_ = callback;
- Send(new GpuMsg_RelinquishResources());
+void GpuProcessHostUIShim::StopGpuProcess(const base::Closure& callback) {
+ close_callback_ = callback;
+
+ BrowserThread::PostTask(
+ BrowserThread::IO, FROM_HERE, base::Bind(&StopGpuProcessOnIO, host_id_));
}
void GpuProcessHostUIShim::SimulateRemoveAllContext() {
@@ -213,6 +219,8 @@ void GpuProcessHostUIShim::SimulateHang() {
GpuProcessHostUIShim::~GpuProcessHostUIShim() {
DCHECK(CalledOnValidThread());
+ if (!close_callback_.is_null())
+ base::ResetAndReturn(&close_callback_).Run();
g_hosts_by_id.Pointer()->Remove(host_id_);
}
@@ -233,8 +241,6 @@ bool GpuProcessHostUIShim::OnControlMessageReceived(
OnGraphicsInfoCollected)
IPC_MESSAGE_HANDLER(GpuHostMsg_VideoMemoryUsageStats,
OnVideoMemoryUsageStatsReceived);
- IPC_MESSAGE_HANDLER(GpuHostMsg_ResourcesRelinquished,
- OnResourcesRelinquished)
IPC_MESSAGE_HANDLER(GpuHostMsg_AddSubscription, OnAddSubscription);
IPC_MESSAGE_HANDLER(GpuHostMsg_RemoveSubscription, OnRemoveSubscription);
@@ -314,12 +320,6 @@ void GpuProcessHostUIShim::OnVideoMemoryUsageStatsReceived(
video_memory_usage_stats);
}
-void GpuProcessHostUIShim::OnResourcesRelinquished() {
- if (!relinquish_callback_.is_null()) {
- base::ResetAndReturn(&relinquish_callback_).Run();
- }
-}
-
void GpuProcessHostUIShim::OnAddSubscription(
int32 process_id, unsigned int target) {
RenderProcessHost* rph = RenderProcessHost::FromID(process_id);
« no previous file with comments | « content/browser/gpu/gpu_process_host_ui_shim.h ('k') | content/common/gpu/gpu_channel_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698