Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(255)

Unified Diff: content/common/gpu/client/context_provider_command_buffer.cc

Issue 23247002: Remove base::Callback from ContextProvider creation. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/common/gpu/client/context_provider_command_buffer.h ('k') | content/renderer/render_thread_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/common/gpu/client/context_provider_command_buffer.cc
diff --git a/content/common/gpu/client/context_provider_command_buffer.cc b/content/common/gpu/client/context_provider_command_buffer.cc
index 338ab4331b5cde55ee9b2f08797ce4941ce1d0e4..65c1c75a0c71dc52c6ca71495679499447725ec5 100644
--- a/content/common/gpu/client/context_provider_command_buffer.cc
+++ b/content/common/gpu/client/context_provider_command_buffer.cc
@@ -76,18 +76,21 @@ class ContextProviderCommandBuffer::MemoryAllocationCallbackProxy
};
scoped_refptr<ContextProviderCommandBuffer>
-ContextProviderCommandBuffer::Create(const CreateCallback& create_callback) {
- scoped_refptr<ContextProviderCommandBuffer> provider =
- new ContextProviderCommandBuffer;
- if (!provider->InitializeOnMainThread(create_callback))
+ContextProviderCommandBuffer::Create(
+ scoped_ptr<WebGraphicsContext3DCommandBufferImpl> context3d) {
+ if (!context3d)
return NULL;
- return provider;
+
+ return new ContextProviderCommandBuffer(context3d.Pass());
}
-ContextProviderCommandBuffer::ContextProviderCommandBuffer()
- : leak_on_destroy_(false),
+ContextProviderCommandBuffer::ContextProviderCommandBuffer(
+ scoped_ptr<WebGraphicsContext3DCommandBufferImpl> context3d)
+ : context3d_(context3d.Pass()),
+ leak_on_destroy_(false),
destroyed_(false) {
DCHECK(main_thread_checker_.CalledOnValidThread());
+ DCHECK(context3d_);
context_thread_checker_.DetachFromThread();
}
@@ -104,16 +107,6 @@ ContextProviderCommandBuffer::~ContextProviderCommandBuffer() {
}
}
-bool ContextProviderCommandBuffer::InitializeOnMainThread(
- const CreateCallback& create_callback) {
- DCHECK(main_thread_checker_.CalledOnValidThread());
-
- DCHECK(!context3d_);
- DCHECK(!create_callback.is_null());
- context3d_ = create_callback.Run();
- return !!context3d_;
-}
-
bool ContextProviderCommandBuffer::BindToCurrentThread() {
DCHECK(context3d_);
« no previous file with comments | « content/common/gpu/client/context_provider_command_buffer.h ('k') | content/renderer/render_thread_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698