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

Unified Diff: gpu/command_buffer/client/scoped_visibility_impl.cc

Issue 2252163003: Update Context Client Visibility to use Scoped Pattern (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: cleanup Created 4 years, 4 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: gpu/command_buffer/client/scoped_visibility_impl.cc
diff --git a/gpu/command_buffer/client/scoped_visibility_impl.cc b/gpu/command_buffer/client/scoped_visibility_impl.cc
new file mode 100644
index 0000000000000000000000000000000000000000..a5f0949d998bb3518a90658a9f051f93e9030f47
--- /dev/null
+++ b/gpu/command_buffer/client/scoped_visibility_impl.cc
@@ -0,0 +1,24 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "gpu/command_buffer/client/scoped_visibility_impl.h"
+
+#include "base/logging.h"
+
+namespace gpu {
+
+ScopedVisibilityImpl::ScopedVisibilityImpl(ContextSupport* context_support)
+ : initial_context_support_(context_support), released_(false) {}
+
+ScopedVisibilityImpl::~ScopedVisibilityImpl() {
+ DCHECK(released_);
+}
+
+void ScopedVisibilityImpl::Release(ContextSupport* context_support) {
+ DCHECK(!released_);
+ DCHECK_EQ(initial_context_support_, context_support);
+ released_ = true;
+}
+
+} // namespace gpu

Powered by Google App Engine
This is Rietveld 408576698