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

Side by Side Diff: content/gpu/gpu_thread.cc

Issue 6708013: Add separate ContentClient interfaces for gpu/plugin/renderer processes. Since we don't have a n... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « content/gpu/content_gpu_client.h ('k') | content/plugin/content_plugin_client.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/gpu/gpu_thread.h" 5 #include "content/gpu/gpu_thread.h"
6 6
7 #include <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "app/gfx/gl/gl_context.h" 10 #include "app/gfx/gl/gl_context.h"
11 #include "app/gfx/gl/gl_implementation.h" 11 #include "app/gfx/gl/gl_implementation.h"
12 #include "app/win/scoped_com_initializer.h" 12 #include "app/win/scoped_com_initializer.h"
13 #include "base/command_line.h" 13 #include "base/command_line.h"
14 #include "base/threading/worker_pool.h" 14 #include "base/threading/worker_pool.h"
15 #include "build/build_config.h" 15 #include "build/build_config.h"
16 #include "content/common/child_process.h" 16 #include "content/common/child_process.h"
17 #include "content/common/content_client.h"
18 #include "content/common/content_switches.h" 17 #include "content/common/content_switches.h"
19 #include "content/common/gpu_messages.h" 18 #include "content/common/gpu_messages.h"
19 #include "content/gpu/content_gpu_client.h"
20 #include "content/gpu/gpu_info_collector.h" 20 #include "content/gpu/gpu_info_collector.h"
21 #include "content/gpu/gpu_watchdog_thread.h" 21 #include "content/gpu/gpu_watchdog_thread.h"
22 #include "ipc/ipc_channel_handle.h" 22 #include "ipc/ipc_channel_handle.h"
23 23
24 #if defined(OS_MACOSX) 24 #if defined(OS_MACOSX)
25 #include "content/common/sandbox_init_wrapper.h" 25 #include "content/common/sandbox_init_wrapper.h"
26 #include "content/common/sandbox_mac.h" 26 #include "content/common/sandbox_mac.h"
27 #elif defined(OS_WIN) 27 #elif defined(OS_WIN)
28 #include "sandbox/src/sandbox.h" 28 #include "sandbox/src/sandbox.h"
29 #endif 29 #endif
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 // Load the GL implementation and locate the bindings before starting the GPU 125 // Load the GL implementation and locate the bindings before starting the GPU
126 // watchdog because this can take a lot of time and the GPU watchdog might 126 // watchdog because this can take a lot of time and the GPU watchdog might
127 // terminate the GPU process. 127 // terminate the GPU process.
128 if (!gfx::GLContext::InitializeOneOff()) { 128 if (!gfx::GLContext::InitializeOneOff()) {
129 LOG(INFO) << "GLContext::InitializeOneOff failed"; 129 LOG(INFO) << "GLContext::InitializeOneOff failed";
130 MessageLoop::current()->Quit(); 130 MessageLoop::current()->Quit();
131 return; 131 return;
132 } 132 }
133 gpu_info_collector::CollectGraphicsInfo(&gpu_info_); 133 gpu_info_collector::CollectGraphicsInfo(&gpu_info_);
134 134
135 content::GetContentClient()->SetGpuInfo(gpu_info_); 135 content::GetContentClient()->gpu()->SetGpuInfo(gpu_info_);
136 LOG(INFO) << "gpu_info_collector::CollectGraphicsInfo complete"; 136 LOG(INFO) << "gpu_info_collector::CollectGraphicsInfo complete";
137 137
138 // Record initialization only after collecting the GPU info because that can 138 // Record initialization only after collecting the GPU info because that can
139 // take a significant amount of time. 139 // take a significant amount of time.
140 gpu_info_.initialization_time = base::Time::Now() - process_start_time_; 140 gpu_info_.initialization_time = base::Time::Now() - process_start_time_;
141 141
142 #if defined (OS_MACOSX) 142 #if defined (OS_MACOSX)
143 // Note that kNoSandbox will also disable the GPU sandbox. 143 // Note that kNoSandbox will also disable the GPU sandbox.
144 bool no_gpu_sandbox = CommandLine::ForCurrentProcess()->HasSwitch( 144 bool no_gpu_sandbox = CommandLine::ForCurrentProcess()->HasSwitch(
145 switches::kNoGpuSandbox); 145 switches::kNoGpuSandbox);
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after
337 337
338 // Runs on the GPU thread. 338 // Runs on the GPU thread.
339 void GpuThread::SetDxDiagnostics(GpuThread* thread, const DxDiagNode& node) { 339 void GpuThread::SetDxDiagnostics(GpuThread* thread, const DxDiagNode& node) {
340 thread->gpu_info_.dx_diagnostics = node; 340 thread->gpu_info_.dx_diagnostics = node;
341 thread->gpu_info_.finalized = true; 341 thread->gpu_info_.finalized = true;
342 thread->collecting_dx_diagnostics_ = false; 342 thread->collecting_dx_diagnostics_ = false;
343 thread->Send(new GpuHostMsg_GraphicsInfoCollected(thread->gpu_info_)); 343 thread->Send(new GpuHostMsg_GraphicsInfoCollected(thread->gpu_info_));
344 } 344 }
345 345
346 #endif 346 #endif
OLDNEW
« no previous file with comments | « content/gpu/content_gpu_client.h ('k') | content/plugin/content_plugin_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698