| 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 // Represents the browser side of the browser <--> renderer communication | 5 // Represents the browser side of the browser <--> renderer communication |
| 6 // channel. There will be one RenderProcessHost per renderer process. | 6 // channel. There will be one RenderProcessHost per renderer process. |
| 7 | 7 |
| 8 #include "content/browser/renderer_host/render_process_host_impl.h" | 8 #include "content/browser/renderer_host/render_process_host_impl.h" |
| 9 | 9 |
| 10 #include <algorithm> | 10 #include <algorithm> |
| (...skipping 1012 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1023 // This is a platform specific function for mapping a transport DIB given its id | 1023 // This is a platform specific function for mapping a transport DIB given its id |
| 1024 TransportDIB* RenderProcessHostImpl::MapTransportDIB( | 1024 TransportDIB* RenderProcessHostImpl::MapTransportDIB( |
| 1025 TransportDIB::Id dib_id) { | 1025 TransportDIB::Id dib_id) { |
| 1026 #if defined(OS_WIN) | 1026 #if defined(OS_WIN) |
| 1027 // On Windows we need to duplicate the handle from the remote process | 1027 // On Windows we need to duplicate the handle from the remote process |
| 1028 HANDLE section; | 1028 HANDLE section; |
| 1029 DuplicateHandle(GetHandle(), dib_id.handle, GetCurrentProcess(), §ion, | 1029 DuplicateHandle(GetHandle(), dib_id.handle, GetCurrentProcess(), §ion, |
| 1030 STANDARD_RIGHTS_REQUIRED | FILE_MAP_READ | FILE_MAP_WRITE, | 1030 STANDARD_RIGHTS_REQUIRED | FILE_MAP_READ | FILE_MAP_WRITE, |
| 1031 FALSE, 0); | 1031 FALSE, 0); |
| 1032 return TransportDIB::Map(section); | 1032 return TransportDIB::Map(section); |
| 1033 #elif defined(OS_ANDROID) || defined(USE_NATIVE_SURFACE_LINUX) |
| 1034 return TransportDIB::Map(dib_id); |
| 1033 #elif defined(TOOLKIT_GTK) || (defined(OS_LINUX) && defined(USE_AURA)) | 1035 #elif defined(TOOLKIT_GTK) || (defined(OS_LINUX) && defined(USE_AURA)) |
| 1034 return TransportDIB::Map(dib_id.shmkey); | 1036 return TransportDIB::Map(dib_id.shmkey); |
| 1035 #elif defined(OS_ANDROID) | |
| 1036 return TransportDIB::Map(dib_id); | |
| 1037 #else | 1037 #else |
| 1038 // On POSIX, the browser allocates all DIBs and keeps a file descriptor around | 1038 // On POSIX, the browser allocates all DIBs and keeps a file descriptor around |
| 1039 // for each. | 1039 // for each. |
| 1040 return widget_helper_->MapTransportDIB(dib_id); | 1040 return widget_helper_->MapTransportDIB(dib_id); |
| 1041 #endif | 1041 #endif |
| 1042 } | 1042 } |
| 1043 | 1043 |
| 1044 TransportDIB* RenderProcessHostImpl::GetTransportDIB( | 1044 TransportDIB* RenderProcessHostImpl::GetTransportDIB( |
| 1045 TransportDIB::Id dib_id) { | 1045 TransportDIB::Id dib_id) { |
| 1046 if (!TransportDIB::is_valid_id(dib_id)) | 1046 if (!TransportDIB::is_valid_id(dib_id)) |
| (...skipping 693 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1740 TRACE_EVENT0("renderer_host", | 1740 TRACE_EVENT0("renderer_host", |
| 1741 "RenderWidgetHostImpl::OnCompositorSurfaceBuffersSwappedNoHost"); | 1741 "RenderWidgetHostImpl::OnCompositorSurfaceBuffersSwappedNoHost"); |
| 1742 AcceleratedSurfaceMsg_BufferPresented_Params ack_params; | 1742 AcceleratedSurfaceMsg_BufferPresented_Params ack_params; |
| 1743 ack_params.sync_point = 0; | 1743 ack_params.sync_point = 0; |
| 1744 RenderWidgetHostImpl::AcknowledgeBufferPresent(route_id, | 1744 RenderWidgetHostImpl::AcknowledgeBufferPresent(route_id, |
| 1745 gpu_process_host_id, | 1745 gpu_process_host_id, |
| 1746 ack_params); | 1746 ack_params); |
| 1747 } | 1747 } |
| 1748 | 1748 |
| 1749 } // namespace content | 1749 } // namespace content |
| OLD | NEW |