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

Unified Diff: content/gpu/gpu_child_thread.cc

Issue 2753293003: gpu: Replace GpuMsg_CollectGraphicsInfo with mojom API. (Closed)
Patch Set: tot merge 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
Index: content/gpu/gpu_child_thread.cc
diff --git a/content/gpu/gpu_child_thread.cc b/content/gpu/gpu_child_thread.cc
index 6c8d424431666b8842517245f8fa99c07baa914c..953f026a1fd8464c43b80f22ae373e4ac349daab 100644
--- a/content/gpu/gpu_child_thread.cc
+++ b/content/gpu/gpu_child_thread.cc
@@ -247,7 +247,6 @@ bool GpuChildThread::Send(IPC::Message* msg) {
bool GpuChildThread::OnControlMessageReceived(const IPC::Message& msg) {
bool handled = true;
IPC_BEGIN_MESSAGE_MAP(GpuChildThread, msg)
- IPC_MESSAGE_HANDLER(GpuMsg_CollectGraphicsInfo, OnCollectGraphicsInfo)
IPC_MESSAGE_HANDLER(GpuMsg_GpuSwitched, OnGpuSwitched)
IPC_MESSAGE_UNHANDLED(handled = false)
IPC_END_MESSAGE_MAP()
@@ -284,6 +283,7 @@ void GpuChildThread::CreateGpuService(
ui::mojom::GpuHostPtr gpu_host,
const gpu::GpuPreferences& gpu_preferences,
mojo::ScopedSharedBufferHandle activity_flags) {
+ gpu_service_->set_in_host_process(in_browser_process_);
gpu_service_->Bind(std::move(request));
gpu_info_.video_decode_accelerator_capabilities =
@@ -349,60 +349,6 @@ void GpuChildThread::CreateDisplayCompositor(
NOTREACHED();
}
-void GpuChildThread::OnCollectGraphicsInfo() {
- if (dead_on_arrival_)
- return;
-
-#if defined(OS_MACOSX)
- // gpu::CollectContextGraphicsInfo() is already called during gpu process
- // initialization (see GpuInit::InitializeAndStartSandbox()) on non-mac
- // platforms, and during in-browser gpu thread initialization on all platforms
- // (See InProcessGpuThread::Init()).
- if (!in_browser_process_) {
- DCHECK_EQ(gpu::kCollectInfoNone, gpu_info_.context_info_state);
- gpu::CollectInfoResult result = gpu::CollectContextGraphicsInfo(&gpu_info_);
- switch (result) {
- case gpu::kCollectInfoFatalFailure:
- LOG(ERROR) << "gpu::CollectGraphicsInfo failed (fatal).";
- // TODO(piman): can we signal overall failure?
- break;
- case gpu::kCollectInfoNonFatalFailure:
- DVLOG(1) << "gpu::CollectGraphicsInfo failed (non-fatal).";
- break;
- case gpu::kCollectInfoNone:
- NOTREACHED();
- break;
- case gpu::kCollectInfoSuccess:
- break;
- }
- GetContentClient()->SetGpuInfo(gpu_info_);
- }
-#endif
-
-#if defined(OS_WIN)
- // GPU full info collection should only happen on un-sandboxed GPU process
- // or single process/in-process gpu mode on Windows.
- base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
- DCHECK(command_line->HasSwitch(switches::kDisableGpuSandbox) ||
- in_browser_process_);
-
- // This is slow, but it's the only thing the unsandboxed GPU process does,
- // and GpuDataManager prevents us from sending multiple collecting requests,
- // so it's OK to be blocking.
- gpu::GetDxDiagnostics(&gpu_info_.dx_diagnostics);
- gpu_info_.dx_diagnostics_info_state = gpu::kCollectInfoSuccess;
-#endif // OS_WIN
-
- Send(new GpuHostMsg_GraphicsInfoCollected(gpu_info_));
-
-#if defined(OS_WIN)
- if (!in_browser_process_) {
- // The unsandboxed GPU process fulfilled its duty. Rest in peace.
- base::MessageLoop::current()->QuitWhenIdle();
- }
-#endif // OS_WIN
-}
-
void GpuChildThread::OnGpuSwitched() {
DVLOG(1) << "GPU: GPU has switched";
// Notify observers in the GPU process.

Powered by Google App Engine
This is Rietveld 408576698