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

Unified Diff: chrome/browser/profile_resetter/automatic_profile_resetter.cc

Issue 1107863002: [chrome/browser/profile_resetter] favor DCHECK_CURRENTLY_ON for better logs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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 | « no previous file | chrome/browser/profile_resetter/automatic_profile_resetter_delegate.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/profile_resetter/automatic_profile_resetter.cc
diff --git a/chrome/browser/profile_resetter/automatic_profile_resetter.cc b/chrome/browser/profile_resetter/automatic_profile_resetter.cc
index 51ea44a6a4ddccedab0bdc58f4467cd8f341d1a7..9dead81cb9a8b480fd7751773c80e25f88e9a82c 100644
--- a/chrome/browser/profile_resetter/automatic_profile_resetter.cc
+++ b/chrome/browser/profile_resetter/automatic_profile_resetter.cc
@@ -218,7 +218,7 @@ class AutomaticProfileResetter::InputBuilder
// Called back by |memento_in_file_| once the |memento_value| has been read.
void IncludeFileBasedMementoCallback(const std::string& memento_value) {
- DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
data_->SetString(kMementoValueInFileKey, memento_value);
// As an asynchronous task, we need to take care of posting the next task.
PostNextTask();
@@ -382,7 +382,7 @@ AutomaticProfileResetter::AutomaticProfileResetter(Profile* profile)
AutomaticProfileResetter::~AutomaticProfileResetter() {}
void AutomaticProfileResetter::Initialize() {
- DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
DCHECK_EQ(state_, STATE_UNINITIALIZED);
if (!ShouldPerformDryRun() && !ShouldPerformLiveRun()) {
@@ -415,7 +415,7 @@ void AutomaticProfileResetter::Initialize() {
}
void AutomaticProfileResetter::Activate() {
- DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
DCHECK(state_ == STATE_INITIALIZED || state_ == STATE_DISABLED);
if (state_ == STATE_INITIALIZED) {
@@ -435,7 +435,7 @@ void AutomaticProfileResetter::Activate() {
}
void AutomaticProfileResetter::TriggerProfileReset(bool send_feedback) {
- DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
DCHECK_EQ(state_, STATE_HAS_SHOWN_BUBBLE);
state_ = STATE_PERFORMING_RESET;
@@ -449,7 +449,7 @@ void AutomaticProfileResetter::TriggerProfileReset(bool send_feedback) {
}
void AutomaticProfileResetter::SkipProfileReset() {
- DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
DCHECK_EQ(state_, STATE_HAS_SHOWN_BUBBLE);
should_show_reset_banner_ = false;
@@ -465,12 +465,12 @@ bool AutomaticProfileResetter::IsResetPromptFlowActive() const {
}
bool AutomaticProfileResetter::ShouldShowResetBanner() const {
- DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
return should_show_reset_banner_ && ShouldPerformLiveRun();
}
void AutomaticProfileResetter::NotifyDidShowResetBubble() {
- DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
DCHECK_EQ(state_, STATE_HAS_TRIGGERED_PROMPT);
state_ = STATE_HAS_SHOWN_BUBBLE;
@@ -480,7 +480,7 @@ void AutomaticProfileResetter::NotifyDidShowResetBubble() {
}
void AutomaticProfileResetter::NotifyDidOpenWebUIResetDialog() {
- DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
// This notification is invoked unconditionally by the WebUI, only care about
// it when the prompt flow is currently active (and not yet resetting).
@@ -493,7 +493,7 @@ void AutomaticProfileResetter::NotifyDidOpenWebUIResetDialog() {
void AutomaticProfileResetter::NotifyDidCloseWebUIResetDialog(
bool performed_reset) {
- DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
// This notification is invoked unconditionally by the WebUI, only care about
// it when the prompt flow is currently active (and not yet resetting).
@@ -516,7 +516,7 @@ void AutomaticProfileResetter::NotifyDidCloseWebUIResetDialog(
}
void AutomaticProfileResetter::NotifyDidCloseWebUIResetBanner() {
- DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
should_show_reset_banner_ = false;
}
@@ -541,7 +541,7 @@ void AutomaticProfileResetter::SetTaskRunnerForWaitingForTesting(
}
void AutomaticProfileResetter::Shutdown() {
- DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
// We better not do anything substantial at this point. The metrics service
// has already been shut down; and local state has already been commited to
@@ -554,7 +554,7 @@ void AutomaticProfileResetter::Shutdown() {
}
void AutomaticProfileResetter::PrepareEvaluationFlow() {
- DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
DCHECK_EQ(state_, STATE_INITIALIZED);
state_ = STATE_WAITING_ON_DEPENDENCIES;
@@ -580,7 +580,7 @@ void AutomaticProfileResetter::OnLoadedModulesAreEnumerated() {
}
void AutomaticProfileResetter::OnDependencyIsReady() {
- DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
DCHECK_EQ(state_, STATE_WAITING_ON_DEPENDENCIES);
if (template_url_service_ready_ && enumeration_of_loaded_modules_ready_) {
@@ -594,7 +594,7 @@ void AutomaticProfileResetter::OnDependencyIsReady() {
}
void AutomaticProfileResetter::BeginEvaluationFlow() {
- DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
DCHECK_EQ(state_, STATE_READY);
DCHECK(!program_.empty());
DCHECK(!input_builder_);
@@ -609,7 +609,7 @@ void AutomaticProfileResetter::BeginEvaluationFlow() {
void AutomaticProfileResetter::ContinueWithEvaluationFlow(
scoped_ptr<base::DictionaryValue> program_input) {
- DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
DCHECK_EQ(state_, STATE_EVALUATING_CONDITIONS);
input_builder_.reset();
@@ -686,7 +686,7 @@ void AutomaticProfileResetter::ReportStatistics(uint32 satisfied_criteria_mask,
void AutomaticProfileResetter::FinishEvaluationFlow(
scoped_ptr<EvaluationResults> results) {
- DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
DCHECK_EQ(state_, STATE_EVALUATING_CONDITIONS);
ReportStatistics(results->satisfied_criteria_mask,
@@ -704,7 +704,7 @@ void AutomaticProfileResetter::FinishEvaluationFlow(
}
void AutomaticProfileResetter::BeginResetPromptFlow() {
- DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
DCHECK_EQ(state_, STATE_EVALUATING_CONDITIONS);
state_ = STATE_HAS_TRIGGERED_PROMPT;
@@ -722,7 +722,7 @@ void AutomaticProfileResetter::BeginResetPromptFlow() {
}
void AutomaticProfileResetter::OnProfileSettingsResetCompleted() {
- DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
DCHECK_EQ(state_, STATE_PERFORMING_RESET);
delegate_->DismissPrompt();
@@ -735,7 +735,7 @@ void AutomaticProfileResetter::ReportPromptResult(PromptResult result) {
}
void AutomaticProfileResetter::PersistMementos() {
- DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
DCHECK(state_ == STATE_HAS_TRIGGERED_PROMPT ||
state_ == STATE_HAS_SHOWN_BUBBLE);
DCHECK(evaluation_results_);
@@ -753,7 +753,7 @@ void AutomaticProfileResetter::PersistMementos() {
}
void AutomaticProfileResetter::FinishResetPromptFlow() {
- DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
DCHECK(state_ == STATE_HAS_TRIGGERED_PROMPT ||
state_ == STATE_HAS_SHOWN_BUBBLE ||
state_ == STATE_PERFORMING_RESET);
« no previous file with comments | « no previous file | chrome/browser/profile_resetter/automatic_profile_resetter_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698