Commit 1a771269 authored by tommi@chromium.org's avatar tommi@chromium.org

Change RenderThread to use ScopedCOMInitializer to initialize COM.

BUG=none
TEST=none
Review URL: http://codereview.chromium.org/8341107

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@107933 0039d316-1c4b-4281-b951-d872f2087c98
parent 63f535e8
......@@ -21,6 +21,7 @@
#include "base/task.h"
#include "base/threading/thread_local.h"
#include "base/values.h"
#include "base/win/scoped_com_initializer.h"
#include "content/common/appcache/appcache_dispatcher.h"
#include "content/common/child_process_messages.h"
#include "content/common/database_messages.h"
......@@ -182,7 +183,7 @@ void RenderThreadImpl::Init() {
// If you are running plugins in this thread you need COM active but in
// the normal case you don't.
if (RenderProcessImpl::InProcessPlugins())
CoInitialize(0);
initialize_com_.reset(new base::win::ScopedCOMInitializer());
#endif
// In single process the single process is all there is.
......@@ -258,9 +259,6 @@ RenderThreadImpl::~RenderThreadImpl() {
#if defined(OS_WIN)
// Clean up plugin channels before this thread goes away.
NPChannelBase::CleanupChannels();
// Don't call COM if the renderer is in the sandbox.
if (RenderProcessImpl::InProcessPlugins())
CoUninitialize();
#endif
}
......
......@@ -56,6 +56,9 @@ class WebStorageEventDispatcher;
namespace base {
class MessageLoopProxy;
class Thread;
namespace win {
class ScopedCOMInitializer;
}
}
namespace content {
......@@ -211,6 +214,9 @@ class CONTENT_EXPORT RenderThreadImpl : public content::RenderThread,
// Used on multiple script execution context threads.
scoped_ptr<WebDatabaseObserverImpl> web_database_observer_impl_;
// Initialize COM when using plugins outside the sandbox (Windows only).
scoped_ptr<base::win::ScopedCOMInitializer> initialize_com_;
// If true, then a GetPlugins call is allowed to rescan the disk.
bool plugin_refresh_allowed_;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment