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

Side by Side Diff: content/common/np_channel_base.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/np_channel_base.h" 5 #include "content/common/np_channel_base.h"
6 6
7 #include <stack> 7 #include <stack>
8 8
9 #include "base/auto_reset.h" 9 #include "base/auto_reset.h"
10 #include "base/hash_tables.h" 10 #include "base/hash_tables.h"
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 #if defined(OS_POSIX) 124 #if defined(OS_POSIX)
125 // Check the validity of fd for bug investigation. Remove after fixed. 125 // Check the validity of fd for bug investigation. Remove after fixed.
126 // See for details: crbug.com/95129, crbug.com/97285. 126 // See for details: crbug.com/95129, crbug.com/97285.
127 if (mode_ == IPC::Channel::MODE_CLIENT) 127 if (mode_ == IPC::Channel::MODE_CLIENT)
128 CHECK_NE(-1, channel_handle_.socket.fd); 128 CHECK_NE(-1, channel_handle_.socket.fd);
129 #endif 129 #endif
130 130
131 channel_.reset(new IPC::SyncChannel( 131 channel_.reset(new IPC::SyncChannel(
132 channel_handle_, mode_, this, ipc_message_loop, create_pipe_now, 132 channel_handle_, mode_, this, ipc_message_loop, create_pipe_now,
133 shutdown_event)); 133 shutdown_event));
134
135 #if defined(OS_POSIX)
136 // Check the validity of fd for bug investigation. Remove after fixed.
137 // See for details: crbug.com/95129, crbug.com/97285.
138 if (mode_ == IPC::Channel::MODE_SERVER)
ddorwin 2011/12/08 19:17:27 Do we have a separate check that covers the client
xhwang 2011/12/08 19:37:49 This same function is shared by both server and cl
139 CHECK_NE(-1, channel_->GetClientFileDescriptor());
140 #endif
141
134 channel_valid_ = true; 142 channel_valid_ = true;
135 return true; 143 return true;
136 } 144 }
137 145
138 bool NPChannelBase::Send(IPC::Message* message) { 146 bool NPChannelBase::Send(IPC::Message* message) {
139 if (!channel_.get()) { 147 if (!channel_.get()) {
140 delete message; 148 delete message;
141 return false; 149 return false;
142 } 150 }
143 151
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
277 285
278 void NPChannelBase::RemoveMappingForNPObjectStub(int route_id, 286 void NPChannelBase::RemoveMappingForNPObjectStub(int route_id,
279 NPObject* object) { 287 NPObject* object) {
280 DCHECK(object != NULL); 288 DCHECK(object != NULL);
281 stub_map_.erase(object); 289 stub_map_.erase(object);
282 } 290 }
283 291
284 void NPChannelBase::RemoveMappingForNPObjectProxy(int route_id) { 292 void NPChannelBase::RemoveMappingForNPObjectProxy(int route_id) {
285 proxy_map_.erase(route_id); 293 proxy_map_.erase(route_id);
286 } 294 }
OLDNEW
« content/common/gpu/gpu_channel_manager.cc ('K') | « content/common/gpu/gpu_channel_manager.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698