Metrics extension compatibility with Google Toolbar

r=Jan.Varga

Change uuid and contractID's to avoid any potential conflicts w/ GTB.

--pete
This commit is contained in:
pete%mozdevgroup.com 2007-11-29 19:33:23 +00:00
Родитель a54dab992b
Коммит 0d6e215dff
7 изменённых файлов: 24 добавлений и 24 удалений

Просмотреть файл

@ -55,7 +55,7 @@
NS_DECL_CLASSINFO(nsMetricsService)
#define COLLECTOR_CONTRACTID(type) \
"@mozilla.org/metrics/collector;1?name=" type ":" NS_METRICS_NAMESPACE
"@mozilla.org/extensions/metrics/collector;1?name=" type ":" NS_METRICS_NAMESPACE
static NS_METHOD
nsMetricsServiceRegisterSelf(nsIComponentManager *compMgr,

Просмотреть файл

@ -1,3 +1,3 @@
pref("metrics.upload.enable", false);
pref("metrics.upload.uri", "");
pref("metrics.event-count", 0);
pref("extensions.mozilla.metrics.upload.enable", false);
pref("extensions.mozilla.metrics.upload.uri", "");
pref("extensions.mozilla.metrics.event-count", 0);

Просмотреть файл

@ -43,11 +43,11 @@
* data on behalf of the MetricsService. When the configuration file reequests
* collector "foo" in namespace "http://www.mozilla.org/metrics",
* the contract id
* "@mozilla.org/metrics/collector;1?name=http://www.mozilla.org/metrics:foo"
* "@mozilla.org/extensions/metrics/collector;1?name=http://www.mozilla.org/metrics:foo"
* is instantiated (using getSerivce). The collector is responsible for
* calling nsIMetricsService::logEvent() when it has something to log.
*/
[scriptable, uuid(9c6bd2a8-784a-4003-9534-faf45b4de64c)]
[scriptable, uuid(be965c17-848a-43d1-a9f6-b3f1c1bd8faa)]
interface nsIMetricsCollector : nsISupports
{
/**

Просмотреть файл

@ -60,7 +60,7 @@ interface nsIDOMWindow;
* (key/value pairs), and an ordered list of child items. The child items
* need not be unique; an item may be repeated.
*/
[scriptable, uuid(880b8655-15a4-4b72-b6d4-6e3325bca4b6)]
[scriptable, uuid(62f4528f-5c59-4e86-a7ee-f34b67d7d65f)]
interface nsIMetricsEventItem : nsISupports
{
/**
@ -130,7 +130,7 @@ interface nsIMetricsEventItem : nsISupports
readonly attribute long childCount;
};
[scriptable, uuid(289cd0d3-00b4-4554-9e6d-71eded08d1d8)]
[scriptable, uuid(0aad28fd-3478-4090-9730-0fff8c7683b5)]
interface nsIMetricsService : nsISupports
{
/**

Просмотреть файл

@ -41,12 +41,12 @@
#define NS_METRICSSERVICE_CLASSNAME "nsMetricsService"
#define NS_METRICSSERVICE_CID \
{ /* 6f72134c-8855-4c07-b181-90d22bf7a0aa */ \
0x6f72134c, \
0x8855, \
0x4c07, \
{0xb1, 0x81, 0x90, 0xd2, 0x2b, 0xf7, 0xa0, 0xaa} \
{ /* 45f190da-8e83-4389-8b42-6939417c3297 */ \
0x45f190da, \
0x8e83, \
0x4389, \
{0x8b, 0x42, 0x69, 0x39, 0x41, 0x7c, 0x32, 0x97} \
}
#define NS_METRICSSERVICE_CONTRACTID "@mozilla.org/metrics/service;1"
#define NS_METRICSSERVICE_CONTRACTID "@mozilla.org/extensions/metrics/service;1"
#endif // nsMetricsModule_h__

Просмотреть файл

@ -112,10 +112,10 @@ PRLogModuleInfo *gMetricsLog;
#endif
static const char kQuitApplicationTopic[] = "quit-application";
static const char kUploadTimePref[] = "metrics.upload.next-time";
static const char kPingTimePref[] = "metrics.upload.next-ping";
static const char kEventCountPref[] = "metrics.event-count";
static const char kEnablePref[] = "metrics.upload.enable";
static const char kUploadTimePref[] = "extensions.mozilla.metrics.upload.next-time";
static const char kPingTimePref[] = "extensions.mozilla.metrics.upload.next-ping";
static const char kEventCountPref[] = "extensions.mozilla.metrics.event-count";
static const char kEnablePref[] = "extensions.mozilla.metrics.upload.enable";
const PRUint32 nsMetricsService::kMaxRetries = 3;
const PRUint32 nsMetricsService::kMetricsVersion = 2;
@ -834,7 +834,7 @@ nsMetricsService::EnableCollectors()
for (i = 0; i < enabledCollectors.Length(); ++i) {
const nsString &name = enabledCollectors[i];
if (!mCollectorMap.GetWeak(name)) {
nsCString contractID("@mozilla.org/metrics/collector;1?name=");
nsCString contractID("@mozilla.org/extensions/metrics/collector;1?name=");
contractID.Append(NS_ConvertUTF16toUTF8(name));
nsCOMPtr<nsIMetricsCollector> coll = do_GetService(contractID.get());
@ -981,10 +981,10 @@ nsMetricsService::StartCollection()
nsCOMPtr<nsIPrefBranch> prefs = do_GetService(NS_PREFSERVICE_CONTRACTID);
NS_ENSURE_STATE(prefs);
prefs->GetIntPref("metrics.event-count", &mEventCount);
prefs->GetIntPref("extensions.mozilla.metrics.event-count", &mEventCount);
// Update the session id pref for the new session
static const char kSessionIDPref[] = "metrics.last-session-id";
static const char kSessionIDPref[] = "extensions.mozilla.metrics.last-session-id";
PRInt32 sessionID = -1;
prefs->GetIntPref(kSessionIDPref, &sessionID);
mSessionID.Cut(0, PR_UINT32_MAX);
@ -1191,7 +1191,7 @@ nsMetricsService::UploadData()
nsCString spec;
nsCOMPtr<nsIPrefBranch> prefs = do_GetService(NS_PREFSERVICE_CONTRACTID);
if (prefs) {
prefs->GetCharPref("metrics.upload.uri", getter_Copies(spec));
prefs->GetCharPref("extensions.mozilla.metrics.upload.uri", getter_Copies(spec));
}
if (spec.IsEmpty()) {
MS_LOG(("Upload URI not set"));
@ -1321,7 +1321,7 @@ nsMetricsService::OpenCompleteXMLStream(nsILocalFile *dataFile,
{
// Construct a full XML document using the header, file contents, and
// footer. We need to generate a client id now if one doesn't exist.
static const char kClientIDPref[] = "metrics.client-id";
static const char kClientIDPref[] = "extensions.mozilla.metrics.client-id";
nsCOMPtr<nsIPrefBranch> prefs = do_GetService(NS_PREFSERVICE_CONTRACTID);
NS_ENSURE_STATE(prefs);

Просмотреть файл

@ -37,7 +37,7 @@
// Common functions for MetricsService tests
function getMetricsService() {
return Components.classes["@mozilla.org/metrics/service;1"]
return Components.classes["@mozilla.org/extensions/metrics/service;1"]
.getService(Components.interfaces.nsIMetricsService);
}