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

Unified Diff: content/public/browser/gpu_utils.cc

Issue 2723363002: gpu: Replace GpuMsg_Finalize ipc with equivalent mojom api (Closed)
Patch Set: . Created 3 years, 9 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/public/browser/gpu_utils.h ('k') | services/ui/gpu/gpu_service.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/public/browser/gpu_utils.cc
diff --git a/content/public/browser/gpu_utils.cc b/content/public/browser/gpu_utils.cc
index 19c6ab65d6297bbf6eeca200f23bed8e0e7037a0..245da16f5a380ddeb9ade1966ba5ed45aeb4c92c 100644
--- a/content/public/browser/gpu_utils.cc
+++ b/content/public/browser/gpu_utils.cc
@@ -5,7 +5,9 @@
#include "content/public/browser/gpu_utils.h"
#include "base/command_line.h"
+#include "base/single_thread_task_runner.h"
#include "base/strings/string_number_conversions.h"
+#include "content/browser/gpu/gpu_process_host.h"
#include "content/public/common/content_features.h"
#include "content/public/common/content_switches.h"
#include "gpu/command_buffer/service/gpu_switches.h"
@@ -24,6 +26,20 @@ bool GetUintFromSwitch(const base::CommandLine* command_line,
return base::StringToUint(switch_value, value);
}
+void RunTaskOnTaskRunner(
+ scoped_refptr<base::SingleThreadTaskRunner> task_runner,
+ const base::Closure& callback) {
+ task_runner->PostTask(FROM_HERE, callback);
+}
+
+void StopGpuProcessImpl(const base::Closure& callback,
+ content::GpuProcessHost* host) {
+ if (host)
+ host->gpu_service()->Stop(callback);
+ else
+ callback.Run();
+}
+
} // namespace
namespace content {
@@ -116,4 +132,13 @@ const gpu::GpuPreferences GetGpuPreferencesFromCommandLine() {
return gpu_preferences;
}
+void StopGpuProcess(const base::Closure& callback) {
+ content::GpuProcessHost::CallOnIO(
+ content::GpuProcessHost::GPU_PROCESS_KIND_SANDBOXED,
+ false /* force_create */,
+ base::Bind(&StopGpuProcessImpl,
+ base::Bind(RunTaskOnTaskRunner,
+ base::ThreadTaskRunnerHandle::Get(), callback)));
+}
+
} // namespace content
« no previous file with comments | « content/public/browser/gpu_utils.h ('k') | services/ui/gpu/gpu_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698