| 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/renderer/render_thread_impl.h" | 5 #include "content/renderer/render_thread_impl.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <limits> | 8 #include <limits> |
| 9 #include <map> | 9 #include <map> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 1116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1127 scoped_refptr<base::MessageLoopProxy> RenderThreadImpl::GetIOLoopProxy() { | 1127 scoped_refptr<base::MessageLoopProxy> RenderThreadImpl::GetIOLoopProxy() { |
| 1128 return io_message_loop_proxy_; | 1128 return io_message_loop_proxy_; |
| 1129 } | 1129 } |
| 1130 | 1130 |
| 1131 scoped_ptr<base::SharedMemory> RenderThreadImpl::AllocateSharedMemory( | 1131 scoped_ptr<base::SharedMemory> RenderThreadImpl::AllocateSharedMemory( |
| 1132 size_t size) { | 1132 size_t size) { |
| 1133 return scoped_ptr<base::SharedMemory>( | 1133 return scoped_ptr<base::SharedMemory>( |
| 1134 HostAllocateSharedMemoryBuffer(size)); | 1134 HostAllocateSharedMemoryBuffer(size)); |
| 1135 } | 1135 } |
| 1136 | 1136 |
| 1137 bool RenderThreadImpl::CreateViewCommandBuffer( | 1137 CreateCommandBufferResult RenderThreadImpl::CreateViewCommandBuffer( |
| 1138 int32 surface_id, | 1138 int32 surface_id, |
| 1139 const GPUCreateCommandBufferConfig& init_params, | 1139 const GPUCreateCommandBufferConfig& init_params, |
| 1140 int32 route_id) { | 1140 int32 route_id) { |
| 1141 TRACE_EVENT1("gpu", | 1141 TRACE_EVENT1("gpu", |
| 1142 "RenderThreadImpl::CreateViewCommandBuffer", | 1142 "RenderThreadImpl::CreateViewCommandBuffer", |
| 1143 "surface_id", | 1143 "surface_id", |
| 1144 surface_id); | 1144 surface_id); |
| 1145 | 1145 |
| 1146 bool succeeded = false; | 1146 CreateCommandBufferResult result; |
| 1147 IPC::Message* message = new GpuHostMsg_CreateViewCommandBuffer( | 1147 IPC::Message* message = new GpuHostMsg_CreateViewCommandBuffer( |
| 1148 surface_id, | 1148 surface_id, |
| 1149 init_params, | 1149 init_params, |
| 1150 route_id, | 1150 route_id, |
| 1151 &succeeded); | 1151 &result); |
| 1152 | 1152 |
| 1153 // Allow calling this from the compositor thread. | 1153 // Allow calling this from the compositor thread. |
| 1154 thread_safe_sender()->Send(message); | 1154 thread_safe_sender()->Send(message); |
| 1155 | 1155 |
| 1156 return succeeded; | 1156 return result; |
| 1157 } | 1157 } |
| 1158 | 1158 |
| 1159 void RenderThreadImpl::CreateImage( | 1159 void RenderThreadImpl::CreateImage( |
| 1160 gfx::PluginWindowHandle window, | 1160 gfx::PluginWindowHandle window, |
| 1161 int32 image_id, | 1161 int32 image_id, |
| 1162 const CreateImageCallback& callback) { | 1162 const CreateImageCallback& callback) { |
| 1163 NOTREACHED(); | 1163 NOTREACHED(); |
| 1164 } | 1164 } |
| 1165 | 1165 |
| 1166 void RenderThreadImpl::DeleteImage(int32 image_id, int32 sync_point) { | 1166 void RenderThreadImpl::DeleteImage(int32 image_id, int32 sync_point) { |
| (...skipping 370 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1537 hidden_widget_count_--; | 1537 hidden_widget_count_--; |
| 1538 | 1538 |
| 1539 if (!GetContentClient()->renderer()->RunIdleHandlerWhenWidgetsHidden()) { | 1539 if (!GetContentClient()->renderer()->RunIdleHandlerWhenWidgetsHidden()) { |
| 1540 return; | 1540 return; |
| 1541 } | 1541 } |
| 1542 | 1542 |
| 1543 ScheduleIdleHandler(kLongIdleHandlerDelayMs); | 1543 ScheduleIdleHandler(kLongIdleHandlerDelayMs); |
| 1544 } | 1544 } |
| 1545 | 1545 |
| 1546 } // namespace content | 1546 } // namespace content |
| OLD | NEW |