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

Unified Diff: ui/aura/mus/window_port_mus.cc

Issue 2610723002: Unify SurfaceInfo (Closed)
Patch Set: Cleanup offscreen canvas Created 3 years, 12 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 | « ui/aura/mus/window_port_mus.h ('k') | ui/aura/mus/window_tree_client.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/aura/mus/window_port_mus.cc
diff --git a/ui/aura/mus/window_port_mus.cc b/ui/aura/mus/window_port_mus.cc
index 52480e730d8ef10eb5da3ef795f82ebdbcb5d547..305fcfc16b603722063e646d1b5277d4fe8074ba 100644
--- a/ui/aura/mus/window_port_mus.cc
+++ b/ui/aura/mus/window_port_mus.cc
@@ -32,8 +32,8 @@ WindowPortMus::WindowPortMus(WindowTreeClient* client,
: WindowMus(window_mus_type), window_tree_client_(client) {}
WindowPortMus::~WindowPortMus() {
- if (surface_info_)
- SetSurfaceIdFromServer(nullptr);
+ if (surface_info_.id().is_valid())
+ SetSurfaceInfoFromServer(cc::SurfaceInfo());
// DESTROY is only scheduled from DestroyFromServer(), meaning if DESTROY is
// present then the server originated the change.
@@ -244,12 +244,11 @@ void WindowPortMus::SetPropertyFromServer(
property_data);
}
-void WindowPortMus::SetSurfaceIdFromServer(
- std::unique_ptr<SurfaceInfo> surface_info) {
- if (surface_info_) {
- const cc::SurfaceId& existing_surface_id = surface_info_->surface_id;
- cc::SurfaceId new_surface_id =
- surface_info ? surface_info->surface_id : cc::SurfaceId();
+void WindowPortMus::SetSurfaceInfoFromServer(
+ const cc::SurfaceInfo& surface_info) {
+ if (surface_info_.id().is_valid()) {
+ const cc::SurfaceId& existing_surface_id = surface_info_.id();
+ const cc::SurfaceId& new_surface_id = surface_info.id();
if (existing_surface_id.is_valid() &&
existing_surface_id != new_surface_id) {
// TODO(kylechar): Start return reference here?
@@ -258,9 +257,9 @@ void WindowPortMus::SetSurfaceIdFromServer(
WindowPortMus* parent = Get(window_->parent());
if (parent && parent->surface_id_handler_) {
parent->surface_id_handler_->OnChildWindowSurfaceChanged(window_,
- &surface_info);
+ surface_info);
}
- surface_info_ = std::move(surface_info);
+ surface_info_ = surface_info;
}
void WindowPortMus::DestroyFromServer() {
« no previous file with comments | « ui/aura/mus/window_port_mus.h ('k') | ui/aura/mus/window_tree_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698