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 "ui/compositor/test/in_process_context_provider.h" | 5 #include "ui/compositor/test/in_process_context_provider.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/lazy_instance.h" | 9 #include "base/lazy_instance.h" |
10 #include "base/strings/stringprintf.h" | 10 #include "base/strings/stringprintf.h" |
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
205 | 205 |
206 base::AutoLock lock(destroyed_lock_); | 206 base::AutoLock lock(destroyed_lock_); |
207 return destroyed_; | 207 return destroyed_; |
208 } | 208 } |
209 | 209 |
210 void InProcessContextProvider::SetLostContextCallback( | 210 void InProcessContextProvider::SetLostContextCallback( |
211 const LostContextCallback& lost_context_callback) { | 211 const LostContextCallback& lost_context_callback) { |
212 lost_context_callback_ = lost_context_callback; | 212 lost_context_callback_ = lost_context_callback; |
213 } | 213 } |
214 | 214 |
215 void InProcessContextProvider::SetMemoryPolicyChangedCallback( | |
216 const MemoryPolicyChangedCallback& memory_policy_changed_callback) { | |
217 // There's no memory manager for the in-process implementation. | |
218 } | |
219 | |
220 void InProcessContextProvider::OnLostContext() { | 215 void InProcessContextProvider::OnLostContext() { |
221 DCHECK(context_thread_checker_.CalledOnValidThread()); | 216 DCHECK(context_thread_checker_.CalledOnValidThread()); |
222 { | 217 { |
223 base::AutoLock lock(destroyed_lock_); | 218 base::AutoLock lock(destroyed_lock_); |
224 if (destroyed_) | 219 if (destroyed_) |
225 return; | 220 return; |
226 destroyed_ = true; | 221 destroyed_ = true; |
227 } | 222 } |
228 if (!lost_context_callback_.is_null()) | 223 if (!lost_context_callback_.is_null()) |
229 base::ResetAndReturn(&lost_context_callback_).Run(); | 224 base::ResetAndReturn(&lost_context_callback_).Run(); |
230 if (gr_context_) | 225 if (gr_context_) |
231 gr_context_->abandonContext(); | 226 gr_context_->abandonContext(); |
232 } | 227 } |
233 | 228 |
234 } // namespace ui | 229 } // namespace ui |
OLD | NEW |