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

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

Issue 8877001: Add more CHECK in GPU and NPAPI process on invalid file descriptors (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: NOTREACHED changed to CHECK(false). Thanks piman! 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
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/common/gpu/gpu_channel_manager.h" 5 #include "content/common/gpu/gpu_channel_manager.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "content/common/child_thread.h" 8 #include "content/common/child_thread.h"
9 #include "content/common/gpu/gpu_channel.h" 9 #include "content/common/gpu/gpu_channel.h"
10 #include "content/common/gpu/gpu_messages.h" 10 #include "content/common/gpu/gpu_messages.h"
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 bool GpuChannelManager::Send(IPC::Message* msg) { 70 bool GpuChannelManager::Send(IPC::Message* msg) {
71 return gpu_child_thread_->Send(msg); 71 return gpu_child_thread_->Send(msg);
72 } 72 }
73 73
74 void GpuChannelManager::OnEstablishChannel(int renderer_id) { 74 void GpuChannelManager::OnEstablishChannel(int renderer_id) {
75 scoped_refptr<GpuChannel> channel; 75 scoped_refptr<GpuChannel> channel;
76 IPC::ChannelHandle channel_handle; 76 IPC::ChannelHandle channel_handle;
77 content::GPUInfo gpu_info; 77 content::GPUInfo gpu_info;
78 78
79 GpuChannelMap::const_iterator iter = gpu_channels_.find(renderer_id); 79 GpuChannelMap::const_iterator iter = gpu_channels_.find(renderer_id);
80 if (iter == gpu_channels_.end()) 80 if (iter == gpu_channels_.end()) {
81 channel = new GpuChannel(this, watchdog_, renderer_id, false); 81 channel = new GpuChannel(this, watchdog_, renderer_id, false);
82 else 82 } else {
83 CHECK(false);
ddorwin 2011/12/08 19:17:27 If this is temporary, there should be a TODO to cl
xhwang 2011/12/08 19:37:49 This should be temporary as I am not confident tha
83 channel = iter->second; 84 channel = iter->second;
85 }
84 86
85 DCHECK(channel != NULL); 87 DCHECK(channel != NULL);
86 88
87 if (channel->Init(io_message_loop_, shutdown_event_)) 89 if (channel->Init(io_message_loop_, shutdown_event_))
88 gpu_channels_[renderer_id] = channel; 90 gpu_channels_[renderer_id] = channel;
89 else 91 else
90 channel = NULL; 92 channel = NULL;
91 93
92 if (channel.get()) { 94 if (channel.get()) {
93 channel_handle.name = channel->GetChannelName(); 95 channel_handle.name = channel->GetChannelName();
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
141 void GpuChannelManager::LoseAllContexts() { 143 void GpuChannelManager::LoseAllContexts() {
142 MessageLoop::current()->PostTask( 144 MessageLoop::current()->PostTask(
143 FROM_HERE, 145 FROM_HERE,
144 base::Bind(&GpuChannelManager::OnLoseAllContexts, 146 base::Bind(&GpuChannelManager::OnLoseAllContexts,
145 weak_factory_.GetWeakPtr())); 147 weak_factory_.GetWeakPtr()));
146 } 148 }
147 149
148 void GpuChannelManager::OnLoseAllContexts() { 150 void GpuChannelManager::OnLoseAllContexts() {
149 gpu_channels_.clear(); 151 gpu_channels_.clear();
150 } 152 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698