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

Unified Diff: cc/output/context_provider.h

Issue 1356463002: Revert of cc: Implement shared worker contexts. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 3 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 | « cc/layers/ui_resource_layer_impl_unittest.cc ('k') | cc/output/output_surface.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/output/context_provider.h
diff --git a/cc/output/context_provider.h b/cc/output/context_provider.h
index 47eff203548fd34b12f0bf6c8195140b6598fef5..c024e02328e9a3930b7593e54b986bdff3566ae5 100644
--- a/cc/output/context_provider.h
+++ b/cc/output/context_provider.h
@@ -32,11 +32,11 @@
explicit ScopedContextLock(ContextProvider* context_provider)
: context_provider_(context_provider),
context_lock_(*context_provider_->GetLock()) {
- // Allow current thread to use |context_provider_|.
+ // Allow current thread to bind to |context_provider|.
context_provider_->DetachFromThread();
}
~ScopedContextLock() {
- // Allow usage by thread for which |context_provider_| is bound to.
+ // Allow a different thread to bind to |context_provider|.
context_provider_->DetachFromThread();
}
@@ -51,9 +51,7 @@
// Bind the 3d context to the current thread. This should be called before
// accessing the contexts. Calling it more than once should have no effect.
// Once this function has been called, the class should only be accessed
- // from the same thread unless the function has some explicitly specified
- // rules for access on a different thread. See SetupLockOnMainThread(), which
- // can be used to provide access from multiple threads.
+ // from the same thread.
virtual bool BindToCurrentThread() = 0;
virtual void DetachFromThread() {}
@@ -72,13 +70,11 @@
// See skia GrContext::resetContext for details.
virtual void InvalidateGrContext(uint32_t state) = 0;
- // Sets up a lock so this context can be used from multiple threads. After
- // calling this, all functions without explicit thread usage constraints can
- // be used on any thread while the lock returned by GetLock() is acquired.
+ // Sets up a lock so this context can be used from multiple threads.
virtual void SetupLock() = 0;
// Returns the lock that should be held if using this context from multiple
- // threads. This can be called on any thread.
+ // threads.
virtual base::Lock* GetLock() = 0;
// Returns the capabilities of the currently bound 3d context.
« no previous file with comments | « cc/layers/ui_resource_layer_impl_unittest.cc ('k') | cc/output/output_surface.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698