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

Unified Diff: services/ui/public/cpp/window.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 | « services/ui/public/cpp/window.h ('k') | services/ui/public/cpp/window_private.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: services/ui/public/cpp/window.cc
diff --git a/services/ui/public/cpp/window.cc b/services/ui/public/cpp/window.cc
index 80778029c0f8fb9aa85d7bfde137f0bf486b1426..828967cacf0f3bdb66ebddbee2c7ee0ba9828c09 100644
--- a/services/ui/public/cpp/window.cc
+++ b/services/ui/public/cpp/window.cc
@@ -544,8 +544,8 @@ Window::~Window() {
transient_parent_->LocalRemoveTransientWindow(this);
// Return the surface reference if there is one.
- if (surface_info_)
- LocalSetSurfaceId(nullptr);
+ if (surface_info_.id().is_valid())
+ LocalSetSurfaceInfo(cc::SurfaceInfo());
// Remove transient children.
while (!transient_children_.empty()) {
@@ -809,11 +809,10 @@ void Window::LocalSetSharedProperty(const std::string& name,
observer.OnWindowSharedPropertyChanged(this, name, old_value_ptr, value);
}
-void Window::LocalSetSurfaceId(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 Window::LocalSetSurfaceInfo(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?
@@ -821,9 +820,9 @@ void Window::LocalSetSurfaceId(std::unique_ptr<SurfaceInfo> surface_info) {
}
if (parent_ && parent_->surface_id_handler_) {
parent_->surface_id_handler_->OnChildWindowSurfaceChanged(this,
- &surface_info);
+ surface_info);
}
- surface_info_ = std::move(surface_info);
+ surface_info_ = surface_info;
}
void Window::NotifyWindowStackingChanged() {
« no previous file with comments | « services/ui/public/cpp/window.h ('k') | services/ui/public/cpp/window_private.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698