OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "android_webview/browser/aw_render_thread_context_provider.h" | 5 #include "android_webview/browser/aw_render_thread_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/trace_event/trace_event.h" | 10 #include "base/trace_event/trace_event.h" |
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
174 DCHECK(main_thread_checker_.CalledOnValidThread()); | 174 DCHECK(main_thread_checker_.CalledOnValidThread()); |
175 | 175 |
176 return destroyed_; | 176 return destroyed_; |
177 } | 177 } |
178 | 178 |
179 void AwRenderThreadContextProvider::SetLostContextCallback( | 179 void AwRenderThreadContextProvider::SetLostContextCallback( |
180 const LostContextCallback& lost_context_callback) { | 180 const LostContextCallback& lost_context_callback) { |
181 lost_context_callback_ = lost_context_callback; | 181 lost_context_callback_ = lost_context_callback; |
182 } | 182 } |
183 | 183 |
184 void AwRenderThreadContextProvider::SetMemoryPolicyChangedCallback( | |
185 const MemoryPolicyChangedCallback& memory_policy_changed_callback) { | |
186 // There's no memory manager for the in-process implementation. | |
187 } | |
188 | |
189 void AwRenderThreadContextProvider::OnLostContext() { | 184 void AwRenderThreadContextProvider::OnLostContext() { |
190 DCHECK(main_thread_checker_.CalledOnValidThread()); | 185 DCHECK(main_thread_checker_.CalledOnValidThread()); |
191 | 186 |
192 if (destroyed_) | 187 if (destroyed_) |
193 return; | 188 return; |
194 destroyed_ = true; | 189 destroyed_ = true; |
195 | 190 |
196 if (!lost_context_callback_.is_null()) | 191 if (!lost_context_callback_.is_null()) |
197 base::ResetAndReturn(&lost_context_callback_).Run(); | 192 base::ResetAndReturn(&lost_context_callback_).Run(); |
198 if (gr_context_) | 193 if (gr_context_) |
199 gr_context_->abandonContext(); | 194 gr_context_->abandonContext(); |
200 } | 195 } |
201 | 196 |
202 } // namespace android_webview | 197 } // namespace android_webview |
OLD | NEW |