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

Unified Diff: chrome/browser/extensions/api/tabs/windows_util.cc

Issue 2386823002: [Extensions] Remove ExtensionFunction::SetError() (Closed)
Patch Set: lazyboy's Created 4 years, 2 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/tabs/windows_util.cc
diff --git a/chrome/browser/extensions/api/tabs/windows_util.cc b/chrome/browser/extensions/api/tabs/windows_util.cc
index 1c4e6495916e6d034aaf3b63ebdc3bc847a43dc2..e7179e6222500a47092ce56bd761375aa333c0a1 100644
--- a/chrome/browser/extensions/api/tabs/windows_util.cc
+++ b/chrome/browser/extensions/api/tabs/windows_util.cc
@@ -26,7 +26,9 @@ namespace windows_util {
bool GetWindowFromWindowID(UIThreadExtensionFunction* function,
int window_id,
extensions::WindowController::TypeFilter filter,
- extensions::WindowController** controller) {
+ extensions::WindowController** controller,
+ std::string* error) {
+ DCHECK(error);
if (window_id == extension_misc::kCurrentWindowId) {
extensions::WindowController* extension_window_controller =
function->dispatcher()->GetExtensionWindowController();
@@ -39,7 +41,7 @@ bool GetWindowFromWindowID(UIThreadExtensionFunction* function,
->CurrentWindowForFunctionWithFilter(function, filter);
}
if (!(*controller)) {
- function->SetError(extensions::tabs_constants::kNoCurrentWindowError);
+ *error = extensions::tabs_constants::kNoCurrentWindowError;
return false;
}
} else {
@@ -47,9 +49,9 @@ bool GetWindowFromWindowID(UIThreadExtensionFunction* function,
extensions::WindowControllerList::GetInstance()
->FindWindowForFunctionByIdWithFilter(function, window_id, filter);
if (!(*controller)) {
- function->SetError(extensions::ErrorUtils::FormatErrorMessage(
+ *error = extensions::ErrorUtils::FormatErrorMessage(
extensions::tabs_constants::kWindowNotFoundError,
- base::IntToString(window_id)));
+ base::IntToString(window_id));
return false;
}
}
« no previous file with comments | « chrome/browser/extensions/api/tabs/windows_util.h ('k') | chrome/browser/extensions/chrome_extension_function.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698