| 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 <set> | 8 #include <set> |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 205 // problem, for example by tracking in the RenderWidgetHelper the routing id | 205 // problem, for example by tracking in the RenderWidgetHelper the routing id |
| 206 // (and surface id) that have been created, but whose RWH haven't yet. | 206 // (and surface id) that have been created, but whose RWH haven't yet. |
| 207 surface_id_ = GpuSurfaceTracker::Get()->LookupSurfaceForRenderer( | 207 surface_id_ = GpuSurfaceTracker::Get()->LookupSurfaceForRenderer( |
| 208 process_->GetID(), | 208 process_->GetID(), |
| 209 routing_id_); | 209 routing_id_); |
| 210 DCHECK(surface_id_); | 210 DCHECK(surface_id_); |
| 211 } | 211 } |
| 212 | 212 |
| 213 is_threaded_compositing_enabled_ = IsThreadedCompositingEnabled(); | 213 is_threaded_compositing_enabled_ = IsThreadedCompositingEnabled(); |
| 214 | 214 |
| 215 | 215 std::pair<RoutingIDWidgetMap::iterator, bool> result = |
| 216 g_routing_id_widget_map.Get().insert(std::make_pair( | 216 g_routing_id_widget_map.Get().insert(std::make_pair( |
| 217 RenderWidgetHostID(process->GetID(), routing_id_), this)); | 217 RenderWidgetHostID(process->GetID(), routing_id_), this)); |
| 218 CHECK(result.second) << "Inserting a duplicate item!"; |
| 218 process_->AddRoute(routing_id_, this); | 219 process_->AddRoute(routing_id_, this); |
| 219 | 220 |
| 220 // If we're initially visible, tell the process host that we're alive. | 221 // If we're initially visible, tell the process host that we're alive. |
| 221 // Otherwise we'll notify the process host when we are first shown. | 222 // Otherwise we'll notify the process host when we are first shown. |
| 222 if (!hidden) | 223 if (!hidden) |
| 223 process_->WidgetRestored(); | 224 process_->WidgetRestored(); |
| 224 | 225 |
| 225 accessibility_mode_ = | 226 accessibility_mode_ = |
| 226 BrowserAccessibilityStateImpl::GetInstance()->accessibility_mode(); | 227 BrowserAccessibilityStateImpl::GetInstance()->accessibility_mode(); |
| 227 | 228 |
| (...skipping 2256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2484 continue; | 2485 continue; |
| 2485 } | 2486 } |
| 2486 RenderWidgetHostImpl* rwhi = RenderWidgetHostImpl::From(rwh); | 2487 RenderWidgetHostImpl* rwhi = RenderWidgetHostImpl::From(rwh); |
| 2487 if (rwhi_set.insert(rwhi).second) | 2488 if (rwhi_set.insert(rwhi).second) |
| 2488 rwhi->FrameSwapped(latency_info); | 2489 rwhi->FrameSwapped(latency_info); |
| 2489 } | 2490 } |
| 2490 } | 2491 } |
| 2491 } | 2492 } |
| 2492 | 2493 |
| 2493 } // namespace content | 2494 } // namespace content |
| OLD | NEW |