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

Unified Diff: blimp/client/compositor/blimp_context_provider.cc

Issue 1317743002: cc: Implement shared worker contexts. (v1) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix tear down 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 | « blimp/client/compositor/blimp_context_provider.h ('k') | cc/output/context_provider.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: blimp/client/compositor/blimp_context_provider.cc
diff --git a/blimp/client/compositor/blimp_context_provider.cc b/blimp/client/compositor/blimp_context_provider.cc
index 303d3093995df217a9b45809b4e14193f74edeac..42c29710d566bb48f0dfaf124d20d018ffd96d26 100644
--- a/blimp/client/compositor/blimp_context_provider.cc
+++ b/blimp/client/compositor/blimp_context_provider.cc
@@ -47,7 +47,8 @@ scoped_refptr<BlimpContextProvider> BlimpContextProvider::Create(
return new BlimpContextProvider(widget);
}
-BlimpContextProvider::BlimpContextProvider(gfx::AcceleratedWidget widget) {
+BlimpContextProvider::BlimpContextProvider(gfx::AcceleratedWidget widget)
+ : lost_(false) {
context_thread_checker_.DetachFromThread();
gpu::gles2::ContextCreationAttribHelper attribs_for_gles2;
@@ -72,8 +73,6 @@ BlimpContextProvider::BlimpContextProvider(gfx::AcceleratedWidget widget) {
}
BlimpContextProvider::~BlimpContextProvider() {
- DCHECK(main_thread_checker_.CalledOnValidThread() ||
- context_thread_checker_.CalledOnValidThread());
}
bool BlimpContextProvider::BindToCurrentThread() {
@@ -150,11 +149,11 @@ void BlimpContextProvider::DeleteCachedResources() {
gr_context_->freeGpuResources();
}
-bool BlimpContextProvider::DestroyedOnMainThread() {
+bool BlimpContextProvider::HasBeenLostOnMainThread() {
DCHECK(main_thread_checker_.CalledOnValidThread());
- base::AutoLock lock(destroyed_lock_);
- return destroyed_;
+ base::AutoLock lock(lost_lock_);
+ return lost_;
}
void BlimpContextProvider::SetLostContextCallback(
@@ -173,10 +172,10 @@ void BlimpContextProvider::OnLostContext() {
DCHECK(context_thread_checker_.CalledOnValidThread());
{
- base::AutoLock lock(destroyed_lock_);
- if (destroyed_)
+ base::AutoLock lock(lost_lock_);
+ if (lost_)
return;
- destroyed_ = true;
+ lost_ = true;
}
if (!lost_context_callback_.is_null())
@@ -185,4 +184,9 @@ void BlimpContextProvider::OnLostContext() {
gr_context_->abandonContext();
}
+bool BlimpContextProvider::HasBeenDestroyed() {
+ DCHECK(context_thread_checker_.CalledOnValidThread());
+ return false;
+}
+
} // namespace blimp
« no previous file with comments | « blimp/client/compositor/blimp_context_provider.h ('k') | cc/output/context_provider.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698