Make ChildThread::current() and ChildProcess::current() only work on the main thread of the child process. In single-process mode, there would be multiple ChildThread objects each using thread local storage to get their value.

Remove ChildThread::IsWebFrameValid since it's not used anymore.

BUG=246884
[email protected]

Review URL: https://codereview.chromium.org/17741010

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@208777 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/content/renderer/render_thread_impl.h b/content/renderer/render_thread_impl.h
index 9ef7002..71d9e5e 100644
--- a/content/renderer/render_thread_impl.h
+++ b/content/renderer/render_thread_impl.h
@@ -13,7 +13,6 @@
 #include "base/strings/string16.h"
 #include "base/timer.h"
 #include "build/build_config.h"
-#include "content/child/child_process.h"
 #include "content/child/child_thread.h"
 #include "content/common/content_export.h"
 #include "content/common/gpu/client/gpu_channel_host.h"
@@ -155,25 +154,6 @@
   virtual void ReleaseCachedFonts() OVERRIDE;
 #endif
 
-  // ChildThread:
-  virtual bool IsWebFrameValid(WebKit::WebFrame* frame) OVERRIDE;
-
-  // GpuChannelHostFactory implementation:
-  virtual bool IsMainThread() OVERRIDE;
-  virtual base::MessageLoop* GetMainLoop() OVERRIDE;
-  virtual scoped_refptr<base::MessageLoopProxy> GetIOLoopProxy() OVERRIDE;
-  virtual base::WaitableEvent* GetShutDownEvent() OVERRIDE;
-  virtual scoped_ptr<base::SharedMemory> AllocateSharedMemory(
-      size_t size) OVERRIDE;
-  virtual int32 CreateViewCommandBuffer(
-      int32 surface_id,
-      const GPUCreateCommandBufferConfig& init_params) OVERRIDE;
-  virtual void CreateImage(
-      gfx::PluginWindowHandle window,
-      int32 image_id,
-      const CreateImageCallback& callback) OVERRIDE;
-  virtual void DeleteImage(int32 image_id, int32 sync_point) OVERRIDE;
-
   // Synchronously establish a channel to the GPU plugin if not previously
   // established or if it has been lost (for example if the GPU plugin crashed).
   // If there is a pending asynchronous request, it will be completed by the
@@ -351,8 +331,25 @@
                                const std::vector<float>& new_touchscreen);
 
  private:
+  // ChildThread
   virtual bool OnControlMessageReceived(const IPC::Message& msg) OVERRIDE;
 
+  // GpuChannelHostFactory implementation:
+  virtual bool IsMainThread() OVERRIDE;
+  virtual base::MessageLoop* GetMainLoop() OVERRIDE;
+  virtual scoped_refptr<base::MessageLoopProxy> GetIOLoopProxy() OVERRIDE;
+  virtual base::WaitableEvent* GetShutDownEvent() OVERRIDE;
+  virtual scoped_ptr<base::SharedMemory> AllocateSharedMemory(
+      size_t size) OVERRIDE;
+  virtual int32 CreateViewCommandBuffer(
+      int32 surface_id,
+      const GPUCreateCommandBufferConfig& init_params) OVERRIDE;
+  virtual void CreateImage(
+      gfx::PluginWindowHandle window,
+      int32 image_id,
+      const CreateImageCallback& callback) OVERRIDE;
+  virtual void DeleteImage(int32 image_id, int32 sync_point) OVERRIDE;
+
   void Init();
 
   void OnSetZoomLevelForCurrentURL(const std::string& scheme,
@@ -430,6 +427,11 @@
   // The channel from the renderer process to the GPU process.
   scoped_refptr<GpuChannelHost> gpu_channel_;
 
+  // Cache of variables that are needed on the compositor thread by
+  // GpuChannelHostFactory methods.
+  scoped_refptr<base::MessageLoopProxy> io_message_loop_proxy_;
+  base::WaitableEvent* shutdown_event_;
+
   // A lazily initiated thread on which file operations are run.
   scoped_ptr<base::Thread> file_thread_;