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

Side by Side Diff: components/metrics/metrics_state_manager.cc

Issue 2236383002: Temporary hack to fix telemetry_perf_unittests flakes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix nullptr Created 4 years, 4 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 #include "components/metrics/metrics_state_manager.h" 5 #include "components/metrics/metrics_state_manager.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/guid.h" 10 #include "base/guid.h"
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after
250 client_id_with_dashes.push_back(*client_id_it); 250 client_id_with_dashes.push_back(*client_id_it);
251 ++client_id_it; 251 ++client_id_it;
252 } 252 }
253 } 253 }
254 DCHECK(client_id_it == client_info->client_id.end()); 254 DCHECK(client_id_it == client_info->client_id.end());
255 client_info->client_id.assign(client_id_with_dashes); 255 client_info->client_id.assign(client_id_with_dashes);
256 } 256 }
257 257
258 // The GUID retrieved (and possibly fixed above) should be valid unless 258 // The GUID retrieved (and possibly fixed above) should be valid unless
259 // retrieval failed. 259 // retrieval failed.
260 DCHECK(!client_info || base::IsValidGUID(client_info->client_id)); 260 // DCHECK(!client_info || base::IsValidGUID(client_info->client_id));
261 // Temporary hack for http://crbug.com/635255.
262 // TODO(asvitkine): address this the right way.
263 if (client_info && !base::IsValidGUID(client_info->client_id))
264 return nullptr;
261 265
262 return client_info; 266 return client_info;
263 } 267 }
264 268
265 int MetricsStateManager::GetLowEntropySource() { 269 int MetricsStateManager::GetLowEntropySource() {
266 UpdateLowEntropySource(); 270 UpdateLowEntropySource();
267 return low_entropy_source_; 271 return low_entropy_source_;
268 } 272 }
269 273
270 void MetricsStateManager::UpdateLowEntropySource() { 274 void MetricsStateManager::UpdateLowEntropySource() {
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
317 321
318 local_state_->ClearPref(prefs::kMetricsClientID); 322 local_state_->ClearPref(prefs::kMetricsClientID);
319 local_state_->ClearPref(prefs::kMetricsLowEntropySource); 323 local_state_->ClearPref(prefs::kMetricsLowEntropySource);
320 local_state_->ClearPref(prefs::kMetricsResetIds); 324 local_state_->ClearPref(prefs::kMetricsResetIds);
321 325
322 // Also clear the backed up client info. 326 // Also clear the backed up client info.
323 store_client_info_.Run(ClientInfo()); 327 store_client_info_.Run(ClientInfo());
324 } 328 }
325 329
326 } // namespace metrics 330 } // namespace metrics
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698