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

Unified Diff: chrome/browser/extensions/api/activity_log_private/activity_log_private_api.cc

Issue 2017113002: [Extensions] DCHECK that ExtensionFunctions respond (and only once) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/extensions/api/activity_log_private/activity_log_private_api.cc
diff --git a/chrome/browser/extensions/api/activity_log_private/activity_log_private_api.cc b/chrome/browser/extensions/api/activity_log_private/activity_log_private_api.cc
index ac60edfded9d89860903bf18c0a707ba94c52121..ed8cd7b117c19926c7061a9a5e69c719612a48a7 100644
--- a/chrome/browser/extensions/api/activity_log_private/activity_log_private_api.cc
+++ b/chrome/browser/extensions/api/activity_log_private/activity_log_private_api.cc
@@ -174,7 +174,8 @@ void ActivityLogPrivateGetExtensionActivitiesFunction::OnLookupCompleted(
SendResponse(true);
}
-bool ActivityLogPrivateDeleteActivitiesFunction::RunAsync() {
+ExtensionFunction::ResponseAction
+ActivityLogPrivateDeleteActivitiesFunction::Run() {
std::unique_ptr<activity_log_private::DeleteActivities::Params> params(
activity_log_private::DeleteActivities::Params::Create(*args_));
EXTENSION_FUNCTION_VALIDATE(params.get());
@@ -187,20 +188,21 @@ bool ActivityLogPrivateDeleteActivitiesFunction::RunAsync() {
action_ids.push_back(value);
}
- ActivityLog* activity_log = ActivityLog::GetInstance(GetProfile());
+ ActivityLog* activity_log = ActivityLog::GetInstance(browser_context());
DCHECK(activity_log);
activity_log->RemoveActions(action_ids);
- return true;
+ return RespondNow(NoArguments());
}
-bool ActivityLogPrivateDeleteDatabaseFunction::RunAsync() {
- ActivityLog* activity_log = ActivityLog::GetInstance(GetProfile());
+ExtensionFunction::ResponseAction
+ActivityLogPrivateDeleteDatabaseFunction::Run() {
+ ActivityLog* activity_log = ActivityLog::GetInstance(browser_context());
DCHECK(activity_log);
activity_log->DeleteDatabase();
- return true;
+ return RespondNow(NoArguments());
}
-bool ActivityLogPrivateDeleteUrlsFunction::RunAsync() {
+ExtensionFunction::ResponseAction ActivityLogPrivateDeleteUrlsFunction::Run() {
std::unique_ptr<activity_log_private::DeleteUrls::Params> params(
activity_log_private::DeleteUrls::Params::Create(*args_));
EXTENSION_FUNCTION_VALIDATE(params.get());
@@ -214,10 +216,10 @@ bool ActivityLogPrivateDeleteUrlsFunction::RunAsync() {
gurls.push_back(GURL(*it));
}
- ActivityLog* activity_log = ActivityLog::GetInstance(GetProfile());
+ ActivityLog* activity_log = ActivityLog::GetInstance(browser_context());
DCHECK(activity_log);
activity_log->RemoveURLs(gurls);
- return true;
+ return RespondNow(NoArguments());
}
} // namespace extensions

Powered by Google App Engine
This is Rietveld 408576698