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

Unified Diff: content/renderer/gpu/webgraphicscontext3d_command_buffer_impl.cc

Issue 8490001: Don't call renderView methods in threaded mode (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 9 years 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/renderer/gpu/webgraphicscontext3d_command_buffer_impl.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/gpu/webgraphicscontext3d_command_buffer_impl.cc
diff --git a/content/renderer/gpu/webgraphicscontext3d_command_buffer_impl.cc b/content/renderer/gpu/webgraphicscontext3d_command_buffer_impl.cc
index 6f2b3254df126073298e9ffcb4857f862f257a00..ac6ad870288fdb5e529709c6deb7b0953267b68e 100644
--- a/content/renderer/gpu/webgraphicscontext3d_command_buffer_impl.cc
+++ b/content/renderer/gpu/webgraphicscontext3d_command_buffer_impl.cc
@@ -23,6 +23,7 @@
#include "base/logging.h"
#include "base/metrics/histogram.h"
#include "base/synchronization/lock.h"
+#include "content/common/child_process.h"
#include "content/public/common/content_switches.h"
#include "content/renderer/gpu/command_buffer_proxy.h"
#include "content/renderer/gpu/gpu_channel_host.h"
@@ -147,6 +148,14 @@ bool WebGraphicsContext3DCommandBufferImpl::MaybeInitializeGL() {
TRACE_EVENT0("gpu", "WebGfxCtx3DCmdBfrImpl::MaybeInitializeGL");
+ // If the context is being initialized on something other than the main
+ // thread, then drop the web_view_ pointer so we don't accidentally
+ // dereference it.
+ MessageLoop* main_message_loop =
+ ChildProcess::current()->main_thread()->message_loop();
+ if (MessageLoop::current() != main_message_loop)
+ web_view_ = NULL;
+
// Convert WebGL context creation attributes into RendererGLContext / EGL size
// requests.
const int alpha_size = attributes_.alpha ? 8 : 0;
« no previous file with comments | « content/renderer/gpu/webgraphicscontext3d_command_buffer_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698