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

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

Issue 23471009: Add a DCHECK to RenderWidgetHost::FromID to ensure that it's only called on the UI thread. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: sync to fix at r221724 Created 7 years, 3 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_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
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
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
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698