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

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

Issue 7200033: Fix crashes when loading gles2.cc on browser startup, and during playback. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 9 years, 6 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
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(OS_WIN) 5 #if defined(OS_WIN)
6 #include <windows.h> 6 #include <windows.h>
7 #endif 7 #endif
8 8
9 #include "content/common/gpu/gpu_channel.h" 9 #include "content/common/gpu/gpu_channel.h"
10 10
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after
205 IPC_MESSAGE_HANDLER(GpuChannelMsg_CreateVideoDecoder, 205 IPC_MESSAGE_HANDLER(GpuChannelMsg_CreateVideoDecoder,
206 OnCreateVideoDecoder) 206 OnCreateVideoDecoder)
207 IPC_MESSAGE_HANDLER(GpuChannelMsg_DestroyVideoDecoder, 207 IPC_MESSAGE_HANDLER(GpuChannelMsg_DestroyVideoDecoder,
208 OnDestroyVideoDecoder) 208 OnDestroyVideoDecoder)
209 IPC_MESSAGE_HANDLER(GpuChannelMsg_CreateTransportTexture, 209 IPC_MESSAGE_HANDLER(GpuChannelMsg_CreateTransportTexture,
210 OnCreateTransportTexture) 210 OnCreateTransportTexture)
211 IPC_MESSAGE_HANDLER(GpuChannelMsg_AssignTexturesToVideoDecoder, 211 IPC_MESSAGE_HANDLER(GpuChannelMsg_AssignTexturesToVideoDecoder,
212 OnAssignTexturesToVideoDecoder) 212 OnAssignTexturesToVideoDecoder)
213 IPC_MESSAGE_UNHANDLED(handled = false) 213 IPC_MESSAGE_UNHANDLED(handled = false)
214 IPC_END_MESSAGE_MAP() 214 IPC_END_MESSAGE_MAP()
215 DCHECK(handled); 215 DCHECK(handled) << msg.type();
216 return handled; 216 return handled;
217 } 217 }
218 218
219 int GpuChannel::GenerateRouteID() { 219 int GpuChannel::GenerateRouteID() {
220 static int last_id = 0; 220 static int last_id = 0;
221 return ++last_id; 221 return ++last_id;
222 } 222 }
223 223
224 void GpuChannel::OnInitialize(base::ProcessHandle renderer_process) { 224 void GpuChannel::OnInitialize(base::ProcessHandle renderer_process) {
225 // Initialize should only happen once. 225 // Initialize should only happen once.
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
318 return; 318 return;
319 } 319 }
320 320
321 GpuCommandBufferStub* stub = stubs_.Lookup(command_buffer_route_id); 321 GpuCommandBufferStub* stub = stubs_.Lookup(command_buffer_route_id);
322 // TODO(vrk): Need to notify renderer that given route is invalid. 322 // TODO(vrk): Need to notify renderer that given route is invalid.
323 if (!stub) 323 if (!stub)
324 return; 324 return;
325 325
326 int32 decoder_id = GenerateRouteID(); 326 int32 decoder_id = GenerateRouteID();
327 327
328 // TODO(fischman): this is a BUG. We hand off stub->scheduler()->decoder()
329 // to be baked into the resulting GpuVideoDecodeAccelerator, but we don't own
330 // that GVDA, and we make no attempt to tear it down if/when
331 // stub->scheduler()->decoder() is destroyed. GpuVideoService should be
332 // subsumed into this class and GpuVideoDecodeAccelerator should be owned by
333 // the GpuCommandBufferStub that owns the commandbuffer GVDA is using.
328 bool ret = service->CreateVideoDecoder( 334 bool ret = service->CreateVideoDecoder(
329 this, &router_, decoder_host_id, decoder_id, stub->scheduler()->decoder(), 335 this, &router_, decoder_host_id, decoder_id, stub->scheduler()->decoder(),
330 configs); 336 configs);
331 DCHECK(ret) << "Failed to create a GpuVideoDecodeAccelerator"; 337 DCHECK(ret) << "Failed to create a GpuVideoDecodeAccelerator";
332 } 338 }
333 339
334 void GpuChannel::OnDestroyVideoDecoder(int32 decoder_id) { 340 void GpuChannel::OnDestroyVideoDecoder(int32 decoder_id) {
335 #if defined(ENABLE_GPU) 341 #if defined(ENABLE_GPU)
336 LOG(ERROR) << "GpuChannel::OnDestroyVideoDecoder"; 342 LOG(ERROR) << "GpuChannel::OnDestroyVideoDecoder";
337 GpuVideoService* service = GpuVideoService::GetInstance(); 343 GpuVideoService* service = GpuVideoService::GetInstance();
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
393 399
394 #if defined(OS_POSIX) 400 #if defined(OS_POSIX)
395 int GpuChannel::GetRendererFileDescriptor() { 401 int GpuChannel::GetRendererFileDescriptor() {
396 int fd = -1; 402 int fd = -1;
397 if (channel_.get()) { 403 if (channel_.get()) {
398 fd = channel_->GetClientFileDescriptor(); 404 fd = channel_->GetClientFileDescriptor();
399 } 405 }
400 return fd; 406 return fd;
401 } 407 }
402 #endif // defined(OS_POSIX) 408 #endif // defined(OS_POSIX)
OLDNEW
« no previous file with comments | « no previous file | content/common/gpu/media/gles2_texture_to_egl_image_translator.cc » ('j') | ppapi/examples/gles2/gles2.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698