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

Unified Diff: content/browser/renderer_host/render_process_host_impl.cc

Issue 11048029: Allow Thread to initialize COM for Windows consumers who need it (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 2 months 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
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);
« no previous file with comments | « content/browser/renderer_host/media/media_stream_manager.cc ('k') | media/audio/audio_input_device_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698