Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3173)

Unified Diff: chrome/browser/metrics/metrics_service.cc

Issue 10117034: Don't cache the IO thread in the MetricsService (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix Linux compile (IWYU) Created 8 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/metrics/metrics_service.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/metrics/metrics_service.cc
diff --git a/chrome/browser/metrics/metrics_service.cc b/chrome/browser/metrics/metrics_service.cc
index 9fc36d0e1426054195b69b3d67cbe49cb6b5915e..92ee6021a7e0fea7efb9b6b165200fb54f814285 100644
--- a/chrome/browser/metrics/metrics_service.cc
+++ b/chrome/browser/metrics/metrics_service.cc
@@ -158,6 +158,7 @@
#include "chrome/browser/browser_process.h"
#include "chrome/browser/extensions/extension_service.h"
#include "chrome/browser/extensions/process_map.h"
+#include "chrome/browser/io_thread.h"
#include "chrome/browser/memory_details.h"
#include "chrome/browser/metrics/histogram_synchronizer.h"
#include "chrome/browser/metrics/metrics_log.h"
@@ -392,7 +393,6 @@ MetricsService::MetricsService()
: recording_active_(false),
reporting_active_(false),
state_(INITIALIZED),
- io_thread_(NULL),
idle_since_last_transmission_(false),
next_window_id_(0),
ALLOW_THIS_IN_INITIALIZER_LIST(self_ptr_factory_(this)),
@@ -787,7 +787,6 @@ void MetricsService::OnInitTaskGotPluginInfo(
DCHECK_EQ(state_, INIT_TASK_SCHEDULED);
plugins_ = plugins;
- io_thread_ = g_browser_process->io_thread();
if (state_ == INIT_TASK_SCHEDULED)
state_ = INIT_TASK_DONE;
}
@@ -1268,10 +1267,11 @@ void MetricsService::OnURLFetchComplete(const content::URLFetcher* source) {
log_manager_.has_unsent_logs());
// Collect network stats if UMA upload succeeded.
- if (server_is_healthy && io_thread_) {
- chrome_browser_net::CollectNetworkStats(network_stats_server_, io_thread_);
+ IOThread* io_thread = g_browser_process->io_thread();
+ if (server_is_healthy && io_thread) {
+ chrome_browser_net::CollectNetworkStats(network_stats_server_, io_thread);
chrome_browser_net::CollectPipeliningCapabilityStatsOnUIThread(
- http_pipelining_test_server_, io_thread_);
+ http_pipelining_test_server_, io_thread);
}
// Reset the cached response data.
« no previous file with comments | « chrome/browser/metrics/metrics_service.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698