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

Side by Side Diff: chrome/browser/metrics/variations/variations_service.cc

Issue 1102233002: favor DCHECK_CURRENTLY_ON for better logs in chrome/browser/media_galleries , metrics and nacl_host (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "chrome/browser/metrics/variations/variations_service.h" 5 #include "chrome/browser/metrics/variations/variations_service.h"
6 6
7 #include <set> 7 #include <set>
8 8
9 #include "base/build_time.h" 9 #include "base/build_time.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after
314 } else { 314 } else {
315 UMA_HISTOGRAM_COUNTS_100("Variations.SeedDateSkew.BuildTimeAheadBy", 315 UMA_HISTOGRAM_COUNTS_100("Variations.SeedDateSkew.BuildTimeAheadBy",
316 build_time_delta_days); 316 build_time_delta_days);
317 } 317 }
318 } 318 }
319 319
320 return true; 320 return true;
321 } 321 }
322 322
323 void VariationsService::StartRepeatedVariationsSeedFetch() { 323 void VariationsService::StartRepeatedVariationsSeedFetch() {
324 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); 324 DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
325 325
326 // Initialize the Variations server URL. 326 // Initialize the Variations server URL.
327 variations_server_url_ = 327 variations_server_url_ =
328 GetVariationsServerURL(policy_pref_service_, restrict_mode_); 328 GetVariationsServerURL(policy_pref_service_, restrict_mode_);
329 329
330 // Check that |CreateTrialsFromSeed| was called, which is necessary to 330 // Check that |CreateTrialsFromSeed| was called, which is necessary to
331 // retrieve the serial number that will be sent to the server. 331 // retrieve the serial number that will be sent to the server.
332 DCHECK(create_trials_from_seed_called_); 332 DCHECK(create_trials_from_seed_called_);
333 333
334 DCHECK(!request_scheduler_.get()); 334 DCHECK(!request_scheduler_.get());
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
487 487
488 base::PostTaskAndReplyWithResult( 488 base::PostTaskAndReplyWithResult(
489 content::BrowserThread::GetBlockingPool(), 489 content::BrowserThread::GetBlockingPool(),
490 FROM_HERE, 490 FROM_HERE,
491 base::Bind(&GetVersionForSimulation), 491 base::Bind(&GetVersionForSimulation),
492 base::Bind(&VariationsService::PerformSimulationWithVersion, 492 base::Bind(&VariationsService::PerformSimulationWithVersion,
493 weak_ptr_factory_.GetWeakPtr(), base::Passed(&seed))); 493 weak_ptr_factory_.GetWeakPtr(), base::Passed(&seed)));
494 } 494 }
495 495
496 void VariationsService::FetchVariationsSeed() { 496 void VariationsService::FetchVariationsSeed() {
497 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); 497 DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
498 498
499 const web_resource::ResourceRequestAllowedNotifier::State state = 499 const web_resource::ResourceRequestAllowedNotifier::State state =
500 resource_request_allowed_notifier_->GetResourceRequestsAllowedState(); 500 resource_request_allowed_notifier_->GetResourceRequestsAllowedState();
501 RecordRequestsAllowedHistogram(ResourceRequestStateToHistogramValue(state)); 501 RecordRequestsAllowedHistogram(ResourceRequestStateToHistogramValue(state));
502 if (state != web_resource::ResourceRequestAllowedNotifier::ALLOWED) { 502 if (state != web_resource::ResourceRequestAllowedNotifier::ALLOWED) {
503 DVLOG(1) << "Resource requests were not allowed. Waiting for notification."; 503 DVLOG(1) << "Resource requests were not allowed. Waiting for notification.";
504 return; 504 return;
505 } 505 }
506 506
507 DoActualFetch(); 507 DoActualFetch();
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
640 local_state_->SetInt64(prefs::kVariationsLastFetchTime, 640 local_state_->SetInt64(prefs::kVariationsLastFetchTime,
641 base::Time::Now().ToInternalValue()); 641 base::Time::Now().ToInternalValue());
642 } 642 }
643 } 643 }
644 644
645 std::string VariationsService::GetInvalidVariationsSeedSignature() const { 645 std::string VariationsService::GetInvalidVariationsSeedSignature() const {
646 return seed_store_.GetInvalidSignature(); 646 return seed_store_.GetInvalidSignature();
647 } 647 }
648 648
649 } // namespace chrome_variations 649 } // namespace chrome_variations
OLDNEW
« no previous file with comments | « chrome/browser/metrics/thread_watcher_android.cc ('k') | chrome/browser/nacl_host/nacl_browser_delegate_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698