OLD | NEW |
---|---|
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 "chrome/browser/renderer_host/render_widget_helper.h" | 5 #include "chrome/browser/renderer_host/render_widget_helper.h" |
6 | 6 |
7 #include "base/eintr_wrapper.h" | 7 #include "base/eintr_wrapper.h" |
8 #include "base/thread.h" | 8 #include "base/thread.h" |
9 #include "chrome/browser/chrome_thread.h" | 9 #include "chrome/browser/chrome_thread.h" |
10 #include "chrome/browser/renderer_host/render_process_host.h" | 10 #include "chrome/browser/renderer_host/render_process_host.h" |
(...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
289 } | 289 } |
290 } | 290 } |
291 | 291 |
292 void RenderWidgetHelper::FreeTransportDIB(TransportDIB::Id dib_id) { | 292 void RenderWidgetHelper::FreeTransportDIB(TransportDIB::Id dib_id) { |
293 AutoLock locked(allocated_dibs_lock_); | 293 AutoLock locked(allocated_dibs_lock_); |
294 | 294 |
295 const std::map<TransportDIB::Id, int>::iterator | 295 const std::map<TransportDIB::Id, int>::iterator |
296 i = allocated_dibs_.find(dib_id); | 296 i = allocated_dibs_.find(dib_id); |
297 | 297 |
298 if (i != allocated_dibs_.end()) { | 298 if (i != allocated_dibs_.end()) { |
299 HANDLE_EINTR(close(i->second)); | 299 if (HANDLE_EINTR(close(i->second)) < 0) |
300 PLOG(ERROR) << "close"; | |
300 allocated_dibs_.erase(i); | 301 allocated_dibs_.erase(i); |
301 } else { | 302 } else { |
302 DLOG(WARNING) << "Renderer asked us to free unknown transport DIB"; | 303 DLOG(WARNING) << "Renderer asked us to free unknown transport DIB"; |
303 } | 304 } |
304 } | 305 } |
305 | 306 |
306 void RenderWidgetHelper::ClearAllocatedDIBs() { | 307 void RenderWidgetHelper::ClearAllocatedDIBs() { |
307 for (std::map<TransportDIB::Id, int>::iterator | 308 for (std::map<TransportDIB::Id, int>::iterator |
308 i = allocated_dibs_.begin(); i != allocated_dibs_.end(); ++i) { | 309 i = allocated_dibs_.begin(); i != allocated_dibs_.end(); ++i) { |
309 HANDLE_EINTR(close(i->second)); | 310 if (HANDLE_EINTR(close(i->second)) < 0) |
311 PLOG(ERROR) << "close: " << i->first; | |
Evan Martin
2010/06/22 23:10:00
i->first or i->second here? maybe make it clear i
| |
310 } | 312 } |
311 | 313 |
312 allocated_dibs_.clear(); | 314 allocated_dibs_.clear(); |
313 } | 315 } |
314 #endif | 316 #endif |
OLD | NEW |