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

Unified Diff: components/exo/surface.cc

Issue 2425923003: Replaced is_null() with is_valid in SurfaceId and related classes. (Closed)
Patch Set: Removed added printf statements; LocalFrameId::is_valid() no longer checks if nonce is 0. Created 4 years, 2 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
Index: components/exo/surface.cc
diff --git a/components/exo/surface.cc b/components/exo/surface.cc
index 5f22ec6fd64ad5a361039368515743886f0a1530..fe7f25695f62033ef9a9339adc591f13c7d3954d 100644
--- a/components/exo/surface.cc
+++ b/components/exo/surface.cc
@@ -239,7 +239,7 @@ Surface::~Surface() {
for (const auto& frame_callback : active_frame_callbacks_)
frame_callback.Run(base::TimeTicks());
- if (!local_frame_id_.is_null())
+ if (local_frame_id_.is_valid())
factory_owner_->surface_factory_->Destroy(local_frame_id_);
}
@@ -446,7 +446,7 @@ void Surface::Commit() {
}
void Surface::OnLostResources() {
- if (local_frame_id_.is_null())
+ if (!local_frame_id_.is_valid())
return;
UpdateResource(false);
@@ -471,7 +471,7 @@ void Surface::CommitSurfaceHierarchy() {
}
cc::LocalFrameId old_local_frame_id = local_frame_id_;
- if (needs_commit_to_new_surface_ || local_frame_id_.is_null()) {
+ if (needs_commit_to_new_surface_ || !local_frame_id_.is_valid()) {
needs_commit_to_new_surface_ = false;
local_frame_id_ = factory_owner_->id_allocator_->GenerateId();
factory_owner_->surface_factory_->Create(local_frame_id_);
@@ -479,7 +479,7 @@ void Surface::CommitSurfaceHierarchy() {
UpdateSurface(true);
- if (!old_local_frame_id.is_null() && old_local_frame_id != local_frame_id_) {
+ if (old_local_frame_id.is_valid() && old_local_frame_id != local_frame_id_) {
factory_owner_->surface_factory_->SetPreviousFrameSurface(
local_frame_id_, old_local_frame_id);
factory_owner_->surface_factory_->Destroy(old_local_frame_id);
@@ -695,7 +695,7 @@ void Surface::SetSurfaceHierarchyNeedsCommitToNewSurfaces() {
}
void Surface::SetSurfaceLayerContents(ui::Layer* layer) {
- if (local_frame_id_.is_null())
+ if (!local_frame_id_.is_valid())
return;
gfx::Size layer_size = layer->bounds().size();

Powered by Google App Engine
This is Rietveld 408576698