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

Side by Side Diff: content/common/gpu/gpu_command_buffer_stub.cc

Issue 8917027: Add IPC to allow gpu process to send message for console back to renderer (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: mock fix Created 9 years 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/common/gpu/gpu_command_buffer_stub.h ('k') | content/common/gpu/gpu_messages.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 #if defined(ENABLE_GPU) 5 #if defined(ENABLE_GPU)
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/debug/trace_event.h" 10 #include "base/debug/trace_event.h"
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after
242 DLOG(ERROR) << "Failed to initialize decoder."; 242 DLOG(ERROR) << "Failed to initialize decoder.";
243 OnInitializeFailed(reply_message); 243 OnInitializeFailed(reply_message);
244 return; 244 return;
245 } 245 }
246 246
247 if (CommandLine::ForCurrentProcess()->HasSwitch( 247 if (CommandLine::ForCurrentProcess()->HasSwitch(
248 switches::kEnableGPUServiceLogging)) { 248 switches::kEnableGPUServiceLogging)) {
249 decoder_->set_debug(true); 249 decoder_->set_debug(true);
250 } 250 }
251 251
252 decoder_->SetMsgCallback(
253 base::Bind(&GpuCommandBufferStub::SendConsoleMessage,
254 base::Unretained(this)));
255
252 SetSwapInterval(); 256 SetSwapInterval();
253 257
254 command_buffer_->SetPutOffsetChangeCallback( 258 command_buffer_->SetPutOffsetChangeCallback(
255 base::Bind(&gpu::GpuScheduler::PutChanged, 259 base::Bind(&gpu::GpuScheduler::PutChanged,
256 base::Unretained(scheduler_.get()))); 260 base::Unretained(scheduler_.get())));
257 command_buffer_->SetGetBufferChangeCallback( 261 command_buffer_->SetGetBufferChangeCallback(
258 base::Bind(&gpu::GpuScheduler::SetGetBuffer, 262 base::Bind(&gpu::GpuScheduler::SetGetBuffer,
259 base::Unretained(scheduler_.get()))); 263 base::Unretained(scheduler_.get())));
260 command_buffer_->SetParseErrorCallback( 264 command_buffer_->SetParseErrorCallback(
261 base::Bind(&GpuCommandBufferStub::OnParseError, base::Unretained(this))); 265 base::Bind(&GpuCommandBufferStub::OnParseError, base::Unretained(this)));
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after
467 471
468 void GpuCommandBufferStub::OnDestroyVideoDecoder(int decoder_route_id) { 472 void GpuCommandBufferStub::OnDestroyVideoDecoder(int decoder_route_id) {
469 channel_->RemoveRoute(decoder_route_id); 473 channel_->RemoveRoute(decoder_route_id);
470 video_decoders_.Remove(decoder_route_id); 474 video_decoders_.Remove(decoder_route_id);
471 } 475 }
472 476
473 void GpuCommandBufferStub::OnSetSurfaceVisible(bool visible) { 477 void GpuCommandBufferStub::OnSetSurfaceVisible(bool visible) {
474 surface_->SetVisible(visible); 478 surface_->SetVisible(visible);
475 } 479 }
476 480
481 void GpuCommandBufferStub::SendConsoleMessage(
482 int32 id,
483 const std::string& message) {
484 GPUCommandBufferConsoleMessage console_message;
485 console_message.id = id;
486 console_message.message = message;
487 IPC::Message* msg = new GpuCommandBufferMsg_ConsoleMsg(
488 route_id_, console_message);
489 msg->set_unblock(true);
490 Send(msg);
491 }
492
477 #endif // defined(ENABLE_GPU) 493 #endif // defined(ENABLE_GPU)
OLDNEW
« no previous file with comments | « content/common/gpu/gpu_command_buffer_stub.h ('k') | content/common/gpu/gpu_messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698