WEB开发网
开发学院手机开发Symbian 开发 Symbian 使用CEComFilter捕获系统HTTP请求 阅读

Symbian 使用CEComFilter捕获系统HTTP请求

 2010-07-21 04:24:00 来源:WEB开发网   
核心提示:7 8 public:9 // MHTTPFilter10 void MHFUnload(RHTTPSession aSession, THTTPFilterHandle aHandle);11 void MHFLoad(RHTTPSession aSession, THTTPFilterHandle aHandle)

7 8 public:

9 // MHTTPFilter10 void MHFUnload(RHTTPSession aSession, THTTPFilterHandle aHandle);

11 void MHFLoad(RHTTPSession aSession, THTTPFilterHandle aHandle);

12 void MHFRunL(RHTTPTransaction aTransaction, const THTTPEvent& aEvent);

13 14 private:

15 CFelixHttpFilter();

16 void ConstructL(TAny* aHttpSession);

17

18 private:

19 RStringF iFilterName;

20 };

21

2、关键类代码实现如下:

1 _LIT8(KFilterName, "FelixFilter");

2 3 CFelixHttpFilter::~CFelixHttpFilter()

4 {

5 iFilterName.Close();

6 }

7 8 CFelixHttpFilter* CFelixHttpFilter::NewLC(TAny* aHttpSession)

9 {

10 CFelixHttpFilter* self = new (ELeave) CFelixHttpFilter();

11 CleanupStack::PushL(self);

12 self->ConstructL(aHttpSession);

13 return self;

14 }

15 16 CFelixHttpFilter* CFelixHttpFilter::NewL(TAny* aHttpSession)

17 {

18 CFelixHttpFilter* self = CFelixHttpFilter::NewLC(aHttpSession);

19 CleanupStack::Pop(); // self;20 return self;

21 }

22 23 void CFelixHttpFilter::ConstructL(TAny* aHttpSession)

24 {

25 RHTTPSession& httpSession = *(reinterpret_cast(aHttpSession));

26

27 iFilterName = httpSession.StringPool().OpenFStringL(KFilterName);

28 CleanupClosePushL(iFilterName);

29

30 httpSession.FilterCollection().AddFilterL(*this, THTTPEvent::EAnyTransactionEvent, RStringF(), KAnyStatusCode, EClientFilters, iFilterName);

31 CleanupStack::Pop(&iFilterName);

32 }

33 34 void CFelixHttpFilter::MHFUnload(RHTTPSession aSession, THTTPFilterHandle aHandle)

35 {

36 delete this;

上一页  1 2 3 4 5 6  下一页

Tags:Symbian 使用 CEComFilter

编辑录入:coldstar [复制链接] [打 印]
赞助商链接