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

Side by Side Diff: src/plugin/PluginDebug.cpp

Issue 11013110: Cleanup (Closed)
Patch Set: More refactoring. Removing main thread, tab counting. Implementing SetPref and GetPref. Addressing … Created July 9, 2013, 12:59 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
OLDNEW
1 #include "PluginStdAfx.h" 1 #include "PluginStdAfx.h"
2 2
3 #include "PluginDebug.h" 3 #include "PluginDebug.h"
4 #include "PluginMutex.h" 4 #include "PluginMutex.h"
5 #include "PluginSettings.h" 5 #include "PluginSettings.h"
6 6
7 7
8 class CPluginDebugLock : public CPluginMutex 8 class CPluginDebugLock : public CPluginMutex
9 { 9 {
10 10
(...skipping 25 matching lines...) Expand all
36 CONSOLE(CT2A(text.GetString(), CP_UTF8)); 36 CONSOLE(CT2A(text.GetString(), CP_UTF8));
37 #endif 37 #endif
38 38
39 if (CPluginSettings::HasInstance()) 39 if (CPluginSettings::HasInstance())
40 { 40 {
41 #ifdef ENABLE_DEBUG_SPLIT_FILE 41 #ifdef ENABLE_DEBUG_SPLIT_FILE
42 CPluginSettings* settings = CPluginSettings::GetInstance(); 42 CPluginSettings* settings = CPluginSettings::GetInstance();
43 43
44 bool isWorkingThread = settings->IsWorkingThread(dwThreadId); 44 bool isWorkingThread = settings->IsWorkingThread(dwThreadId);
45 45
46 CString processor; 46 CString processor;
Wladimir Palant 2013/07/11 12:53:10 Aren't you leaving that variable uninitialized? Ho
Oleksandr 2013/07/22 00:48:16 Process ID isn't really a reliable identifier here
47 if (settings->IsMainProcess(dwProcessId) && settings->IsMainThread(dwThreadI d))
48 {
49 processor = L"main_thread";
50 }
51 else if (settings->IsMainProcess(dwProcessId) && settings->IsMainUiThread(dw ThreadId))
52 {
53 processor = L"main_ui";
54 }
55 else if (isWorkingThread)
56 {
57 processor = L"tab" + settings->GetTabNumber() + L"_thread";
58 }
59 else
60 {
61 processor = L"tab" + settings->GetTabNumber() + L"_ui";
62 }
63 #else 47 #else
64 if (dwProcessId == 0) 48 if (dwProcessId == 0)
65 { 49 {
66 dwProcessId = ::GetCurrentProcessId(); 50 dwProcessId = ::GetCurrentProcessId();
67 } 51 }
68 if (dwThreadId == 0) 52 if (dwThreadId == 0)
69 { 53 {
70 dwThreadId = ::GetCurrentThreadId(); 54 dwThreadId = ::GetCurrentThreadId();
71 } 55 }
72 56
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after
247 srcTrunc = src.Left(67) + L"..." + src.Right(30); 231 srcTrunc = src.Left(67) + L"..." + src.Right(30);
248 } 232 }
249 233
250 CString blocking; 234 CString blocking;
251 blocking.Format(L"Ignored %-12s %s %s", type, domain.IsEmpty()? L"-" : doma in, srcTrunc); 235 blocking.Format(L"Ignored %-12s %s %s", type, domain.IsEmpty()? L"-" : doma in, srcTrunc);
252 236
253 DebugResult(blocking); 237 DebugResult(blocking);
254 } 238 }
255 239
256 #endif // ENABLE_DEBUG_RESULT_IGNORED 240 #endif // ENABLE_DEBUG_RESULT_IGNORED
OLDNEW

Powered by Google App Engine
This is Rietveld