The Thread Manager in Firefox2 - Mozilla

This is a discussion on The Thread Manager in Firefox2 - Mozilla ; Hello, I've decided to use The Thread Manager in my extension. It was introduced in Firefox3 and I'm wondering if its possible to register thread manager in Firefox2 so I could create my extension with backward compatibility. I'm still learning ...

+ Reply to Thread
Results 1 to 2 of 2

Thread: The Thread Manager in Firefox2

  1. The Thread Manager in Firefox2

    Hello,

    I've decided to use The Thread Manager in my extension. It was introduced in
    Firefox3 and I'm wondering if its possible to register thread manager in
    Firefox2 so I could create my extension with backward compatibility. I'm
    still learning XPCOM and I've already know how to register my own .so
    component and make everything work but I have no idea how to register thread
    manager in FF2.

    I assume it's possible to make use of it in Firefox2 as far as it's just
    another component. However, I don't know which files I should compile to
    create needed component and how to register it.
    Can I register it with my component's install.rdf file or it needs to be
    done from my C++ component with nsIComponentRegistrar function?

    I would really appreciate any help and especially links to some code where
    something similar is done.

    Filip Balejko

  2. Re: The Thread Manager in Firefox2

    On Mon, 5 May 2008 18:07:22 +0200, Filip wrote:
    > I've decided to use The Thread Manager in my extension. It was introduced in
    > Firefox3 and I'm wondering if its possible to register thread manager in
    > Firefox2 so I could create my extension with backward compatibility. I'm
    > still learning XPCOM and I've already know how to register my own .so
    > component and make everything work but I have no idea how to register thread
    > manager in FF2.
    >
    > I assume it's possible to make use of it in Firefox2 as far as it's just
    > another component. However, I don't know which files I should compile to
    > create needed component and how to register it.
    > Can I register it with my component's install.rdf file or it needs to be
    > done from my C++ component with nsIComponentRegistrar function?
    >
    > I would really appreciate any help and especially links to some code where
    > something similar is done.


    Here is one way of doing it in javascript (from FireFTP):

    if ("nsIThreadManager" in Components.interfaces) {
    this.eventQueue =
    Components.classes["@mozilla.org/thread-manager;1"].getService().currentThread;
    } else {
    this.threadService =
    Components.classes["@mozilla.org/thread;1"].getService(Components.interfaces.nsIThread);
    this.eventQueueService =
    Components.classes["@mozilla.org/event-queue-service;1"].getService(Components.interfaces.nsIEventQueueSer vice);
    this.eventQueue =
    this.eventQueueService.createFromIThread(this.thre adService.currentThread,true);
    }

    Phil

    --
    Philip Chee ,
    http://flashblock.mozdev.org/ http://xsidebar.mozdev.org
    Guard us from the she-wolf and the wolf, and guard us from the thief,
    oh Night, and so be good for us to pass.
    [ ]Proceed with Caution - Twisted Mind Under Construction!
    * TagZilla 0.066.6


+ Reply to Thread