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

Unified Diff: components/mus/ws/server_window_surface.cc

Issue 1640253003: Makes resolving ids work correctly in new world (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: merge to trunk Created 4 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « components/mus/ws/server_window_delegate.h ('k') | components/mus/ws/test_server_window_delegate.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/mus/ws/server_window_surface.cc
diff --git a/components/mus/ws/server_window_surface.cc b/components/mus/ws/server_window_surface.cc
index 61208c15ceb53f5d9fb56478d93ee517abf5992a..9c836c9e478683f7aa0ce45219d02df9b59802d4 100644
--- a/components/mus/ws/server_window_surface.cc
+++ b/components/mus/ws/server_window_surface.cc
@@ -99,13 +99,15 @@ bool ServerWindowSurface::ConvertSurfaceDrawQuad(
const mojom::CompositorFrameMetadataPtr& metadata,
cc::SharedQuadState* sqs,
cc::RenderPass* render_pass) {
- Id id = static_cast<Id>(
+ // Surface ids originate from the client, meaning they are ClientWindowIds
+ // and can only be resolved by the client that submitted the frame.
+ const ClientWindowId other_client_window_id(
input->surface_quad_state->surface.To<cc::SurfaceId>().id);
- // TODO(sky): this is now wrong, needs mapping from client to window.
- WindowId other_window_id = WindowIdFromTransportId(id);
- ServerWindow* other_window = window()->GetChildWindow(other_window_id);
+ ServerWindow* other_window = window()->delegate()->FindWindowForSurface(
+ window(), mojom::SurfaceType::DEFAULT, other_client_window_id);
if (!other_window) {
- DVLOG(2) << "The window ID '" << id << "' does not exist.";
+ DVLOG(2) << "The window ID '" << other_client_window_id.id
+ << "' does not exist.";
// TODO(fsamuel): We return true here so that the CompositorFrame isn't
// entirely rejected. We just drop this SurfaceDrawQuad. This failure
// can happen if the client has an out of date view of the window tree.
@@ -113,7 +115,7 @@ bool ServerWindowSurface::ConvertSurfaceDrawQuad(
return true;
}
- referenced_window_ids_.insert(other_window_id);
+ referenced_window_ids_.insert(other_window->id());
ServerWindowSurface* default_surface =
other_window->GetOrCreateSurfaceManager()->GetDefaultSurface();
« no previous file with comments | « components/mus/ws/server_window_delegate.h ('k') | components/mus/ws/test_server_window_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698