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 | 10 |
(...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
341 | 341 |
342 // Prepared the staged log to be passed to the server. Upon return, | 342 // Prepared the staged log to be passed to the server. Upon return, |
343 // current_fetch_ should be reset with its upload data set to a compressed | 343 // current_fetch_ should be reset with its upload data set to a compressed |
344 // copy of the staged log. | 344 // copy of the staged log. |
345 void PrepareFetchWithStagedLog(); | 345 void PrepareFetchWithStagedLog(); |
346 | 346 |
347 // Implementation of net::URLFetcherDelegate. Called after transmission | 347 // Implementation of net::URLFetcherDelegate. Called after transmission |
348 // completes (either successfully or with failure). | 348 // completes (either successfully or with failure). |
349 virtual void OnURLFetchComplete(const net::URLFetcher* source) OVERRIDE; | 349 virtual void OnURLFetchComplete(const net::URLFetcher* source) OVERRIDE; |
350 | 350 |
351 // Logs debugging details, for the case where the server returns a response | |
352 // code other than 200. | |
353 void LogBadResponseCode(int response_code, bool is_xml); | |
354 | |
355 // Records a window-related notification. |window_or_tab| is either a pointer | 351 // Records a window-related notification. |window_or_tab| is either a pointer |
356 // to a WebContents (for a tab) or a Browser (for a window). | 352 // to a WebContents (for a tab) or a Browser (for a window). |
357 void LogWindowOrTabChange(int type, uintptr_t window_or_tab); | 353 void LogWindowOrTabChange(int type, uintptr_t window_or_tab); |
358 | 354 |
359 // Reads, increments and then sets the specified integer preference. | 355 // Reads, increments and then sets the specified integer preference. |
360 void IncrementPrefValue(const char* path); | 356 void IncrementPrefValue(const char* path); |
361 | 357 |
362 // Reads, increments and then sets the specified long preference that is | 358 // Reads, increments and then sets the specified long preference that is |
363 // stored as a string. | 359 // stored as a string. |
364 void IncrementLongPrefsValue(const char* path); | 360 void IncrementLongPrefsValue(const char* path); |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
434 // The list of plugins which was retrieved on the file thread. | 430 // The list of plugins which was retrieved on the file thread. |
435 std::vector<webkit::WebPluginInfo> plugins_; | 431 std::vector<webkit::WebPluginInfo> plugins_; |
436 | 432 |
437 // Google Update statistics, which were retrieved on a blocking pool thread. | 433 // Google Update statistics, which were retrieved on a blocking pool thread. |
438 GoogleUpdateMetrics google_update_metrics_; | 434 GoogleUpdateMetrics google_update_metrics_; |
439 | 435 |
440 // The initial log, used to record startup metrics. | 436 // The initial log, used to record startup metrics. |
441 scoped_ptr<MetricsLog> initial_log_; | 437 scoped_ptr<MetricsLog> initial_log_; |
442 | 438 |
443 // The outstanding transmission appears as a URL Fetch operation. | 439 // The outstanding transmission appears as a URL Fetch operation. |
444 scoped_ptr<net::URLFetcher> current_fetch_xml_; | 440 scoped_ptr<net::URLFetcher> current_fetch_; |
445 scoped_ptr<net::URLFetcher> current_fetch_proto_; | |
446 | |
447 // The URLs for the XML and protobuf metrics servers. | |
448 string16 server_url_xml_; | |
449 string16 server_url_proto_; | |
450 | 441 |
451 // The TCP/UDP echo server to collect network connectivity stats. | 442 // The TCP/UDP echo server to collect network connectivity stats. |
452 std::string network_stats_server_; | 443 std::string network_stats_server_; |
453 | 444 |
454 // The HTTP pipelining test server. | 445 // The HTTP pipelining test server. |
455 std::string http_pipelining_test_server_; | 446 std::string http_pipelining_test_server_; |
456 | 447 |
457 // The identifier that's sent to the server with the log reports. | 448 // The identifier that's sent to the server with the log reports. |
458 std::string client_id_; | 449 std::string client_id_; |
459 | 450 |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
526 friend class extensions::ExtensionDownloader; | 517 friend class extensions::ExtensionDownloader; |
527 friend class extensions::ManifestFetchData; | 518 friend class extensions::ManifestFetchData; |
528 | 519 |
529 // Returns true if prefs::kMetricsReportingEnabled is set. | 520 // Returns true if prefs::kMetricsReportingEnabled is set. |
530 static bool IsMetricsReportingEnabled(); | 521 static bool IsMetricsReportingEnabled(); |
531 | 522 |
532 DISALLOW_IMPLICIT_CONSTRUCTORS(MetricsServiceHelper); | 523 DISALLOW_IMPLICIT_CONSTRUCTORS(MetricsServiceHelper); |
533 }; | 524 }; |
534 | 525 |
535 #endif // CHROME_BROWSER_METRICS_METRICS_SERVICE_H_ | 526 #endif // CHROME_BROWSER_METRICS_METRICS_SERVICE_H_ |
OLD | NEW |