Chromium Code Reviews| Index: content/renderer/gpu/renderer_gl_context.cc |
| =================================================================== |
| --- content/renderer/gpu/renderer_gl_context.cc (revision 98270) |
| +++ content/renderer/gpu/renderer_gl_context.cc (working copy) |
| @@ -10,6 +10,7 @@ |
| #include "base/memory/scoped_ptr.h" |
| #include "base/memory/singleton.h" |
| #include "base/memory/weak_ptr.h" |
| +#include "base/message_loop.h" |
| #include "base/shared_memory.h" |
| #include "content/common/view_messages.h" |
| #include "content/renderer/gpu/command_buffer_proxy.h" |
| @@ -208,6 +209,7 @@ |
| } |
| bool RendererGLContext::MakeCurrent(RendererGLContext* context) { |
| + DCHECK(MessageLoop::current() == message_loop_); |
|
lain Merrick
2011/08/25 20:13:22
Oops, this is static. Will fix.
|
| if (context) { |
| gles2::SetGLContext(context->gles2_implementation_); |
| @@ -284,7 +286,11 @@ |
| transfer_buffer_id_(-1), |
| gles2_implementation_(NULL), |
| last_error_(SUCCESS), |
| - frame_number_(0) { |
| + frame_number_(0) |
| +#ifndef NDEBUG |
| + , message_loop_(MessageLoop::current()) |
| +#endif |
| +{ |
| DCHECK(channel); |
| } |
| @@ -297,6 +303,7 @@ |
| const char* allowed_extensions, |
| const int32* attrib_list, |
| const GURL& active_url) { |
| + DCHECK(MessageLoop::current() == message_loop_); |
| DCHECK(size.width() >= 0 && size.height() >= 0); |
| TRACE_EVENT2("gpu", "RendererGLContext::Initialize", |
| "on_screen", onscreen, "num_pixels", size.GetArea()); |
| @@ -415,6 +422,7 @@ |
| void RendererGLContext::Destroy() { |
| TRACE_EVENT0("gpu", "RendererGLContext::Destroy"); |
| + DCHECK(MessageLoop::current() == message_loop_); |
| SetParent(NULL); |
| if (gles2_implementation_) { |