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

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

Issue 2379653006: Replaced cc::SurfaceId::nonce_ with base::UnguessableToken (Closed)
Patch Set: Added static cast to LocalFrameId::hash() to avoid warnings when compiled on Windows Created 4 years, 1 month 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/delegated_frame_host.h" 5 #include "content/browser/renderer_host/delegated_frame_host.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <string> 8 #include <string>
9 #include <utility> 9 #include <utility>
10 #include <vector> 10 #include <vector>
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after
209 209
210 cc::FrameSinkId DelegatedFrameHost::GetFrameSinkId() { 210 cc::FrameSinkId DelegatedFrameHost::GetFrameSinkId() {
211 return frame_sink_id_; 211 return frame_sink_id_;
212 } 212 }
213 213
214 cc::SurfaceId DelegatedFrameHost::SurfaceIdAtPoint( 214 cc::SurfaceId DelegatedFrameHost::SurfaceIdAtPoint(
215 cc::SurfaceHittestDelegate* delegate, 215 cc::SurfaceHittestDelegate* delegate,
216 const gfx::Point& point, 216 const gfx::Point& point,
217 gfx::Point* transformed_point) { 217 gfx::Point* transformed_point) {
218 cc::SurfaceId surface_id(frame_sink_id_, local_frame_id_); 218 cc::SurfaceId surface_id(frame_sink_id_, local_frame_id_);
219 if (surface_id.is_null()) 219 // TODO(staraz): Kludge: The is_null() check is causing tests to fail.
220 // The proper fix is to change it to is_valid which is going to be added in
221 // another CL
222 if (frame_sink_id_.is_null() || local_frame_id_.is_null())
220 return surface_id; 223 return surface_id;
221 cc::SurfaceHittest hittest(delegate, GetSurfaceManager()); 224 cc::SurfaceHittest hittest(delegate, GetSurfaceManager());
222 gfx::Transform target_transform; 225 gfx::Transform target_transform;
223 cc::SurfaceId target_local_frame_id = 226 cc::SurfaceId target_local_frame_id =
224 hittest.GetTargetSurfaceAtPoint(surface_id, point, &target_transform); 227 hittest.GetTargetSurfaceAtPoint(surface_id, point, &target_transform);
225 *transformed_point = point; 228 *transformed_point = point;
226 if (!target_local_frame_id.is_null()) 229 if (!target_local_frame_id.is_null())
227 target_transform.TransformPoint(transformed_point); 230 target_transform.TransformPoint(transformed_point);
228 return target_local_frame_id; 231 return target_local_frame_id;
229 } 232 }
(...skipping 653 matching lines...) Expand 10 before | Expand all | Expand 10 after
883 std::move(request)); 886 std::move(request));
884 } 887 }
885 } 888 }
886 889
887 void DelegatedFrameHost::UnlockResources() { 890 void DelegatedFrameHost::UnlockResources() {
888 DCHECK(!local_frame_id_.is_null()); 891 DCHECK(!local_frame_id_.is_null());
889 delegated_frame_evictor_->UnlockFrame(); 892 delegated_frame_evictor_->UnlockFrame();
890 } 893 }
891 894
892 } // namespace content 895 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698