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

Unified Diff: chrome/browser/extensions/api/browsing_data/browsing_data_api.cc

Issue 10855049: Deal correctly with BrowsingData API calls during startup. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: DCHECK. Created 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/api/browsing_data/browsing_data_api.cc
diff --git a/chrome/browser/extensions/api/browsing_data/browsing_data_api.cc b/chrome/browser/extensions/api/browsing_data/browsing_data_api.cc
index afdb914649f31b6c8f227068efbc38e676a244da..f1a706b6a195f3f52d86ccd8ca53ceb8b22bbf16 100644
--- a/chrome/browser/extensions/api/browsing_data/browsing_data_api.cc
+++ b/chrome/browser/extensions/api/browsing_data/browsing_data_api.cc
@@ -116,6 +116,9 @@ void BrowsingDataExtensionFunction::OnBrowsingDataRemoverDone() {
}
bool BrowsingDataExtensionFunction::RunImpl() {
+ // If we don't have a profile, something's pretty wrong.
+ DCHECK(profile());
+
if (BrowsingDataRemover::is_removing()) {
error_ = extension_browsing_data_api_constants::kOneAtATimeError;
return false;
@@ -147,13 +150,12 @@ bool BrowsingDataExtensionFunction::RunImpl() {
if (removal_mask_ & BrowsingDataRemover::REMOVE_PLUGIN_DATA) {
// If we're being asked to remove plugin data, check whether it's actually
// supported.
- Profile* profile = GetCurrentBrowser()->profile();
BrowserThread::PostTask(
BrowserThread::FILE, FROM_HERE,
base::Bind(
&BrowsingDataExtensionFunction::CheckRemovingPluginDataSupported,
this,
- PluginPrefs::GetForProfile(profile)));
+ PluginPrefs::GetForProfile(profile())));
} else {
StartRemoving();
}
@@ -180,8 +182,8 @@ void BrowsingDataExtensionFunction::StartRemoving() {
// that we're notified after removal) and call remove() with the arguments
// we've generated above. We can use a raw pointer here, as the browsing data
// remover is responsible for deleting itself once data removal is complete.
- BrowsingDataRemover* remover = new BrowsingDataRemover(
- GetCurrentBrowser()->profile(), remove_since_, base::Time::Now());
+ BrowsingDataRemover* remover = new BrowsingDataRemover(profile(),
+ remove_since_, base::Time::Now());
remover->AddObserver(this);
remover->Remove(removal_mask_, origin_set_mask_);
}
« 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