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

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

Issue 1996783002: Make cc::SurfaceId unguessable (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed Ben's comment Created 4 years, 6 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
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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_input_event_router.h" 5 #include "content/browser/renderer_host/render_widget_host_input_event_router.h"
6 6
7 #include "base/debug/dump_without_crashing.h" 7 #include "base/debug/dump_without_crashing.h"
8 #include "cc/quads/surface_draw_quad.h" 8 #include "cc/quads/surface_draw_quad.h"
9 #include "cc/surfaces/surface_id_allocator.h" 9 #include "cc/surfaces/surface_id_allocator.h"
10 #include "cc/surfaces/surface_manager.h" 10 #include "cc/surfaces/surface_manager.h"
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after
266 266
267 void RenderWidgetHostInputEventRouter::RemoveSurfaceIdNamespaceOwner( 267 void RenderWidgetHostInputEventRouter::RemoveSurfaceIdNamespaceOwner(
268 uint32_t id) { 268 uint32_t id) {
269 auto it_to_remove = owner_map_.find(id); 269 auto it_to_remove = owner_map_.find(id);
270 if (it_to_remove != owner_map_.end()) { 270 if (it_to_remove != owner_map_.end()) {
271 it_to_remove->second->RemoveObserver(this); 271 it_to_remove->second->RemoveObserver(this);
272 owner_map_.erase(it_to_remove); 272 owner_map_.erase(it_to_remove);
273 } 273 }
274 274
275 for (auto it = hittest_data_.begin(); it != hittest_data_.end();) { 275 for (auto it = hittest_data_.begin(); it != hittest_data_.end();) {
276 if (cc::SurfaceIdAllocator::NamespaceForId(it->first) == id) 276 if (it->first.id_namespace() == id)
277 it = hittest_data_.erase(it); 277 it = hittest_data_.erase(it);
278 else 278 else
279 ++it; 279 ++it;
280 } 280 }
281 } 281 }
282 282
283 void RenderWidgetHostInputEventRouter::OnHittestData( 283 void RenderWidgetHostInputEventRouter::OnHittestData(
284 const FrameHostMsg_HittestData_Params& params) { 284 const FrameHostMsg_HittestData_Params& params) {
285 if (owner_map_.find(cc::SurfaceIdAllocator::NamespaceForId( 285 if (owner_map_.find(params.surface_id.id_namespace()) == owner_map_.end()) {
286 params.surface_id)) == owner_map_.end()) {
287 return; 286 return;
288 } 287 }
289 HittestData data; 288 HittestData data;
290 data.ignored_for_hittest = params.ignored_for_hittest; 289 data.ignored_for_hittest = params.ignored_for_hittest;
291 hittest_data_[params.surface_id] = data; 290 hittest_data_[params.surface_id] = data;
292 } 291 }
293 292
294 } // namespace content 293 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698