From 57cf978844f365885c897eaa748573822796af32 Mon Sep 17 00:00:00 2001 From: "jam@chromium.org" Date: Wed, 26 Jun 2013 20:39:01 +0000 Subject: 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 R=scottmg@chromium.org Review URL: https://codereview.chromium.org/17741010 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@208777 0039d316-1c4b-4281-b951-d872f2087c98 --- content/browser/gpu/gpu_process_host.cc | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) (limited to 'content/browser') diff --git a/content/browser/gpu/gpu_process_host.cc b/content/browser/gpu/gpu_process_host.cc index 0f7a214..4f4e71b 100644 --- a/content/browser/gpu/gpu_process_host.cc +++ b/content/browser/gpu/gpu_process_host.cc @@ -285,8 +285,7 @@ class GpuMainThread : public base::Thread { explicit GpuMainThread(const std::string& channel_id) : base::Thread("Chrome_InProcGpuThread"), channel_id_(channel_id), - gpu_process_(NULL), - child_thread_(NULL) { + gpu_process_(NULL) { } virtual ~GpuMainThread() { @@ -295,27 +294,20 @@ class GpuMainThread : public base::Thread { protected: virtual void Init() OVERRIDE { - if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kSingleProcess)) { - child_thread_ = new GpuChildThread(channel_id_); - } else { - gpu_process_ = new GpuProcess(); - // The process object takes ownership of the thread object, so do not - // save and delete the pointer. - gpu_process_->set_main_thread(new GpuChildThread(channel_id_)); - } + gpu_process_ = new GpuProcess(); + // The process object takes ownership of the thread object, so do not + // save and delete the pointer. + gpu_process_->set_main_thread(new GpuChildThread(channel_id_)); } virtual void CleanUp() OVERRIDE { delete gpu_process_; - if (child_thread_) - delete child_thread_; } private: std::string channel_id_; // Deleted in CleanUp() on the gpu thread, so don't use smart pointers. GpuProcess* gpu_process_; - GpuChildThread* child_thread_; DISALLOW_COPY_AND_ASSIGN(GpuMainThread); }; -- cgit v1.1