Back to index

lightning-sunbird  0.9+nobinonly
Defines | Functions
nsMetricsConfig.cpp File Reference
#include "nsMetricsService.h"
#include "nsStringUtils.h"
#include "nsIDOMDocument.h"
#include "nsIDOMParser.h"
#include "nsIDOMElement.h"
#include "nsIDOM3Node.h"
#include "nsIFileStreams.h"
#include "nsILocalFile.h"
#include "nsComponentManagerUtils.h"
#include "nsNetCID.h"
#include "prprf.h"
#include "nsTArray.h"
#include "nsIDOMSerializer.h"

Go to the source code of this file.

Defines

#define NS_DEFAULT_UPLOAD_INTERVAL_SEC   60 * 5

Functions

static const nsString MakeKey (const nsAString &eventNS, const nsAString &eventName)
static void SplitKey (const nsString &key, nsString &eventNS, nsString &eventName)
static void ReadIntegerAttr (nsIDOMElement *elem, const nsAString &attrName, PRInt32 *result)

Define Documentation

Definition at line 53 of file nsMetricsConfig.cpp.


Function Documentation

static const nsString MakeKey ( const nsAString &  eventNS,
const nsAString &  eventName 
) [static]

Definition at line 58 of file nsMetricsConfig.cpp.

{
  // Since eventName must be a valid XML NCName, we can use ':' to separate
  // eventName from eventNS when formulating our hash key.
  NS_ASSERTION(FindChar(eventName, ':') == -1, "Not a valid NCName");

  nsString key;
  key.Append(eventName);
  key.Append(':');
  key.Append(eventNS);
  return key;
}

Here is the call graph for this function:

Here is the caller graph for this function:

static void ReadIntegerAttr ( nsIDOMElement elem,
const nsAString &  attrName,
PRInt32 result 
) [static]

Definition at line 86 of file nsMetricsConfig.cpp.

{
  nsString attrValue;
  elem->GetAttribute(attrName, attrValue);

  NS_ConvertUTF16toUTF8 attrValueUtf8(attrValue);
  PR_sscanf(attrValueUtf8.get(), "%ld", result);
}

Here is the call graph for this function:

Here is the caller graph for this function:

static void SplitKey ( const nsString key,
nsString eventNS,
nsString eventName 
) [static]

Definition at line 72 of file nsMetricsConfig.cpp.

{
  PRInt32 colon = FindChar(key, ':');
  if (colon == -1) {
    NS_ERROR("keys from MakeKey should always have a colon");
    return;
  }

  eventName = Substring(key, 0, colon);
  eventNS = Substring(key, colon + 1, key.Length() - colon - 1);
}

Here is the call graph for this function:

Here is the caller graph for this function: