summaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
authordcastagna <dcastagna@chromium.org>2015-10-21 16:28:55 -0700
committerCommit bot <commit-bot@chromium.org>2015-10-21 23:30:44 +0000
commit9a266c3df43597fa469b8004430c79a69ba277aa (patch)
treee799ffb6487d8c639343723b39a0e7dd45a3fb88 /ui
parent2c8c2879553dea07b8d9c2b05655e7ae58aeab04 (diff)
downloadchromium_src-9a266c3df43597fa469b8004430c79a69ba277aa.zip
chromium_src-9a266c3df43597fa469b8004430c79a69ba277aa.tar.gz
chromium_src-9a266c3df43597fa469b8004430c79a69ba277aa.tar.bz2
Remove ContextProvider::DestroyedOnMainThread.
ContextProvider::DestroyedOnMainThread was used on the main thread to check when a context bound to different thread had been destroyed. After crrev.com/1369843002, the only place where DestroyedOnMainThread is called is on the shared main thread context, that is already bound to the main thread. DestroyedOnMainThread and the lock used to protect |destroyed| are no longer needed. BUG=544547 CQ_INCLUDE_TRYBOTS=tryserver.blink:linux_blink_rel Review URL: https://codereview.chromium.org/1406923004 Cr-Commit-Position: refs/heads/master@{#355431}
Diffstat (limited to 'ui')
-rw-r--r--ui/compositor/test/in_process_context_factory.cc5
-rw-r--r--ui/compositor/test/in_process_context_provider.cc16
-rw-r--r--ui/compositor/test/in_process_context_provider.h4
3 files changed, 4 insertions, 21 deletions
diff --git a/ui/compositor/test/in_process_context_factory.cc b/ui/compositor/test/in_process_context_factory.cc
index 1d96e01..5d08817 100644
--- a/ui/compositor/test/in_process_context_factory.cc
+++ b/ui/compositor/test/in_process_context_factory.cc
@@ -178,8 +178,9 @@ void InProcessContextFactory::RemoveReflector(Reflector* reflector) {
scoped_refptr<cc::ContextProvider>
InProcessContextFactory::SharedMainThreadContextProvider() {
- if (shared_main_thread_contexts_.get() &&
- !shared_main_thread_contexts_->DestroyedOnMainThread())
+ if (shared_main_thread_contexts_ &&
+ shared_main_thread_contexts_->ContextGL()->GetGraphicsResetStatusKHR() ==
+ GL_NO_ERROR)
return shared_main_thread_contexts_;
shared_main_thread_contexts_ = InProcessContextProvider::CreateOffscreen(
diff --git a/ui/compositor/test/in_process_context_provider.cc b/ui/compositor/test/in_process_context_provider.cc
index 92fbf3a..1588da5 100644
--- a/ui/compositor/test/in_process_context_provider.cc
+++ b/ui/compositor/test/in_process_context_provider.cc
@@ -79,8 +79,7 @@ InProcessContextProvider::InProcessContextProvider(
gpu_memory_buffer_manager_(gpu_memory_buffer_manager),
image_factory_(image_factory),
window_(window),
- debug_name_(debug_name),
- destroyed_(false) {
+ debug_name_(debug_name) {
DCHECK(main_thread_checker_.CalledOnValidThread());
context_thread_checker_.DetachFromThread();
}
@@ -200,13 +199,6 @@ void InProcessContextProvider::DeleteCachedResources() {
}
}
-bool InProcessContextProvider::DestroyedOnMainThread() {
- DCHECK(main_thread_checker_.CalledOnValidThread());
-
- base::AutoLock lock(destroyed_lock_);
- return destroyed_;
-}
-
void InProcessContextProvider::SetLostContextCallback(
const LostContextCallback& lost_context_callback) {
lost_context_callback_ = lost_context_callback;
@@ -214,12 +206,6 @@ void InProcessContextProvider::SetLostContextCallback(
void InProcessContextProvider::OnLostContext() {
DCHECK(context_thread_checker_.CalledOnValidThread());
- {
- base::AutoLock lock(destroyed_lock_);
- if (destroyed_)
- return;
- destroyed_ = true;
- }
if (!lost_context_callback_.is_null())
base::ResetAndReturn(&lost_context_callback_).Run();
if (gr_context_)
diff --git a/ui/compositor/test/in_process_context_provider.h b/ui/compositor/test/in_process_context_provider.h
index b728041..c80fb0f 100644
--- a/ui/compositor/test/in_process_context_provider.h
+++ b/ui/compositor/test/in_process_context_provider.h
@@ -50,7 +50,6 @@ class InProcessContextProvider : public cc::ContextProvider {
base::Lock* GetLock() override;
void VerifyContexts() override;
void DeleteCachedResources() override;
- bool DestroyedOnMainThread() override;
void SetLostContextCallback(
const LostContextCallback& lost_context_callback) override;
@@ -80,9 +79,6 @@ class InProcessContextProvider : public cc::ContextProvider {
LostContextCallback lost_context_callback_;
- base::Lock destroyed_lock_;
- bool destroyed_;
-
base::Lock context_lock_;
DISALLOW_COPY_AND_ASSIGN(InProcessContextProvider);