OLD | NEW |
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/browser/renderer_host/render_widget_helper.h" | 5 #include "content/browser/renderer_host/render_widget_helper.h" |
6 | 6 |
7 #include "base/eintr_wrapper.h" | 7 #include "base/eintr_wrapper.h" |
8 #include "base/threading/thread.h" | 8 #include "base/threading/thread.h" |
9 #include "content/browser/browser_thread.h" | 9 #include "content/browser/browser_thread.h" |
10 #include "content/browser/renderer_host/render_process_host.h" | 10 #include "content/browser/renderer_host/render_process_host.h" |
(...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
326 void RenderWidgetHelper::ClearAllocatedDIBs() { | 326 void RenderWidgetHelper::ClearAllocatedDIBs() { |
327 for (std::map<TransportDIB::Id, int>::iterator | 327 for (std::map<TransportDIB::Id, int>::iterator |
328 i = allocated_dibs_.begin(); i != allocated_dibs_.end(); ++i) { | 328 i = allocated_dibs_.begin(); i != allocated_dibs_.end(); ++i) { |
329 if (HANDLE_EINTR(close(i->second)) < 0) | 329 if (HANDLE_EINTR(close(i->second)) < 0) |
330 PLOG(ERROR) << "close: " << i->first; | 330 PLOG(ERROR) << "close: " << i->first; |
331 } | 331 } |
332 | 332 |
333 allocated_dibs_.clear(); | 333 allocated_dibs_.clear(); |
334 } | 334 } |
335 #endif | 335 #endif |
| 336 |
| 337 void RenderWidgetHelper::SetCompositingSurface( |
| 338 int render_widget_id, |
| 339 gfx::PluginWindowHandle compositing_surface) { |
| 340 base::AutoLock locked(view_compositing_surface_map_lock_); |
| 341 if (compositing_surface != gfx::kNullPluginWindow) |
| 342 view_compositing_surface_map_[render_widget_id] = compositing_surface; |
| 343 else |
| 344 view_compositing_surface_map_.erase(render_widget_id); |
| 345 } |
| 346 |
| 347 gfx::PluginWindowHandle RenderWidgetHelper::LookupCompositingSurface( |
| 348 int render_widget_id) { |
| 349 base::AutoLock locked(view_compositing_surface_map_lock_); |
| 350 ViewCompositingSurfaceMap::iterator it = |
| 351 view_compositing_surface_map_.find(render_widget_id); |
| 352 if (it == view_compositing_surface_map_.end()) |
| 353 return gfx::kNullPluginWindow; |
| 354 |
| 355 return it->second; |
| 356 } |
OLD | NEW |