From a0c91a9ffb1db127cf1f06e285b208a544ed4567 Mon Sep 17 00:00:00 2001 From: "kalman@chromium.org" Date: Sat, 3 May 2014 03:41:43 +0000 Subject: Drive extension functions from ExtensionFunction::Run. The SyncExtensionFunction and AsyncExtensionFunction derivates now expose RunSync and RunAsync respectively. New extension function implementations should just implement Run directly. BUG=365732 R=rockot@chromium.org TBR=dmazzoni@chromium.org Review URL: https://codereview.chromium.org/257333002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@268033 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/browser/extensions/api/processes/processes_api.cc | 12 ++++++------ chrome/browser/extensions/api/processes/processes_api.h | 7 +++---- 2 files changed, 9 insertions(+), 10 deletions(-) (limited to 'chrome/browser/extensions/api/processes') diff --git a/chrome/browser/extensions/api/processes/processes_api.cc b/chrome/browser/extensions/api/processes/processes_api.cc index 70bc204..d09cc5e 100644 --- a/chrome/browser/extensions/api/processes/processes_api.cc +++ b/chrome/browser/extensions/api/processes/processes_api.cc @@ -538,7 +538,7 @@ void ProcessesAPI::OnListenerRemoved(const EventListenerInfo& details) { GetProcessIdForTabFunction::GetProcessIdForTabFunction() : tab_id_(-1) { } -bool GetProcessIdForTabFunction::RunImpl() { +bool GetProcessIdForTabFunction::RunAsync() { #if defined(ENABLE_TASK_MANAGER) EXTENSION_FUNCTION_VALIDATE(args_->GetInteger(0, &tab_id_)); @@ -592,14 +592,14 @@ void GetProcessIdForTabFunction::GetProcessIdForTab() { SendResponse(true); } - // Balance the AddRef in the RunImpl. + // Balance the AddRef in the RunAsync. Release(); } TerminateFunction::TerminateFunction() : process_id_(-1) { } -bool TerminateFunction::RunImpl() { +bool TerminateFunction::RunAsync() { #if defined(ENABLE_TASK_MANAGER) EXTENSION_FUNCTION_VALIDATE(args_->GetInteger(0, &process_id_)); @@ -662,7 +662,7 @@ void TerminateFunction::TerminateProcess() { SendResponse(true); } - // Balance the AddRef in the RunImpl. + // Balance the AddRef in the RunAsync. Release(); #else error_ = errors::kExtensionNotSupported; @@ -680,7 +680,7 @@ GetProcessInfoFunction::GetProcessInfoFunction() GetProcessInfoFunction::~GetProcessInfoFunction() { } -bool GetProcessInfoFunction::RunImpl() { +bool GetProcessInfoFunction::RunAsync() { #if defined(ENABLE_TASK_MANAGER) base::Value* processes = NULL; @@ -763,7 +763,7 @@ void GetProcessInfoFunction::GatherProcessInfo() { SetResult(processes); SendResponse(true); - // Balance the AddRef in the RunImpl. + // Balance the AddRef in the RunAsync. Release(); #endif // defined(ENABLE_TASK_MANAGER) } diff --git a/chrome/browser/extensions/api/processes/processes_api.h b/chrome/browser/extensions/api/processes/processes_api.h index 035a705a..dd89ca2 100644 --- a/chrome/browser/extensions/api/processes/processes_api.h +++ b/chrome/browser/extensions/api/processes/processes_api.h @@ -139,7 +139,7 @@ class GetProcessIdForTabFunction : public ChromeAsyncExtensionFunction { private: virtual ~GetProcessIdForTabFunction() {} - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; void GetProcessIdForTab(); @@ -161,8 +161,7 @@ class TerminateFunction : public ChromeAsyncExtensionFunction { private: virtual ~TerminateFunction() {} - virtual bool RunImpl() OVERRIDE; - + virtual bool RunAsync() OVERRIDE; void TerminateProcess(); @@ -181,7 +180,7 @@ class GetProcessInfoFunction : public ChromeAsyncExtensionFunction { private: virtual ~GetProcessInfoFunction(); - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; void GatherProcessInfo(); -- cgit v1.1