summaryrefslogtreecommitdiffstats
path: root/chrome/browser/metrics_service.h
diff options
context:
space:
mode:
authorpetersont@google.com <petersont@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-08-04 21:59:45 +0000
committerpetersont@google.com <petersont@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-08-04 21:59:45 +0000
commit252873ef94051e50ea9cb3a4e8fa1e1d17aef384 (patch)
treeeab3695e37b973f7f29f93a411cfd9d700f61c99 /chrome/browser/metrics_service.h
parent198ba17f199e64660ac7b0f54e0767201915f51f (diff)
downloadchromium_src-252873ef94051e50ea9cb3a4e8fa1e1d17aef384.zip
chromium_src-252873ef94051e50ea9cb3a4e8fa1e1d17aef384.tar.gz
chromium_src-252873ef94051e50ea9cb3a4e8fa1e1d17aef384.tar.bz2
Implemented xml parsing of UMA server response data.
Used libxml rather than scanf/the wrapper class XmlReader. More data from the response are recorded to be used later to control the transmissions. git-svn-id: svn://svn.chromium.org/chrome/trunk/src@341 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/metrics_service.h')
-rw-r--r--chrome/browser/metrics_service.h32
1 files changed, 26 insertions, 6 deletions
diff --git a/chrome/browser/metrics_service.h b/chrome/browser/metrics_service.h
index d16c6ca..dc65d45 100644
--- a/chrome/browser/metrics_service.h
+++ b/chrome/browser/metrics_service.h
@@ -207,10 +207,19 @@ class MetricsService : public NotificationObserver,
int response_code,
const ResponseCookies& cookies,
const std::string& data);
- // Extract the time interval suggested by the server for waiting after a log
- // transmision before starting the next transmision. The result is set into
- // interlog_duration_.
- void GetSuggestedInterlogTime(const std::string& server_data);
+
+ // Called by OnURLFetchComplete to handle the case when the server returned
+ // a response code not equal to 200.
+ void HandleBadResponseCode();
+
+ // Called by OnURLFetchComplete with data as the argument
+ // parses the xml returned by the server in the call to OnURLFetchComplete
+ // and extracts settings for subsequent frequency and content of log posts.
+ void GetSettingsFromResponseData(const std::string& data);
+
+ // This is a helper function for GetSettingsFromResponseData which iterates
+ // through the xml tree at the level of the <config> node.
+ void GetSettingsFromConfigNode(xmlNodePtr config_node);
// Records a window-related notification.
void LogWindowChange(NotificationType type,
@@ -332,9 +341,20 @@ class MetricsService : public NotificationObserver,
// histogram) so that we can send only the delta with the next log.
MetricsService::LoggedSampleMap logged_samples_;
- // The duration for which we build up a log. After that period, we try to
- // send the log (unless another log is already pending).
+ // The interval between consecutive log transmissions (to avoid hogging the
+ // outbound network link). This is usually also the duration for which we
+ // build up a log, but if other unsent-logs from previous sessions exist, we
+ // quickly transmit those unsent logs while we continue to build a log.
TimeDelta interlog_duration_;
+
+ // The maximum number of events which get transmitted in the log. This is
+ // provided by the UMA server in the server response data.
+ int event_limit_;
+
+ // The types of data that are to be included in the log. These are called
+ // "collectors" in the server response data.
+ std::set<std::string> collectors_;
+
// Indicate that a timer for sending the next log has already been queued,
// or that a URLFetch (i.e., log transmission) is in progress.
bool timer_pending_;