Remove some unused histogram_value params from ExtensionFunction*
Bug: None
Test: None
Change-Id: I6e693ed3ac7c2ea75b6b77e1416b3a12dcfcc25f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1701620
Reviewed-by: Devlin <[email protected]>
Commit-Queue: Istiaque Ahmed <[email protected]>
Cr-Commit-Position: refs/heads/master@{#677495}
diff --git a/chrome/browser/extensions/chrome_extension_function_unittest.cc b/chrome/browser/extensions/chrome_extension_function_unittest.cc
index f3c17934..9d3fe1a 100644
--- a/chrome/browser/extensions/chrome_extension_function_unittest.cc
+++ b/chrome/browser/extensions/chrome_extension_function_unittest.cc
@@ -18,8 +18,7 @@
void SuccessCallback(bool* did_respond,
ExtensionFunction::ResponseType type,
const base::ListValue& results,
- const std::string& error,
- functions::HistogramValue histogram_value) {
+ const std::string& error) {
EXPECT_EQ(ExtensionFunction::ResponseType::SUCCEEDED, type);
*did_respond = true;
}
@@ -27,8 +26,7 @@
void FailCallback(bool* did_respond,
ExtensionFunction::ResponseType type,
const base::ListValue& results,
- const std::string& error,
- functions::HistogramValue histogram_value) {
+ const std::string& error) {
EXPECT_EQ(ExtensionFunction::ResponseType::FAILED, type);
*did_respond = true;
}
diff --git a/extensions/browser/api_test_utils.cc b/extensions/browser/api_test_utils.cc
index 84856f26..3d95cd59f 100644
--- a/extensions/browser/api_test_utils.cc
+++ b/extensions/browser/api_test_utils.cc
@@ -51,8 +51,7 @@
void SendResponseHelper::OnResponse(ExtensionFunction::ResponseType response,
const base::ListValue& results,
- const std::string& error,
- functions::HistogramValue histogram_value) {
+ const std::string& error) {
ASSERT_NE(ExtensionFunction::BAD_MESSAGE, response);
response_.reset(new bool(response == ExtensionFunction::SUCCEEDED));
run_loop_.Quit();
diff --git a/extensions/browser/api_test_utils.h b/extensions/browser/api_test_utils.h
index 90957e1..77c823f 100644
--- a/extensions/browser/api_test_utils.h
+++ b/extensions/browser/api_test_utils.h
@@ -50,8 +50,7 @@
// Response handler.
void OnResponse(ExtensionFunction::ResponseType response,
const base::ListValue& results,
- const std::string& error,
- functions::HistogramValue histogram_value);
+ const std::string& error);
base::RunLoop run_loop_;
std::unique_ptr<bool> response_;
diff --git a/extensions/browser/extension_function.cc b/extensions/browser/extension_function.cc
index c80df7d..7bf63da 100644
--- a/extensions/browser/extension_function.cc
+++ b/extensions/browser/extension_function.cc
@@ -481,7 +481,7 @@
if (!results_)
results_.reset(new base::ListValue());
- response_callback_.Run(response, *results_, GetError(), histogram_value());
+ response_callback_.Run(response, *results_, GetError());
LogUma(success, timer_.Elapsed(), histogram_value_);
OnResponded();
diff --git a/extensions/browser/extension_function.h b/extensions/browser/extension_function.h
index cb244c6..1c0b86b 100644
--- a/extensions/browser/extension_function.h
+++ b/extensions/browser/extension_function.h
@@ -118,11 +118,10 @@
BAD_MESSAGE
};
- using ResponseCallback = base::Callback<void(
- ResponseType type,
- const base::ListValue& results,
- const std::string& error,
- extensions::functions::HistogramValue histogram_value)>;
+ using ResponseCallback =
+ base::RepeatingCallback<void(ResponseType type,
+ const base::ListValue& results,
+ const std::string& error)>;
ExtensionFunction();
diff --git a/extensions/browser/extension_function_dispatcher.cc b/extensions/browser/extension_function_dispatcher.cc
index a41c1ea..08f523f 100644
--- a/extensions/browser/extension_function_dispatcher.cc
+++ b/extensions/browser/extension_function_dispatcher.cc
@@ -111,8 +111,7 @@
int request_id,
ExtensionFunction::ResponseType type,
const base::ListValue& results,
- const std::string& error,
- functions::HistogramValue histogram_value) {
+ const std::string& error) {
if (!ipc_sender.get())
return;
@@ -159,8 +158,7 @@
void OnExtensionFunctionCompleted(int request_id,
ExtensionFunction::ResponseType type,
const base::ListValue& results,
- const std::string& error,
- functions::HistogramValue histogram_value) {
+ const std::string& error) {
CommonResponseCallback(render_frame_host_,
render_frame_host_->GetRoutingID(), kMainThreadId,
request_id, type, results, error);
@@ -223,8 +221,7 @@
void OnExtensionFunctionCompleted(int request_id,
ExtensionFunction::ResponseType type,
const base::ListValue& results,
- const std::string& error,
- functions::HistogramValue histogram_value) {
+ const std::string& error) {
if (type == ExtensionFunction::BAD_MESSAGE) {
// The renderer will be shut down from ExtensionFunction::SetBadMessage().
return;
@@ -617,7 +614,7 @@
const ExtensionFunction::ResponseCallback& callback) {
if (!function->HasPermission()) {
LOG(ERROR) << "Permission denied for " << params.name;
- SendAccessDenied(callback, function->histogram_value());
+ SendAccessDenied(callback);
return false;
}
return true;
@@ -636,7 +633,7 @@
ExtensionFunctionRegistry::GetInstance().NewFunction(params.name);
if (!function) {
LOG(ERROR) << "Unknown Extension API - " << params.name;
- SendAccessDenied(callback, extensions::functions::UNKNOWN);
+ SendAccessDenied(callback);
return NULL;
}
@@ -657,11 +654,10 @@
// static
void ExtensionFunctionDispatcher::SendAccessDenied(
- const ExtensionFunction::ResponseCallback& callback,
- functions::HistogramValue histogram_value) {
+ const ExtensionFunction::ResponseCallback& callback) {
base::ListValue empty_list;
callback.Run(ExtensionFunction::FAILED, empty_list,
- "Access to extension API denied.", histogram_value);
+ "Access to extension API denied.");
}
} // namespace extensions
diff --git a/extensions/browser/extension_function_dispatcher.h b/extensions/browser/extension_function_dispatcher.h
index 9ace6e7a..08f11f8e 100644
--- a/extensions/browser/extension_function_dispatcher.h
+++ b/extensions/browser/extension_function_dispatcher.h
@@ -169,8 +169,7 @@
// Helper to run the response callback with an access denied error. Can be
// called on any thread.
static void SendAccessDenied(
- const ExtensionFunction::ResponseCallback& callback,
- functions::HistogramValue histogram_value);
+ const ExtensionFunction::ResponseCallback& callback);
void DispatchWithCallbackInternal(
const ExtensionHostMsg_Request_Params& params,