Remove NO_LOG LogType enum value.

Also, changes a condition to a switch to
make compiler warn if a new enum value is
added.

BUG=none

Review URL: https://codereview.chromium.org/310483009

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@274582 0039d316-1c4b-4281-b951-d872f2087c98
parent 524c4a7c
...@@ -37,7 +37,6 @@ MetricsLogBase::MetricsLogBase(const std::string& client_id, ...@@ -37,7 +37,6 @@ MetricsLogBase::MetricsLogBase(const std::string& client_id,
const std::string& version_string) const std::string& version_string)
: locked_(false), : locked_(false),
log_type_(log_type) { log_type_(log_type) {
DCHECK_NE(NO_LOG, log_type);
if (IsTestingID(client_id)) if (IsTestingID(client_id))
uma_proto_.set_client_id(0); uma_proto_.set_client_id(0);
else else
......
...@@ -24,11 +24,9 @@ namespace metrics { ...@@ -24,11 +24,9 @@ namespace metrics {
// This class provides base functionality for logging metrics data. // This class provides base functionality for logging metrics data.
class MetricsLogBase { class MetricsLogBase {
public: public:
// TODO(asvitkine): Remove the NO_LOG value.
enum LogType { enum LogType {
INITIAL_STABILITY_LOG, // The initial log containing stability stats. INITIAL_STABILITY_LOG, // The initial log containing stability stats.
ONGOING_LOG, // Subsequent logs in a session. ONGOING_LOG, // Subsequent logs in a session.
NO_LOG, // Placeholder value for when there is no log.
}; };
// Creates a new metrics log of the specified type. // Creates a new metrics log of the specified type.
......
...@@ -102,12 +102,14 @@ void MetricsLogManager::ResumePausedLog() { ...@@ -102,12 +102,14 @@ void MetricsLogManager::ResumePausedLog() {
} }
void MetricsLogManager::StoreLog(std::string* log, LogType log_type) { void MetricsLogManager::StoreLog(std::string* log, LogType log_type) {
DCHECK_NE(MetricsLogBase::NO_LOG, log_type); switch (log_type) {
metrics::PersistedLogs* destination_queue = case MetricsLogBase::INITIAL_STABILITY_LOG:
(log_type == MetricsLogBase::INITIAL_STABILITY_LOG) ? initial_log_queue_.StoreLog(log);
&initial_log_queue_ : &ongoing_log_queue_; break;
case MetricsLogBase::ONGOING_LOG:
destination_queue->StoreLog(log); ongoing_log_queue_.StoreLog(log);
break;
}
} }
void MetricsLogManager::StoreStagedLogAsUnsent( void MetricsLogManager::StoreStagedLogAsUnsent(
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment