Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: src/plugin/PluginTabBase.cpp

Issue 29331643: Noissue - Make the use of 'QueryInterface' calls consistent (Closed)
Patch Set: Created Nov. 30, 2015, 6:01 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/plugin/PluginDomTraverserBase.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/plugin/PluginTabBase.cpp
===================================================================
--- a/src/plugin/PluginTabBase.cpp
+++ b/src/plugin/PluginTabBase.cpp
@@ -158,7 +158,7 @@
DEBUG_GENERAL(L"InjectABP. Injecting");
CComPtr<IDispatch> pDocDispatch;
browser->get_Document(&pDocDispatch);
- CComQIPtr<IHTMLDocument2> pDoc2 = pDocDispatch;
+ CComQIPtr<IHTMLDocument2> pDoc2(pDocDispatch);
if (!pDoc2)
{
DEBUG_ERROR_LOG(0, PLUGIN_ERROR_CREATE_SETTINGS_JAVASCRIPT, PLUGIN_ERROR_CREATE_SETTINGS_JAVASCRIPT_INVOKE, "CPluginTabBase::InjectABP - Failed to QI document");
@@ -171,7 +171,7 @@
DEBUG_ERROR_LOG(0, PLUGIN_ERROR_CREATE_SETTINGS_JAVASCRIPT, PLUGIN_ERROR_CREATE_SETTINGS_JAVASCRIPT_INVOKE, "CPluginTabBase::InjectABP - Failed to get parent window");
return;
}
- CComQIPtr<IDispatchEx> pWndEx = pWnd2;
+ CComQIPtr<IDispatchEx> pWndEx(pWnd2);
if (!pWndEx)
{
DEBUG_ERROR_LOG(0, PLUGIN_ERROR_CREATE_SETTINGS_JAVASCRIPT, PLUGIN_ERROR_CREATE_SETTINGS_JAVASCRIPT_INVOKE, "CPluginTabBase::InjectABP - Failed to QI dispatch");
@@ -237,22 +237,24 @@
return;
}
- CComQIPtr<IHTMLDocument2> pDoc = pDocDispatch;
+ CComQIPtr<IHTMLDocument2> pDoc(pDocDispatch);
if (!pDoc)
{
return;
}
+
CComPtr<IOleObject> pOleObj;
-
- pDocDispatch->QueryInterface(IID_IOleObject, (void**)&pOleObj);
-
-
+ pDocDispatch->QueryInterface(&pOleObj);
+ if (!pOleObj)
+ {
+ return;
+ }
CComPtr<IOleClientSite> pClientSite;
pOleObj->GetClientSite(&pClientSite);
if (pClientSite != NULL)
{
CComPtr<IDocHostUIHandler> docHostUIHandler;
- pClientSite->QueryInterface(IID_IDocHostUIHandler, (void**)&docHostUIHandler);
+ pClientSite->QueryInterface(&docHostUIHandler);
if (docHostUIHandler != NULL)
{
docHostUIHandler->UpdateUI();
« no previous file with comments | « src/plugin/PluginDomTraverserBase.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld