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

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: Add TODO for clean up later as this change is temporary. 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
« no previous file with comments | « content/common/gpu/gpu_channel.cc ('k') | content/common/np_channel_base.cc » ('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/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 // TODO(xhwang): Added to investigate crbug.com/95732. Clean up after fixed.
84 CHECK(false);
83 channel = iter->second; 85 channel = iter->second;
86 }
84 87
85 DCHECK(channel != NULL); 88 DCHECK(channel != NULL);
86 89
87 if (channel->Init(io_message_loop_, shutdown_event_)) 90 if (channel->Init(io_message_loop_, shutdown_event_))
88 gpu_channels_[renderer_id] = channel; 91 gpu_channels_[renderer_id] = channel;
89 else 92 else
90 channel = NULL; 93 channel = NULL;
91 94
92 if (channel.get()) { 95 if (channel.get()) {
93 channel_handle.name = channel->GetChannelName(); 96 channel_handle.name = channel->GetChannelName();
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
141 void GpuChannelManager::LoseAllContexts() { 144 void GpuChannelManager::LoseAllContexts() {
142 MessageLoop::current()->PostTask( 145 MessageLoop::current()->PostTask(
143 FROM_HERE, 146 FROM_HERE,
144 base::Bind(&GpuChannelManager::OnLoseAllContexts, 147 base::Bind(&GpuChannelManager::OnLoseAllContexts,
145 weak_factory_.GetWeakPtr())); 148 weak_factory_.GetWeakPtr()));
146 } 149 }
147 150
148 void GpuChannelManager::OnLoseAllContexts() { 151 void GpuChannelManager::OnLoseAllContexts() {
149 gpu_channels_.clear(); 152 gpu_channels_.clear();
150 } 153 }
OLDNEW
« no previous file with comments | « content/common/gpu/gpu_channel.cc ('k') | content/common/np_channel_base.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698