This source file includes following definitions.
- hr_
#include "ui/base/win/scoped_ole_initializer.h"
#include "base/logging.h"
namespace ui {
ScopedOleInitializer::ScopedOleInitializer()
:
#ifndef NDEBUG
thread_id_(GetCurrentThreadId()),
#endif
hr_(OleInitialize(NULL)) {
#ifndef NDEBUG
if (hr_ == S_FALSE) {
LOG(ERROR) << "Multiple OleInitialize() calls for thread " << thread_id_;
} else {
DCHECK_NE(OLE_E_WRONGCOMPOBJ, hr_) << "Incompatible DLLs on machine";
DCHECK_NE(RPC_E_CHANGED_MODE, hr_) << "Invalid COM thread model change";
}
#endif
}
ScopedOleInitializer::~ScopedOleInitializer() {
#ifndef NDEBUG
DCHECK_EQ(thread_id_, GetCurrentThreadId());
#endif
if (SUCCEEDED(hr_))
OleUninitialize();
}
}