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

Unified Diff: content/gpu/gpu_main.cc

Issue 9401025: Collect GPU info before enabling sandbox. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 years, 10 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/gpu/gpu_child_thread.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/gpu/gpu_main.cc
===================================================================
--- content/gpu/gpu_main.cc (revision 122391)
+++ content/gpu/gpu_main.cc (working copy)
@@ -15,9 +15,11 @@
#include "base/win/scoped_com_initializer.h"
#include "build/build_config.h"
#include "content/common/gpu/gpu_config.h"
+#include "content/public/common/content_client.h"
#include "content/public/common/content_switches.h"
#include "content/public/common/main_function_params.h"
#include "content/gpu/gpu_child_thread.h"
+#include "content/gpu/gpu_info_collector.h"
#include "content/gpu/gpu_process.h"
#include "ui/gfx/gl/gl_surface.h"
#include "ui/gfx/gl/gl_switches.h"
@@ -71,10 +73,17 @@
// GpuMsg_Initialize message from the browser.
bool dead_on_arrival = false;
- // Load the GL implementation and locate the bindings before starting the GPU
- // watchdog because this can take a lot of time and the GPU watchdog might
- // terminate the GPU process.
- if (!gfx::GLSurface::InitializeOneOff()) {
+ // Load and initialize the GL implementation and locate the GL entry points.
+ content::GPUInfo gpu_info;
+ if (gfx::GLSurface::InitializeOneOff()) {
+ // Collect information about the GPU.
+ if (!gpu_info_collector::CollectGraphicsInfo(&gpu_info)) {
+ LOG(INFO) << "gpu_info_collector::CollectGraphicsInfo failed";
+ }
+
+ // Set the GPU info even if it failed.
+ content::GetContentClient()->SetGpuInfo(gpu_info);
+ } else {
LOG(INFO) << "gfx::GLSurface::InitializeOneOff failed";
dead_on_arrival = true;
}
@@ -114,7 +123,7 @@
GpuProcess gpu_process;
- GpuChildThread* child_thread = new GpuChildThread(dead_on_arrival);
+ GpuChildThread* child_thread = new GpuChildThread(dead_on_arrival, gpu_info);
child_thread->Init(start_time);
« no previous file with comments | « content/gpu/gpu_child_thread.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698