Fix names of in-process threads, tidy gpu DEPS

Follow-up after http://crrev.com/217968 per comments on
https://chromiumcodereview.appspot.com/23235002/

[email protected]
BUG=237249

Review URL: https://chromiumcodereview.appspot.com/23452016

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@221199 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/content/app/content_main_runner.cc b/content/app/content_main_runner.cc
index 07e846fb..3f1bc1c 100644
--- a/content/app/content_main_runner.cc
+++ b/content/app/content_main_runner.cc
@@ -29,7 +29,7 @@
 #include "content/browser/gpu/gpu_process_host.h"
 #include "content/common/set_process_title.h"
 #include "content/common/url_schemes.h"
-#include "content/gpu/gpu_main_thread.h"
+#include "content/gpu/in_process_gpu_thread.h"
 #include "content/public/app/content_main_delegate.h"
 #include "content/public/app/startup_helper_win.h"
 #include "content/public/browser/content_browser_client.h"
@@ -41,8 +41,8 @@
 #include "content/public/common/content_switches.h"
 #include "content/public/common/main_function_params.h"
 #include "content/public/common/sandbox_init.h"
-#include "content/renderer/renderer_main_thread.h"
-#include "content/utility/utility_main_thread.h"
+#include "content/renderer/in_process_renderer_thread.h"
+#include "content/utility/in_process_utility_thread.h"
 #include "crypto/nss_util.h"
 #include "ipc/ipc_switches.h"
 #include "media/base/media.h"
@@ -431,10 +431,12 @@
   };
 
 #if !defined(CHROME_MULTIPLE_DLL_BROWSER)
-  UtilityProcessHost::RegisterUtilityMainThreadFactory(CreateUtilityMainThread);
+  UtilityProcessHost::RegisterUtilityMainThreadFactory(
+      CreateInProcessUtilityThread);
   RenderProcessHost::RegisterRendererMainThreadFactory(
-      CreateRendererMainThread);
-  GpuProcessHost::RegisterGpuMainThreadFactory(CreateGpuMainThread);
+      CreateInProcessRendererThread);
+  GpuProcessHost::RegisterGpuMainThreadFactory(
+      CreateInProcessGpuThread);
 #endif
 
   for (size_t i = 0; i < arraysize(kMainFunctions); ++i) {
diff --git a/content/browser/DEPS b/content/browser/DEPS
index 3a85518..0027720 100644
--- a/content/browser/DEPS
+++ b/content/browser/DEPS
@@ -1,5 +1,4 @@
 include_rules = [
-  "+content/gpu",  # For gpu_info_collector.h and in-process GPU
   "+content/port/browser",
   "+content/public/browser",
   "+content/child/webkitplatformsupport_impl.h",  # For in-process webkit
diff --git a/content/browser/gpu/gpu_process_host.cc b/content/browser/gpu/gpu_process_host.cc
index cc1e0baf..c6a22c2 100644
--- a/content/browser/gpu/gpu_process_host.cc
+++ b/content/browser/gpu/gpu_process_host.cc
@@ -25,8 +25,6 @@
 #include "content/common/child_process_host_impl.h"
 #include "content/common/gpu/gpu_messages.h"
 #include "content/common/view_messages.h"
-#include "content/gpu/gpu_child_thread.h"
-#include "content/gpu/gpu_process.h"
 #include "content/port/browser/render_widget_host_view_frame_subscriber.h"
 #include "content/public/browser/browser_thread.h"
 #include "content/public/browser/content_browser_client.h"
diff --git a/content/content.gyp b/content/content.gyp
index 9c51df7..221a1a5 100644
--- a/content/content.gyp
+++ b/content/content.gyp
@@ -122,17 +122,17 @@
             'content_resources.gyp:content_resources',
           ],
           'conditions': [
-            ['OS != "ios" and chrome_multiple_dll != 1', {
+            ['java_bridge==1', {
+              'dependencies': [
+                'content_child',
+              ]
+            }],
+            ['OS=="android"', {
               'dependencies': [
                 'content_gpu',
                 'content_utility',
               ],
             }],
-            ['java_bridge==1', {
-              'dependencies': [
-                'content_child',
-              ]
-            }]
           ],
         },
         {
diff --git a/content/content_gpu.gypi b/content/content_gpu.gypi
index 5dba0ac..9068549 100644
--- a/content/content_gpu.gypi
+++ b/content/content_gpu.gypi
@@ -14,10 +14,10 @@
     'gpu/gpu_process.h',
     'gpu/gpu_child_thread.cc',
     'gpu/gpu_child_thread.h',
-    'gpu/gpu_main_thread.cc',
-    'gpu/gpu_main_thread.h',
     'gpu/gpu_watchdog_thread.cc',
     'gpu/gpu_watchdog_thread.h',
+    'gpu/in_process_gpu_thread.cc',
+    'gpu/in_process_gpu_thread.h',
   ],
   'include_dirs': [
     '..',
diff --git a/content/content_renderer.gypi b/content/content_renderer.gypi
index 40e015b..fdbbb48 100644
--- a/content/content_renderer.gypi
+++ b/content/content_renderer.gypi
@@ -141,6 +141,8 @@
     'renderer/idle_user_detector.h',
     'renderer/image_loading_helper.cc',
     'renderer/image_loading_helper.h',
+    'renderer/in_process_renderer_thread.cc',
+    'renderer/in_process_renderer_thread.h',
     'renderer/input_tag_speech_dispatcher.cc',
     'renderer/input_tag_speech_dispatcher.h',
     'renderer/internal_document_state_data.cc',
@@ -461,8 +463,6 @@
     'renderer/renderer_main_platform_delegate_linux.cc',
     'renderer/renderer_main_platform_delegate_mac.mm',
     'renderer/renderer_main_platform_delegate_win.cc',
-    'renderer/renderer_main_thread.cc',
-    'renderer/renderer_main_thread.h',
     'renderer/renderer_webapplicationcachehost_impl.cc',
     'renderer/renderer_webapplicationcachehost_impl.h',
     'renderer/renderer_webcookiejar_impl.cc',
diff --git a/content/content_utility.gypi b/content/content_utility.gypi
index a152c952..47be4e0 100644
--- a/content/content_utility.gypi
+++ b/content/content_utility.gypi
@@ -11,9 +11,9 @@
     'public/utility/content_utility_client.h',
     'public/utility/utility_thread.cc',
     'public/utility/utility_thread.h',
+    'utility/in_process_utility_thread.cc',
+    'utility/in_process_utility_thread.h',
     'utility/utility_main.cc',
-    'utility/utility_main_thread.cc',
-    'utility/utility_main_thread.h',
     'utility/utility_thread_impl.cc',
     'utility/utility_thread_impl.h',
   ],
diff --git a/content/gpu/gpu_main_thread.cc b/content/gpu/in_process_gpu_thread.cc
similarity index 65%
rename from content/gpu/gpu_main_thread.cc
rename to content/gpu/in_process_gpu_thread.cc
index 65fef13b..59a257d 100644
--- a/content/gpu/gpu_main_thread.cc
+++ b/content/gpu/in_process_gpu_thread.cc
@@ -2,36 +2,36 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#include "content/gpu/gpu_main_thread.h"
+#include "content/gpu/in_process_gpu_thread.h"
 
 #include "content/gpu/gpu_child_thread.h"
 #include "content/gpu/gpu_process.h"
 
 namespace content {
 
-GpuMainThread::GpuMainThread(const std::string& channel_id)
+InProcessGpuThread::InProcessGpuThread(const std::string& channel_id)
     : base::Thread("Chrome_InProcGpuThread"),
       channel_id_(channel_id),
       gpu_process_(NULL) {
 }
 
-GpuMainThread::~GpuMainThread() {
+InProcessGpuThread::~InProcessGpuThread() {
   Stop();
 }
 
-void GpuMainThread::Init() {
+void InProcessGpuThread::Init() {
   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_));
 }
 
-void GpuMainThread::CleanUp() {
+void InProcessGpuThread::CleanUp() {
   delete gpu_process_;
 }
 
-base::Thread* CreateGpuMainThread(const std::string& channel_id) {
-  return new GpuMainThread(channel_id);
+base::Thread* CreateInProcessGpuThread(const std::string& channel_id) {
+  return new InProcessGpuThread(channel_id);
 }
 
 }  // namespace content
diff --git a/content/gpu/gpu_main_thread.h b/content/gpu/in_process_gpu_thread.h
similarity index 61%
rename from content/gpu/gpu_main_thread.h
rename to content/gpu/in_process_gpu_thread.h
index f34f431..ef6b4e1 100644
--- a/content/gpu/gpu_main_thread.h
+++ b/content/gpu/in_process_gpu_thread.h
@@ -2,8 +2,8 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#ifndef CONTENT_GPU_GPU_MAIN_THREAD_H_
-#define CONTENT_GPU_GPU_MAIN_THREAD_H_
+#ifndef CONTENT_GPU_IN_PROCESS_GPU_THREAD_H_
+#define CONTENT_GPU_IN_PROCESS_GPU_THREAD_H_
 
 #include "base/threading/thread.h"
 #include "content/common/content_export.h"
@@ -14,10 +14,10 @@
 
 // This class creates a GPU thread (instead of a GPU process), when running
 // with --in-process-gpu or --single-process.
-class GpuMainThread : public base::Thread {
+class InProcessGpuThread : public base::Thread {
  public:
-  explicit GpuMainThread(const std::string& channel_id);
-  virtual ~GpuMainThread();
+  explicit InProcessGpuThread(const std::string& channel_id);
+  virtual ~InProcessGpuThread();
 
  protected:
   virtual void Init() OVERRIDE;
@@ -28,11 +28,12 @@
   // Deleted in CleanUp() on the gpu thread, so don't use smart pointers.
   GpuProcess* gpu_process_;
 
-  DISALLOW_COPY_AND_ASSIGN(GpuMainThread);
+  DISALLOW_COPY_AND_ASSIGN(InProcessGpuThread);
 };
 
-CONTENT_EXPORT base::Thread* CreateGpuMainThread(const std::string& channel_id);
+CONTENT_EXPORT base::Thread* CreateInProcessGpuThread(
+    const std::string& channel_id);
 
 }  // namespace content
 
-#endif  // CONTENT_GPU_GPU_MAIN_THREAD_H_
+#endif  // CONTENT_GPU_IN_PROCESS_GPU_THREAD_H_
diff --git a/content/public/test/content_test_suite_base.cc b/content/public/test/content_test_suite_base.cc
index ce6eac3a..27c9c63 100644
--- a/content/public/test/content_test_suite_base.cc
+++ b/content/public/test/content_test_suite_base.cc
@@ -12,13 +12,13 @@
 #include "content/browser/browser_thread_impl.h"
 #include "content/browser/gpu/gpu_process_host.h"
 #include "content/common/url_schemes.h"
-#include "content/gpu/gpu_main_thread.h"
+#include "content/gpu/in_process_gpu_thread.h"
 #include "content/public/browser/render_process_host.h"
 #include "content/public/browser/utility_process_host.h"
 #include "content/public/common/content_client.h"
 #include "content/public/common/content_paths.h"
-#include "content/renderer/renderer_main_thread.h"
-#include "content/utility/utility_main_thread.h"
+#include "content/renderer/in_process_renderer_thread.h"
+#include "content/utility/in_process_utility_thread.h"
 #include "testing/gtest/include/gtest/gtest.h"
 #include "ui/base/ui_base_paths.h"
 
@@ -70,10 +70,11 @@
 #endif
 
 #if !defined(OS_IOS)
-  UtilityProcessHost::RegisterUtilityMainThreadFactory(CreateUtilityMainThread);
+  UtilityProcessHost::RegisterUtilityMainThreadFactory(
+      CreateInProcessUtilityThread);
   RenderProcessHost::RegisterRendererMainThreadFactory(
-      CreateRendererMainThread);
-  GpuProcessHost::RegisterGpuMainThreadFactory(CreateGpuMainThread);
+      CreateInProcessRendererThread);
+  GpuProcessHost::RegisterGpuMainThreadFactory(CreateInProcessGpuThread);
   if (external_libraries_enabled_)
     media::InitializeMediaLibraryForTesting();
 #endif
diff --git a/content/renderer/renderer_main_thread.cc b/content/renderer/in_process_renderer_thread.cc
similarity index 75%
rename from content/renderer/renderer_main_thread.cc
rename to content/renderer/in_process_renderer_thread.cc
index c6704c83..fa6b834 100644
--- a/content/renderer/renderer_main_thread.cc
+++ b/content/renderer/in_process_renderer_thread.cc
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#include "content/renderer/renderer_main_thread.h"
+#include "content/renderer/in_process_renderer_thread.h"
 
 #include "content/renderer/render_process.h"
 #include "content/renderer/render_process_impl.h"
@@ -10,20 +10,20 @@
 
 namespace content {
 
-RendererMainThread::RendererMainThread(const std::string& channel_id)
+InProcessRendererThread::InProcessRendererThread(const std::string& channel_id)
     : Thread("Chrome_InProcRendererThread"), channel_id_(channel_id) {
 }
 
-RendererMainThread::~RendererMainThread() {
+InProcessRendererThread::~InProcessRendererThread() {
   Stop();
 }
 
-void RendererMainThread::Init() {
+void InProcessRendererThread::Init() {
   render_process_.reset(new RenderProcessImpl());
   new RenderThreadImpl(channel_id_);
 }
 
-void RendererMainThread::CleanUp() {
+void InProcessRendererThread::CleanUp() {
   render_process_.reset();
 
   // It's a little lame to manually set this flag.  But the single process
@@ -38,8 +38,8 @@
   SetThreadWasQuitProperly(true);
 }
 
-base::Thread* CreateRendererMainThread(const std::string& channel_id) {
-  return new RendererMainThread(channel_id);
+base::Thread* CreateInProcessRendererThread(const std::string& channel_id) {
+  return new InProcessRendererThread(channel_id);
 }
 
 }  // namespace content
diff --git a/content/renderer/renderer_main_thread.h b/content/renderer/in_process_renderer_thread.h
similarity index 60%
rename from content/renderer/renderer_main_thread.h
rename to content/renderer/in_process_renderer_thread.h
index dca7cb8..bc5a5d3d 100644
--- a/content/renderer/renderer_main_thread.h
+++ b/content/renderer/in_process_renderer_thread.h
@@ -2,8 +2,8 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#ifndef CONTENT_RENDERER_RENDERER_MAIN_THREAD_H_
-#define CONTENT_RENDERER_RENDERER_MAIN_THREAD_H_
+#ifndef CONTENT_RENDERER_IN_PROCESS_RENDERER_THREAD_H_
+#define CONTENT_RENDERER_IN_PROCESS_RENDERER_THREAD_H_
 
 #include <string>
 
@@ -15,10 +15,10 @@
 
 // This class creates the IO thread for the renderer when running in
 // single-process mode.  It's not used in multi-process mode.
-class RendererMainThread : public base::Thread {
+class InProcessRendererThread : public base::Thread {
  public:
-  explicit RendererMainThread(const std::string& channel_id);
-  virtual ~RendererMainThread();
+  explicit InProcessRendererThread(const std::string& channel_id);
+  virtual ~InProcessRendererThread();
 
  protected:
   virtual void Init() OVERRIDE;
@@ -28,12 +28,12 @@
   std::string channel_id_;
   scoped_ptr<RenderProcess> render_process_;
 
-  DISALLOW_COPY_AND_ASSIGN(RendererMainThread);
+  DISALLOW_COPY_AND_ASSIGN(InProcessRendererThread);
 };
 
-CONTENT_EXPORT base::Thread* CreateRendererMainThread(
+CONTENT_EXPORT base::Thread* CreateInProcessRendererThread(
     const std::string& channel_id);
 
 }  // namespace content
 
-#endif  // CONTENT_RENDERER_RENDERER_MAIN_THREAD_H_
+#endif  // CONTENT_RENDERER_IN_PROCESS_RENDERER_THREAD_H_
diff --git a/content/utility/utility_main_thread.cc b/content/utility/in_process_utility_thread.cc
similarity index 66%
rename from content/utility/utility_main_thread.cc
rename to content/utility/in_process_utility_thread.cc
index 7d97399..8859e518 100644
--- a/content/utility/utility_main_thread.cc
+++ b/content/utility/in_process_utility_thread.cc
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#include "content/utility/utility_main_thread.h"
+#include "content/utility/in_process_utility_thread.h"
 
 #include "content/child/child_process.h"
 #include "content/utility/utility_thread_impl.h"
@@ -13,23 +13,24 @@
 // are many globals used in the utility process.
 static base::LazyInstance<base::Lock> g_one_utility_thread_lock;
 
-UtilityMainThread::UtilityMainThread(const std::string& channel_id)
+InProcessUtilityThread::InProcessUtilityThread(const std::string& channel_id)
     : Thread("Chrome_InProcUtilityThread"), channel_id_(channel_id) {
 }
 
-UtilityMainThread::~UtilityMainThread() {
+InProcessUtilityThread::~InProcessUtilityThread() {
   Stop();
 }
 
-void UtilityMainThread::Init() {
+void InProcessUtilityThread::Init() {
   // We need to return right away or else the main thread that started us will
   // hang.
   base::MessageLoop::current()->PostTask(
       FROM_HERE,
-      base::Bind(&UtilityMainThread::InitInternal, base::Unretained(this)));
+      base::Bind(&InProcessUtilityThread::InitInternal,
+                 base::Unretained(this)));
 }
 
-void UtilityMainThread::CleanUp() {
+void InProcessUtilityThread::CleanUp() {
   child_process_.reset();
 
   // See comment in RendererMainThread.
@@ -37,14 +38,14 @@
   g_one_utility_thread_lock.Get().Release();
 }
 
-void UtilityMainThread::InitInternal() {
+void InProcessUtilityThread::InitInternal() {
   g_one_utility_thread_lock.Get().Acquire();
   child_process_.reset(new ChildProcess());
   child_process_->set_main_thread(new UtilityThreadImpl(channel_id_));
 }
 
-base::Thread* CreateUtilityMainThread(const std::string& channel_id) {
-  return new UtilityMainThread(channel_id);
+base::Thread* CreateInProcessUtilityThread(const std::string& channel_id) {
+  return new InProcessUtilityThread(channel_id);
 }
 
 }  // namespace content
diff --git a/content/utility/in_process_utility_thread.h b/content/utility/in_process_utility_thread.h
new file mode 100644
index 0000000..7f4c732
--- /dev/null
+++ b/content/utility/in_process_utility_thread.h
@@ -0,0 +1,40 @@
+// Copyright 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CONTENT_UTILITY_IN_PROCESS_UTILITY_THREAD_H_
+#define CONTENT_UTILITY_IN_PROCESS_UTILITY_THREAD_H_
+
+#include <string>
+
+#include "base/threading/thread.h"
+#include "content/common/content_export.h"
+
+namespace content {
+
+class ChildProcess;
+
+class InProcessUtilityThread : public base::Thread {
+ public:
+  InProcessUtilityThread(const std::string& channel_id);
+  virtual ~InProcessUtilityThread();
+
+ private:
+  // base::Thread implementation:
+  virtual void Init() OVERRIDE;
+  virtual void CleanUp() OVERRIDE;
+
+  void InitInternal();
+
+  std::string channel_id_;
+  scoped_ptr<ChildProcess> child_process_;
+
+  DISALLOW_COPY_AND_ASSIGN(InProcessUtilityThread);
+};
+
+CONTENT_EXPORT base::Thread* CreateInProcessUtilityThread(
+    const std::string& channel_id);
+
+}  // namespace content
+
+#endif  // CONTENT_UTILITY_IN_PROCESS_UTILITY_THREAD_H_
diff --git a/content/utility/utility_main_thread.h b/content/utility/utility_main_thread.h
deleted file mode 100644
index 43e22b74..0000000
--- a/content/utility/utility_main_thread.h
+++ /dev/null
@@ -1,40 +0,0 @@
-// Copyright 2013 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef CONTENT_UTILITY_UTILITY_MAIN_THREAD_H_
-#define CONTENT_UTILITY_UTILITY_MAIN_THREAD_H_
-
-#include <string>
-
-#include "base/threading/thread.h"
-#include "content/common/content_export.h"
-
-namespace content {
-
-class ChildProcess;
-
-class UtilityMainThread : public base::Thread {
- public:
-  UtilityMainThread(const std::string& channel_id);
-  virtual ~UtilityMainThread();
- private:
-
-  // base::Thread implementation:
-  virtual void Init() OVERRIDE;
-  virtual void CleanUp() OVERRIDE;
-
-  void InitInternal();
-
-  std::string channel_id_;
-  scoped_ptr<ChildProcess> child_process_;
-
-  DISALLOW_COPY_AND_ASSIGN(UtilityMainThread);
-};
-
-CONTENT_EXPORT base::Thread* CreateUtilityMainThread(
-    const std::string& channel_id);
-
-}  // namespace content
-
-#endif  // CONTENT_UTILITY_UTILITY_MAIN_THREAD_H_