|
1 /* |
|
2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: |
|
15 * |
|
16 */ |
|
17 |
|
18 #include "MemSpyViewThreadInfoItemHeap.h" |
|
19 |
|
20 // Engine includes |
|
21 #include <memspy/engine/memspyengine.h> |
|
22 #include <memspy/engine/memspyengineobjectprocess.h> |
|
23 #include <memspy/engine/memspyengineobjectthread.h> |
|
24 #include <memspy/engine/memspyengineobjectcontainer.h> |
|
25 #include <memspy/engine/memspyengineobjectthreadinfoobjects.h> |
|
26 #include <memspy/engine/memspyengineobjectthreadinfocontainer.h> |
|
27 #include <memspy/engine/memspyenginehelperprocess.h> |
|
28 #include <memspy/engine/memspyenginehelperheap.h> |
|
29 |
|
30 // User includes |
|
31 #include "MemSpyContainerObserver.h" |
|
32 #include "MemSpyViewThreads.h" |
|
33 #include "MemSpyViewThreadInfoItemHeap.h" |
|
34 |
|
35 |
|
36 |
|
37 CMemSpyViewThreadInfoItemHeap::CMemSpyViewThreadInfoItemHeap( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver, CMemSpyThreadInfoContainer& aContainer ) |
|
38 : CMemSpyViewThreadInfoItemGeneric( aEngine, aObserver, aContainer, EMemSpyThreadInfoItemTypeHeap ) |
|
39 { |
|
40 } |
|
41 |
|
42 |
|
43 TBool CMemSpyViewThreadInfoItemHeap::HandleCommandL( TInt aCommand ) |
|
44 { |
|
45 TBool handled = ETrue; |
|
46 // |
|
47 switch ( aCommand ) |
|
48 { |
|
49 #ifndef __WINS__ |
|
50 case EMemSpyCmdHeapDataDump: |
|
51 OnCmdHeapDataL(); |
|
52 break; |
|
53 #endif |
|
54 case EMemSpyCmdHeapCellListing: |
|
55 OnCmdHeapCellListingL(); |
|
56 break; |
|
57 case EMemSpyCmdHeapInfoThread: |
|
58 OnCmdHeapInfoL(); |
|
59 break; |
|
60 |
|
61 default: |
|
62 handled = CMemSpyViewBase::HandleCommandL( aCommand ); |
|
63 break; |
|
64 } |
|
65 // |
|
66 return handled; |
|
67 } |
|
68 |
|
69 |
|
70 void CMemSpyViewThreadInfoItemHeap::OnCmdHeapDataL() |
|
71 { |
|
72 iEngine.HelperHeap().OutputHeapDataUserL( Thread() ); |
|
73 } |
|
74 |
|
75 |
|
76 void CMemSpyViewThreadInfoItemHeap::OnCmdHeapCellListingL() |
|
77 { |
|
78 iEngine.HelperHeap().OutputCellListingUserL( Thread() ); |
|
79 } |
|
80 |
|
81 |
|
82 void CMemSpyViewThreadInfoItemHeap::OnCmdHeapInfoL() |
|
83 { |
|
84 iEngine.HelperHeap().OutputHeapInfoUserL( Thread() ); |
|
85 } |
|
86 |
|
87 |
|
88 void CMemSpyViewThreadInfoItemHeap::DynInitMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane ) |
|
89 { |
|
90 if ( aResourceId == R_MEMSPY_MENUPANE ) |
|
91 { |
|
92 aMenuPane->SetItemDimmed( EMemSpyCmdHeap, Thread().IsDead() ); |
|
93 } |
|
94 } |