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

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

Issue 712343003: Infrastructure for temportarily relinquishing GPU resources. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Try trybots again. Maybe now I have access Created 6 years, 1 month 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
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 8c4450628e7885b8275398a0659b4d9867022fd5..a5850c1ec70b20fbc2f9dc5981532bb14ea5775b 100644
--- a/content/browser/gpu/gpu_process_host_ui_shim.cc
+++ b/content/browser/gpu/gpu_process_host_ui_shim.cc
@@ -7,6 +7,7 @@
#include <algorithm>
#include "base/bind.h"
+#include "base/callback_helpers.h"
#include "base/debug/trace_event.h"
#include "base/id_map.h"
#include "base/lazy_instance.h"
@@ -180,6 +181,13 @@ bool GpuProcessHostUIShim::OnMessageReceived(const IPC::Message& message) {
return OnControlMessageReceived(message);
}
+void GpuProcessHostUIShim::RelinquishGpuResources(
+ const base::Closure& callback) {
dcheng 2014/11/21 03:06:03 Nit: this indent should be 4 spaces.
GusFernandez 2014/11/21 19:13:56 Done.
+ DCHECK(relinquish_callback_.is_null());
+ relinquish_callback_ = callback;
+ Send(new GpuMsg_RelinquishResources());
+}
+
void GpuProcessHostUIShim::SimulateRemoveAllContext() {
Send(new GpuMsg_Clean());
}
@@ -212,6 +220,8 @@ bool GpuProcessHostUIShim::OnControlMessageReceived(
OnGraphicsInfoCollected)
IPC_MESSAGE_HANDLER(GpuHostMsg_VideoMemoryUsageStats,
OnVideoMemoryUsageStatsReceived);
+ IPC_MESSAGE_HANDLER(GpuHostMsg_ResourcesRelinquished,
+ OnResourcesRelinquished)
IPC_MESSAGE_UNHANDLED_ERROR()
IPC_END_MESSAGE_MAP()
@@ -282,4 +292,10 @@ void GpuProcessHostUIShim::OnVideoMemoryUsageStatsReceived(
video_memory_usage_stats);
}
+void GpuProcessHostUIShim::OnResourcesRelinquished() {
+ if (!relinquish_callback_.is_null()) {
+ base::ResetAndReturn(&relinquish_callback_).Run();
+ }
+}
+
} // namespace content

Powered by Google App Engine
This is Rietveld 408576698