| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/browser/renderer_host/render_widget_helper.h" | 5 #include "content/browser/renderer_host/render_widget_helper.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
| 9 #include "base/lazy_instance.h" | 9 #include "base/lazy_instance.h" |
| 10 #include "base/posix/eintr_wrapper.h" | 10 #include "base/posix/eintr_wrapper.h" |
| (...skipping 363 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 374 } | 374 } |
| 375 } | 375 } |
| 376 | 376 |
| 377 void RenderWidgetHelper::FreeTransportDIB(TransportDIB::Id dib_id) { | 377 void RenderWidgetHelper::FreeTransportDIB(TransportDIB::Id dib_id) { |
| 378 base::AutoLock locked(allocated_dibs_lock_); | 378 base::AutoLock locked(allocated_dibs_lock_); |
| 379 | 379 |
| 380 const std::map<TransportDIB::Id, int>::iterator | 380 const std::map<TransportDIB::Id, int>::iterator |
| 381 i = allocated_dibs_.find(dib_id); | 381 i = allocated_dibs_.find(dib_id); |
| 382 | 382 |
| 383 if (i != allocated_dibs_.end()) { | 383 if (i != allocated_dibs_.end()) { |
| 384 if (HANDLE_EINTR(close(i->second)) < 0) | 384 if (IGNORE_EINTR(close(i->second)) < 0) |
| 385 PLOG(ERROR) << "close"; | 385 PLOG(ERROR) << "close"; |
| 386 allocated_dibs_.erase(i); | 386 allocated_dibs_.erase(i); |
| 387 } else { | 387 } else { |
| 388 DLOG(WARNING) << "Renderer asked us to free unknown transport DIB"; | 388 DLOG(WARNING) << "Renderer asked us to free unknown transport DIB"; |
| 389 } | 389 } |
| 390 } | 390 } |
| 391 | 391 |
| 392 void RenderWidgetHelper::ClearAllocatedDIBs() { | 392 void RenderWidgetHelper::ClearAllocatedDIBs() { |
| 393 for (std::map<TransportDIB::Id, int>::iterator | 393 for (std::map<TransportDIB::Id, int>::iterator |
| 394 i = allocated_dibs_.begin(); i != allocated_dibs_.end(); ++i) { | 394 i = allocated_dibs_.begin(); i != allocated_dibs_.end(); ++i) { |
| 395 if (HANDLE_EINTR(close(i->second)) < 0) | 395 if (IGNORE_EINTR(close(i->second)) < 0) |
| 396 PLOG(ERROR) << "close: " << i->first; | 396 PLOG(ERROR) << "close: " << i->first; |
| 397 } | 397 } |
| 398 | 398 |
| 399 allocated_dibs_.clear(); | 399 allocated_dibs_.clear(); |
| 400 } | 400 } |
| 401 #endif | 401 #endif |
| 402 | 402 |
| 403 } // namespace content | 403 } // namespace content |
| OLD | NEW |