Chromium Code Reviews| Index: content/renderer/render_process_impl.cc |
| =================================================================== |
| --- content/renderer/render_process_impl.cc (revision 200602) |
| +++ content/renderer/render_process_impl.cc (working copy) |
| @@ -113,12 +113,8 @@ |
| // Platform specific code for dealing with bitmap transport... |
| TransportDIB* RenderProcessImpl::CreateTransportDIB(size_t size) { |
| -#if defined(OS_WIN) || defined(OS_LINUX) || \ |
| - defined(OS_OPENBSD) || defined(OS_ANDROID) |
| - // Windows and Linux create transport DIBs inside the renderer |
| - return TransportDIB::Create(size, transport_dib_next_sequence_number_++); |
| -#elif defined(OS_MACOSX) |
| - // Mac creates transport DIBs in the browser, so we need to do a sync IPC to |
| +#if defined(OS_POSIX) && !defined(TOOLKIT_GTK) && !defined(OS_ANDROID) |
| + // POSIX creates transport DIBs in the browser, so we need to do a sync IPC to |
| // get one. The TransportDIB is cached in the browser. |
| TransportDIB::Handle handle; |
| IPC::Message* msg = new ViewHostMsg_AllocTransportDIB(size, true, &handle); |
| @@ -127,15 +123,19 @@ |
| if (handle.fd < 0) |
| return NULL; |
| return TransportDIB::Map(handle); |
| -#endif // defined(OS_MACOSX) |
| +#else |
| + // Windows, legacy GTK and Android create transport DIBs inside the |
| + // renderer. |
| + return TransportDIB::Create(size, transport_dib_next_sequence_number_++); |
|
slavi
2013/05/16 23:15:48
Shouldn't we also map the new dib to match the sem
|
| +#endif |
| } |
| void RenderProcessImpl::FreeTransportDIB(TransportDIB* dib) { |
| if (!dib) |
| return; |
| -#if defined(OS_MACOSX) |
| - // On Mac we need to tell the browser that it can drop a reference to the |
| +#if defined(OS_POSIX) && !defined(TOOLKIT_GTK) && !defined(OS_ANDROID) |
| + // On POSIX we need to tell the browser that it can drop a reference to the |
| // shared memory. |
| IPC::Message* msg = new ViewHostMsg_FreeTransportDIB(dib->id()); |
| main_thread()->Send(msg); |