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/browser/renderer_host/render_widget_host_impl.h" | 5 #include "content/browser/renderer_host/render_widget_host_impl.h" |
6 | 6 |
7 #include <math.h> | 7 #include <math.h> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/auto_reset.h" | 10 #include "base/auto_reset.h" |
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
219 RenderWidgetHost* RenderWidgetHost::FromID( | 219 RenderWidgetHost* RenderWidgetHost::FromID( |
220 int32 process_id, | 220 int32 process_id, |
221 int32 routing_id) { | 221 int32 routing_id) { |
222 return RenderWidgetHostImpl::FromID(process_id, routing_id); | 222 return RenderWidgetHostImpl::FromID(process_id, routing_id); |
223 } | 223 } |
224 | 224 |
225 // static | 225 // static |
226 RenderWidgetHostImpl* RenderWidgetHostImpl::FromID( | 226 RenderWidgetHostImpl* RenderWidgetHostImpl::FromID( |
227 int32 process_id, | 227 int32 process_id, |
228 int32 routing_id) { | 228 int32 routing_id) { |
| 229 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
229 RoutingIDWidgetMap* widgets = g_routing_id_widget_map.Pointer(); | 230 RoutingIDWidgetMap* widgets = g_routing_id_widget_map.Pointer(); |
230 RoutingIDWidgetMap::iterator it = widgets->find( | 231 RoutingIDWidgetMap::iterator it = widgets->find( |
231 RenderWidgetHostID(process_id, routing_id)); | 232 RenderWidgetHostID(process_id, routing_id)); |
232 return it == widgets->end() ? NULL : it->second; | 233 return it == widgets->end() ? NULL : it->second; |
233 } | 234 } |
234 | 235 |
235 // static | 236 // static |
236 std::vector<RenderWidgetHost*> RenderWidgetHost::GetRenderWidgetHosts() { | 237 std::vector<RenderWidgetHost*> RenderWidgetHost::GetRenderWidgetHosts() { |
237 std::vector<RenderWidgetHost*> hosts; | 238 std::vector<RenderWidgetHost*> hosts; |
238 RoutingIDWidgetMap* widgets = g_routing_id_widget_map.Pointer(); | 239 RoutingIDWidgetMap* widgets = g_routing_id_widget_map.Pointer(); |
(...skipping 2271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2510 int process_id = (b->first.second >> 32) & 0xffffffff; | 2511 int process_id = (b->first.second >> 32) & 0xffffffff; |
2511 RenderWidgetHost* rwh = | 2512 RenderWidgetHost* rwh = |
2512 RenderWidgetHost::FromID(process_id, routing_id); | 2513 RenderWidgetHost::FromID(process_id, routing_id); |
2513 if (!rwh) | 2514 if (!rwh) |
2514 continue; | 2515 continue; |
2515 RenderWidgetHostImpl::From(rwh)->FrameSwapped(latency_info); | 2516 RenderWidgetHostImpl::From(rwh)->FrameSwapped(latency_info); |
2516 } | 2517 } |
2517 } | 2518 } |
2518 | 2519 |
2519 } // namespace content | 2520 } // namespace content |
OLD | NEW |