| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 return true; | 92 return true; |
| 93 | 93 |
| 94 if (!WebContext3DImpl()->InitializeOnCurrentThread()) | 94 if (!WebContext3DImpl()->InitializeOnCurrentThread()) |
| 95 return false; | 95 return false; |
| 96 | 96 |
| 97 gr_interface_->BindToCurrentThread(); | 97 gr_interface_->BindToCurrentThread(); |
| 98 InitializeCapabilities(); | 98 InitializeCapabilities(); |
| 99 | 99 |
| 100 const std::string unique_context_name = | 100 const std::string unique_context_name = |
| 101 base::StringPrintf("%s-%p", debug_name_.c_str(), WebContext3DImpl()); | 101 base::StringPrintf("%s-%p", debug_name_.c_str(), WebContext3DImpl()); |
| 102 WebContext3DImpl()->traceBeginCHROMIUM("gpu_toplevel", | 102 ContextGL()->TraceBeginCHROMIUM("gpu_toplevel", unique_context_name.c_str()); |
| 103 unique_context_name.c_str()); | |
| 104 | 103 |
| 105 lost_context_callback_proxy_.reset(new LostContextCallbackProxy(this)); | 104 lost_context_callback_proxy_.reset(new LostContextCallbackProxy(this)); |
| 106 return true; | 105 return true; |
| 107 } | 106 } |
| 108 | 107 |
| 109 void ContextProviderInProcess::DetachFromThread() { | 108 void ContextProviderInProcess::DetachFromThread() { |
| 110 context_thread_checker_.DetachFromThread(); | 109 context_thread_checker_.DetachFromThread(); |
| 111 } | 110 } |
| 112 | 111 |
| 113 void ContextProviderInProcess::InitializeCapabilities() { | 112 void ContextProviderInProcess::InitializeCapabilities() { |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 190 | 189 |
| 191 void ContextProviderInProcess::SetLostContextCallback( | 190 void ContextProviderInProcess::SetLostContextCallback( |
| 192 const LostContextCallback& lost_context_callback) { | 191 const LostContextCallback& lost_context_callback) { |
| 193 DCHECK(context_thread_checker_.CalledOnValidThread()); | 192 DCHECK(context_thread_checker_.CalledOnValidThread()); |
| 194 DCHECK(lost_context_callback_.is_null() || | 193 DCHECK(lost_context_callback_.is_null() || |
| 195 lost_context_callback.is_null()); | 194 lost_context_callback.is_null()); |
| 196 lost_context_callback_ = lost_context_callback; | 195 lost_context_callback_ = lost_context_callback; |
| 197 } | 196 } |
| 198 | 197 |
| 199 } // namespace content | 198 } // namespace content |
| OLD | NEW |