OLD | NEW |
---|---|
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "content/browser/android/in_process/context_provider_in_process.h" | 5 #include "content/browser/android/in_process/context_provider_in_process.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/callback_helpers.h" | 8 #include "base/callback_helpers.h" |
9 #include "base/strings/stringprintf.h" | 9 #include "base/strings/stringprintf.h" |
10 #include "cc/output/managed_memory_policy.h" | 10 #include "cc/output/managed_memory_policy.h" |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
51 const std::string& debug_name) | 51 const std::string& debug_name) |
52 : context3d_(context3d.Pass()), | 52 : context3d_(context3d.Pass()), |
53 destroyed_(false), | 53 destroyed_(false), |
54 debug_name_(debug_name) { | 54 debug_name_(debug_name) { |
55 DCHECK(main_thread_checker_.CalledOnValidThread()); | 55 DCHECK(main_thread_checker_.CalledOnValidThread()); |
56 DCHECK(context3d_); | 56 DCHECK(context3d_); |
57 context_thread_checker_.DetachFromThread(); | 57 context_thread_checker_.DetachFromThread(); |
58 } | 58 } |
59 | 59 |
60 ContextProviderInProcess::~ContextProviderInProcess() { | 60 ContextProviderInProcess::~ContextProviderInProcess() { |
61 DCHECK(main_thread_checker_.CalledOnValidThread() || | |
62 context_thread_checker_.CalledOnValidThread()); | |
63 } | 61 } |
64 | 62 |
65 blink::WebGraphicsContext3D* ContextProviderInProcess::WebContext3D() { | 63 blink::WebGraphicsContext3D* ContextProviderInProcess::WebContext3D() { |
66 DCHECK(lost_context_callback_proxy_); // Is bound to thread. | 64 DCHECK(lost_context_callback_proxy_); // Is bound to thread. |
67 DCHECK(context_thread_checker_.CalledOnValidThread()); | 65 DCHECK(context_thread_checker_.CalledOnValidThread()); |
68 | 66 |
69 return context3d_.get(); | 67 return context3d_.get(); |
70 } | 68 } |
71 | 69 |
72 bool ContextProviderInProcess::BindToCurrentThread() { | 70 bool ContextProviderInProcess::BindToCurrentThread() { |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
201 DCHECK(lost_context_callback_.is_null() || | 199 DCHECK(lost_context_callback_.is_null() || |
202 lost_context_callback.is_null()); | 200 lost_context_callback.is_null()); |
203 lost_context_callback_ = lost_context_callback; | 201 lost_context_callback_ = lost_context_callback; |
204 } | 202 } |
205 | 203 |
206 void ContextProviderInProcess::SetMemoryPolicyChangedCallback( | 204 void ContextProviderInProcess::SetMemoryPolicyChangedCallback( |
207 const MemoryPolicyChangedCallback& memory_policy_changed_callback) { | 205 const MemoryPolicyChangedCallback& memory_policy_changed_callback) { |
208 // There's no memory manager for the in-process implementation. | 206 // There's no memory manager for the in-process implementation. |
209 } | 207 } |
210 | 208 |
209 bool ContextProviderInProcess::HasBeenDestroyed() { | |
210 DCHECK(context_thread_checker_.CalledOnValidThread()); | |
211 return destroyed_; | |
piman
2015/09/04 22:19:13
I think you need to take destroyed_lock_.
| |
212 } | |
213 | |
211 } // namespace content | 214 } // namespace content |
OLD | NEW |