| Index: content/browser/android/in_process/context_provider_in_process.cc
|
| diff --git a/content/browser/android/in_process/context_provider_in_process.cc b/content/browser/android/in_process/context_provider_in_process.cc
|
| index 5fea00f2502b594bdd22517e2b25933d30095223..9ab0f8636f16b646eb1f99eb5141959079c97189 100644
|
| --- a/content/browser/android/in_process/context_provider_in_process.cc
|
| +++ b/content/browser/android/in_process/context_provider_in_process.cc
|
| @@ -49,17 +49,13 @@ scoped_refptr<ContextProviderInProcess> ContextProviderInProcess::Create(
|
| ContextProviderInProcess::ContextProviderInProcess(
|
| scoped_ptr<WebGraphicsContext3DInProcessCommandBufferImpl> context3d,
|
| const std::string& debug_name)
|
| - : context3d_(context3d.Pass()),
|
| - destroyed_(false),
|
| - debug_name_(debug_name) {
|
| + : context3d_(context3d.Pass()), lost_(false), debug_name_(debug_name) {
|
| DCHECK(main_thread_checker_.CalledOnValidThread());
|
| DCHECK(context3d_);
|
| context_thread_checker_.DetachFromThread();
|
| }
|
|
|
| ContextProviderInProcess::~ContextProviderInProcess() {
|
| - DCHECK(main_thread_checker_.CalledOnValidThread() ||
|
| - context_thread_checker_.CalledOnValidThread());
|
| }
|
|
|
| blink::WebGraphicsContext3D* ContextProviderInProcess::WebContext3D() {
|
| @@ -177,10 +173,10 @@ void ContextProviderInProcess::DeleteCachedResources() {
|
| void ContextProviderInProcess::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())
|
| base::ResetAndReturn(&lost_context_callback_).Run();
|
| @@ -188,11 +184,11 @@ void ContextProviderInProcess::OnLostContext() {
|
| gr_context_->OnLostContext();
|
| }
|
|
|
| -bool ContextProviderInProcess::DestroyedOnMainThread() {
|
| +bool ContextProviderInProcess::HasBeenLostOnMainThread() {
|
| DCHECK(main_thread_checker_.CalledOnValidThread());
|
|
|
| - base::AutoLock lock(destroyed_lock_);
|
| - return destroyed_;
|
| + base::AutoLock lock(lost_lock_);
|
| + return lost_;
|
| }
|
|
|
| void ContextProviderInProcess::SetLostContextCallback(
|
| @@ -208,4 +204,9 @@ void ContextProviderInProcess::SetMemoryPolicyChangedCallback(
|
| // There's no memory manager for the in-process implementation.
|
| }
|
|
|
| +bool ContextProviderInProcess::HasBeenDestroyed() {
|
| + DCHECK(context_thread_checker_.CalledOnValidThread());
|
| + return false;
|
| +}
|
| +
|
| } // namespace content
|
|
|