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 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
164 TRACE_EVENT_SCOPE_THREAD); | 164 TRACE_EVENT_SCOPE_THREAD); |
165 gr_context_->freeGpuResources(); | 165 gr_context_->freeGpuResources(); |
166 } | 166 } |
167 } | 167 } |
168 | 168 |
169 void AwRenderThreadContextProvider::SetLostContextCallback( | 169 void AwRenderThreadContextProvider::SetLostContextCallback( |
170 const LostContextCallback& lost_context_callback) { | 170 const LostContextCallback& lost_context_callback) { |
171 lost_context_callback_ = lost_context_callback; | 171 lost_context_callback_ = lost_context_callback; |
172 } | 172 } |
173 | 173 |
| 174 void AwRenderThreadContextProvider::SetMemoryPolicyChangedCallback( |
| 175 const MemoryPolicyChangedCallback& memory_policy_changed_callback) { |
| 176 // There's no memory manager for the in-process implementation. |
| 177 } |
| 178 |
174 void AwRenderThreadContextProvider::OnLostContext() { | 179 void AwRenderThreadContextProvider::OnLostContext() { |
175 DCHECK(main_thread_checker_.CalledOnValidThread()); | 180 DCHECK(main_thread_checker_.CalledOnValidThread()); |
176 | 181 |
177 if (!lost_context_callback_.is_null()) | 182 if (!lost_context_callback_.is_null()) |
178 base::ResetAndReturn(&lost_context_callback_).Run(); | 183 base::ResetAndReturn(&lost_context_callback_).Run(); |
179 if (gr_context_) | 184 if (gr_context_) |
180 gr_context_->abandonContext(); | 185 gr_context_->abandonContext(); |
181 } | 186 } |
182 | 187 |
183 } // namespace android_webview | 188 } // namespace android_webview |
OLD | NEW |