mozilla

Compare Revisions

nsISupports proxies

Change Revisions

Revision 58605:

Revision 58605 by Dmose on

Revision 58606:

Revision 58606 by pospec4444 on

Title:
nsISupports proxies
nsISupports proxies
Slug:
nsISupports_proxies
nsISupports_proxies
Tags:
NeedsHelp, XPCOM, NeedsUpdate, Obsolete
NeedsHelp, XPCOM, NeedsUpdate, Obsolete
Content:

Revision 58605
Revision 58606
n91        NS_WITH_SERVICE( nsIProxyObjectManager, pIProxyObjectManan91        nsCOMPtr<nsiproxyobjectmanager> pIProxyObjectManage
>ger, kProxyObjectManagerCID, &rv);>r(do_GetService("@mozilla.org/xpcomproxy;1", &rv));
n94        rv = pIProxyObjectManager->GetProxyForObject( NS_UI_THn94        nsCOMPtr<ifoo> pTestObj(do_CreateInstance(FOO_CONTR
>READ_EVENTQ,>ACTID, &rv));
95                                                  nsITestProxy::G95        if(NS_FAILED(rv)) return rv;
>etIID(), 
96                                                  createdTestObje
>ct, 
97                                                  PROXY_SYNC | PR
>OXY_ALWAYS, 
98                                                  (void**)proxyTo
>TestObject); 
n100    // we do not care about the real object anymore. ie. GetProxyn97        nsCOMPtr<iformfiller> pProxy;
>Object 
101    // refcounts it.98        rv = pIProxyObjectManager->GetProxyForObject(NS_PROXY_
 >TO_MAIN_THREAD,
102        NS_RELEASE(createdTestObject);99                                                  IFoo::GetIID(),
100                                                  pTestObj,
101                                                  NS_PROXY_SYNC |
 > NS_PROXY_ALWAYS,
102                                                  getter_AddRefs(
 >pProxy));
103        if(NS_FAILED(rv)) return rv;
n104        proxyToTestObject->Test1(x,y,z);n105        // we do not care about the real object anymore.
106        // ie. GetProxyObject refcounts it.
107        NS_RELEASE(pTestObj);
nn109        pProxy->Bar();
106        NS_RELEASE(proxyToTestObject);110        NS_RELEASE(pProxy);
111</iformfiller></ifoo></nsiproxyobjectmanager>
t109      <br>t114      &nbsp;

Back to History