Index: content/browser/renderer_host/render_process_host_impl.cc |
=================================================================== |
--- content/browser/renderer_host/render_process_host_impl.cc (revision 159908) |
+++ content/browser/renderer_host/render_process_host_impl.cc (working copy) |
@@ -33,7 +33,7 @@ |
#include "base/string_util.h" |
#include "base/supports_user_data.h" |
#include "base/sys_info.h" |
-#include "base/threading/thread.h" |
+#include "base/threading/com_thread.h" |
#include "base/threading/thread_restrictions.h" |
#include "base/tracked_objects.h" |
#include "content/browser/appcache/appcache_dispatcher_host.h" |
@@ -132,10 +132,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 RendererMainThread : public base::ComThread { |
public: |
explicit RendererMainThread(const std::string& channel_id) |
- : base::Thread("Chrome_InProcRendererThread"), |
+ : ComThread("Chrome_InProcRendererThread", false), |
channel_id_(channel_id) { |
} |
cpu_(ooo_6.6-7.5)
2012/10/04 18:09:03
I rather not derive from base::Thread, I rather ha
|
@@ -144,11 +144,8 @@ |
} |
protected: |
- virtual void Init() { |
-#if defined(OS_WIN) |
- com_initializer_.reset(new base::win::ScopedCOMInitializer()); |
-#endif |
- |
+ virtual void Init() OVERRIDE { |
+ ComThread::Init(); |
render_process_.reset(new RenderProcessImpl()); |
new RenderThreadImpl(channel_id_); |
} |
@@ -156,9 +153,8 @@ |
virtual void CleanUp() { |
render_process_.reset(); |
-#if defined(OS_WIN) |
- com_initializer_.reset(); |
-#endif |
+ ComThread::CleanUp(); |
+ |
// It's a little lame to manually set this flag. But the single process |
// RendererThread will receive the WM_QUIT. We don't need to assert on |
// this thread, so just force the flag manually. |
@@ -168,14 +164,11 @@ |
// other threads like WebThread which are created by this thread |
// which resets this flag. Please see Thread::StartWithOptions. Setting |
// this flag to true in Cleanup works around these problems. |
- base::Thread::SetThreadWasQuitProperly(true); |
+ SetThreadWasQuitProperly(true); |
} |
private: |
std::string channel_id_; |
-#if defined(OS_WIN) |
- scoped_ptr<base::win::ScopedCOMInitializer> com_initializer_; |
-#endif |
scoped_ptr<RenderProcess> render_process_; |
DISALLOW_COPY_AND_ASSIGN(RendererMainThread); |