| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 |
| 11 | 11 |
| 12 #include <map> | 12 #include <map> |
| 13 #include <string> | 13 #include <string> |
| 14 #include <vector> | 14 #include <vector> |
| 15 | 15 |
| 16 #include "base/basictypes.h" | 16 #include "base/basictypes.h" |
| 17 #include "base/gtest_prod_util.h" | 17 #include "base/gtest_prod_util.h" |
| 18 #include "base/memory/weak_ptr.h" | 18 #include "base/memory/weak_ptr.h" |
| 19 #include "base/memory/scoped_ptr.h" | 19 #include "base/memory/scoped_ptr.h" |
| 20 #include "base/memory/weak_ptr.h" |
| 20 #include "base/process_util.h" | 21 #include "base/process_util.h" |
| 21 #include "chrome/browser/io_thread.h" | 22 #include "chrome/browser/io_thread.h" |
| 22 #include "chrome/common/metrics_helpers.h" | 23 #include "chrome/common/metrics_helpers.h" |
| 23 #include "content/common/child_process_info.h" | 24 #include "content/common/child_process_info.h" |
| 24 #include "content/public/common/url_fetcher_delegate.h" | 25 #include "content/public/common/url_fetcher_delegate.h" |
| 25 #include "content/public/browser/notification_observer.h" | 26 #include "content/public/browser/notification_observer.h" |
| 26 #include "content/public/browser/notification_registrar.h" | 27 #include "content/public/browser/notification_registrar.h" |
| 27 | 28 |
| 28 #if defined(OS_CHROMEOS) | 29 #if defined(OS_CHROMEOS) |
| 29 #include "chrome/browser/chromeos/external_metrics.h" | 30 #include "chrome/browser/chromeos/external_metrics.h" |
| (...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 362 // it. |next_window_id_| is used to track which IDs we have used so far. | 363 // it. |next_window_id_| is used to track which IDs we have used so far. |
| 363 typedef std::map<uintptr_t, int> WindowMap; | 364 typedef std::map<uintptr_t, int> WindowMap; |
| 364 WindowMap window_map_; | 365 WindowMap window_map_; |
| 365 int next_window_id_; | 366 int next_window_id_; |
| 366 | 367 |
| 367 // Buffer of child process notifications for quick access. See | 368 // Buffer of child process notifications for quick access. See |
| 368 // ChildProcessStats documentation above for more details. | 369 // ChildProcessStats documentation above for more details. |
| 369 struct ChildProcessStats; | 370 struct ChildProcessStats; |
| 370 std::map<string16, ChildProcessStats> child_process_stats_buffer_; | 371 std::map<string16, ChildProcessStats> child_process_stats_buffer_; |
| 371 | 372 |
| 372 ScopedRunnableMethodFactory<MetricsService> log_sender_factory_; | 373 base::WeakPtrFactory<MetricsService> log_sender_factory_; |
| 373 base::WeakPtrFactory<MetricsService> state_saver_factory_; | 374 base::WeakPtrFactory<MetricsService> state_saver_factory_; |
| 374 | 375 |
| 375 // Dictionary containing all the profile specific metrics. This is set | 376 // Dictionary containing all the profile specific metrics. This is set |
| 376 // at creation time from the prefs. | 377 // at creation time from the prefs. |
| 377 scoped_ptr<base::DictionaryValue> profile_dictionary_; | 378 scoped_ptr<base::DictionaryValue> profile_dictionary_; |
| 378 | 379 |
| 379 // The scheduler for determining when uploads should happen. | 380 // The scheduler for determining when uploads should happen. |
| 380 scoped_ptr<MetricsReportingScheduler> scheduler_; | 381 scoped_ptr<MetricsReportingScheduler> scheduler_; |
| 381 | 382 |
| 382 // Indicates that an asynchronous reporting step is running. | 383 // Indicates that an asynchronous reporting step is running. |
| (...skipping 23 matching lines...) Expand all Loading... |
| 406 friend class InstantFieldTrial; | 407 friend class InstantFieldTrial; |
| 407 friend bool prerender::IsOmniboxEnabled(Profile* profile); | 408 friend bool prerender::IsOmniboxEnabled(Profile* profile); |
| 408 | 409 |
| 409 // Returns true if prefs::kMetricsReportingEnabled is set. | 410 // Returns true if prefs::kMetricsReportingEnabled is set. |
| 410 static bool IsMetricsReportingEnabled(); | 411 static bool IsMetricsReportingEnabled(); |
| 411 | 412 |
| 412 DISALLOW_IMPLICIT_CONSTRUCTORS(MetricsServiceHelper); | 413 DISALLOW_IMPLICIT_CONSTRUCTORS(MetricsServiceHelper); |
| 413 }; | 414 }; |
| 414 | 415 |
| 415 #endif // CHROME_BROWSER_METRICS_METRICS_SERVICE_H_ | 416 #endif // CHROME_BROWSER_METRICS_METRICS_SERVICE_H_ |
| OLD | NEW |