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

Unified Diff: content/browser/gpu/gpu_process_host.h

Issue 712343003: Infrastructure for temportarily relinquishing GPU resources. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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
« no previous file with comments | « no previous file | content/browser/gpu/gpu_process_host.cc » ('j') | content/browser/gpu/gpu_process_host.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/gpu/gpu_process_host.h
diff --git a/content/browser/gpu/gpu_process_host.h b/content/browser/gpu/gpu_process_host.h
index 2952d3869effc927437dad452f2b05e214952caa..03dfb1afdbabd21ed6f95836c69db6277c174d6b 100644
--- a/content/browser/gpu/gpu_process_host.h
+++ b/content/browser/gpu/gpu_process_host.h
@@ -64,6 +64,8 @@ class GpuProcessHost : public BrowserChildProcessHostDelegate,
typedef base::Callback<void(const gfx::GpuMemoryBufferHandle& handle)>
CreateGpuMemoryBufferCallback;
+ typedef base::Callback<void(bool successful)> RelinquishCallback;
+
static bool gpu_enabled() { return gpu_enabled_; }
static int gpu_crash_count() { return gpu_crash_count_; }
@@ -89,6 +91,10 @@ class GpuProcessHost : public BrowserChildProcessHostDelegate,
CONTENT_EXPORT static void RegisterGpuMainThreadFactory(
GpuMainThreadFactoryFunction create);
+ // Relinquish all internal GPU driver resources. All windows should be closed
+ // and the browser is being set to be placed in the bacckground.
+ static void RelinquishResources(const RelinquishCallback& callback);
+
// Get the GPU process host for the GPU process with the given ID. Returns
// null if the process no longer exists.
static GpuProcessHost* FromID(int host_id);
@@ -176,6 +182,8 @@ class GpuProcessHost : public BrowserChildProcessHostDelegate,
#if defined(OS_MACOSX)
void OnAcceleratedSurfaceBuffersSwapped(const IPC::Message& message);
#endif
+ void RelinquishResourcesInternal(const RelinquishCallback& callback);
+ void OnResourcesRelinquished(bool success);
void CreateChannelCache(int32 client_id);
void OnDestroyChannel(int32 client_id);
@@ -230,6 +238,9 @@ class GpuProcessHost : public BrowserChildProcessHostDelegate,
// Time Init started. Used to log total GPU process startup time to UMA.
base::TimeTicks init_start_time_;
+ // Completion callback for RelinquishResources.
+ RelinquishCallback relinquish_callback_;
+
// Whether this host recorded a GPU crash or not.
bool gpu_crash_recorded_;
« no previous file with comments | « no previous file | content/browser/gpu/gpu_process_host.cc » ('j') | content/browser/gpu/gpu_process_host.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698