summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbacker@chromium.org <backer@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-01-31 20:36:22 +0000
committerbacker@chromium.org <backer@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-01-31 20:36:22 +0000
commite6ff5a31f8298bab997b64adcd06e7694733745c (patch)
tree710f4c30532f4b03a34f3cf376fdfada7012e367
parent3fbdcfdfd3f499ad6336478afd2f62572269a210 (diff)
downloadchromium_src-e6ff5a31f8298bab997b64adcd06e7694733745c.zip
chromium_src-e6ff5a31f8298bab997b64adcd06e7694733745c.tar.gz
chromium_src-e6ff5a31f8298bab997b64adcd06e7694733745c.tar.bz2
Small fixes for GPU process in single process mode.
ChildThread::current() doesn't necessarily refer to the GpuThread in single-process mode. Disabled about:gpu logging for single process mode. BUG=none TEST=by hand Review URL: http://codereview.chromium.org/6312031 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@73183 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/gpu/gpu_channel.cc2
-rw-r--r--chrome/gpu/gpu_thread.cc9
2 files changed, 7 insertions, 4 deletions
diff --git a/chrome/gpu/gpu_channel.cc b/chrome/gpu/gpu_channel.cc
index 5ef74e2..1848a2c 100644
--- a/chrome/gpu/gpu_channel.cc
+++ b/chrome/gpu/gpu_channel.cc
@@ -54,7 +54,7 @@ bool GpuChannel::OnMessageReceived(const IPC::Message& message) {
}
void GpuChannel::OnChannelError() {
- static_cast<GpuThread*>(ChildThread::current())->RemoveChannel(renderer_id_);
+ gpu_thread_->RemoveChannel(renderer_id_);
}
bool GpuChannel::Send(IPC::Message* message) {
diff --git a/chrome/gpu/gpu_thread.cc b/chrome/gpu/gpu_thread.cc
index f9000c5..f9f3341 100644
--- a/chrome/gpu/gpu_thread.cc
+++ b/chrome/gpu/gpu_thread.cc
@@ -93,18 +93,21 @@ bool GpuProcessLogMessageHandler(int severity,
const char* file, int line,
size_t message_start,
const std::string& str) {
- std::string header = str.substr(0,message_start);
+ std::string header = str.substr(0, message_start);
std::string message = str.substr(message_start);
ChildThread::current()->Send(
new GpuHostMsg_OnLogMessage(severity, header, message));
return false;
}
-} // namespace
+} // namespace
void GpuThread::OnInitialize() {
// Redirect LOG messages to the GpuProcessHost
- logging::SetLogMessageHandler(GpuProcessLogMessageHandler);
+ bool single_process = CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kSingleProcess);
+ if (!single_process)
+ logging::SetLogMessageHandler(GpuProcessLogMessageHandler);
// 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