mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-16 22:04:36 +00:00
change <load> event to <document action='load'> for consistency (bug 330711). r=marria
This commit is contained in:
parent
111cf37ffb
commit
0ec527b6ae
@ -256,8 +256,13 @@ nsLoadCollector::OnStateChange(nsIWebProgress *webProgress,
|
||||
} else if (flags & STATE_STOP) {
|
||||
RequestEntry entry;
|
||||
if (mRequestMap.Get(request, &entry)) {
|
||||
nsHashPropertyBag *props = entry.properties;
|
||||
// Log a <document action="load"> event
|
||||
|
||||
nsHashPropertyBag *props = entry.properties;
|
||||
rv = props->SetPropertyAsACString(NS_LITERAL_STRING("action"),
|
||||
NS_LITERAL_CSTRING("load"));
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
// Compute the load time now that we have the end time.
|
||||
PRInt64 loadTime = (PR_Now() - entry.startTime) / PR_USEC_PER_MSEC;
|
||||
rv = props->SetPropertyAsUint64(NS_LITERAL_STRING("loadtime"), loadTime);
|
||||
@ -272,7 +277,7 @@ nsLoadCollector::OnStateChange(nsIWebProgress *webProgress,
|
||||
}
|
||||
|
||||
nsMetricsService *ms = nsMetricsService::get();
|
||||
rv = ms->LogEvent(NS_LITERAL_STRING("load"), props);
|
||||
rv = ms->LogEvent(NS_LITERAL_STRING("document"), props);
|
||||
|
||||
mRequestMap.Remove(request);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
@ -42,7 +42,7 @@
|
||||
// This file defines the load collector class, which monitors requests using
|
||||
// the document loader service and records the events into the metrics service.
|
||||
//
|
||||
// The load collector logs <load/> events.
|
||||
// The load collector logs <document action="load"/> events.
|
||||
// This event has the following attributes:
|
||||
//
|
||||
// origin: The action which initiated the load (string). Possible values are:
|
||||
|
@ -97,7 +97,7 @@ nsMetricsConfig::Load(nsIFile *file)
|
||||
// xmlns:foo="http://foo.com/metrics">
|
||||
// <collectors>
|
||||
// <collector type="ui"/>
|
||||
// <collector type="load"/>
|
||||
// <collector type="document"/>
|
||||
// <collector type="window"/>
|
||||
// <collector type="foo:mystat"/>
|
||||
// </collectors>
|
||||
|
@ -367,7 +367,7 @@ nsMetricsService::EnableCollectors()
|
||||
//
|
||||
nsresult rv;
|
||||
if (mConfig.IsEventEnabled(NS_LITERAL_STRING(NS_METRICS_NAMESPACE),
|
||||
NS_LITERAL_STRING("load"))) {
|
||||
NS_LITERAL_STRING("document"))) {
|
||||
rv = nsLoadCollector::Startup();
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
} else {
|
||||
|
Loading…
x
Reference in New Issue
Block a user