Back to index

lightning-sunbird  0.9+nobinonly
Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes
nsWindowCollector Class Reference

#include <nsWindowCollector.h>

Inheritance diagram for nsWindowCollector:
Inheritance graph
Collaboration diagram for nsWindowCollector:
Collaboration graph

List of all members.

Public Member Functions

nsWindowCollector ()
void LogWindowOpen (nsITimer *timer, nsISupports *subject)
void onAttach ()
 Notification that this collector should be enabled.
void onDetach ()
 Notification that this collector is no longer enabled.
void onNewLog ()
 Notification that the MetricsService is starting a new event log.
void observe (in nsISupports aSubject, in string aTopic, in wstring aData)
 Observe will be called when there is a notification for the topic |aTopic|.

Private Member Functions

 ~nsWindowCollector ()

Static Private Member Functions

static void WindowOpenCallback (nsITimer *timer, void *closure)

Private Attributes

nsTArray< nsCOMPtr< nsITimer > > mWindowOpenTimers

Detailed Description

Definition at line 82 of file nsWindowCollector.h.

Constructor & Destructor Documentation

Definition at line 53 of file nsWindowCollector.cpp.


Definition at line 57 of file nsWindowCollector.cpp.


Member Function Documentation

void nsWindowCollector::LogWindowOpen ( nsITimer timer,
nsISupports *  subject 

Definition at line 135 of file nsWindowCollector.cpp.

  nsCOMPtr<nsPIDOMWindow> window = do_QueryInterface(subject);

  if (!window) {

  nsCOMPtr<nsIDOMWindowInternal> opener;

  nsCOMPtr<nsIWritablePropertyBag2> properties;
  if (!properties) {

  if (opener) {



  nsMetricsService *ms = nsMetricsService::get();
  if (ms) {
    ms->LogEvent(NS_LITERAL_STRING("window"), properties);

Here is the call graph for this function:

void nsIObserver::observe ( in nsISupports  aSubject,
in string  aTopic,
in wstring  aData 
) [inherited]

Observe will be called when there is a notification for the topic |aTopic|.

This assumes that the object implementing this interface has been registered with an observer service such as the nsIObserverService.

If you expect multiple topics/subjects, the impl is responsible for filtering.

You should not modify, add, remove, or enumerate notifications in the implemention of observe.

aSubject: Notification specific interface pointer.
aTopic: The notification topic or subject.
aData: Notification specific wide string. subject event.

Notification that this collector should be enabled.

The collector should register itself for observer and event notifications as necessary.

Notification that this collector is no longer enabled.

The collector should unregister itself from observer and event notifications so that the object can be freed.

Notification that the MetricsService is starting a new event log.

This happens after any onDetach() notifications that result from parsing the new configuration.

void nsWindowCollector::WindowOpenCallback ( nsITimer timer,
void closure 
) [static, private]

Definition at line 126 of file nsWindowCollector.cpp.

  WindowOpenClosure *wc = NS_STATIC_CAST(WindowOpenClosure *, closure);
  wc->collector->LogWindowOpen(timer, wc->subject);

  delete wc;

Member Data Documentation

Definition at line 102 of file nsWindowCollector.h.

The documentation for this class was generated from the following files: