Commit 5893b13b authored by anujk.sharma's avatar anujk.sharma Committed by Commit bot

favor DCHECK_CURRENTLY_ON for better logs in chrome/browser/profile_resetter

BUG=466848

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

Cr-Commit-Position: refs/heads/master@{#327250}
parent fb3e2efd
...@@ -218,7 +218,7 @@ class AutomaticProfileResetter::InputBuilder ...@@ -218,7 +218,7 @@ class AutomaticProfileResetter::InputBuilder
// Called back by |memento_in_file_| once the |memento_value| has been read. // Called back by |memento_in_file_| once the |memento_value| has been read.
void IncludeFileBasedMementoCallback(const std::string& memento_value) { 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); data_->SetString(kMementoValueInFileKey, memento_value);
// As an asynchronous task, we need to take care of posting the next task. // As an asynchronous task, we need to take care of posting the next task.
PostNextTask(); PostNextTask();
...@@ -382,7 +382,7 @@ AutomaticProfileResetter::AutomaticProfileResetter(Profile* profile) ...@@ -382,7 +382,7 @@ AutomaticProfileResetter::AutomaticProfileResetter(Profile* profile)
AutomaticProfileResetter::~AutomaticProfileResetter() {} AutomaticProfileResetter::~AutomaticProfileResetter() {}
void AutomaticProfileResetter::Initialize() { void AutomaticProfileResetter::Initialize() {
DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
DCHECK_EQ(state_, STATE_UNINITIALIZED); DCHECK_EQ(state_, STATE_UNINITIALIZED);
if (!ShouldPerformDryRun() && !ShouldPerformLiveRun()) { if (!ShouldPerformDryRun() && !ShouldPerformLiveRun()) {
...@@ -415,7 +415,7 @@ void AutomaticProfileResetter::Initialize() { ...@@ -415,7 +415,7 @@ void AutomaticProfileResetter::Initialize() {
} }
void AutomaticProfileResetter::Activate() { void AutomaticProfileResetter::Activate() {
DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
DCHECK(state_ == STATE_INITIALIZED || state_ == STATE_DISABLED); DCHECK(state_ == STATE_INITIALIZED || state_ == STATE_DISABLED);
if (state_ == STATE_INITIALIZED) { if (state_ == STATE_INITIALIZED) {
...@@ -435,7 +435,7 @@ void AutomaticProfileResetter::Activate() { ...@@ -435,7 +435,7 @@ void AutomaticProfileResetter::Activate() {
} }
void AutomaticProfileResetter::TriggerProfileReset(bool send_feedback) { 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); DCHECK_EQ(state_, STATE_HAS_SHOWN_BUBBLE);
state_ = STATE_PERFORMING_RESET; state_ = STATE_PERFORMING_RESET;
...@@ -449,7 +449,7 @@ void AutomaticProfileResetter::TriggerProfileReset(bool send_feedback) { ...@@ -449,7 +449,7 @@ void AutomaticProfileResetter::TriggerProfileReset(bool send_feedback) {
} }
void AutomaticProfileResetter::SkipProfileReset() { void AutomaticProfileResetter::SkipProfileReset() {
DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
DCHECK_EQ(state_, STATE_HAS_SHOWN_BUBBLE); DCHECK_EQ(state_, STATE_HAS_SHOWN_BUBBLE);
should_show_reset_banner_ = false; should_show_reset_banner_ = false;
...@@ -465,12 +465,12 @@ bool AutomaticProfileResetter::IsResetPromptFlowActive() const { ...@@ -465,12 +465,12 @@ bool AutomaticProfileResetter::IsResetPromptFlowActive() const {
} }
bool AutomaticProfileResetter::ShouldShowResetBanner() const { bool AutomaticProfileResetter::ShouldShowResetBanner() const {
DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
return should_show_reset_banner_ && ShouldPerformLiveRun(); return should_show_reset_banner_ && ShouldPerformLiveRun();
} }
void AutomaticProfileResetter::NotifyDidShowResetBubble() { void AutomaticProfileResetter::NotifyDidShowResetBubble() {
DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
DCHECK_EQ(state_, STATE_HAS_TRIGGERED_PROMPT); DCHECK_EQ(state_, STATE_HAS_TRIGGERED_PROMPT);
state_ = STATE_HAS_SHOWN_BUBBLE; state_ = STATE_HAS_SHOWN_BUBBLE;
...@@ -480,7 +480,7 @@ void AutomaticProfileResetter::NotifyDidShowResetBubble() { ...@@ -480,7 +480,7 @@ void AutomaticProfileResetter::NotifyDidShowResetBubble() {
} }
void AutomaticProfileResetter::NotifyDidOpenWebUIResetDialog() { 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 // This notification is invoked unconditionally by the WebUI, only care about
// it when the prompt flow is currently active (and not yet resetting). // it when the prompt flow is currently active (and not yet resetting).
...@@ -493,7 +493,7 @@ void AutomaticProfileResetter::NotifyDidOpenWebUIResetDialog() { ...@@ -493,7 +493,7 @@ void AutomaticProfileResetter::NotifyDidOpenWebUIResetDialog() {
void AutomaticProfileResetter::NotifyDidCloseWebUIResetDialog( void AutomaticProfileResetter::NotifyDidCloseWebUIResetDialog(
bool performed_reset) { 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 // This notification is invoked unconditionally by the WebUI, only care about
// it when the prompt flow is currently active (and not yet resetting). // it when the prompt flow is currently active (and not yet resetting).
...@@ -516,7 +516,7 @@ void AutomaticProfileResetter::NotifyDidCloseWebUIResetDialog( ...@@ -516,7 +516,7 @@ void AutomaticProfileResetter::NotifyDidCloseWebUIResetDialog(
} }
void AutomaticProfileResetter::NotifyDidCloseWebUIResetBanner() { void AutomaticProfileResetter::NotifyDidCloseWebUIResetBanner() {
DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
should_show_reset_banner_ = false; should_show_reset_banner_ = false;
} }
...@@ -541,7 +541,7 @@ void AutomaticProfileResetter::SetTaskRunnerForWaitingForTesting( ...@@ -541,7 +541,7 @@ void AutomaticProfileResetter::SetTaskRunnerForWaitingForTesting(
} }
void AutomaticProfileResetter::Shutdown() { 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 // 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 // has already been shut down; and local state has already been commited to
...@@ -554,7 +554,7 @@ void AutomaticProfileResetter::Shutdown() { ...@@ -554,7 +554,7 @@ void AutomaticProfileResetter::Shutdown() {
} }
void AutomaticProfileResetter::PrepareEvaluationFlow() { void AutomaticProfileResetter::PrepareEvaluationFlow() {
DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
DCHECK_EQ(state_, STATE_INITIALIZED); DCHECK_EQ(state_, STATE_INITIALIZED);
state_ = STATE_WAITING_ON_DEPENDENCIES; state_ = STATE_WAITING_ON_DEPENDENCIES;
...@@ -580,7 +580,7 @@ void AutomaticProfileResetter::OnLoadedModulesAreEnumerated() { ...@@ -580,7 +580,7 @@ void AutomaticProfileResetter::OnLoadedModulesAreEnumerated() {
} }
void AutomaticProfileResetter::OnDependencyIsReady() { void AutomaticProfileResetter::OnDependencyIsReady() {
DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
DCHECK_EQ(state_, STATE_WAITING_ON_DEPENDENCIES); DCHECK_EQ(state_, STATE_WAITING_ON_DEPENDENCIES);
if (template_url_service_ready_ && enumeration_of_loaded_modules_ready_) { if (template_url_service_ready_ && enumeration_of_loaded_modules_ready_) {
...@@ -594,7 +594,7 @@ void AutomaticProfileResetter::OnDependencyIsReady() { ...@@ -594,7 +594,7 @@ void AutomaticProfileResetter::OnDependencyIsReady() {
} }
void AutomaticProfileResetter::BeginEvaluationFlow() { void AutomaticProfileResetter::BeginEvaluationFlow() {
DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
DCHECK_EQ(state_, STATE_READY); DCHECK_EQ(state_, STATE_READY);
DCHECK(!program_.empty()); DCHECK(!program_.empty());
DCHECK(!input_builder_); DCHECK(!input_builder_);
...@@ -609,7 +609,7 @@ void AutomaticProfileResetter::BeginEvaluationFlow() { ...@@ -609,7 +609,7 @@ void AutomaticProfileResetter::BeginEvaluationFlow() {
void AutomaticProfileResetter::ContinueWithEvaluationFlow( void AutomaticProfileResetter::ContinueWithEvaluationFlow(
scoped_ptr<base::DictionaryValue> program_input) { 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); DCHECK_EQ(state_, STATE_EVALUATING_CONDITIONS);
input_builder_.reset(); input_builder_.reset();
...@@ -686,7 +686,7 @@ void AutomaticProfileResetter::ReportStatistics(uint32 satisfied_criteria_mask, ...@@ -686,7 +686,7 @@ void AutomaticProfileResetter::ReportStatistics(uint32 satisfied_criteria_mask,
void AutomaticProfileResetter::FinishEvaluationFlow( void AutomaticProfileResetter::FinishEvaluationFlow(
scoped_ptr<EvaluationResults> results) { scoped_ptr<EvaluationResults> results) {
DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
DCHECK_EQ(state_, STATE_EVALUATING_CONDITIONS); DCHECK_EQ(state_, STATE_EVALUATING_CONDITIONS);
ReportStatistics(results->satisfied_criteria_mask, ReportStatistics(results->satisfied_criteria_mask,
...@@ -704,7 +704,7 @@ void AutomaticProfileResetter::FinishEvaluationFlow( ...@@ -704,7 +704,7 @@ void AutomaticProfileResetter::FinishEvaluationFlow(
} }
void AutomaticProfileResetter::BeginResetPromptFlow() { void AutomaticProfileResetter::BeginResetPromptFlow() {
DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
DCHECK_EQ(state_, STATE_EVALUATING_CONDITIONS); DCHECK_EQ(state_, STATE_EVALUATING_CONDITIONS);
state_ = STATE_HAS_TRIGGERED_PROMPT; state_ = STATE_HAS_TRIGGERED_PROMPT;
...@@ -722,7 +722,7 @@ void AutomaticProfileResetter::BeginResetPromptFlow() { ...@@ -722,7 +722,7 @@ void AutomaticProfileResetter::BeginResetPromptFlow() {
} }
void AutomaticProfileResetter::OnProfileSettingsResetCompleted() { void AutomaticProfileResetter::OnProfileSettingsResetCompleted() {
DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
DCHECK_EQ(state_, STATE_PERFORMING_RESET); DCHECK_EQ(state_, STATE_PERFORMING_RESET);
delegate_->DismissPrompt(); delegate_->DismissPrompt();
...@@ -735,7 +735,7 @@ void AutomaticProfileResetter::ReportPromptResult(PromptResult result) { ...@@ -735,7 +735,7 @@ void AutomaticProfileResetter::ReportPromptResult(PromptResult result) {
} }
void AutomaticProfileResetter::PersistMementos() { void AutomaticProfileResetter::PersistMementos() {
DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
DCHECK(state_ == STATE_HAS_TRIGGERED_PROMPT || DCHECK(state_ == STATE_HAS_TRIGGERED_PROMPT ||
state_ == STATE_HAS_SHOWN_BUBBLE); state_ == STATE_HAS_SHOWN_BUBBLE);
DCHECK(evaluation_results_); DCHECK(evaluation_results_);
...@@ -753,7 +753,7 @@ void AutomaticProfileResetter::PersistMementos() { ...@@ -753,7 +753,7 @@ void AutomaticProfileResetter::PersistMementos() {
} }
void AutomaticProfileResetter::FinishResetPromptFlow() { void AutomaticProfileResetter::FinishResetPromptFlow() {
DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
DCHECK(state_ == STATE_HAS_TRIGGERED_PROMPT || DCHECK(state_ == STATE_HAS_TRIGGERED_PROMPT ||
state_ == STATE_HAS_SHOWN_BUBBLE || state_ == STATE_HAS_SHOWN_BUBBLE ||
state_ == STATE_PERFORMING_RESET); state_ == STATE_PERFORMING_RESET);
......
...@@ -305,7 +305,7 @@ void AutomaticProfileResetterDelegateImpl::TriggerProfileSettingsReset( ...@@ -305,7 +305,7 @@ void AutomaticProfileResetterDelegateImpl::TriggerProfileSettingsReset(
} }
void AutomaticProfileResetterDelegateImpl::OnTemplateURLServiceChanged() { void AutomaticProfileResetterDelegateImpl::OnTemplateURLServiceChanged() {
DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
DCHECK(template_url_service_); DCHECK(template_url_service_);
if (template_url_service_->loaded() && if (template_url_service_->loaded() &&
!template_url_service_ready_event_.is_signaled()) !template_url_service_ready_event_.is_signaled())
...@@ -328,7 +328,7 @@ void AutomaticProfileResetterDelegateImpl::Observe( ...@@ -328,7 +328,7 @@ void AutomaticProfileResetterDelegateImpl::Observe(
int type, int type,
const content::NotificationSource& source, const content::NotificationSource& source,
const content::NotificationDetails& details) { const content::NotificationDetails& details) {
DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
if (type == chrome::NOTIFICATION_MODULE_LIST_ENUMERATED && if (type == chrome::NOTIFICATION_MODULE_LIST_ENUMERATED &&
!modules_have_been_enumerated_event_.is_signaled()) { !modules_have_been_enumerated_event_.is_signaled()) {
#if defined(OS_WIN) #if defined(OS_WIN)
...@@ -364,7 +364,7 @@ void AutomaticProfileResetterDelegateImpl::RunProfileSettingsReset( ...@@ -364,7 +364,7 @@ void AutomaticProfileResetterDelegateImpl::RunProfileSettingsReset(
void AutomaticProfileResetterDelegateImpl:: void AutomaticProfileResetterDelegateImpl::
OnBrandcodedDefaultsFetched() { OnBrandcodedDefaultsFetched() {
DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
DCHECK(brandcoded_config_fetcher_); DCHECK(brandcoded_config_fetcher_);
DCHECK(!brandcoded_config_fetcher_->IsActive()); DCHECK(!brandcoded_config_fetcher_->IsActive());
brandcoded_defaults_ = brandcoded_config_fetcher_->GetSettings(); brandcoded_defaults_ = brandcoded_config_fetcher_->GetSettings();
...@@ -376,7 +376,7 @@ void AutomaticProfileResetterDelegateImpl:: ...@@ -376,7 +376,7 @@ void AutomaticProfileResetterDelegateImpl::
void AutomaticProfileResetterDelegateImpl::OnProfileSettingsResetCompleted( void AutomaticProfileResetterDelegateImpl::OnProfileSettingsResetCompleted(
const base::Closure& user_callback, const base::Closure& user_callback,
scoped_ptr<ResettableSettingsSnapshot> old_settings_snapshot) { scoped_ptr<ResettableSettingsSnapshot> old_settings_snapshot) {
DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
if (old_settings_snapshot) { if (old_settings_snapshot) {
ResettableSettingsSnapshot new_settings_snapshot(profile_); ResettableSettingsSnapshot new_settings_snapshot(profile_);
int difference = int difference =
......
...@@ -37,7 +37,7 @@ ...@@ -37,7 +37,7 @@
namespace { namespace {
void ResetShortcutsOnFileThread() { void ResetShortcutsOnFileThread() {
DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::FILE)); DCHECK_CURRENTLY_ON(content::BrowserThread::FILE);
// Get full path of chrome. // Get full path of chrome.
base::FilePath chrome_exe; base::FilePath chrome_exe;
if (!PathService::Get(base::FILE_EXE, &chrome_exe)) if (!PathService::Get(base::FILE_EXE, &chrome_exe))
...@@ -127,7 +127,7 @@ void ProfileResetter::Reset( ...@@ -127,7 +127,7 @@ void ProfileResetter::Reset(
} }
bool ProfileResetter::IsActive() const { bool ProfileResetter::IsActive() const {
DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
return pending_reset_flags_ != 0; return pending_reset_flags_ != 0;
} }
...@@ -326,7 +326,7 @@ void ProfileResetter::OnBrowsingDataRemoverDone() { ...@@ -326,7 +326,7 @@ void ProfileResetter::OnBrowsingDataRemoverDone() {
std::vector<ShortcutCommand> GetChromeLaunchShortcuts( std::vector<ShortcutCommand> GetChromeLaunchShortcuts(
const scoped_refptr<SharedCancellationFlag>& cancel) { const scoped_refptr<SharedCancellationFlag>& cancel) {
DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::FILE)); DCHECK_CURRENTLY_ON(content::BrowserThread::FILE);
#if defined(OS_WIN) #if defined(OS_WIN)
// Get full path of chrome. // Get full path of chrome.
base::FilePath chrome_exe; base::FilePath chrome_exe;
......
...@@ -90,7 +90,7 @@ void RemoveCookieTester::AddCookie(const std::string& host, ...@@ -90,7 +90,7 @@ void RemoveCookieTester::AddCookie(const std::string& host,
void RemoveCookieTester::GetCookieOnIOThread( void RemoveCookieTester::GetCookieOnIOThread(
net::URLRequestContextGetter* context_getter, net::URLRequestContextGetter* context_getter,
const std::string& host) { const std::string& host) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); DCHECK_CURRENTLY_ON(BrowserThread::IO);
net::CookieStore* cookie_store = context_getter-> net::CookieStore* cookie_store = context_getter->
GetURLRequestContext()->cookie_store(); GetURLRequestContext()->cookie_store();
cookie_store->GetCookiesWithOptionsAsync( cookie_store->GetCookiesWithOptionsAsync(
...@@ -103,7 +103,7 @@ void RemoveCookieTester::SetCookieOnIOThread( ...@@ -103,7 +103,7 @@ void RemoveCookieTester::SetCookieOnIOThread(
net::URLRequestContextGetter* context_getter, net::URLRequestContextGetter* context_getter,
const std::string& host, const std::string& host,
const std::string& definition) { const std::string& definition) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); DCHECK_CURRENTLY_ON(BrowserThread::IO);
net::CookieStore* cookie_store = context_getter-> net::CookieStore* cookie_store = context_getter->
GetURLRequestContext()->cookie_store(); GetURLRequestContext()->cookie_store();
cookie_store->SetCookieWithOptionsAsync( cookie_store->SetCookieWithOptionsAsync(
......
...@@ -60,7 +60,7 @@ ResettableSettingsSnapshot::ResettableSettingsSnapshot( ...@@ -60,7 +60,7 @@ ResettableSettingsSnapshot::ResettableSettingsSnapshot(
: startup_(SessionStartupPref::GetStartupPref(profile)), : startup_(SessionStartupPref::GetStartupPref(profile)),
shortcuts_determined_(false), shortcuts_determined_(false),
weak_ptr_factory_(this) { weak_ptr_factory_(this) {
DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
// URLs are always stored sorted. // URLs are always stored sorted.
std::sort(startup_.urls.begin(), startup_.urls.end()); std::sort(startup_.urls.begin(), startup_.urls.end());
...@@ -90,14 +90,14 @@ ResettableSettingsSnapshot::ResettableSettingsSnapshot( ...@@ -90,14 +90,14 @@ ResettableSettingsSnapshot::ResettableSettingsSnapshot(
} }
ResettableSettingsSnapshot::~ResettableSettingsSnapshot() { ResettableSettingsSnapshot::~ResettableSettingsSnapshot() {
DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
if (cancellation_flag_.get()) if (cancellation_flag_.get())
cancellation_flag_->data.Set(); cancellation_flag_->data.Set();
} }
void ResettableSettingsSnapshot::Subtract( void ResettableSettingsSnapshot::Subtract(
const ResettableSettingsSnapshot& snapshot) { const ResettableSettingsSnapshot& snapshot) {
DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
ExtensionList extensions = base::STLSetDifference<ExtensionList>( ExtensionList extensions = base::STLSetDifference<ExtensionList>(
enabled_extensions_, snapshot.enabled_extensions_); enabled_extensions_, snapshot.enabled_extensions_);
enabled_extensions_.swap(extensions); enabled_extensions_.swap(extensions);
...@@ -105,7 +105,7 @@ void ResettableSettingsSnapshot::Subtract( ...@@ -105,7 +105,7 @@ void ResettableSettingsSnapshot::Subtract(
int ResettableSettingsSnapshot::FindDifferentFields( int ResettableSettingsSnapshot::FindDifferentFields(
const ResettableSettingsSnapshot& snapshot) const { const ResettableSettingsSnapshot& snapshot) const {
DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
int bit_mask = 0; int bit_mask = 0;
if (startup_.type != snapshot.startup_.type || if (startup_.type != snapshot.startup_.type ||
...@@ -134,7 +134,7 @@ int ResettableSettingsSnapshot::FindDifferentFields( ...@@ -134,7 +134,7 @@ int ResettableSettingsSnapshot::FindDifferentFields(
void ResettableSettingsSnapshot::RequestShortcuts( void ResettableSettingsSnapshot::RequestShortcuts(
const base::Closure& callback) { const base::Closure& callback) {
DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
DCHECK(!cancellation_flag_.get() && !shortcuts_determined()); DCHECK(!cancellation_flag_.get() && !shortcuts_determined());
cancellation_flag_ = new SharedCancellationFlag; cancellation_flag_ = new SharedCancellationFlag;
...@@ -150,7 +150,7 @@ void ResettableSettingsSnapshot::RequestShortcuts( ...@@ -150,7 +150,7 @@ void ResettableSettingsSnapshot::RequestShortcuts(
void ResettableSettingsSnapshot::SetShortcutsAndReport( void ResettableSettingsSnapshot::SetShortcutsAndReport(
const base::Closure& callback, const base::Closure& callback,
const std::vector<ShortcutCommand>& shortcuts) { const std::vector<ShortcutCommand>& shortcuts) {
DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
shortcuts_ = shortcuts; shortcuts_ = shortcuts;
shortcuts_determined_ = true; shortcuts_determined_ = true;
cancellation_flag_ = NULL; cancellation_flag_ = NULL;
...@@ -161,7 +161,7 @@ void ResettableSettingsSnapshot::SetShortcutsAndReport( ...@@ -161,7 +161,7 @@ void ResettableSettingsSnapshot::SetShortcutsAndReport(
std::string SerializeSettingsReport(const ResettableSettingsSnapshot& snapshot, std::string SerializeSettingsReport(const ResettableSettingsSnapshot& snapshot,
int field_mask) { int field_mask) {
DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
base::DictionaryValue dict; base::DictionaryValue dict;
if (field_mask & ResettableSettingsSnapshot::STARTUP_MODE) { if (field_mask & ResettableSettingsSnapshot::STARTUP_MODE) {
...@@ -248,7 +248,7 @@ scoped_ptr<base::ListValue> GetReadableFeedbackForSnapshot( ...@@ -248,7 +248,7 @@ scoped_ptr<base::ListValue> GetReadableFeedbackForSnapshot(
Profile* profile, Profile* profile,
const ResettableSettingsSnapshot& snapshot) { const ResettableSettingsSnapshot& snapshot) {
DCHECK(profile); DCHECK(profile);
DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
scoped_ptr<base::ListValue> list(new base::ListValue); scoped_ptr<base::ListValue> list(new base::ListValue);
AddPair(list.get(), AddPair(list.get(),
l10n_util::GetStringUTF16(IDS_RESET_PROFILE_SETTINGS_LOCALE), l10n_util::GetStringUTF16(IDS_RESET_PROFILE_SETTINGS_LOCALE),
......
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