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

Unified Diff: base/win/scoped_com_initializer.h

Issue 10899041: Add additional debug/check for ScopedCOMInitializer. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 4 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/win/scoped_com_initializer.h
diff --git a/base/win/scoped_com_initializer.h b/base/win/scoped_com_initializer.h
index f0ea0ec565199f450aacbfa9c9d060a44b4a006d..48388fae2e75f6e99fa45078c61a887111bf38ca 100644
--- a/base/win/scoped_com_initializer.h
+++ b/base/win/scoped_com_initializer.h
@@ -50,6 +50,19 @@ class ScopedCOMInitializer {
thread_id_ = GetCurrentThreadId();
#endif
hr_ = CoInitializeEx(NULL, init);
+#ifndef NDEBUG
+ switch (hr_) {
+ case S_FALSE:
+ LOG(ERROR) << "Multiple CoInitialize() called for thread "
+ << thread_id_;
+ break;
+ case RPC_E_CHANGED_MODE:
+ DCHECK(false) << "Invalid COM thread model change";
+ break;
+ default:
+ break;
+ }
+#endif
}
HRESULT hr_;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698