Back to index

lightning-sunbird  0.9+nobinonly
Static Public Member Functions
nsMetricsUtils Class Reference

#include <nsMetricsService.h>

List of all members.

Static Public Member Functions

static nsresult NewPropertyBag (nsIWritablePropertyBag2 **result)
static nsresult AddChildItem (nsIMetricsEventItem *parent, const nsAString &childName, nsIPropertyBag *childProperties)
static PRBool GetRandomNoise (void *buf, PRSize size)
static nsresult CreateElement (nsIDOMDocument *ownerDoc, const nsAString &tag, nsIDOMElement **element)
static PRBool IsSubframe (nsIDocShellTreeItem *docShell)
static PRUint32 FindWindowForNode (nsIDOMNode *node)

Detailed Description

Definition at line 296 of file nsMetricsService.h.


Member Function Documentation

nsresult nsMetricsUtils::AddChildItem ( nsIMetricsEventItem parent,
const nsAString &  childName,
nsIPropertyBag childProperties 
) [static]

Definition at line 1701 of file nsMetricsService.cpp.

{
  nsCOMPtr<nsIMetricsEventItem> item;
  nsMetricsService::get()->CreateEventItem(childName, getter_AddRefs(item));
  NS_ENSURE_STATE(item);

  item->SetProperties(childProperties);

  nsresult rv = parent->AppendChild(item);
  NS_ENSURE_SUCCESS(rv, rv);

  return NS_OK;
}

Here is the call graph for this function:

Here is the caller graph for this function:

nsresult nsMetricsUtils::CreateElement ( nsIDOMDocument ownerDoc,
const nsAString &  tag,
nsIDOMElement **  element 
) [static]

Definition at line 1734 of file nsMetricsService.cpp.

{
  return ownerDoc->CreateElementNS(NS_LITERAL_STRING(NS_METRICS_NAMESPACE),
                                   tag, element);
}

Here is the caller graph for this function:

Definition at line 1764 of file nsMetricsService.cpp.

{
  nsCOMPtr<nsIDOMDocument> ownerDoc;
  node->GetOwnerDocument(getter_AddRefs(ownerDoc));
  NS_ENSURE_STATE(ownerDoc);

  nsCOMPtr<nsIDOMDocumentView> docView = do_QueryInterface(ownerDoc);
  NS_ENSURE_STATE(docView);

  nsCOMPtr<nsIDOMAbstractView> absView;
  docView->GetDefaultView(getter_AddRefs(absView));
  NS_ENSURE_STATE(absView);

  nsCOMPtr<nsIDOMWindow> window = do_QueryInterface(absView);
  NS_ENSURE_STATE(window);

  return nsMetricsService::GetWindowID(window);
}

Here is the call graph for this function:

Here is the caller graph for this function:

PRBool nsMetricsUtils::GetRandomNoise ( void buf,
PRSize  size 
) [static]

Definition at line 1718 of file nsMetricsService.cpp.

{
  PRSize nbytes = 0;
  while (nbytes < size) {
    PRSize n = PR_GetRandomNoise(
        NS_STATIC_CAST(char *, buf) + nbytes, size - nbytes);
    if (n == 0) {
      MS_LOG(("Couldn't get any random bytes"));
      return PR_FALSE;
    }
    nbytes += n;
  }
  return PR_TRUE;
}

Here is the caller graph for this function:

Definition at line 1743 of file nsMetricsService.cpp.

{
  // Consider the docshell to be a subframe if it's is content, not chrome,
  // and has a parent docshell which is also content.
  if (!docShell) {
    return PR_FALSE;
  }

  PRInt32 itemType;
  docShell->GetItemType(&itemType);
  if (itemType != nsIDocShellTreeItem::typeContent) {
    return PR_FALSE;
  }

  nsCOMPtr<nsIDocShellTreeItem> parent;
  docShell->GetSameTypeParent(getter_AddRefs(parent));
  return (parent != nsnull);
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 1695 of file nsMetricsService.cpp.

{
  return CallCreateInstance("@mozilla.org/hash-property-bag;1", result);
}

Here is the call graph for this function:

Here is the caller graph for this function:


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