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

Side by Side Diff: content/browser/renderer_host/render_widget_helper.cc

Issue 247263005: Remove TransportDIB methods from RenderProcess(Host) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 8 months 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 | Annotate | Revision Log
OLDNEW
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 325 matching lines...) Expand 10 before | Expand all | Expand 10 after
336 336
337 void RenderWidgetHelper::OnCreateFullscreenWidgetOnUI(int opener_id, 337 void RenderWidgetHelper::OnCreateFullscreenWidgetOnUI(int opener_id,
338 int route_id) { 338 int route_id) {
339 RenderViewHostImpl* host = RenderViewHostImpl::FromID( 339 RenderViewHostImpl* host = RenderViewHostImpl::FromID(
340 render_process_id_, opener_id); 340 render_process_id_, opener_id);
341 if (host) 341 if (host)
342 host->CreateNewFullscreenWidget(route_id); 342 host->CreateNewFullscreenWidget(route_id);
343 } 343 }
344 344
345 #if defined(OS_POSIX) && !defined(OS_ANDROID) 345 #if defined(OS_POSIX) && !defined(OS_ANDROID)
346 TransportDIB* RenderWidgetHelper::MapTransportDIB(TransportDIB::Id dib_id) {
347 base::AutoLock locked(allocated_dibs_lock_);
348
349 const std::map<TransportDIB::Id, int>::iterator
350 i = allocated_dibs_.find(dib_id);
351 if (i == allocated_dibs_.end())
352 return NULL;
353
354 base::FileDescriptor fd(dup(i->second), true);
355 return TransportDIB::Map(fd);
356 }
357
358 void RenderWidgetHelper::AllocTransportDIB(uint32 size, 346 void RenderWidgetHelper::AllocTransportDIB(uint32 size,
359 bool cache_in_browser, 347 bool cache_in_browser,
360 TransportDIB::Handle* result) { 348 TransportDIB::Handle* result) {
361 scoped_ptr<base::SharedMemory> shared_memory(new base::SharedMemory()); 349 scoped_ptr<base::SharedMemory> shared_memory(new base::SharedMemory());
362 if (!shared_memory->CreateAnonymous(size)) { 350 if (!shared_memory->CreateAnonymous(size)) {
363 result->fd = -1; 351 result->fd = -1;
364 result->auto_close = false; 352 result->auto_close = false;
365 return; 353 return;
366 } 354 }
367 355
(...skipping 26 matching lines...) Expand all
394 i = allocated_dibs_.begin(); i != allocated_dibs_.end(); ++i) { 382 i = allocated_dibs_.begin(); i != allocated_dibs_.end(); ++i) {
395 if (IGNORE_EINTR(close(i->second)) < 0) 383 if (IGNORE_EINTR(close(i->second)) < 0)
396 PLOG(ERROR) << "close: " << i->first; 384 PLOG(ERROR) << "close: " << i->first;
397 } 385 }
398 386
399 allocated_dibs_.clear(); 387 allocated_dibs_.clear();
400 } 388 }
401 #endif 389 #endif
402 390
403 } // namespace content 391 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/renderer_host/render_widget_helper.h ('k') | content/public/browser/render_process_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698