summaryrefslogtreecommitdiffstats
path: root/content/gpu/gpu_main.cc
diff options
context:
space:
mode:
authorapatrick@chromium.org <apatrick@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-02-18 00:30:50 +0000
committerapatrick@chromium.org <apatrick@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-02-18 00:30:50 +0000
commitf09182462bb6c240cf9d6211eed080687c4d5b9c (patch)
treee8151f44003f5eb22b7d9e41f018caeb2285db52 /content/gpu/gpu_main.cc
parent56ff47995a667275343921b55ff816152e6d1e77 (diff)
downloadchromium_src-f09182462bb6c240cf9d6211eed080687c4d5b9c.zip
chromium_src-f09182462bb6c240cf9d6211eed080687c4d5b9c.tar.gz
chromium_src-f09182462bb6c240cf9d6211eed080687c4d5b9c.tar.bz2
Collect GPU info before enabling sandbox.
BUG=112205 Review URL: https://chromiumcodereview.appspot.com/9401025 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@122646 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/gpu/gpu_main.cc')
-rw-r--r--content/gpu/gpu_main.cc19
1 files changed, 14 insertions, 5 deletions
diff --git a/content/gpu/gpu_main.cc b/content/gpu/gpu_main.cc
index b1d6629..49155a31 100644
--- a/content/gpu/gpu_main.cc
+++ b/content/gpu/gpu_main.cc
@@ -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 @@ int GpuMain(const content::MainFunctionParams& parameters) {
// 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 @@ int GpuMain(const content::MainFunctionParams& parameters) {
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);