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

Unified Diff: src/plugin/PluginClass.cpp

Issue 29332677: Noissue - Trace life cycle of 'CPluginClass' (Closed)
Patch Set: Created Dec. 15, 2015, 4:25 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/plugin/PluginClass.cpp
===================================================================
--- a/src/plugin/PluginClass.cpp
+++ b/src/plugin/PluginClass.cpp
@@ -92,6 +92,13 @@
CPluginClass::CPluginClass()
: m_webBrowser2(nullptr)
{
+ DEBUG_GENERAL([this]() -> std::wstring
+ {
+ std::wstring s = L"CPluginClass::<constructor>, this = ";
+ s += ToHexLiteral(this);
+ return s;
+ }());
+
//Use this line to debug memory leaks
// _CrtDumpMemoryLeaks();
@@ -112,6 +119,13 @@
CPluginClass::~CPluginClass()
{
+ DEBUG_GENERAL([this]() -> std::wstring
+ {
+ std::wstring s = L"CPluginClass::<destructor>, this = ";
+ s += ToHexLiteral(this);
+ return s;
+ }());
+
delete m_tab;
}
@@ -197,8 +211,7 @@
{
if (unknownSite)
{
-
- DEBUG_GENERAL(L"================================================================================\nNEW TAB UI\n================================================================================")
+ DEBUG_GENERAL(L"================================================================================\nNEW TAB UI\n================================================================================");
HRESULT hr = ::CoInitialize(NULL);
if (FAILED(hr))
@@ -214,6 +227,13 @@
{
throw std::logic_error("CPluginClass::SetSite - Unable to convert site pointer to IWebBrowser2*");
}
+ DEBUG_GENERAL([this]() -> std::wstring
+ {
+ std::wstringstream ss;
+ ss << L"CPluginClass::SetSite, this = " << ToHexLiteral(this);
+ ss << L", browser = " << ToHexLiteral(m_webBrowser2);
+ return ss.str();
+ }());
//register the mimefilter
//and only mimefilter
@@ -229,7 +249,6 @@
try
{
- DEBUG_GENERAL("Loaded as BHO");
HRESULT hr = DispEventAdvise(m_webBrowser2);
if (SUCCEEDED(hr))
{
@@ -258,6 +277,14 @@
}
else
{
+ DEBUG_GENERAL([this]() -> std::wstring
+ {
+ std::wstringstream ss;
+ ss << L"CPluginClass::SetSite, this = " << ToHexLiteral(this);
+ ss << L", browser = nullptr";
+ return ss.str();
+ }());
+
Unadvise();
// Destroy window
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld