diff -r 8df58d8c99e8 -r b3ffff030d5c libraries/btrace_parser/src/btrace_appresponse.cpp --- a/libraries/btrace_parser/src/btrace_appresponse.cpp Tue Oct 26 15:36:30 2010 +0100 +++ b/libraries/btrace_parser/src/btrace_appresponse.cpp Thu Oct 28 16:54:54 2010 +0100 @@ -18,17 +18,17 @@ // CBtraceAppResponse // -EXPORT_C CBtraceAppResponse* CBtraceAppResponse::NewL(CBtraceReader& aReader) +EXPORT_C CBtraceAppResponse* CBtraceAppResponse::NewL(CBtraceReader& aReader, CBtraceContext& aContext) { - CBtraceAppResponse* self = new (ELeave) CBtraceAppResponse(aReader); + CBtraceAppResponse* self = new (ELeave) CBtraceAppResponse(aReader, aContext); CleanupStack::PushL(self); self->ConstructL(); CleanupStack::Pop(self); return self; } -CBtraceAppResponse::CBtraceAppResponse(CBtraceReader& aReader) - : iReader(aReader) +CBtraceAppResponse::CBtraceAppResponse(CBtraceReader& aReader, CBtraceContext& aContext) + : iReader(aReader), iContext(aContext) { } @@ -53,14 +53,13 @@ { const TUint32* data = reinterpret_cast(aFrame.iData.Ptr()); const TAmTraceEventEvCapture event = static_cast(*data++); - const TUint32 processIdLowWord = *data++; - const TUint32 processIdHighWord = *data++; switch (event) { - case EAmTraceEventEvCaptureSystemAppResponse: + case EAmTraceEventEvCaptureAppResponse: { - SeenAppResponseL(aFrame.iTickCount, MAKE_TUINT64(processIdHighWord, processIdLowWord)); + const TInt32 wgId = *data++; + SeenAppResponseL(aFrame.iTickCount, wgId); } break; @@ -77,32 +76,36 @@ }; } -void CBtraceAppResponse::SeenAppResponseL(const TBtraceTickCount& aTickCount, const TProcessId& aProcessId) +void CBtraceAppResponse::SeenAppResponseL(const TBtraceTickCount& aTickCount, TInt aWindowGroupId) { - TInt ii = iNotifs.Count(); - while (--ii >= 0) + const TBtraceWindowGroupId* btraceWgId = iContext.FindWindowGroup(aWindowGroupId); + if (btraceWgId) { - TAppResponseNotif& nt = iNotifs[ii]; - if (nt.iProcessId == aProcessId) + TInt ii = iNotifs.Count(); + while (--ii >= 0) { - MBtraceAppResponseObserver& observer = nt.iObserver; - if (nt.iPersistence == ENotificationOneShot) + TAppResponseNotif& nt = iNotifs[ii]; + if (iContext.WindowGroupName(*btraceWgId).MatchF(nt.iWindowGroupNamePattern) != KErrNotFound) { - iNotifs.Remove(ii); + MBtraceAppResponseObserver& observer = nt.iObserver; + if (nt.iPersistence == ENotificationOneShot) + { + iNotifs.Remove(ii); + } + observer.HandleAppResponseSeenL(aTickCount); } - observer.HandleAppResponseSeenL(aTickCount); } - } + } } -EXPORT_C void CBtraceAppResponse::NotifyAppResponseL(MBtraceAppResponseObserver& aObserver, const TProcessId& aProcessId) +EXPORT_C void CBtraceAppResponse::NotifyAppResponseL(MBtraceAppResponseObserver& aObserver, const TDesC& aWindowGroupNamePattern) { - NotifyAppResponseL(aObserver, aProcessId, ENotificationOneShot); + NotifyAppResponseL(aObserver, aWindowGroupNamePattern, ENotificationOneShot); } -EXPORT_C void CBtraceAppResponse::NotifyAppResponseL(MBtraceAppResponseObserver& aObserver, const TProcessId& aProcessId, TBtraceNotificationPersistence aPersistence) +EXPORT_C void CBtraceAppResponse::NotifyAppResponseL(MBtraceAppResponseObserver& aObserver, const TDesC& aWindowGroupNamePattern, TBtraceNotificationPersistence aPersistence) { - TAppResponseNotif notify(aObserver, aProcessId, aPersistence); + TAppResponseNotif notify(aObserver, aWindowGroupNamePattern, aPersistence); User::LeaveIfError(iNotifs.Append(notify)); } @@ -122,7 +125,7 @@ // CBtraceAppResponse::TAppResponseNotif // -CBtraceAppResponse::TAppResponseNotif::TAppResponseNotif(MBtraceAppResponseObserver& aObserver, const TProcessId& aProcessId, TBtraceNotificationPersistence aPersistence) - : iObserver(aObserver), iProcessId(aProcessId), iPersistence(aPersistence) +CBtraceAppResponse::TAppResponseNotif::TAppResponseNotif(MBtraceAppResponseObserver& aObserver, const TDesC& aWindowGroupNamePattern, TBtraceNotificationPersistence aPersistence) + : iObserver(aObserver), iWindowGroupNamePattern(aWindowGroupNamePattern), iPersistence(aPersistence) { }