| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 // This file defines a service that collects information about the user | 5 // This file defines a service that collects information about the user |
| 6 // experience in order to help improve future versions of the app. | 6 // experience in order to help improve future versions of the app. |
| 7 | 7 |
| 8 #ifndef CHROME_BROWSER_METRICS_METRICS_SERVICE_H_ | 8 #ifndef CHROME_BROWSER_METRICS_METRICS_SERVICE_H_ |
| 9 #define CHROME_BROWSER_METRICS_METRICS_SERVICE_H_ | 9 #define CHROME_BROWSER_METRICS_METRICS_SERVICE_H_ |
| 10 #pragma once | 10 #pragma once |
| (...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 284 // current_fetch_ should be reset with its upload data set to a compressed | 284 // current_fetch_ should be reset with its upload data set to a compressed |
| 285 // copy of the staged log. | 285 // copy of the staged log. |
| 286 void PrepareFetchWithStagedLog(); | 286 void PrepareFetchWithStagedLog(); |
| 287 | 287 |
| 288 // Implementation of net::URLFetcherDelegate. Called after transmission | 288 // Implementation of net::URLFetcherDelegate. Called after transmission |
| 289 // completes (either successfully or with failure). | 289 // completes (either successfully or with failure). |
| 290 virtual void OnURLFetchComplete(const net::URLFetcher* source) OVERRIDE; | 290 virtual void OnURLFetchComplete(const net::URLFetcher* source) OVERRIDE; |
| 291 | 291 |
| 292 // Logs debugging details, for the case where the server returns a response | 292 // Logs debugging details, for the case where the server returns a response |
| 293 // code other than 200. | 293 // code other than 200. |
| 294 void LogBadResponseCode(); | 294 void LogBadResponseCode(int response_code, bool is_xml); |
| 295 | 295 |
| 296 // Records a window-related notification. | 296 // Records a window-related notification. |
| 297 void LogWindowChange(int type, | 297 void LogWindowChange(int type, |
| 298 const content::NotificationSource& source, | 298 const content::NotificationSource& source, |
| 299 const content::NotificationDetails& details); | 299 const content::NotificationDetails& details); |
| 300 | 300 |
| 301 // Reads, increments and then sets the specified integer preference. | 301 // Reads, increments and then sets the specified integer preference. |
| 302 void IncrementPrefValue(const char* path); | 302 void IncrementPrefValue(const char* path); |
| 303 | 303 |
| 304 // Reads, increments and then sets the specified long preference that is | 304 // Reads, increments and then sets the specified long preference that is |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 388 // Google Update statistics, which were retrieved on a blocking pool thread. | 388 // Google Update statistics, which were retrieved on a blocking pool thread. |
| 389 GoogleUpdateMetrics google_update_metrics_; | 389 GoogleUpdateMetrics google_update_metrics_; |
| 390 | 390 |
| 391 // The initial log, used to record startup metrics. | 391 // The initial log, used to record startup metrics. |
| 392 scoped_ptr<MetricsLog> initial_log_; | 392 scoped_ptr<MetricsLog> initial_log_; |
| 393 | 393 |
| 394 // The outstanding transmission appears as a URL Fetch operation. | 394 // The outstanding transmission appears as a URL Fetch operation. |
| 395 scoped_ptr<net::URLFetcher> current_fetch_xml_; | 395 scoped_ptr<net::URLFetcher> current_fetch_xml_; |
| 396 scoped_ptr<net::URLFetcher> current_fetch_proto_; | 396 scoped_ptr<net::URLFetcher> current_fetch_proto_; |
| 397 | 397 |
| 398 // Cached responses from the XML request while we wait for a response to the | |
| 399 // protubuf request. | |
| 400 int response_code_; | |
| 401 std::string response_status_; | |
| 402 std::string response_data_; | |
| 403 | |
| 404 // The URLs for the XML and protobuf metrics servers. | 398 // The URLs for the XML and protobuf metrics servers. |
| 405 string16 server_url_xml_; | 399 string16 server_url_xml_; |
| 406 string16 server_url_proto_; | 400 string16 server_url_proto_; |
| 407 | 401 |
| 408 // The TCP/UDP echo server to collect network connectivity stats. | 402 // The TCP/UDP echo server to collect network connectivity stats. |
| 409 std::string network_stats_server_; | 403 std::string network_stats_server_; |
| 410 | 404 |
| 411 // The HTTP pipelining test server. | 405 // The HTTP pipelining test server. |
| 412 std::string http_pipelining_test_server_; | 406 std::string http_pipelining_test_server_; |
| 413 | 407 |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 478 friend bool prerender::IsOmniboxEnabled(Profile* profile); | 472 friend bool prerender::IsOmniboxEnabled(Profile* profile); |
| 479 friend class extensions::ExtensionDownloader; | 473 friend class extensions::ExtensionDownloader; |
| 480 | 474 |
| 481 // Returns true if prefs::kMetricsReportingEnabled is set. | 475 // Returns true if prefs::kMetricsReportingEnabled is set. |
| 482 static bool IsMetricsReportingEnabled(); | 476 static bool IsMetricsReportingEnabled(); |
| 483 | 477 |
| 484 DISALLOW_IMPLICIT_CONSTRUCTORS(MetricsServiceHelper); | 478 DISALLOW_IMPLICIT_CONSTRUCTORS(MetricsServiceHelper); |
| 485 }; | 479 }; |
| 486 | 480 |
| 487 #endif // CHROME_BROWSER_METRICS_METRICS_SERVICE_H_ | 481 #endif // CHROME_BROWSER_METRICS_METRICS_SERVICE_H_ |
| OLD | NEW |