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

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

Issue 10169039: Revert 133773 - [UMA] Add performance profile data to UMA uploads. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: 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
===================================================================
--- chrome/browser/metrics/metrics_service.cc (revision 133778)
+++ chrome/browser/metrics/metrics_service.cc (working copy)
@@ -152,7 +152,6 @@
#include "base/string_number_conversions.h"
#include "base/threading/platform_thread.h"
#include "base/threading/thread.h"
-#include "base/tracked_objects.h"
#include "base/utf_string_conversions.h"
#include "base/values.h"
#include "chrome/browser/bookmarks/bookmark_model.h"
@@ -165,7 +164,6 @@
#include "chrome/browser/metrics/metrics_log.h"
#include "chrome/browser/metrics/metrics_log_serializer.h"
#include "chrome/browser/metrics/metrics_reporting_scheduler.h"
-#include "chrome/browser/metrics/tracking_synchronizer.h"
#include "chrome/browser/net/http_pipelining_compatibility_client.h"
#include "chrome/browser/net/network_stats.h"
#include "chrome/browser/prefs/pref_service.h"
@@ -775,7 +773,7 @@
void MetricsService::OnInitTaskGotHardwareClass(
const std::string& hardware_class) {
- DCHECK_EQ(INIT_TASK_SCHEDULED, state_);
+ DCHECK_EQ(state_, INIT_TASK_SCHEDULED);
hardware_class_ = hardware_class;
// Start the next part of the init task: loading plugin information.
@@ -786,33 +784,13 @@
void MetricsService::OnInitTaskGotPluginInfo(
const std::vector<webkit::WebPluginInfo>& plugins) {
- DCHECK_EQ(INIT_TASK_SCHEDULED, state_);
+ DCHECK_EQ(state_, INIT_TASK_SCHEDULED);
plugins_ = plugins;
- // Start the next part of the init task: fetching performance data. This will
- // call into |FinishedReceivingProfilerData()| when the task completes.
- chrome_browser_metrics::TrackingSynchronizer::FetchProfilerDataAsynchronously(
- self_ptr_factory_.GetWeakPtr());
+ if (state_ == INIT_TASK_SCHEDULED)
+ state_ = INIT_TASK_DONE;
}
-void MetricsService::ReceivedProfilerData(
- const tracked_objects::ProcessDataSnapshot& process_data,
- content::ProcessType process_type) {
- DCHECK_EQ(INIT_TASK_SCHEDULED, state_);
-
- // Upon the first callback, create the initial log so that we can immediately
- // save the profiler data.
- if (!initial_log_.get())
- initial_log_.reset(new MetricsLog(client_id_, session_id_));
-
- initial_log_->RecordProfilerData(process_data, process_type);
-}
-
-void MetricsService::FinishedReceivingProfilerData() {
- DCHECK_EQ(INIT_TASK_SCHEDULED, state_);
- state_ = INIT_TASK_DONE;
-}
-
std::string MetricsService::GenerateClientID() {
return guid::GenerateGUID();
}
@@ -1036,7 +1014,7 @@
// anything, because the server will tell us whether it wants to hear
// from us.
PrepareInitialLog();
- DCHECK_EQ(INIT_TASK_DONE, state_);
+ DCHECK(state_ == INIT_TASK_DONE);
log_manager_.LoadPersistedUnsentLogs();
state_ = INITIAL_LOG_READY;
break;
@@ -1064,17 +1042,16 @@
}
void MetricsService::PrepareInitialLog() {
- DCHECK_EQ(INIT_TASK_DONE, state_);
+ DCHECK(state_ == INIT_TASK_DONE);
- DCHECK(initial_log_.get());
- initial_log_->set_hardware_class(hardware_class_);
- initial_log_->RecordEnvironment(plugins_, profile_dictionary_.get());
+ MetricsLog* log = new MetricsLog(client_id_, session_id_);
+ log->set_hardware_class(hardware_class_); // Adds to initial log.
+ log->RecordEnvironment(plugins_, profile_dictionary_.get());
// Histograms only get written to the current log, so make the new log current
// before writing them.
log_manager_.PauseCurrentLog();
- log_manager_.BeginLoggingWithLog(initial_log_.release(),
- MetricsLogManager::INITIAL_LOG);
+ log_manager_.BeginLoggingWithLog(log, MetricsLogManager::INITIAL_LOG);
RecordCurrentHistograms();
log_manager_.FinishCurrentLog();
log_manager_.ResumePausedLog();
@@ -1279,7 +1256,7 @@
log_manager_.DiscardStagedLog();
if (log_manager_.has_unsent_logs())
- DCHECK_LT(state_, SENDING_CURRENT_LOGS);
+ DCHECK(state_ < SENDING_CURRENT_LOGS);
}
// Error 400 indicates a problem with the log, not with the server, so
« 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