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 "cc/output/output_surface.h" | 5 #include "cc/output/output_surface.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/location.h" | 8 #include "base/location.h" |
9 #include "base/single_thread_task_runner.h" | 9 #include "base/single_thread_task_runner.h" |
10 #include "base/thread_task_runner_handle.h" | 10 #include "base/thread_task_runner_handle.h" |
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
223 client_ = NULL; | 223 client_ = NULL; |
224 | 224 |
225 // In certain cases, ThreadTaskRunnerHandle isn't set (Android Webview). | 225 // In certain cases, ThreadTaskRunnerHandle isn't set (Android Webview). |
226 // Don't register a dump provider in these cases. | 226 // Don't register a dump provider in these cases. |
227 // TODO(ericrk): Get this working in Android Webview. crbug.com/517156 | 227 // TODO(ericrk): Get this working in Android Webview. crbug.com/517156 |
228 if (client_ && base::ThreadTaskRunnerHandle::IsSet()) { | 228 if (client_ && base::ThreadTaskRunnerHandle::IsSet()) { |
229 // Now that we are on the context thread, register a dump provider with this | 229 // Now that we are on the context thread, register a dump provider with this |
230 // thread's task runner. This will overwrite any previous dump provider | 230 // thread's task runner. This will overwrite any previous dump provider |
231 // registered. | 231 // registered. |
232 base::trace_event::MemoryDumpManager::GetInstance()->RegisterDumpProvider( | 232 base::trace_event::MemoryDumpManager::GetInstance()->RegisterDumpProvider( |
233 this, base::ThreadTaskRunnerHandle::Get()); | 233 this, "OutputSurface", base::ThreadTaskRunnerHandle::Get()); |
234 } | 234 } |
235 | 235 |
236 return success; | 236 return success; |
237 } | 237 } |
238 | 238 |
239 void OutputSurface::DetachFromClient() { | 239 void OutputSurface::DetachFromClient() { |
240 DetachFromClientInternal(); | 240 DetachFromClientInternal(); |
241 } | 241 } |
242 | 242 |
243 void OutputSurface::EnsureBackbuffer() { | 243 void OutputSurface::EnsureBackbuffer() { |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
363 if (context_provider_.get()) { | 363 if (context_provider_.get()) { |
364 context_provider_->SetLostContextCallback( | 364 context_provider_->SetLostContextCallback( |
365 ContextProvider::LostContextCallback()); | 365 ContextProvider::LostContextCallback()); |
366 } | 366 } |
367 context_provider_ = nullptr; | 367 context_provider_ = nullptr; |
368 client_ = nullptr; | 368 client_ = nullptr; |
369 weak_ptr_factory_.InvalidateWeakPtrs(); | 369 weak_ptr_factory_.InvalidateWeakPtrs(); |
370 } | 370 } |
371 | 371 |
372 } // namespace cc | 372 } // namespace cc |
OLD | NEW |