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

Unified Diff: android_webview/browser/surfaces_instance.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: android_webview/browser/surfaces_instance.cc
diff --git a/android_webview/browser/surfaces_instance.cc b/android_webview/browser/surfaces_instance.cc
index 23843c01cfc1e8d04f1b77ddca60d87dc5750ccd..f033ee66478e92a0d813a88195ae513cc47ef1f7 100644
--- a/android_webview/browser/surfaces_instance.cc
+++ b/android_webview/browser/surfaces_instance.cc
@@ -86,7 +86,7 @@ SurfacesInstance::~SurfacesInstance() {
g_surfaces_instance = nullptr;
DCHECK(child_ids_.empty());
- if (!root_id_.is_null())
+ if (root_id_.is_valid())
surface_factory_->Destroy(root_id_);
surface_manager_->InvalidateFrameSinkId(frame_sink_id_);
@@ -135,7 +135,7 @@ void SurfacesInstance::DrawAndSwap(const gfx::Size& viewport,
frame.delegated_frame_data = std::move(delegated_frame);
frame.metadata.referenced_surfaces = child_ids_;
- if (root_id_.is_null()) {
+ if (!root_id_.is_valid()) {
root_id_ = surface_id_allocator_->GenerateId();
surface_factory_->Create(root_id_);
display_->SetSurfaceId(cc::SurfaceId(frame_sink_id_, root_id_), 1.f);
@@ -151,7 +151,7 @@ void SurfacesInstance::AddChildId(const cc::SurfaceId& child_id) {
DCHECK(std::find(child_ids_.begin(), child_ids_.end(), child_id) ==
child_ids_.end());
child_ids_.push_back(child_id);
- if (!root_id_.is_null())
+ if (root_id_.is_valid())
SetEmptyRootFrame();
}
@@ -159,7 +159,7 @@ void SurfacesInstance::RemoveChildId(const cc::SurfaceId& child_id) {
auto itr = std::find(child_ids_.begin(), child_ids_.end(), child_id);
DCHECK(itr != child_ids_.end());
child_ids_.erase(itr);
- if (!root_id_.is_null())
+ if (root_id_.is_valid())
SetEmptyRootFrame();
}

Powered by Google App Engine
This is Rietveld 408576698