diff options
185 files changed, 926 insertions, 753 deletions
diff --git a/apps/shell/browser/api/shell/shell_api.cc b/apps/shell/browser/api/shell/shell_api.cc index f06996c..c985025 100644 --- a/apps/shell/browser/api/shell/shell_api.cc +++ b/apps/shell/browser/api/shell/shell_api.cc @@ -21,6 +21,8 @@ namespace OnLaunched = apps::shell_api::shell::OnLaunched; namespace apps { namespace { +const char kInvalidArguments[] = "Invalid arguments"; + // Creates a function call result to send to the renderer. DictionaryValue* CreateResult(apps::ShellAppWindow* app_window) { int view_id = app_window->GetRenderViewRoutingID(); @@ -49,14 +51,14 @@ ShellCreateWindowFunction::ShellCreateWindowFunction() { ShellCreateWindowFunction::~ShellCreateWindowFunction() { } -bool ShellCreateWindowFunction::RunImpl() { +ExtensionFunction::ResponseAction ShellCreateWindowFunction::Run() { scoped_ptr<CreateWindow::Params> params(CreateWindow::Params::Create(*args_)); - EXTENSION_FUNCTION_VALIDATE(params.get()); + EXTENSION_FUNCTION_VALIDATE_TYPESAFE(params.get()); // Convert "main.html" to "chrome-extension:/<id>/main.html". GURL url = GetExtension()->GetResourceURL(params->url); if (!url.is_valid()) - return false; + return RespondNow(Error(kInvalidArguments)); // The desktop keeps ownership of the window. apps::ShellAppWindow* app_window = @@ -65,11 +67,7 @@ bool ShellCreateWindowFunction::RunImpl() { app_window->LoadURL(url); // Create the reply to send to the renderer. - DictionaryValue* result = CreateResult(app_window); - SetResult(result); - - SendResponse(true /* success */); - return true; + return RespondNow(SingleArgument(CreateResult(app_window))); } } // namespace apps diff --git a/apps/shell/browser/api/shell/shell_api.h b/apps/shell/browser/api/shell/shell_api.h index 209fc99..b572ce7 100644 --- a/apps/shell/browser/api/shell/shell_api.h +++ b/apps/shell/browser/api/shell/shell_api.h @@ -39,7 +39,7 @@ class ShellCreateWindowFunction : public UIThreadExtensionFunction { private: virtual ~ShellCreateWindowFunction(); - virtual bool RunImpl() OVERRIDE; + virtual ResponseAction Run() OVERRIDE; DISALLOW_COPY_AND_ASSIGN(ShellCreateWindowFunction); }; diff --git a/apps/shell/browser/shell_app_window_api.cc b/apps/shell/browser/shell_app_window_api.cc new file mode 100644 index 0000000..de1012c --- /dev/null +++ b/apps/shell/browser/shell_app_window_api.cc @@ -0,0 +1,85 @@ +// Copyright 2014 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "apps/shell/browser/shell_app_window_api.h" + +#include "apps/shell/browser/shell_app_window.h" +#include "apps/shell/browser/shell_desktop_controller.h" +#include "base/values.h" + +using base::DictionaryValue; + +namespace extensions { +namespace { + +// Returns stub values for window bounds. +DictionaryValue* CreateStubBoundsProperties() { + DictionaryValue* properties = new DictionaryValue; + properties->SetInteger("left", 0); + properties->SetInteger("top", 0); + properties->SetInteger("width", 0); + properties->SetInteger("height", 0); + return properties; +} + +// Creates a function call result to send to the renderer. +DictionaryValue* CreateResult(apps::ShellAppWindow* app_window) { + int view_id = app_window->GetRenderViewRoutingID(); + + DictionaryValue* result = new DictionaryValue; + result->Set("viewId", new base::FundamentalValue(view_id)); + result->Set("injectTitlebar", new base::FundamentalValue(false)); + result->Set("id", new base::StringValue("app_shell")); + + // Add stub window property data. + result->SetBoolean("fullscreen", true); + result->SetBoolean("minimized", false); + result->SetBoolean("maximized", false); + result->SetBoolean("alwaysOnTop", false); + result->SetBoolean("hasFrameColor", false); + result->SetInteger("frameColor", 0); + result->Set("innerBounds", CreateStubBoundsProperties()); + result->Set("outerBounds", CreateStubBoundsProperties()); + + return result; +} + +} // namespace + +ShellAppWindowCreateFunction::ShellAppWindowCreateFunction() { +} + +ShellAppWindowCreateFunction::~ShellAppWindowCreateFunction() { +} + +bool ShellAppWindowCreateFunction::RunAsync() { + // Arguments must contain a URL and may contain options and a callback. + if (args_->GetSize() < 1 || args_->GetSize() > 3) + return false; + + // Extract the URL for the window contents, e.g. "main.html". + std::string url_string; + if (!args_->GetString(0, &url_string)) + return false; + + // Convert "main.html" to "chrome-extension:/<id>/main.html". + GURL url = GetExtension()->GetResourceURL(url_string); + if (!url.is_valid()) + return false; + + // The desktop keeps ownership of the window. + apps::ShellAppWindow* app_window = + apps::ShellDesktopController::instance()->CreateAppWindow( + browser_context()); + app_window->LoadURL(url); + + // Create the reply to send to the renderer. + DictionaryValue* result = CreateResult(app_window); + SetResult(result); + + SendResponse(true /* success */); + return true; +} + +} // namespace extensions diff --git a/apps/shell/browser/shell_app_window_api.h b/apps/shell/browser/shell_app_window_api.h new file mode 100644 index 0000000..bb5eb37 --- /dev/null +++ b/apps/shell/browser/shell_app_window_api.h @@ -0,0 +1,31 @@ +// Copyright 2014 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef APPS_SHELL_BROWSER_SHELL_APP_WINDOW_API_H_ +#define APPS_SHELL_BROWSER_SHELL_APP_WINDOW_API_H_ + +#include "base/compiler_specific.h" +#include "extensions/browser/extension_function.h" + +namespace extensions { + +// A simplified implementation of the chrome.app.window.create() function for +// app_shell. Opens a fullscreen window and invokes the window callback. Most +// of the response is stub data, but the JS contentWindow is valid. +class ShellAppWindowCreateFunction : public AsyncExtensionFunction { + public: + ShellAppWindowCreateFunction(); + + // Don't use the APP_WINDOW_CREATE histogram so we don't pollute the + // statistics for the real Chrome implementation. + DECLARE_EXTENSION_FUNCTION("app.window.create", UNKNOWN); + + private: + virtual ~ShellAppWindowCreateFunction(); + virtual bool RunAsync() OVERRIDE; +}; + +} // namespace extensions + +#endif // APPS_SHELL_BROWSER_SHELL_APP_WINDOW_API_H_ diff --git a/chrome/browser/chromeos/extensions/echo_private_api.cc b/chrome/browser/chromeos/extensions/echo_private_api.cc index 1ebc5f0..230c636 100644 --- a/chrome/browser/chromeos/extensions/echo_private_api.cc +++ b/chrome/browser/chromeos/extensions/echo_private_api.cc @@ -150,7 +150,7 @@ EchoPrivateGetOobeTimestampFunction::EchoPrivateGetOobeTimestampFunction() { EchoPrivateGetOobeTimestampFunction::~EchoPrivateGetOobeTimestampFunction() { } -bool EchoPrivateGetOobeTimestampFunction::RunImpl() { +bool EchoPrivateGetOobeTimestampFunction::RunAsync() { BrowserThread::PostTaskAndReplyWithResult( BrowserThread::FILE, FROM_HERE, base::Bind( @@ -199,7 +199,7 @@ EchoPrivateGetUserConsentFunction::CreateForTest( EchoPrivateGetUserConsentFunction::~EchoPrivateGetUserConsentFunction() {} -bool EchoPrivateGetUserConsentFunction::RunImpl() { +bool EchoPrivateGetUserConsentFunction::RunAsync() { CheckRedeemOffersAllowed(); return true; } diff --git a/chrome/browser/chromeos/extensions/echo_private_api.h b/chrome/browser/chromeos/extensions/echo_private_api.h index 2ec5bc7..20ea9ca 100644 --- a/chrome/browser/chromeos/extensions/echo_private_api.h +++ b/chrome/browser/chromeos/extensions/echo_private_api.h @@ -46,7 +46,7 @@ class EchoPrivateGetOobeTimestampFunction protected: virtual ~EchoPrivateGetOobeTimestampFunction(); - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; private: bool GetOobeTimestampOnFileThread(); @@ -102,7 +102,7 @@ class EchoPrivateGetUserConsentFunction : public ChromeAsyncExtensionFunction, protected: virtual ~EchoPrivateGetUserConsentFunction(); - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; private: // chromeos::EchoDialogListener overrides. diff --git a/chrome/browser/chromeos/extensions/file_manager/file_browser_handler_api.cc b/chrome/browser/chromeos/extensions/file_manager/file_browser_handler_api.cc index f80e275..bdf207e 100644 --- a/chrome/browser/chromeos/extensions/file_manager/file_browser_handler_api.cc +++ b/chrome/browser/chromeos/extensions/file_manager/file_browser_handler_api.cc @@ -284,7 +284,7 @@ FileBrowserHandlerInternalSelectFileFunction:: FileBrowserHandlerInternalSelectFileFunction:: ~FileBrowserHandlerInternalSelectFileFunction() {} -bool FileBrowserHandlerInternalSelectFileFunction::RunImpl() { +bool FileBrowserHandlerInternalSelectFileFunction::RunAsync() { scoped_ptr<SelectFile::Params> params(SelectFile::Params::Create(*args_)); base::FilePath suggested_name(params->selection_params.suggested_name); diff --git a/chrome/browser/chromeos/extensions/file_manager/file_browser_handler_api.h b/chrome/browser/chromeos/extensions/file_manager/file_browser_handler_api.h index 472782f..e130ae7 100644 --- a/chrome/browser/chromeos/extensions/file_manager/file_browser_handler_api.h +++ b/chrome/browser/chromeos/extensions/file_manager/file_browser_handler_api.h @@ -110,7 +110,7 @@ class FileBrowserHandlerInternalSelectFileFunction // AsyncExtensionFunction implementation. // Runs the extension function implementation. - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; private: // Respond to the API with selected entry definition. diff --git a/chrome/browser/chromeos/extensions/file_manager/private_api_dialog.cc b/chrome/browser/chromeos/extensions/file_manager/private_api_dialog.cc index a96a1fc..375a7bd 100644 --- a/chrome/browser/chromeos/extensions/file_manager/private_api_dialog.cc +++ b/chrome/browser/chromeos/extensions/file_manager/private_api_dialog.cc @@ -25,14 +25,14 @@ SelectFileDialogExtension::RoutingID GetFileDialogRoutingID( } // namespace -bool FileBrowserPrivateCancelDialogFunction::RunImpl() { +bool FileBrowserPrivateCancelDialogFunction::RunAsync() { SelectFileDialogExtension::OnFileSelectionCanceled( GetFileDialogRoutingID(this)); SendResponse(true); return true; } -bool FileBrowserPrivateSelectFileFunction::RunImpl() { +bool FileBrowserPrivateSelectFileFunction::RunAsync() { using extensions::api::file_browser_private::SelectFile::Params; const scoped_ptr<Params> params(Params::Create(*args_)); EXTENSION_FUNCTION_VALIDATE(params); @@ -73,7 +73,7 @@ void FileBrowserPrivateSelectFileFunction::GetSelectedFileInfoResponse( SendResponse(true); } -bool FileBrowserPrivateSelectFilesFunction::RunImpl() { +bool FileBrowserPrivateSelectFilesFunction::RunAsync() { using extensions::api::file_browser_private::SelectFiles::Params; const scoped_ptr<Params> params(Params::Create(*args_)); EXTENSION_FUNCTION_VALIDATE(params); diff --git a/chrome/browser/chromeos/extensions/file_manager/private_api_dialog.h b/chrome/browser/chromeos/extensions/file_manager/private_api_dialog.h index 899f047..c333a15 100644 --- a/chrome/browser/chromeos/extensions/file_manager/private_api_dialog.h +++ b/chrome/browser/chromeos/extensions/file_manager/private_api_dialog.h @@ -29,7 +29,7 @@ class FileBrowserPrivateCancelDialogFunction virtual ~FileBrowserPrivateCancelDialogFunction() {} // AsyncExtensionFunction overrides. - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; }; class FileBrowserPrivateSelectFileFunction @@ -42,7 +42,7 @@ class FileBrowserPrivateSelectFileFunction virtual ~FileBrowserPrivateSelectFileFunction() {} // AsyncExtensionFunction overrides. - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; private: // A callback method to handle the result of GetSelectedFileInfo. @@ -62,7 +62,7 @@ class FileBrowserPrivateSelectFilesFunction virtual ~FileBrowserPrivateSelectFilesFunction() {} // AsyncExtensionFunction overrides. - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; private: // A callback method to handle the result of GetSelectedFileInfo. diff --git a/chrome/browser/chromeos/extensions/file_manager/private_api_drive.cc b/chrome/browser/chromeos/extensions/file_manager/private_api_drive.cc index f5f1528..52dd4eb 100644 --- a/chrome/browser/chromeos/extensions/file_manager/private_api_drive.cc +++ b/chrome/browser/chromeos/extensions/file_manager/private_api_drive.cc @@ -349,7 +349,7 @@ FileBrowserPrivateGetDriveEntryPropertiesFunction:: FileBrowserPrivateGetDriveEntryPropertiesFunction:: ~FileBrowserPrivateGetDriveEntryPropertiesFunction() {} -bool FileBrowserPrivateGetDriveEntryPropertiesFunction::RunImpl() { +bool FileBrowserPrivateGetDriveEntryPropertiesFunction::RunAsync() { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); using api::file_browser_private::GetDriveEntryProperties::Params; @@ -390,7 +390,7 @@ void FileBrowserPrivateGetDriveEntryPropertiesFunction:: SendResponse(true); } -bool FileBrowserPrivatePinDriveFileFunction::RunImpl() { +bool FileBrowserPrivatePinDriveFileFunction::RunAsync() { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); using extensions::api::file_browser_private::PinDriveFile::Params; @@ -437,7 +437,7 @@ FileBrowserPrivateGetDriveFilesFunction:: ~FileBrowserPrivateGetDriveFilesFunction() { } -bool FileBrowserPrivateGetDriveFilesFunction::RunImpl() { +bool FileBrowserPrivateGetDriveFilesFunction::RunAsync() { using extensions::api::file_browser_private::GetDriveFiles::Params; const scoped_ptr<Params> params(Params::Create(*args_)); EXTENSION_FUNCTION_VALIDATE(params); @@ -503,7 +503,7 @@ void FileBrowserPrivateGetDriveFilesFunction::OnFileReady( GetFileOrSendResponse(); } -bool FileBrowserPrivateCancelFileTransfersFunction::RunImpl() { +bool FileBrowserPrivateCancelFileTransfersFunction::RunAsync() { using extensions::api::file_browser_private::CancelFileTransfers::Params; const scoped_ptr<Params> params(Params::Create(*args_)); EXTENSION_FUNCTION_VALIDATE(params); @@ -557,7 +557,7 @@ bool FileBrowserPrivateCancelFileTransfersFunction::RunImpl() { return true; } -bool FileBrowserPrivateSearchDriveFunction::RunImpl() { +bool FileBrowserPrivateSearchDriveFunction::RunAsync() { using extensions::api::file_browser_private::SearchDrive::Params; const scoped_ptr<Params> params(Params::Create(*args_)); EXTENSION_FUNCTION_VALIDATE(params); @@ -626,7 +626,7 @@ void FileBrowserPrivateSearchDriveFunction::OnEntryDefinitionList( SendResponse(true); } -bool FileBrowserPrivateSearchDriveMetadataFunction::RunImpl() { +bool FileBrowserPrivateSearchDriveMetadataFunction::RunAsync() { using api::file_browser_private::SearchDriveMetadata::Params; const scoped_ptr<Params> params(Params::Create(*args_)); EXTENSION_FUNCTION_VALIDATE(params); @@ -770,7 +770,7 @@ bool FileBrowserPrivateGetDriveConnectionStateFunction::RunSync() { return true; } -bool FileBrowserPrivateRequestAccessTokenFunction::RunImpl() { +bool FileBrowserPrivateRequestAccessTokenFunction::RunAsync() { using extensions::api::file_browser_private::RequestAccessToken::Params; const scoped_ptr<Params> params(Params::Create(*args_)); EXTENSION_FUNCTION_VALIDATE(params); @@ -804,7 +804,7 @@ void FileBrowserPrivateRequestAccessTokenFunction::OnAccessTokenFetched( SendResponse(true); } -bool FileBrowserPrivateGetShareUrlFunction::RunImpl() { +bool FileBrowserPrivateGetShareUrlFunction::RunAsync() { using extensions::api::file_browser_private::GetShareUrl::Params; const scoped_ptr<Params> params(Params::Create(*args_)); EXTENSION_FUNCTION_VALIDATE(params); @@ -842,7 +842,7 @@ void FileBrowserPrivateGetShareUrlFunction::OnGetShareUrl( SendResponse(true); } -bool FileBrowserPrivateRequestDriveShareFunction::RunImpl() { +bool FileBrowserPrivateRequestDriveShareFunction::RunAsync() { using extensions::api::file_browser_private::RequestDriveShare::Params; const scoped_ptr<Params> params(Params::Create(*args_)); EXTENSION_FUNCTION_VALIDATE(params); diff --git a/chrome/browser/chromeos/extensions/file_manager/private_api_drive.h b/chrome/browser/chromeos/extensions/file_manager/private_api_drive.h index f666c90..b3eec92 100644 --- a/chrome/browser/chromeos/extensions/file_manager/private_api_drive.h +++ b/chrome/browser/chromeos/extensions/file_manager/private_api_drive.h @@ -41,7 +41,7 @@ class FileBrowserPrivateGetDriveEntryPropertiesFunction virtual ~FileBrowserPrivateGetDriveEntryPropertiesFunction(); // AsyncExtensionFunction overrides. - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; private: void CompleteGetFileProperties(drive::FileError error); @@ -62,10 +62,10 @@ class FileBrowserPrivatePinDriveFileFunction virtual ~FileBrowserPrivatePinDriveFileFunction() {} // AsyncExtensionFunction overrides. - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; private: - // Callback for RunImpl(). + // Callback for RunAsync(). void OnPinStateSet(drive::FileError error); }; @@ -89,7 +89,7 @@ class FileBrowserPrivateGetDriveFilesFunction virtual ~FileBrowserPrivateGetDriveFilesFunction(); // AsyncExtensionFunction overrides. - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; private: // Gets the file on the top of the |remaining_drive_paths_| or sends the @@ -117,7 +117,7 @@ class FileBrowserPrivateCancelFileTransfersFunction virtual ~FileBrowserPrivateCancelFileTransfersFunction() {} // AsyncExtensionFunction overrides. - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; }; class FileBrowserPrivateSearchDriveFunction @@ -131,7 +131,7 @@ class FileBrowserPrivateSearchDriveFunction protected: virtual ~FileBrowserPrivateSearchDriveFunction() {} - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; private: // Callback for Search(). @@ -159,7 +159,7 @@ class FileBrowserPrivateSearchDriveMetadataFunction protected: virtual ~FileBrowserPrivateSearchDriveMetadataFunction() {} - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; private: // Callback for SearchMetadata(); @@ -199,7 +199,7 @@ class FileBrowserPrivateRequestAccessTokenFunction virtual ~FileBrowserPrivateRequestAccessTokenFunction() {} // AsyncExtensionFunction overrides. - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; // Callback with a cached auth token (if available) or a fetched one. void OnAccessTokenFetched(google_apis::GDataErrorCode code, @@ -217,7 +217,7 @@ class FileBrowserPrivateGetShareUrlFunction virtual ~FileBrowserPrivateGetShareUrlFunction() {} // AsyncExtensionFunction overrides. - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; // Callback with an url to the sharing dialog as |share_url|, called by // FileSystem::GetShareUrl. @@ -233,7 +233,7 @@ class FileBrowserPrivateRequestDriveShareFunction protected: virtual ~FileBrowserPrivateRequestDriveShareFunction() {} - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; private: // Called back after the drive file system operation is finished. diff --git a/chrome/browser/chromeos/extensions/file_manager/private_api_file_system.cc b/chrome/browser/chromeos/extensions/file_manager/private_api_file_system.cc index 0edaaaf..d150dcb 100644 --- a/chrome/browser/chromeos/extensions/file_manager/private_api_file_system.cc +++ b/chrome/browser/chromeos/extensions/file_manager/private_api_file_system.cc @@ -258,7 +258,7 @@ bool FileBrowserPrivateRequestFileSystemFunction:: return true; } -bool FileBrowserPrivateRequestFileSystemFunction::RunImpl() { +bool FileBrowserPrivateRequestFileSystemFunction::RunAsync() { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); using extensions::api::file_browser_private::RequestFileSystem::Params; const scoped_ptr<Params> params(Params::Create(*args_)); @@ -340,7 +340,7 @@ void FileWatchFunctionBase::Respond(bool success) { SendResponse(success); } -bool FileWatchFunctionBase::RunImpl() { +bool FileWatchFunctionBase::RunAsync() { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); if (!render_view_host() || !render_view_host()->GetProcess()) @@ -394,7 +394,7 @@ void FileBrowserPrivateRemoveFileWatchFunction::PerformFileWatchOperation( Respond(true); } -bool FileBrowserPrivateGetSizeStatsFunction::RunImpl() { +bool FileBrowserPrivateGetSizeStatsFunction::RunAsync() { using extensions::api::file_browser_private::GetSizeStats::Params; const scoped_ptr<Params> params(Params::Create(*args_)); EXTENSION_FUNCTION_VALIDATE(params); @@ -469,7 +469,7 @@ void FileBrowserPrivateGetSizeStatsFunction::GetSizeStatsCallback( SendResponse(true); } -bool FileBrowserPrivateValidatePathNameLengthFunction::RunImpl() { +bool FileBrowserPrivateValidatePathNameLengthFunction::RunAsync() { using extensions::api::file_browser_private::ValidatePathNameLength::Params; const scoped_ptr<Params> params(Params::Create(*args_)); EXTENSION_FUNCTION_VALIDATE(params); @@ -508,7 +508,7 @@ void FileBrowserPrivateValidatePathNameLengthFunction::OnFilePathLimitRetrieved( SendResponse(true); } -bool FileBrowserPrivateFormatVolumeFunction::RunImpl() { +bool FileBrowserPrivateFormatVolumeFunction::RunAsync() { using extensions::api::file_browser_private::FormatVolume::Params; const scoped_ptr<Params> params(Params::Create(*args_)); EXTENSION_FUNCTION_VALIDATE(params); @@ -529,7 +529,7 @@ bool FileBrowserPrivateFormatVolumeFunction::RunImpl() { return true; } -bool FileBrowserPrivateStartCopyFunction::RunImpl() { +bool FileBrowserPrivateStartCopyFunction::RunAsync() { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); using extensions::api::file_browser_private::StartCopy::Params; @@ -578,7 +578,7 @@ void FileBrowserPrivateStartCopyFunction::RunAfterStartCopy( SendResponse(true); } -bool FileBrowserPrivateCancelCopyFunction::RunImpl() { +bool FileBrowserPrivateCancelCopyFunction::RunAsync() { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); using extensions::api::file_browser_private::CancelCopy::Params; diff --git a/chrome/browser/chromeos/extensions/file_manager/private_api_file_system.h b/chrome/browser/chromeos/extensions/file_manager/private_api_file_system.h index b3d4280..6209105 100644 --- a/chrome/browser/chromeos/extensions/file_manager/private_api_file_system.h +++ b/chrome/browser/chromeos/extensions/file_manager/private_api_file_system.h @@ -42,7 +42,7 @@ class FileBrowserPrivateRequestFileSystemFunction virtual ~FileBrowserPrivateRequestFileSystemFunction() {} // AsyncExtensionFunction overrides. - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; private: void RespondSuccessOnUIThread(const std::string& name, @@ -81,7 +81,7 @@ class FileWatchFunctionBase : public LoggedAsyncExtensionFunction { const std::string& extension_id) = 0; // AsyncExtensionFunction overrides. - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; // Calls SendResponse() with |success| converted to base::Value. void Respond(bool success); @@ -133,7 +133,7 @@ class FileBrowserPrivateGetSizeStatsFunction virtual ~FileBrowserPrivateGetSizeStatsFunction() {} // AsyncExtensionFunction overrides. - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; private: void GetDriveAvailableSpaceCallback(drive::FileError error, @@ -157,7 +157,7 @@ class FileBrowserPrivateValidatePathNameLengthFunction void OnFilePathLimitRetrieved(size_t current_length, size_t max_length); // AsyncExtensionFunction overrides. - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; }; // Implements the chrome.fileBrowserPrivate.formatVolume method. @@ -172,7 +172,7 @@ class FileBrowserPrivateFormatVolumeFunction virtual ~FileBrowserPrivateFormatVolumeFunction() {} // AsyncExtensionFunction overrides. - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; }; // Implements the chrome.fileBrowserPrivate.startCopy method. @@ -186,10 +186,10 @@ class FileBrowserPrivateStartCopyFunction virtual ~FileBrowserPrivateStartCopyFunction() {} // AsyncExtensionFunction overrides. - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; private: - // Part of RunImpl(). Called after Copy() is started on IO thread. + // Part of RunAsync(). Called after Copy() is started on IO thread. void RunAfterStartCopy(int operation_id); }; @@ -204,7 +204,7 @@ class FileBrowserPrivateCancelCopyFunction virtual ~FileBrowserPrivateCancelCopyFunction() {} // AsyncExtensionFunction overrides. - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; }; } // namespace extensions diff --git a/chrome/browser/chromeos/extensions/file_manager/private_api_misc.cc b/chrome/browser/chromeos/extensions/file_manager/private_api_misc.cc index 2fcabf5..ce1e3af 100644 --- a/chrome/browser/chromeos/extensions/file_manager/private_api_misc.cc +++ b/chrome/browser/chromeos/extensions/file_manager/private_api_misc.cc @@ -168,7 +168,7 @@ FileBrowserPrivateZipSelectionFunction:: FileBrowserPrivateZipSelectionFunction:: ~FileBrowserPrivateZipSelectionFunction() {} -bool FileBrowserPrivateZipSelectionFunction::RunImpl() { +bool FileBrowserPrivateZipSelectionFunction::RunAsync() { using extensions::api::file_browser_private::ZipSelection::Params; const scoped_ptr<Params> params(Params::Create(*args_)); EXTENSION_FUNCTION_VALIDATE(params); @@ -253,7 +253,7 @@ bool FileBrowserPrivateZoomFunction::RunSync() { return true; } -bool FileBrowserPrivateInstallWebstoreItemFunction::RunImpl() { +bool FileBrowserPrivateInstallWebstoreItemFunction::RunAsync() { using extensions::api::file_browser_private::InstallWebstoreItem::Params; const scoped_ptr<Params> params(Params::Create(*args_)); EXTENSION_FUNCTION_VALIDATE(params); @@ -308,7 +308,7 @@ FileBrowserPrivateRequestWebStoreAccessTokenFunction:: ~FileBrowserPrivateRequestWebStoreAccessTokenFunction() { } -bool FileBrowserPrivateRequestWebStoreAccessTokenFunction::RunImpl() { +bool FileBrowserPrivateRequestWebStoreAccessTokenFunction::RunAsync() { std::vector<std::string> scopes; scopes.push_back(kCWSScope); diff --git a/chrome/browser/chromeos/extensions/file_manager/private_api_misc.h b/chrome/browser/chromeos/extensions/file_manager/private_api_misc.h index 628a635..d6f4a59 100644 --- a/chrome/browser/chromeos/extensions/file_manager/private_api_misc.h +++ b/chrome/browser/chromeos/extensions/file_manager/private_api_misc.h @@ -74,7 +74,7 @@ class FileBrowserPrivateZipSelectionFunction virtual ~FileBrowserPrivateZipSelectionFunction(); // AsyncExtensionFunction overrides. - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; // Receives the result from ZipFileCreator. void OnZipDone(bool success); @@ -107,7 +107,7 @@ class FileBrowserPrivateInstallWebstoreItemFunction virtual ~FileBrowserPrivateInstallWebstoreItemFunction() {} // AsyncExtensionFunction overrides. - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; void OnInstallComplete(bool success, const std::string& error); private: @@ -124,7 +124,7 @@ class FileBrowserPrivateRequestWebStoreAccessTokenFunction protected: virtual ~FileBrowserPrivateRequestWebStoreAccessTokenFunction(); - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; private: scoped_ptr<google_apis::AuthServiceInterface> auth_service_; diff --git a/chrome/browser/chromeos/extensions/file_manager/private_api_mount.cc b/chrome/browser/chromeos/extensions/file_manager/private_api_mount.cc index 16fa5ac..e30dd19 100644 --- a/chrome/browser/chromeos/extensions/file_manager/private_api_mount.cc +++ b/chrome/browser/chromeos/extensions/file_manager/private_api_mount.cc @@ -25,7 +25,7 @@ namespace file_browser_private = extensions::api::file_browser_private; namespace extensions { -bool FileBrowserPrivateAddMountFunction::RunImpl() { +bool FileBrowserPrivateAddMountFunction::RunAsync() { using file_browser_private::AddMount::Params; const scoped_ptr<Params> params(Params::Create(*args_)); EXTENSION_FUNCTION_VALIDATE(params); @@ -89,7 +89,7 @@ void FileBrowserPrivateAddMountFunction::RunAfterMarkCacheFileAsMounted( chromeos::MOUNT_TYPE_ARCHIVE); } -bool FileBrowserPrivateRemoveMountFunction::RunImpl() { +bool FileBrowserPrivateRemoveMountFunction::RunAsync() { using file_browser_private::RemoveMount::Params; const scoped_ptr<Params> params(Params::Create(*args_)); EXTENSION_FUNCTION_VALIDATE(params); @@ -143,7 +143,7 @@ bool FileBrowserPrivateRemoveMountFunction::RunImpl() { return true; } -bool FileBrowserPrivateGetVolumeMetadataListFunction::RunImpl() { +bool FileBrowserPrivateGetVolumeMetadataListFunction::RunAsync() { if (args_->GetSize()) return false; diff --git a/chrome/browser/chromeos/extensions/file_manager/private_api_mount.h b/chrome/browser/chromeos/extensions/file_manager/private_api_mount.h index b66f8e0..69c2d9d 100644 --- a/chrome/browser/chromeos/extensions/file_manager/private_api_mount.h +++ b/chrome/browser/chromeos/extensions/file_manager/private_api_mount.h @@ -30,11 +30,11 @@ class FileBrowserPrivateAddMountFunction : public LoggedAsyncExtensionFunction { virtual ~FileBrowserPrivateAddMountFunction() {} // AsyncExtensionFunction overrides. - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; private: // Part of Run(). Called after MarkCacheFielAsMounted for Drive File System. - // (or directly called from RunImpl() for other file system). + // (or directly called from RunAsync() for other file system). void RunAfterMarkCacheFileAsMounted(const base::FilePath& display_name, drive::FileError error, const base::FilePath& file_path); @@ -52,7 +52,7 @@ class FileBrowserPrivateRemoveMountFunction virtual ~FileBrowserPrivateRemoveMountFunction() {} // AsyncExtensionFunction overrides. - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; }; // Implements chrome.fileBrowserPrivate.getVolumeMetadataList method. @@ -66,7 +66,7 @@ class FileBrowserPrivateGetVolumeMetadataListFunction virtual ~FileBrowserPrivateGetVolumeMetadataListFunction() {} // AsyncExtensionFunction overrides. - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; }; } // namespace extensions diff --git a/chrome/browser/chromeos/extensions/file_manager/private_api_tasks.cc b/chrome/browser/chromeos/extensions/file_manager/private_api_tasks.cc index 0e703c5..e2cb9fe 100644 --- a/chrome/browser/chromeos/extensions/file_manager/private_api_tasks.cc +++ b/chrome/browser/chromeos/extensions/file_manager/private_api_tasks.cc @@ -87,7 +87,7 @@ void SniffMimeType(PathAndMimeTypeSet* path_mime_set, } // namespace -bool FileBrowserPrivateExecuteTaskFunction::RunImpl() { +bool FileBrowserPrivateExecuteTaskFunction::RunAsync() { using extensions::api::file_browser_private::ExecuteTask::Params; using extensions::api::file_browser_private::ExecuteTask::Results::Create; const scoped_ptr<Params> params(Params::Create(*args_)); @@ -146,7 +146,7 @@ void FileBrowserPrivateExecuteTaskFunction::OnTaskExecuted( extensions::api::file_browser_private::TASK_RESULT_FAILED); } -bool FileBrowserPrivateGetFileTasksFunction::RunImpl() { +bool FileBrowserPrivateGetFileTasksFunction::RunAsync() { using extensions::api::file_browser_private::GetFileTasks::Params; const scoped_ptr<Params> params(Params::Create(*args_)); EXTENSION_FUNCTION_VALIDATE(params); diff --git a/chrome/browser/chromeos/extensions/file_manager/private_api_tasks.h b/chrome/browser/chromeos/extensions/file_manager/private_api_tasks.h index 0c9f027..6f0a75e 100644 --- a/chrome/browser/chromeos/extensions/file_manager/private_api_tasks.h +++ b/chrome/browser/chromeos/extensions/file_manager/private_api_tasks.h @@ -26,7 +26,7 @@ class FileBrowserPrivateExecuteTaskFunction virtual ~FileBrowserPrivateExecuteTaskFunction() {} // AsyncExtensionFunction overrides. - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; private: void OnTaskExecuted( @@ -44,7 +44,7 @@ class FileBrowserPrivateGetFileTasksFunction virtual ~FileBrowserPrivateGetFileTasksFunction() {} // AsyncExtensionFunction overrides. - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; private: void OnSniffingMimeTypeCompleted( diff --git a/chrome/browser/chromeos/extensions/file_system_provider/file_system_provider_api.cc b/chrome/browser/chromeos/extensions/file_system_provider/file_system_provider_api.cc index 8e378db..d37f23c 100644 --- a/chrome/browser/chromeos/extensions/file_system_provider/file_system_provider_api.cc +++ b/chrome/browser/chromeos/extensions/file_system_provider/file_system_provider_api.cc @@ -85,7 +85,7 @@ bool FileSystemProviderUnmountFunction::RunSync() { return true; } -bool FileSystemProviderInternalUnmountRequestedSuccessFunction::RunSync() { +bool FileSystemProviderInternalUnmountRequestedSuccessFunction::RunWhenValid() { using api::file_system_provider_internal::UnmountRequestedSuccess::Params; scoped_ptr<Params> params(Params::Create(*args_)); EXTENSION_FUNCTION_VALIDATE(params); @@ -95,7 +95,7 @@ bool FileSystemProviderInternalUnmountRequestedSuccessFunction::RunSync() { return true; } -bool FileSystemProviderInternalUnmountRequestedErrorFunction::RunSync() { +bool FileSystemProviderInternalUnmountRequestedErrorFunction::RunWhenValid() { using api::file_system_provider_internal::UnmountRequestedError::Params; const scoped_ptr<Params> params(Params::Create(*args_)); EXTENSION_FUNCTION_VALIDATE(params); @@ -104,7 +104,8 @@ bool FileSystemProviderInternalUnmountRequestedErrorFunction::RunSync() { return true; } -bool FileSystemProviderInternalGetMetadataRequestedSuccessFunction::RunSync() { +bool +FileSystemProviderInternalGetMetadataRequestedSuccessFunction::RunWhenValid() { using api::file_system_provider_internal::GetMetadataRequestedSuccess::Params; scoped_ptr<Params> params(Params::Create(*args_)); EXTENSION_FUNCTION_VALIDATE(params); @@ -114,7 +115,8 @@ bool FileSystemProviderInternalGetMetadataRequestedSuccessFunction::RunSync() { return true; } -bool FileSystemProviderInternalGetMetadataRequestedErrorFunction::RunSync() { +bool +FileSystemProviderInternalGetMetadataRequestedErrorFunction::RunWhenValid() { using api::file_system_provider_internal::GetMetadataRequestedError::Params; const scoped_ptr<Params> params(Params::Create(*args_)); EXTENSION_FUNCTION_VALIDATE(params); diff --git a/chrome/browser/chromeos/extensions/file_system_provider/file_system_provider_api.h b/chrome/browser/chromeos/extensions/file_system_provider/file_system_provider_api.h index 728513c..b762701 100644 --- a/chrome/browser/chromeos/extensions/file_system_provider/file_system_provider_api.h +++ b/chrome/browser/chromeos/extensions/file_system_provider/file_system_provider_api.h @@ -39,7 +39,7 @@ class FileSystemProviderInternalUnmountRequestedSuccessFunction protected: virtual ~FileSystemProviderInternalUnmountRequestedSuccessFunction() {} - virtual bool RunSync() OVERRIDE; + virtual bool RunWhenValid() OVERRIDE; }; class FileSystemProviderInternalUnmountRequestedErrorFunction @@ -51,7 +51,7 @@ class FileSystemProviderInternalUnmountRequestedErrorFunction protected: virtual ~FileSystemProviderInternalUnmountRequestedErrorFunction() {} - virtual bool RunSync() OVERRIDE; + virtual bool RunWhenValid() OVERRIDE; }; class FileSystemProviderInternalGetMetadataRequestedSuccessFunction @@ -63,7 +63,7 @@ class FileSystemProviderInternalGetMetadataRequestedSuccessFunction protected: virtual ~FileSystemProviderInternalGetMetadataRequestedSuccessFunction() {} - virtual bool RunSync() OVERRIDE; + virtual bool RunWhenValid() OVERRIDE; }; class FileSystemProviderInternalGetMetadataRequestedErrorFunction @@ -75,7 +75,7 @@ class FileSystemProviderInternalGetMetadataRequestedErrorFunction protected: virtual ~FileSystemProviderInternalGetMetadataRequestedErrorFunction() {} - virtual bool RunSync() OVERRIDE; + virtual bool RunWhenValid() OVERRIDE; }; } // namespace extensions diff --git a/chrome/browser/chromeos/extensions/file_system_provider/provider_function.cc b/chrome/browser/chromeos/extensions/file_system_provider/provider_function.cc index 3ef54d7..53a3206 100644 --- a/chrome/browser/chromeos/extensions/file_system_provider/provider_function.cc +++ b/chrome/browser/chromeos/extensions/file_system_provider/provider_function.cc @@ -94,12 +94,12 @@ void FileSystemProviderInternalFunction::FulfillRequest( SetErrorResponse(kSecurityErrorName, kResponseFailedErrorMessage); } -bool FileSystemProviderInternalFunction::RunImpl() { +bool FileSystemProviderInternalFunction::RunSync() { DCHECK(args_); if (!Parse()) return true; - SendResponse(RunSync()); + SendResponse(RunWhenValid()); return true; } diff --git a/chrome/browser/chromeos/extensions/file_system_provider/provider_function.h b/chrome/browser/chromeos/extensions/file_system_provider/provider_function.h index 10e8789..ed689c2c 100644 --- a/chrome/browser/chromeos/extensions/file_system_provider/provider_function.h +++ b/chrome/browser/chromeos/extensions/file_system_provider/provider_function.h @@ -68,10 +68,15 @@ class FileSystemProviderInternalFunction : public ChromeSyncExtensionFunction { scoped_ptr<chromeos::file_system_provider::RequestValue> value, bool has_next); - // ChromeSyncExtensionFunction overrides. - virtual bool RunImpl() OVERRIDE; + // Subclasses implement this for their functionality. + // Called after Parse() is successful, such that |request_id_| and + // |request_manager_| have been fully initialized. + virtual bool RunWhenValid() = 0; private: + // ChromeSyncExtensionFunction overrides. + virtual bool RunSync() OVERRIDE; + // Parses the request in order to extract the request manager. If fails, then // sets a response and returns false. bool Parse(); diff --git a/chrome/browser/chromeos/extensions/info_private_api.cc b/chrome/browser/chromeos/extensions/info_private_api.cc index f7c9514..4d13dcf 100644 --- a/chrome/browser/chromeos/extensions/info_private_api.cc +++ b/chrome/browser/chromeos/extensions/info_private_api.cc @@ -112,7 +112,7 @@ ChromeosInfoPrivateGetFunction::ChromeosInfoPrivateGetFunction() { ChromeosInfoPrivateGetFunction::~ChromeosInfoPrivateGetFunction() { } -bool ChromeosInfoPrivateGetFunction::RunImpl() { +bool ChromeosInfoPrivateGetFunction::RunAsync() { base::ListValue* list = NULL; EXTENSION_FUNCTION_VALIDATE(args_->GetList(0, &list)); scoped_ptr<base::DictionaryValue> result(new base::DictionaryValue()); diff --git a/chrome/browser/chromeos/extensions/info_private_api.h b/chrome/browser/chromeos/extensions/info_private_api.h index 14f2e68..afa531c 100644 --- a/chrome/browser/chromeos/extensions/info_private_api.h +++ b/chrome/browser/chromeos/extensions/info_private_api.h @@ -23,7 +23,7 @@ class ChromeosInfoPrivateGetFunction : public AsyncExtensionFunction { protected: virtual ~ChromeosInfoPrivateGetFunction(); - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; private: // Returns a newly allocate value, or null. diff --git a/chrome/browser/chromeos/extensions/screenlock_private_api.cc b/chrome/browser/chromeos/extensions/screenlock_private_api.cc index c22fb4d..ed6f171 100644 --- a/chrome/browser/chromeos/extensions/screenlock_private_api.cc +++ b/chrome/browser/chromeos/extensions/screenlock_private_api.cc @@ -61,7 +61,7 @@ ScreenlockPrivateGetLockedFunction::ScreenlockPrivateGetLockedFunction() {} ScreenlockPrivateGetLockedFunction::~ScreenlockPrivateGetLockedFunction() {} -bool ScreenlockPrivateGetLockedFunction::RunImpl() { +bool ScreenlockPrivateGetLockedFunction::RunAsync() { bool locked = false; chromeos::ScreenLocker* locker = chromeos::ScreenLocker::default_screen_locker(); @@ -76,7 +76,7 @@ ScreenlockPrivateSetLockedFunction::ScreenlockPrivateSetLockedFunction() {} ScreenlockPrivateSetLockedFunction::~ScreenlockPrivateSetLockedFunction() {} -bool ScreenlockPrivateSetLockedFunction::RunImpl() { +bool ScreenlockPrivateSetLockedFunction::RunAsync() { scoped_ptr<screenlock::SetLocked::Params> params( screenlock::SetLocked::Params::Create(*args_)); EXTENSION_FUNCTION_VALIDATE(params.get()); @@ -98,7 +98,7 @@ ScreenlockPrivateShowMessageFunction::ScreenlockPrivateShowMessageFunction() {} ScreenlockPrivateShowMessageFunction::~ScreenlockPrivateShowMessageFunction() {} -bool ScreenlockPrivateShowMessageFunction::RunImpl() { +bool ScreenlockPrivateShowMessageFunction::RunAsync() { scoped_ptr<screenlock::ShowMessage::Params> params( screenlock::ShowMessage::Params::Create(*args_)); EXTENSION_FUNCTION_VALIDATE(params.get()); @@ -118,7 +118,7 @@ ScreenlockPrivateShowButtonFunction:: ScreenlockPrivateShowButtonFunction:: ~ScreenlockPrivateShowButtonFunction() {} -bool ScreenlockPrivateShowButtonFunction::RunImpl() { +bool ScreenlockPrivateShowButtonFunction::RunAsync() { scoped_ptr<screenlock::ShowButton::Params> params( screenlock::ShowButton::Params::Create(*args_)); EXTENSION_FUNCTION_VALIDATE(params.get()); @@ -157,7 +157,7 @@ ScreenlockPrivateHideButtonFunction::ScreenlockPrivateHideButtonFunction() {} ScreenlockPrivateHideButtonFunction::~ScreenlockPrivateHideButtonFunction() {} -bool ScreenlockPrivateHideButtonFunction::RunImpl() { +bool ScreenlockPrivateHideButtonFunction::RunAsync() { chromeos::ScreenLocker* locker = chromeos::ScreenLocker::default_screen_locker(); if (locker) { @@ -175,7 +175,7 @@ ScreenlockPrivateSetAuthTypeFunction::ScreenlockPrivateSetAuthTypeFunction() {} ScreenlockPrivateSetAuthTypeFunction::~ScreenlockPrivateSetAuthTypeFunction() {} -bool ScreenlockPrivateSetAuthTypeFunction::RunImpl() { +bool ScreenlockPrivateSetAuthTypeFunction::RunAsync() { scoped_ptr<screenlock::SetAuthType::Params> params( screenlock::SetAuthType::Params::Create(*args_)); EXTENSION_FUNCTION_VALIDATE(params.get()); @@ -201,7 +201,7 @@ ScreenlockPrivateGetAuthTypeFunction::ScreenlockPrivateGetAuthTypeFunction() {} ScreenlockPrivateGetAuthTypeFunction::~ScreenlockPrivateGetAuthTypeFunction() {} -bool ScreenlockPrivateGetAuthTypeFunction::RunImpl() { +bool ScreenlockPrivateGetAuthTypeFunction::RunAsync() { chromeos::ScreenLocker* locker = chromeos::ScreenLocker::default_screen_locker(); if (locker) { @@ -225,7 +225,7 @@ ScreenlockPrivateAcceptAuthAttemptFunction:: ScreenlockPrivateAcceptAuthAttemptFunction:: ~ScreenlockPrivateAcceptAuthAttemptFunction() {} -bool ScreenlockPrivateAcceptAuthAttemptFunction::RunImpl() { +bool ScreenlockPrivateAcceptAuthAttemptFunction::RunAsync() { scoped_ptr<screenlock::AcceptAuthAttempt::Params> params( screenlock::AcceptAuthAttempt::Params::Create(*args_)); EXTENSION_FUNCTION_VALIDATE(params.get()); diff --git a/chrome/browser/chromeos/extensions/screenlock_private_api.h b/chrome/browser/chromeos/extensions/screenlock_private_api.h index 7e597d2..97dd94d 100644 --- a/chrome/browser/chromeos/extensions/screenlock_private_api.h +++ b/chrome/browser/chromeos/extensions/screenlock_private_api.h @@ -21,7 +21,8 @@ class ScreenlockPrivateGetLockedFunction : public ChromeAsyncExtensionFunction { DECLARE_EXTENSION_FUNCTION("screenlockPrivate.getLocked", SCREENLOCKPRIVATE_GETLOCKED) ScreenlockPrivateGetLockedFunction(); - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; + private: virtual ~ScreenlockPrivateGetLockedFunction(); DISALLOW_COPY_AND_ASSIGN(ScreenlockPrivateGetLockedFunction); @@ -32,7 +33,8 @@ class ScreenlockPrivateSetLockedFunction : public ChromeAsyncExtensionFunction { DECLARE_EXTENSION_FUNCTION("screenlockPrivate.setLocked", SCREENLOCKPRIVATE_SETLOCKED) ScreenlockPrivateSetLockedFunction(); - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; + private: virtual ~ScreenlockPrivateSetLockedFunction(); DISALLOW_COPY_AND_ASSIGN(ScreenlockPrivateSetLockedFunction); @@ -44,7 +46,8 @@ class ScreenlockPrivateShowMessageFunction DECLARE_EXTENSION_FUNCTION("screenlockPrivate.showMessage", SCREENLOCKPRIVATE_SHOWMESSAGE) ScreenlockPrivateShowMessageFunction(); - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; + private: virtual ~ScreenlockPrivateShowMessageFunction(); DISALLOW_COPY_AND_ASSIGN(ScreenlockPrivateShowMessageFunction ); @@ -56,7 +59,8 @@ class ScreenlockPrivateShowButtonFunction DECLARE_EXTENSION_FUNCTION("screenlockPrivate.showButton", SCREENLOCKPRIVATE_SHOWBUTTON) ScreenlockPrivateShowButtonFunction(); - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; + private: virtual ~ScreenlockPrivateShowButtonFunction(); void OnImageLoaded(const gfx::Image& image); @@ -69,7 +73,7 @@ class ScreenlockPrivateHideButtonFunction DECLARE_EXTENSION_FUNCTION("screenlockPrivate.hideButton", SCREENLOCKPRIVATE_HIDEBUTTON) ScreenlockPrivateHideButtonFunction(); - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; private: virtual ~ScreenlockPrivateHideButtonFunction(); @@ -83,7 +87,7 @@ class ScreenlockPrivateSetAuthTypeFunction DECLARE_EXTENSION_FUNCTION("screenlockPrivate.setAuthType", SCREENLOCKPRIVATE_SETAUTHTYPE) ScreenlockPrivateSetAuthTypeFunction(); - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; private: virtual ~ScreenlockPrivateSetAuthTypeFunction(); @@ -96,7 +100,7 @@ class ScreenlockPrivateGetAuthTypeFunction DECLARE_EXTENSION_FUNCTION("screenlockPrivate.getAuthType", SCREENLOCKPRIVATE_GETAUTHTYPE) ScreenlockPrivateGetAuthTypeFunction(); - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; private: virtual ~ScreenlockPrivateGetAuthTypeFunction(); @@ -109,7 +113,7 @@ class ScreenlockPrivateAcceptAuthAttemptFunction DECLARE_EXTENSION_FUNCTION("screenlockPrivate.acceptAuthAttempt", SCREENLOCKPRIVATE_ACCEPTAUTHATTEMPT) ScreenlockPrivateAcceptAuthAttemptFunction(); - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; private: virtual ~ScreenlockPrivateAcceptAuthAttemptFunction(); diff --git a/chrome/browser/chromeos/extensions/wallpaper_api.cc b/chrome/browser/chromeos/extensions/wallpaper_api.cc index 383c7c7..7ce929d 100644 --- a/chrome/browser/chromeos/extensions/wallpaper_api.cc +++ b/chrome/browser/chromeos/extensions/wallpaper_api.cc @@ -93,7 +93,7 @@ WallpaperSetWallpaperFunction::WallpaperSetWallpaperFunction() { WallpaperSetWallpaperFunction::~WallpaperSetWallpaperFunction() { } -bool WallpaperSetWallpaperFunction::RunImpl() { +bool WallpaperSetWallpaperFunction::RunAsync() { params_ = set_wallpaper::Params::Create(*args_); EXTENSION_FUNCTION_VALIDATE(params_); diff --git a/chrome/browser/chromeos/extensions/wallpaper_api.h b/chrome/browser/chromeos/extensions/wallpaper_api.h index 7fe549d..493ff55 100644 --- a/chrome/browser/chromeos/extensions/wallpaper_api.h +++ b/chrome/browser/chromeos/extensions/wallpaper_api.h @@ -29,7 +29,7 @@ class WallpaperSetWallpaperFunction : public WallpaperFunctionBase { virtual ~WallpaperSetWallpaperFunction(); // AsyncExtensionFunction overrides. - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; private: virtual void OnWallpaperDecoded(const gfx::ImageSkia& image) OVERRIDE; diff --git a/chrome/browser/chromeos/extensions/wallpaper_private_api.cc b/chrome/browser/chromeos/extensions/wallpaper_private_api.cc index f74db97..9643385 100644 --- a/chrome/browser/chromeos/extensions/wallpaper_private_api.cc +++ b/chrome/browser/chromeos/extensions/wallpaper_private_api.cc @@ -285,7 +285,7 @@ WallpaperPrivateSetWallpaperIfExistsFunction:: WallpaperPrivateSetWallpaperIfExistsFunction:: ~WallpaperPrivateSetWallpaperIfExistsFunction() {} -bool WallpaperPrivateSetWallpaperIfExistsFunction::RunImpl() { +bool WallpaperPrivateSetWallpaperIfExistsFunction::RunAsync() { params = set_wallpaper_if_exists::Params::Create(*args_); EXTENSION_FUNCTION_VALIDATE(params); @@ -388,7 +388,7 @@ WallpaperPrivateSetWallpaperFunction::WallpaperPrivateSetWallpaperFunction() { WallpaperPrivateSetWallpaperFunction::~WallpaperPrivateSetWallpaperFunction() { } -bool WallpaperPrivateSetWallpaperFunction::RunImpl() { +bool WallpaperPrivateSetWallpaperFunction::RunAsync() { params = set_wallpaper::Params::Create(*args_); EXTENSION_FUNCTION_VALIDATE(params); @@ -489,7 +489,7 @@ WallpaperPrivateResetWallpaperFunction:: WallpaperPrivateResetWallpaperFunction:: ~WallpaperPrivateResetWallpaperFunction() {} -bool WallpaperPrivateResetWallpaperFunction::RunImpl() { +bool WallpaperPrivateResetWallpaperFunction::RunAsync() { chromeos::WallpaperManager* wallpaper_manager = chromeos::WallpaperManager::Get(); chromeos::UserManager* user_manager = chromeos::UserManager::Get(); @@ -517,7 +517,7 @@ WallpaperPrivateSetCustomWallpaperFunction:: WallpaperPrivateSetCustomWallpaperFunction:: ~WallpaperPrivateSetCustomWallpaperFunction() {} -bool WallpaperPrivateSetCustomWallpaperFunction::RunImpl() { +bool WallpaperPrivateSetCustomWallpaperFunction::RunAsync() { params = set_custom_wallpaper::Params::Create(*args_); EXTENSION_FUNCTION_VALIDATE(params); @@ -609,7 +609,7 @@ WallpaperPrivateSetCustomWallpaperLayoutFunction:: WallpaperPrivateSetCustomWallpaperLayoutFunction:: ~WallpaperPrivateSetCustomWallpaperLayoutFunction() {} -bool WallpaperPrivateSetCustomWallpaperLayoutFunction::RunImpl() { +bool WallpaperPrivateSetCustomWallpaperLayoutFunction::RunAsync() { scoped_ptr<set_custom_wallpaper_layout::Params> params( set_custom_wallpaper_layout::Params::Create(*args_)); EXTENSION_FUNCTION_VALIDATE(params); @@ -645,7 +645,7 @@ WallpaperPrivateMinimizeInactiveWindowsFunction:: ~WallpaperPrivateMinimizeInactiveWindowsFunction() { } -bool WallpaperPrivateMinimizeInactiveWindowsFunction::RunImpl() { +bool WallpaperPrivateMinimizeInactiveWindowsFunction::RunAsync() { WindowStateManager::MinimizeInactiveWindows( chromeos::UserManager::Get()->GetActiveUser()->username_hash()); return true; @@ -659,7 +659,7 @@ WallpaperPrivateRestoreMinimizedWindowsFunction:: ~WallpaperPrivateRestoreMinimizedWindowsFunction() { } -bool WallpaperPrivateRestoreMinimizedWindowsFunction::RunImpl() { +bool WallpaperPrivateRestoreMinimizedWindowsFunction::RunAsync() { WindowStateManager::RestoreWindows( chromeos::UserManager::Get()->GetActiveUser()->username_hash()); return true; @@ -671,7 +671,7 @@ WallpaperPrivateGetThumbnailFunction::WallpaperPrivateGetThumbnailFunction() { WallpaperPrivateGetThumbnailFunction::~WallpaperPrivateGetThumbnailFunction() { } -bool WallpaperPrivateGetThumbnailFunction::RunImpl() { +bool WallpaperPrivateGetThumbnailFunction::RunAsync() { scoped_ptr<get_thumbnail::Params> params( get_thumbnail::Params::Create(*args_)); EXTENSION_FUNCTION_VALIDATE(params); @@ -758,7 +758,7 @@ WallpaperPrivateSaveThumbnailFunction::WallpaperPrivateSaveThumbnailFunction() { WallpaperPrivateSaveThumbnailFunction:: ~WallpaperPrivateSaveThumbnailFunction() {} -bool WallpaperPrivateSaveThumbnailFunction::RunImpl() { +bool WallpaperPrivateSaveThumbnailFunction::RunAsync() { scoped_ptr<save_thumbnail::Params> params( save_thumbnail::Params::Create(*args_)); EXTENSION_FUNCTION_VALIDATE(params); @@ -811,7 +811,7 @@ WallpaperPrivateGetOfflineWallpaperListFunction:: ~WallpaperPrivateGetOfflineWallpaperListFunction() { } -bool WallpaperPrivateGetOfflineWallpaperListFunction::RunImpl() { +bool WallpaperPrivateGetOfflineWallpaperListFunction::RunAsync() { sequence_token_ = BrowserThread::GetBlockingPool()-> GetNamedSequenceToken(chromeos::kWallpaperSequenceTokenName); scoped_refptr<base::SequencedTaskRunner> task_runner = diff --git a/chrome/browser/chromeos/extensions/wallpaper_private_api.h b/chrome/browser/chromeos/extensions/wallpaper_private_api.h index 5586c8b..a9be422 100644 --- a/chrome/browser/chromeos/extensions/wallpaper_private_api.h +++ b/chrome/browser/chromeos/extensions/wallpaper_private_api.h @@ -39,7 +39,7 @@ class WallpaperPrivateSetWallpaperIfExistsFunction virtual ~WallpaperPrivateSetWallpaperIfExistsFunction(); // AsyncExtensionFunction overrides. - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; private: virtual void OnWallpaperDecoded(const gfx::ImageSkia& image) OVERRIDE; @@ -74,7 +74,7 @@ class WallpaperPrivateSetWallpaperFunction : public WallpaperFunctionBase { virtual ~WallpaperPrivateSetWallpaperFunction(); // AsyncExtensionFunction overrides. - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; private: virtual void OnWallpaperDecoded(const gfx::ImageSkia& image) OVERRIDE; @@ -111,7 +111,7 @@ class WallpaperPrivateResetWallpaperFunction virtual ~WallpaperPrivateResetWallpaperFunction(); // AsyncExtensionFunction overrides. - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; }; class WallpaperPrivateSetCustomWallpaperFunction @@ -126,7 +126,7 @@ class WallpaperPrivateSetCustomWallpaperFunction virtual ~WallpaperPrivateSetCustomWallpaperFunction(); // AsyncExtensionFunction overrides. - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; private: virtual void OnWallpaperDecoded(const gfx::ImageSkia& wallpaper) OVERRIDE; @@ -165,7 +165,7 @@ class WallpaperPrivateSetCustomWallpaperLayoutFunction virtual ~WallpaperPrivateSetCustomWallpaperLayoutFunction(); // AsyncExtensionFunction overrides. - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; }; class WallpaperPrivateMinimizeInactiveWindowsFunction @@ -180,7 +180,7 @@ class WallpaperPrivateMinimizeInactiveWindowsFunction virtual ~WallpaperPrivateMinimizeInactiveWindowsFunction(); // AsyncExtensionFunction overrides. - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; }; class WallpaperPrivateRestoreMinimizedWindowsFunction @@ -195,7 +195,7 @@ class WallpaperPrivateRestoreMinimizedWindowsFunction virtual ~WallpaperPrivateRestoreMinimizedWindowsFunction(); // AsyncExtensionFunction overrides. - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; }; class WallpaperPrivateGetThumbnailFunction : public AsyncExtensionFunction { @@ -209,7 +209,7 @@ class WallpaperPrivateGetThumbnailFunction : public AsyncExtensionFunction { virtual ~WallpaperPrivateGetThumbnailFunction(); // AsyncExtensionFunction overrides. - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; private: // Failed to get thumbnail for |file_name|. @@ -242,7 +242,7 @@ class WallpaperPrivateSaveThumbnailFunction : public AsyncExtensionFunction { virtual ~WallpaperPrivateSaveThumbnailFunction(); // AsyncExtensionFunction overrides. - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; private: // Failed to save thumbnail for |file_name|. @@ -270,7 +270,7 @@ class WallpaperPrivateGetOfflineWallpaperListFunction virtual ~WallpaperPrivateGetOfflineWallpaperListFunction(); // AsyncExtensionFunction overrides. - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; private: // Enumerates the list of files in online wallpaper directory. diff --git a/chrome/browser/chromeos/extensions/wallpaper_private_api_unittest.cc b/chrome/browser/chromeos/extensions/wallpaper_private_api_unittest.cc index ea63359..515f586 100644 --- a/chrome/browser/chromeos/extensions/wallpaper_private_api_unittest.cc +++ b/chrome/browser/chromeos/extensions/wallpaper_private_api_unittest.cc @@ -51,8 +51,8 @@ class TestMinimizeFunction public: TestMinimizeFunction() {} - virtual bool RunImpl() OVERRIDE { - return WallpaperPrivateMinimizeInactiveWindowsFunction::RunImpl(); + virtual bool RunAsync() OVERRIDE { + return WallpaperPrivateMinimizeInactiveWindowsFunction::RunAsync(); } protected: @@ -64,8 +64,8 @@ class TestRestoreFunction public: TestRestoreFunction() {} - virtual bool RunImpl() OVERRIDE { - return WallpaperPrivateRestoreMinimizedWindowsFunction::RunImpl(); + virtual bool RunAsync() OVERRIDE { + return WallpaperPrivateRestoreMinimizedWindowsFunction::RunAsync(); } protected: virtual ~TestRestoreFunction() {} @@ -100,7 +100,7 @@ TEST_F(WallpaperPrivateApiUnittest, HideAndRestoreWindows) { EXPECT_TRUE(window0_state->IsActive()); scoped_refptr<TestMinimizeFunction> minimize_function( new TestMinimizeFunction()); - EXPECT_TRUE(minimize_function->RunImpl()); + EXPECT_TRUE(minimize_function->RunAsync()); // All windows except window 0 should be minimized. EXPECT_FALSE(window0_state->IsMinimized()); @@ -112,7 +112,7 @@ TEST_F(WallpaperPrivateApiUnittest, HideAndRestoreWindows) { window0.reset(); scoped_refptr<TestRestoreFunction> restore_function( new TestRestoreFunction()); - EXPECT_TRUE(restore_function->RunImpl()); + EXPECT_TRUE(restore_function->RunAsync()); // Windows 1 and 2 should no longer be minimized. Window 1 should again // be maximized. Window 3 should still be minimized. @@ -140,7 +140,7 @@ TEST_F(WallpaperPrivateApiUnittest, HideAndManualUnminimizeWindows) { EXPECT_TRUE(window0_state->IsActive()); scoped_refptr<TestMinimizeFunction> minimize_function_0( new TestMinimizeFunction()); - EXPECT_TRUE(minimize_function_0->RunImpl()); + EXPECT_TRUE(minimize_function_0->RunAsync()); // All windows except window 0 should be minimized. EXPECT_FALSE(window0_state->IsMinimized()); @@ -150,7 +150,7 @@ TEST_F(WallpaperPrivateApiUnittest, HideAndManualUnminimizeWindows) { // change. scoped_refptr<TestMinimizeFunction> minimize_function_1( new TestMinimizeFunction()); - EXPECT_TRUE(minimize_function_1->RunImpl()); + EXPECT_TRUE(minimize_function_1->RunAsync()); // All windows except window 0 should be minimized. EXPECT_FALSE(window0_state->IsMinimized()); @@ -163,7 +163,7 @@ TEST_F(WallpaperPrivateApiUnittest, HideAndManualUnminimizeWindows) { scoped_refptr<TestMinimizeFunction> minimize_function_2( new TestMinimizeFunction()); - EXPECT_TRUE(minimize_function_2->RunImpl()); + EXPECT_TRUE(minimize_function_2->RunAsync()); // Window 1 should be minimized again. EXPECT_FALSE(window0_state->IsMinimized()); @@ -173,7 +173,7 @@ TEST_F(WallpaperPrivateApiUnittest, HideAndManualUnminimizeWindows) { window0.reset(); scoped_refptr<TestRestoreFunction> restore_function( new TestRestoreFunction()); - EXPECT_TRUE(restore_function->RunImpl()); + EXPECT_TRUE(restore_function->RunAsync()); // Windows 1 should no longer be minimized. EXPECT_FALSE(window1_state->IsMinimized()); @@ -280,7 +280,7 @@ TEST_F(WallpaperPrivateApiMultiUserUnittest, HideAndRestoreWindowsTwoUsers) { EXPECT_TRUE(window0_state->IsActive()); scoped_refptr<TestMinimizeFunction> minimize_function_0( new TestMinimizeFunction()); - EXPECT_TRUE(minimize_function_0->RunImpl()); + EXPECT_TRUE(minimize_function_0->RunAsync()); // All windows except window 0 should be minimized. EXPECT_FALSE(window0_state->IsMinimized()); @@ -298,7 +298,7 @@ TEST_F(WallpaperPrivateApiMultiUserUnittest, HideAndRestoreWindowsTwoUsers) { EXPECT_TRUE(window2_state->IsActive()); scoped_refptr<TestMinimizeFunction> minimize_function_1( new TestMinimizeFunction()); - EXPECT_TRUE(minimize_function_1->RunImpl()); + EXPECT_TRUE(minimize_function_1->RunAsync()); // All windows except window 2 should be minimized. EXPECT_FALSE(window2_state->IsMinimized()); @@ -322,7 +322,7 @@ TEST_F(WallpaperPrivateApiMultiUserUnittest, HideAndRestoreWindowsTwoUsers) { window2.reset(); scoped_refptr<TestRestoreFunction> restore_function_0( new TestRestoreFunction()); - EXPECT_TRUE(restore_function_0->RunImpl()); + EXPECT_TRUE(restore_function_0->RunAsync()); EXPECT_FALSE(window3_state->IsMinimized()); @@ -336,7 +336,7 @@ TEST_F(WallpaperPrivateApiMultiUserUnittest, HideAndRestoreWindowsTwoUsers) { window0.reset(); scoped_refptr<TestRestoreFunction> restore_function_1( new TestRestoreFunction()); - EXPECT_TRUE(restore_function_1->RunImpl()); + EXPECT_TRUE(restore_function_1->RunAsync()); EXPECT_FALSE(window1_state->IsMinimized()); EXPECT_FALSE(window3_state->IsMinimized()); @@ -380,7 +380,7 @@ TEST_F(WallpaperPrivateApiMultiUserUnittest, HideTeleportedWindow) { EXPECT_TRUE(window0_state->IsActive()); scoped_refptr<TestMinimizeFunction> minimize_function_0( new TestMinimizeFunction()); - EXPECT_TRUE(minimize_function_0->RunImpl()); + EXPECT_TRUE(minimize_function_0->RunAsync()); // All windows except window 0 should be minimized. EXPECT_FALSE(window0_state->IsMinimized()); @@ -395,7 +395,7 @@ TEST_F(WallpaperPrivateApiMultiUserUnittest, HideTeleportedWindow) { window0.reset(); scoped_refptr<TestRestoreFunction> restore_function_1( new TestRestoreFunction()); - EXPECT_TRUE(restore_function_1->RunImpl()); + EXPECT_TRUE(restore_function_1->RunAsync()); EXPECT_FALSE(window1_state->IsMinimized()); EXPECT_FALSE(window2_state->IsMinimized()); 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 bb99213..ba4f4a9 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 @@ -95,7 +95,7 @@ void ActivityLogAPI::OnExtensionActivity(scoped_refptr<Action> activity) { EventRouter::Get(browser_context_)->BroadcastEvent(event.Pass()); } -bool ActivityLogPrivateGetExtensionActivitiesFunction::RunImpl() { +bool ActivityLogPrivateGetExtensionActivitiesFunction::RunAsync() { scoped_ptr<activity_log_private::GetExtensionActivities::Params> params( activity_log_private::GetExtensionActivities::Params::Create(*args_)); EXTENSION_FUNCTION_VALIDATE(params.get()); @@ -176,7 +176,7 @@ void ActivityLogPrivateGetExtensionActivitiesFunction::OnLookupCompleted( SendResponse(true); } -bool ActivityLogPrivateDeleteActivitiesFunction::RunImpl() { +bool ActivityLogPrivateDeleteActivitiesFunction::RunAsync() { scoped_ptr<activity_log_private::DeleteActivities::Params> params( activity_log_private::DeleteActivities::Params::Create(*args_)); EXTENSION_FUNCTION_VALIDATE(params.get()); @@ -195,14 +195,14 @@ bool ActivityLogPrivateDeleteActivitiesFunction::RunImpl() { return true; } -bool ActivityLogPrivateDeleteDatabaseFunction::RunImpl() { +bool ActivityLogPrivateDeleteDatabaseFunction::RunAsync() { ActivityLog* activity_log = ActivityLog::GetInstance(GetProfile()); DCHECK(activity_log); activity_log->DeleteDatabase(); return true; } -bool ActivityLogPrivateDeleteUrlsFunction::RunImpl() { +bool ActivityLogPrivateDeleteUrlsFunction::RunAsync() { scoped_ptr<activity_log_private::DeleteUrls::Params> params( activity_log_private::DeleteUrls::Params::Create(*args_)); EXTENSION_FUNCTION_VALIDATE(params.get()); diff --git a/chrome/browser/extensions/api/activity_log_private/activity_log_private_api.h b/chrome/browser/extensions/api/activity_log_private/activity_log_private_api.h index 513d015..3df12f4f 100644 --- a/chrome/browser/extensions/api/activity_log_private/activity_log_private_api.h +++ b/chrome/browser/extensions/api/activity_log_private/activity_log_private_api.h @@ -71,7 +71,7 @@ class ActivityLogPrivateGetExtensionActivitiesFunction virtual ~ActivityLogPrivateGetExtensionActivitiesFunction() {} // ExtensionFunction: - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; private: void OnLookupCompleted( @@ -89,7 +89,7 @@ class ActivityLogPrivateDeleteActivitiesFunction virtual ~ActivityLogPrivateDeleteActivitiesFunction() {} // ExtensionFunction: - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; }; // The implementation of activityLogPrivate.deleteDatabase @@ -103,7 +103,7 @@ class ActivityLogPrivateDeleteDatabaseFunction virtual ~ActivityLogPrivateDeleteDatabaseFunction() {} // ExtensionFunction: - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; }; // The implementation of activityLogPrivate.deleteUrls @@ -117,7 +117,7 @@ class ActivityLogPrivateDeleteUrlsFunction virtual ~ActivityLogPrivateDeleteUrlsFunction() {} // ExtensionFunction: - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; }; } // namespace extensions diff --git a/chrome/browser/extensions/api/alarms/alarms_api.cc b/chrome/browser/extensions/api/alarms/alarms_api.cc index 6c717cb..4de1670 100644 --- a/chrome/browser/extensions/api/alarms/alarms_api.cc +++ b/chrome/browser/extensions/api/alarms/alarms_api.cc @@ -98,7 +98,7 @@ AlarmsCreateFunction::~AlarmsCreateFunction() { delete clock_; } -bool AlarmsCreateFunction::RunImpl() { +bool AlarmsCreateFunction::RunAsync() { scoped_ptr<alarms::Create::Params> params( alarms::Create::Params::Create(*args_)); EXTENSION_FUNCTION_VALIDATE(params.get()); @@ -129,7 +129,7 @@ void AlarmsCreateFunction::Callback() { SendResponse(true); } -bool AlarmsGetFunction::RunImpl() { +bool AlarmsGetFunction::RunAsync() { scoped_ptr<alarms::Get::Params> params(alarms::Get::Params::Create(*args_)); EXTENSION_FUNCTION_VALIDATE(params.get()); @@ -150,7 +150,7 @@ void AlarmsGetFunction::Callback( SendResponse(true); } -bool AlarmsGetAllFunction::RunImpl() { +bool AlarmsGetAllFunction::RunAsync() { AlarmManager::Get(GetProfile())->GetAllAlarms( extension_id(), base::Bind(&AlarmsGetAllFunction::Callback, this)); return true; @@ -170,7 +170,7 @@ void AlarmsGetAllFunction::Callback(const AlarmList* alarms) { SendResponse(true); } -bool AlarmsClearFunction::RunImpl() { +bool AlarmsClearFunction::RunAsync() { scoped_ptr<alarms::Clear::Params> params( alarms::Clear::Params::Create(*args_)); EXTENSION_FUNCTION_VALIDATE(params.get()); @@ -189,7 +189,7 @@ void AlarmsClearFunction::Callback(const std::string& name, bool success) { SendResponse(true); } -bool AlarmsClearAllFunction::RunImpl() { +bool AlarmsClearAllFunction::RunAsync() { AlarmManager::Get(GetProfile())->RemoveAllAlarms( extension_id(), base::Bind(&AlarmsClearAllFunction::Callback, this)); return true; diff --git a/chrome/browser/extensions/api/alarms/alarms_api.h b/chrome/browser/extensions/api/alarms/alarms_api.h index 3d971af..4bbe3398 100644 --- a/chrome/browser/extensions/api/alarms/alarms_api.h +++ b/chrome/browser/extensions/api/alarms/alarms_api.h @@ -27,7 +27,7 @@ class AlarmsCreateFunction : public ChromeAsyncExtensionFunction { virtual ~AlarmsCreateFunction(); // ExtensionFunction: - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; DECLARE_EXTENSION_FUNCTION("alarms.create", ALARMS_CREATE) private: void Callback(); @@ -44,7 +44,7 @@ class AlarmsGetFunction : public ChromeAsyncExtensionFunction { virtual ~AlarmsGetFunction() {} // ExtensionFunction: - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; private: void Callback(const std::string& name, Alarm* alarm); @@ -56,7 +56,8 @@ class AlarmsGetAllFunction : public ChromeAsyncExtensionFunction { virtual ~AlarmsGetAllFunction() {} // ExtensionFunction: - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; + private: void Callback(const AlarmList* alarms); DECLARE_EXTENSION_FUNCTION("alarms.getAll", ALARMS_GETALL) @@ -67,7 +68,8 @@ class AlarmsClearFunction : public ChromeAsyncExtensionFunction { virtual ~AlarmsClearFunction() {} // ExtensionFunction: - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; + private: void Callback(const std::string& name, bool success); DECLARE_EXTENSION_FUNCTION("alarms.clear", ALARMS_CLEAR) @@ -78,7 +80,8 @@ class AlarmsClearAllFunction : public ChromeAsyncExtensionFunction { virtual ~AlarmsClearAllFunction() {} // ExtensionFunction: - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; + private: void Callback(); DECLARE_EXTENSION_FUNCTION("alarms.clearAll", ALARMS_CLEARALL) diff --git a/chrome/browser/extensions/api/app_window/app_window_api.cc b/chrome/browser/extensions/api/app_window/app_window_api.cc index 14af30a..4f2b68e 100644 --- a/chrome/browser/extensions/api/app_window/app_window_api.cc +++ b/chrome/browser/extensions/api/app_window/app_window_api.cc @@ -139,7 +139,7 @@ void AppWindowCreateFunction::SendDelayedResponse() { SendResponse(true); } -bool AppWindowCreateFunction::RunImpl() { +bool AppWindowCreateFunction::RunAsync() { // Don't create app window if the system is shutting down. if (extensions::ExtensionsBrowserClient::Get()->IsShuttingDown()) return false; diff --git a/chrome/browser/extensions/api/app_window/app_window_api.h b/chrome/browser/extensions/api/app_window/app_window_api.h index de73bac..8f976bf 100644 --- a/chrome/browser/extensions/api/app_window/app_window_api.h +++ b/chrome/browser/extensions/api/app_window/app_window_api.h @@ -16,7 +16,7 @@ struct CreateWindowOptions; } } -class AppWindowCreateFunction : public UIThreadExtensionFunction { +class AppWindowCreateFunction : public AsyncExtensionFunction { public: AppWindowCreateFunction(); DECLARE_EXTENSION_FUNCTION("app.window.create", APP_WINDOW_CREATE) @@ -25,7 +25,7 @@ class AppWindowCreateFunction : public UIThreadExtensionFunction { protected: virtual ~AppWindowCreateFunction() {} - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; private: bool GetBoundsSpec( diff --git a/chrome/browser/extensions/api/audio/audio_api.cc b/chrome/browser/extensions/api/audio/audio_api.cc index 06285f0..f711c95 100644 --- a/chrome/browser/extensions/api/audio/audio_api.cc +++ b/chrome/browser/extensions/api/audio/audio_api.cc @@ -46,7 +46,7 @@ void AudioAPI::OnDeviceChanged() { } } -bool AudioGetInfoFunction::RunImpl() { +bool AudioGetInfoFunction::RunAsync() { AudioService* service = AudioAPI::GetFactoryInstance()->Get(GetProfile())->GetService(); DCHECK(service); diff --git a/chrome/browser/extensions/api/audio/audio_api.h b/chrome/browser/extensions/api/audio/audio_api.h index f99547a..8a33e85 100644 --- a/chrome/browser/extensions/api/audio/audio_api.h +++ b/chrome/browser/extensions/api/audio/audio_api.h @@ -45,7 +45,7 @@ class AudioGetInfoFunction : public ChromeAsyncExtensionFunction { protected: virtual ~AudioGetInfoFunction() {} - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; private: void OnGetInfoCompleted(const OutputInfo& output_info, diff --git a/chrome/browser/extensions/api/automation_internal/automation_internal_api.cc b/chrome/browser/extensions/api/automation_internal/automation_internal_api.cc index 9c77eda..8860055 100644 --- a/chrome/browser/extensions/api/automation_internal/automation_internal_api.cc +++ b/chrome/browser/extensions/api/automation_internal/automation_internal_api.cc @@ -59,7 +59,7 @@ class AutomationWebContentsObserver // if this doesn't turn accessibility on for the first time (e.g. if a // RendererAccessibility object existed already because a screenreader has been // run at some point). -bool AutomationInternalEnableCurrentTabFunction::RunImpl() { +bool AutomationInternalEnableCurrentTabFunction::RunAsync() { if (!CommandLine::ForCurrentProcess()->HasSwitch( switches::kEnableAutomationAPI)) { return false; @@ -88,7 +88,7 @@ bool AutomationInternalEnableCurrentTabFunction::RunImpl() { return true; } -bool AutomationInternalPerformActionFunction::RunImpl() { +bool AutomationInternalPerformActionFunction::RunAsync() { using api::automation_internal::PerformAction::Params; scoped_ptr<Params> params(Params::Create(*args_)); EXTENSION_FUNCTION_VALIDATE(params.get()); diff --git a/chrome/browser/extensions/api/automation_internal/automation_internal_api.h b/chrome/browser/extensions/api/automation_internal/automation_internal_api.h index f82867b..6f902f7 100644 --- a/chrome/browser/extensions/api/automation_internal/automation_internal_api.h +++ b/chrome/browser/extensions/api/automation_internal/automation_internal_api.h @@ -27,7 +27,7 @@ class AutomationInternalEnableCurrentTabFunction protected: virtual ~AutomationInternalEnableCurrentTabFunction() {} - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; }; class AutomationInternalPerformActionFunction @@ -37,7 +37,7 @@ class AutomationInternalPerformActionFunction protected: virtual ~AutomationInternalPerformActionFunction() {} - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; }; } // namespace extensions diff --git a/chrome/browser/extensions/api/bluetooth/bluetooth_api.cc b/chrome/browser/extensions/api/bluetooth/bluetooth_api.cc index 77128f8..14bff9d 100644 --- a/chrome/browser/extensions/api/bluetooth/bluetooth_api.cc +++ b/chrome/browser/extensions/api/bluetooth/bluetooth_api.cc @@ -315,7 +315,7 @@ BluetoothAddProfileFunction::BluetoothAddProfileFunction() {} BluetoothAddProfileFunction::~BluetoothAddProfileFunction() {} -bool BluetoothAddProfileFunction::RunImpl() { +bool BluetoothAddProfileFunction::RunAsync() { DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); scoped_ptr<AddProfile::Params> params(AddProfile::Params::Create(*args_)); EXTENSION_FUNCTION_VALIDATE(params.get() != NULL); @@ -474,37 +474,37 @@ void BluetoothConnectFunction::OnErrorCallback(const std::string& error) { SendResponse(false); } -bool BluetoothDisconnectFunction::RunImpl() { +bool BluetoothDisconnectFunction::RunAsync() { // TODO(keybuk): Remove. SetError("Removed. Use chrome.bluetoothSocket.disconnect() instead."); return false; } -bool BluetoothSendFunction::RunImpl() { +bool BluetoothSendFunction::RunAsync() { // TODO(keybuk): Remove. SetError("Removed. Use chrome.bluetoothSocket.send() instead."); return false; } -bool BluetoothUpdateSocketFunction::RunImpl() { +bool BluetoothUpdateSocketFunction::RunAsync() { // TODO(keybuk): Remove. SetError("Removed. Use chrome.bluetoothSocket.update() instead."); return false; } -bool BluetoothSetSocketPausedFunction::RunImpl() { +bool BluetoothSetSocketPausedFunction::RunAsync() { // TODO(keybuk): Remove. SetError("Removed. Use chrome.bluetoothSocket.setPaused() instead."); return false; } -bool BluetoothGetSocketFunction::RunImpl() { +bool BluetoothGetSocketFunction::RunAsync() { // TODO(keybuk): Remove. SetError("Removed. Use chrome.bluetoothSocket.getInfo() instead."); return false; } -bool BluetoothGetSocketsFunction::RunImpl() { +bool BluetoothGetSocketsFunction::RunAsync() { // TODO(keybuk): Remove. SetError("Removed. Use chrome.bluetoothSocket.getSockets() instead."); return false; diff --git a/chrome/browser/extensions/api/bluetooth/bluetooth_api.h b/chrome/browser/extensions/api/bluetooth/bluetooth_api.h index 9ce771e..22afeaf 100644 --- a/chrome/browser/extensions/api/bluetooth/bluetooth_api.h +++ b/chrome/browser/extensions/api/bluetooth/bluetooth_api.h @@ -142,7 +142,7 @@ class BluetoothGetDeviceFunction : public BluetoothExtensionFunction { virtual ~BluetoothGetDeviceFunction(); }; -class BluetoothAddProfileFunction : public UIThreadExtensionFunction { +class BluetoothAddProfileFunction : public AsyncExtensionFunction { public: DECLARE_EXTENSION_FUNCTION("bluetooth.addProfile", BLUETOOTH_ADDPROFILE) @@ -150,7 +150,7 @@ class BluetoothAddProfileFunction : public UIThreadExtensionFunction { protected: virtual ~BluetoothAddProfileFunction(); - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; virtual void RegisterProfile( const device::BluetoothProfile::Options& options, @@ -187,40 +187,40 @@ class BluetoothConnectFunction : public BluetoothExtensionFunction { void OnErrorCallback(const std::string& error); }; -class BluetoothDisconnectFunction : public UIThreadExtensionFunction { +class BluetoothDisconnectFunction : public AsyncExtensionFunction { public: DECLARE_EXTENSION_FUNCTION("bluetooth.disconnect", BLUETOOTH_DISCONNECT) protected: virtual ~BluetoothDisconnectFunction() {} - // UIThreadExtensionFunction: - virtual bool RunImpl() OVERRIDE; + // AsyncExtensionFunction: + virtual bool RunAsync() OVERRIDE; }; -class BluetoothSendFunction : public UIThreadExtensionFunction { +class BluetoothSendFunction : public AsyncExtensionFunction { public: DECLARE_EXTENSION_FUNCTION("bluetooth.send", BLUETOOTH_WRITE) protected: virtual ~BluetoothSendFunction() {} - // UIThreadExtensionFunction: - virtual bool RunImpl() OVERRIDE; + // AsyncExtensionFunction: + virtual bool RunAsync() OVERRIDE; }; -class BluetoothUpdateSocketFunction : public UIThreadExtensionFunction { +class BluetoothUpdateSocketFunction : public AsyncExtensionFunction { public: DECLARE_EXTENSION_FUNCTION("bluetooth.updateSocket", BLUETOOTH_UPDATE_SOCKET) protected: virtual ~BluetoothUpdateSocketFunction() {} - // UIThreadExtensionFunction: - virtual bool RunImpl() OVERRIDE; + // AsyncExtensionFunction: + virtual bool RunAsync() OVERRIDE; }; -class BluetoothSetSocketPausedFunction : public UIThreadExtensionFunction { +class BluetoothSetSocketPausedFunction : public AsyncExtensionFunction { public: DECLARE_EXTENSION_FUNCTION("bluetooth.setSocketPaused", BLUETOOTH_SET_SOCKET_PAUSED) @@ -228,30 +228,30 @@ class BluetoothSetSocketPausedFunction : public UIThreadExtensionFunction { protected: virtual ~BluetoothSetSocketPausedFunction() {} - // UIThreadExtensionFunction: - virtual bool RunImpl() OVERRIDE; + // AsyncExtensionFunction: + virtual bool RunAsync() OVERRIDE; }; -class BluetoothGetSocketFunction : public UIThreadExtensionFunction { +class BluetoothGetSocketFunction : public AsyncExtensionFunction { public: DECLARE_EXTENSION_FUNCTION("bluetooth.getSocket", BLUETOOTH_GET_SOCKET) protected: virtual ~BluetoothGetSocketFunction() {} - // UIThreadExtensionFunction: - virtual bool RunImpl() OVERRIDE; + // AsyncExtensionFunction: + virtual bool RunAsync() OVERRIDE; }; -class BluetoothGetSocketsFunction : public UIThreadExtensionFunction { +class BluetoothGetSocketsFunction : public AsyncExtensionFunction { public: DECLARE_EXTENSION_FUNCTION("bluetooth.getSockets", BLUETOOTH_GET_SOCKETS) protected: virtual ~BluetoothGetSocketsFunction() {} - // UIThreadExtensionFunction: - virtual bool RunImpl() OVERRIDE; + // AsyncExtensionFunction: + virtual bool RunAsync() OVERRIDE; }; class BluetoothGetLocalOutOfBandPairingDataFunction diff --git a/chrome/browser/extensions/api/bluetooth/bluetooth_extension_function.cc b/chrome/browser/extensions/api/bluetooth/bluetooth_extension_function.cc index 2732bea..bbc4fbd 100644 --- a/chrome/browser/extensions/api/bluetooth/bluetooth_extension_function.cc +++ b/chrome/browser/extensions/api/bluetooth/bluetooth_extension_function.cc @@ -46,7 +46,7 @@ BluetoothExtensionFunction::BluetoothExtensionFunction() { BluetoothExtensionFunction::~BluetoothExtensionFunction() { } -bool BluetoothExtensionFunction::RunImpl() { +bool BluetoothExtensionFunction::RunAsync() { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); if (!IsBluetoothSupported(browser_context())) { diff --git a/chrome/browser/extensions/api/bluetooth/bluetooth_extension_function.h b/chrome/browser/extensions/api/bluetooth/bluetooth_extension_function.h index 0e77d7a..dfe9ea5 100644 --- a/chrome/browser/extensions/api/bluetooth/bluetooth_extension_function.h +++ b/chrome/browser/extensions/api/bluetooth/bluetooth_extension_function.h @@ -21,7 +21,7 @@ namespace api { // Base class for bluetooth extension functions. This class initializes // bluetooth adapter and calls (on the UI thread) DoWork() implemented by // individual bluetooth extension functions. -class BluetoothExtensionFunction : public UIThreadExtensionFunction { +class BluetoothExtensionFunction : public AsyncExtensionFunction { public: BluetoothExtensionFunction(); @@ -29,7 +29,7 @@ class BluetoothExtensionFunction : public UIThreadExtensionFunction { virtual ~BluetoothExtensionFunction(); // ExtensionFunction: - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; private: void RunOnAdapterReady(scoped_refptr<device::BluetoothAdapter> adapter); diff --git a/chrome/browser/extensions/api/bluetooth_low_energy/bluetooth_low_energy_api.cc b/chrome/browser/extensions/api/bluetooth_low_energy/bluetooth_low_energy_api.cc index cb637d4..0bdb906 100644 --- a/chrome/browser/extensions/api/bluetooth_low_energy/bluetooth_low_energy_api.cc +++ b/chrome/browser/extensions/api/bluetooth_low_energy/bluetooth_low_energy_api.cc @@ -107,7 +107,7 @@ BluetoothLowEnergyExtensionFunction::BluetoothLowEnergyExtensionFunction() { BluetoothLowEnergyExtensionFunction::~BluetoothLowEnergyExtensionFunction() { } -bool BluetoothLowEnergyExtensionFunction::RunImpl() { +bool BluetoothLowEnergyExtensionFunction::RunAsync() { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); BluetoothLowEnergyEventRouter* event_router = diff --git a/chrome/browser/extensions/api/bluetooth_low_energy/bluetooth_low_energy_api.h b/chrome/browser/extensions/api/bluetooth_low_energy/bluetooth_low_energy_api.h index ad55f61..59f1428 100644 --- a/chrome/browser/extensions/api/bluetooth_low_energy/bluetooth_low_energy_api.h +++ b/chrome/browser/extensions/api/bluetooth_low_energy/bluetooth_low_energy_api.h @@ -53,7 +53,7 @@ namespace api { // Base class for bluetoothLowEnergy API functions. This class handles some of // the common logic involved in all API functions, such as checking for // platform support and returning the correct error. -class BluetoothLowEnergyExtensionFunction : public UIThreadExtensionFunction { +class BluetoothLowEnergyExtensionFunction : public AsyncExtensionFunction { public: BluetoothLowEnergyExtensionFunction(); @@ -61,10 +61,10 @@ class BluetoothLowEnergyExtensionFunction : public UIThreadExtensionFunction { virtual ~BluetoothLowEnergyExtensionFunction(); // ExtensionFunction override. - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; // Implemented by individual bluetoothLowEnergy extension functions to perform - // the body of the function. This invoked asynchonously after RunImpl after + // the body of the function. This invoked asynchonously after RunAsync after // the BluetoothLowEnergyEventRouter has obtained a handle on the // BluetoothAdapter. virtual bool DoWork() = 0; diff --git a/chrome/browser/extensions/api/bluetooth_socket/bluetooth_socket_api.cc b/chrome/browser/extensions/api/bluetooth_socket/bluetooth_socket_api.cc index 0fd43f5..9894e40 100644 --- a/chrome/browser/extensions/api/bluetooth_socket/bluetooth_socket_api.cc +++ b/chrome/browser/extensions/api/bluetooth_socket/bluetooth_socket_api.cc @@ -68,7 +68,7 @@ BluetoothSocketAsyncApiFunction::BluetoothSocketAsyncApiFunction() {} BluetoothSocketAsyncApiFunction::~BluetoothSocketAsyncApiFunction() {} -bool BluetoothSocketAsyncApiFunction::RunImpl() { +bool BluetoothSocketAsyncApiFunction::RunAsync() { if (!PrePrepare() || !Prepare()) { return false; } @@ -208,25 +208,25 @@ void BluetoothSocketSetPausedFunction::Work() { results_ = bluetooth_socket::SetPaused::Results::Create(); } -bool BluetoothSocketListenUsingRfcommFunction::RunImpl() { +bool BluetoothSocketListenUsingRfcommFunction::RunAsync() { // TODO(keybuk): Implement. SetError("Not yet implemented."); return false; } -bool BluetoothSocketListenUsingInsecureRfcommFunction::RunImpl() { +bool BluetoothSocketListenUsingInsecureRfcommFunction::RunAsync() { // TODO(keybuk): Implement. SetError("Not yet implemented."); return false; } -bool BluetoothSocketListenUsingL2capFunction::RunImpl() { +bool BluetoothSocketListenUsingL2capFunction::RunAsync() { // TODO(keybuk): Implement. SetError("Not yet implemented."); return false; } -bool BluetoothSocketConnectFunction::RunImpl() { +bool BluetoothSocketConnectFunction::RunAsync() { // TODO(keybuk): Implement. SetError("Not yet implemented."); return false; diff --git a/chrome/browser/extensions/api/bluetooth_socket/bluetooth_socket_api.h b/chrome/browser/extensions/api/bluetooth_socket/bluetooth_socket_api.h index c7cd376..1dbf204 100644 --- a/chrome/browser/extensions/api/bluetooth_socket/bluetooth_socket_api.h +++ b/chrome/browser/extensions/api/bluetooth_socket/bluetooth_socket_api.h @@ -31,15 +31,15 @@ class BluetoothSocketEventDispatcher; // thread while providing methods to manage resources of that class. This // follows the pattern of AsyncApiFunction, but does not derive from it, // because BluetoothApiSocket methods must be called on the UI Thread. -class BluetoothSocketAsyncApiFunction : public UIThreadExtensionFunction { +class BluetoothSocketAsyncApiFunction : public AsyncExtensionFunction { public: BluetoothSocketAsyncApiFunction(); protected: virtual ~BluetoothSocketAsyncApiFunction(); - // UIThreadExtensionFunction: - virtual bool RunImpl() OVERRIDE; + // AsyncExtensionFunction: + virtual bool RunAsync() OVERRIDE; bool PrePrepare(); bool Respond(); @@ -114,8 +114,7 @@ class BluetoothSocketSetPausedFunction BluetoothSocketEventDispatcher* socket_event_dispatcher_; }; -class BluetoothSocketListenUsingRfcommFunction - : public UIThreadExtensionFunction { +class BluetoothSocketListenUsingRfcommFunction : public AsyncExtensionFunction { public: DECLARE_EXTENSION_FUNCTION("bluetoothSocket.listenUsingRfcomm", BLUETOOTHSOCKET_LISTENUSINGRFCOMM); @@ -123,12 +122,12 @@ class BluetoothSocketListenUsingRfcommFunction protected: virtual ~BluetoothSocketListenUsingRfcommFunction() {} - // UIThreadExtensionFunction override: - virtual bool RunImpl() OVERRIDE; + // AsyncExtensionFunction override: + virtual bool RunAsync() OVERRIDE; }; class BluetoothSocketListenUsingInsecureRfcommFunction - : public UIThreadExtensionFunction { + : public AsyncExtensionFunction { public: DECLARE_EXTENSION_FUNCTION("bluetoothSocket.listenUsingInsecureRfcomm", BLUETOOTHSOCKET_LISTENUSINGINSECURERFCOMM); @@ -136,12 +135,11 @@ class BluetoothSocketListenUsingInsecureRfcommFunction protected: virtual ~BluetoothSocketListenUsingInsecureRfcommFunction() {} - // UIThreadExtensionFunction override: - virtual bool RunImpl() OVERRIDE; + // AsyncExtensionFunction override: + virtual bool RunAsync() OVERRIDE; }; -class BluetoothSocketListenUsingL2capFunction - : public UIThreadExtensionFunction { +class BluetoothSocketListenUsingL2capFunction : public AsyncExtensionFunction { public: DECLARE_EXTENSION_FUNCTION("bluetoothSocket.listenUsingL2cap", BLUETOOTHSOCKET_LISTENUSINGL2CAP); @@ -149,11 +147,11 @@ class BluetoothSocketListenUsingL2capFunction protected: virtual ~BluetoothSocketListenUsingL2capFunction() {} - // UIThreadExtensionFunction override: - virtual bool RunImpl() OVERRIDE; + // AsyncExtensionFunction override: + virtual bool RunAsync() OVERRIDE; }; -class BluetoothSocketConnectFunction : public UIThreadExtensionFunction { +class BluetoothSocketConnectFunction : public AsyncExtensionFunction { public: DECLARE_EXTENSION_FUNCTION("bluetoothSocket.connect", BLUETOOTHSOCKET_CONNECT); @@ -161,8 +159,8 @@ class BluetoothSocketConnectFunction : public UIThreadExtensionFunction { protected: virtual ~BluetoothSocketConnectFunction() {} - // UIThreadExtensionFunction override: - virtual bool RunImpl() OVERRIDE; + // AsyncExtensionFunction override: + virtual bool RunAsync() OVERRIDE; }; class BluetoothSocketDisconnectFunction diff --git a/chrome/browser/extensions/api/bookmark_manager_private/bookmark_manager_private_api.cc b/chrome/browser/extensions/api/bookmark_manager_private/bookmark_manager_private_api.cc index 91f2fa6..a090c2d 100644 --- a/chrome/browser/extensions/api/bookmark_manager_private/bookmark_manager_private_api.cc +++ b/chrome/browser/extensions/api/bookmark_manager_private/bookmark_manager_private_api.cc @@ -440,7 +440,7 @@ bool BookmarkManagerPrivateSortChildrenFunction::RunOnReady() { return true; } -bool BookmarkManagerPrivateGetStringsFunction::RunImpl() { +bool BookmarkManagerPrivateGetStringsFunction::RunAsync() { base::DictionaryValue* localized_strings = new base::DictionaryValue(); localized_strings->SetString("title", diff --git a/chrome/browser/extensions/api/bookmark_manager_private/bookmark_manager_private_api.h b/chrome/browser/extensions/api/bookmark_manager_private/bookmark_manager_private_api.h index e5f1007..1aed39c 100644 --- a/chrome/browser/extensions/api/bookmark_manager_private/bookmark_manager_private_api.h +++ b/chrome/browser/extensions/api/bookmark_manager_private/bookmark_manager_private_api.h @@ -197,7 +197,7 @@ class BookmarkManagerPrivateGetStringsFunction : public AsyncExtensionFunction { virtual ~BookmarkManagerPrivateGetStringsFunction() {} // ExtensionFunction: - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; }; class BookmarkManagerPrivateStartDragFunction diff --git a/chrome/browser/extensions/api/bookmarks/bookmarks_api.cc b/chrome/browser/extensions/api/bookmarks/bookmarks_api.cc index 67be4c6..a8587a0 100644 --- a/chrome/browser/extensions/api/bookmarks/bookmarks_api.cc +++ b/chrome/browser/extensions/api/bookmarks/bookmarks_api.cc @@ -98,7 +98,7 @@ base::FilePath GetDefaultFilepathForBookmarkExport() { } // namespace -bool BookmarksFunction::RunImpl() { +bool BookmarksFunction::RunAsync() { BookmarkModel* model = BookmarkModelFactory::GetForProfile(GetProfile()); if (!model->loaded()) { // Bookmarks are not ready yet. We'll wait. diff --git a/chrome/browser/extensions/api/bookmarks/bookmarks_api.h b/chrome/browser/extensions/api/bookmarks/bookmarks_api.h index 7adb870..112f63e 100644 --- a/chrome/browser/extensions/api/bookmarks/bookmarks_api.h +++ b/chrome/browser/extensions/api/bookmarks/bookmarks_api.h @@ -117,12 +117,12 @@ class BookmarksFunction : public ChromeAsyncExtensionFunction, public BaseBookmarkModelObserver { public: // AsyncExtensionFunction: - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; protected: virtual ~BookmarksFunction() {} - // RunImpl semantic equivalent called when the bookmarks are ready. + // RunAsync semantic equivalent called when the bookmarks are ready. virtual bool RunOnReady() = 0; // Helper to get the bookmark id as int64 from the given string id. 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 3c881d3..b6987ae 100644 --- a/chrome/browser/extensions/api/browsing_data/browsing_data_api.cc +++ b/chrome/browser/extensions/api/browsing_data/browsing_data_api.cc @@ -220,10 +220,10 @@ void BrowsingDataRemoverFunction::OnBrowsingDataRemoverDone() { DCHECK_CURRENTLY_ON(BrowserThread::UI); this->SendResponse(true); - Release(); // Balanced in RunImpl. + Release(); // Balanced in RunAsync. } -bool BrowsingDataRemoverFunction::RunImpl() { +bool BrowsingDataRemoverFunction::RunAsync() { // If we don't have a profile, something's pretty wrong. DCHECK(GetProfile()); diff --git a/chrome/browser/extensions/api/browsing_data/browsing_data_api.h b/chrome/browser/extensions/api/browsing_data/browsing_data_api.h index 9a5c814..42d1cad 100644 --- a/chrome/browser/extensions/api/browsing_data/browsing_data_api.h +++ b/chrome/browser/extensions/api/browsing_data/browsing_data_api.h @@ -86,7 +86,7 @@ class BrowsingDataRemoverFunction : public ChromeAsyncExtensionFunction, virtual void OnBrowsingDataRemoverDone() OVERRIDE; // ExtensionFunction: - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; protected: virtual ~BrowsingDataRemoverFunction() {} diff --git a/chrome/browser/extensions/api/capture_web_contents_function.cc b/chrome/browser/extensions/api/capture_web_contents_function.cc index 6590856..ae2bdbb 100644 --- a/chrome/browser/extensions/api/capture_web_contents_function.cc +++ b/chrome/browser/extensions/api/capture_web_contents_function.cc @@ -32,7 +32,7 @@ bool CaptureWebContentsFunction::HasPermission() { return true; } -bool CaptureWebContentsFunction::RunImpl() { +bool CaptureWebContentsFunction::RunAsync() { EXTENSION_FUNCTION_VALIDATE(args_); context_id_ = extension_misc::kCurrentWindowId; diff --git a/chrome/browser/extensions/api/capture_web_contents_function.h b/chrome/browser/extensions/api/capture_web_contents_function.h index 1e3a85f..0a1c741 100644 --- a/chrome/browser/extensions/api/capture_web_contents_function.h +++ b/chrome/browser/extensions/api/capture_web_contents_function.h @@ -27,7 +27,7 @@ class CaptureWebContentsFunction : public ChromeAsyncExtensionFunction { // ExtensionFunction implementation. virtual bool HasPermission() OVERRIDE; - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; virtual bool IsScreenshotEnabled() = 0; virtual content::WebContents* GetWebContentsForID(int context_id) = 0; @@ -51,10 +51,10 @@ class CaptureWebContentsFunction : public ChromeAsyncExtensionFunction { // the guest. int context_id_; - // The format (JPEG vs PNG) of the resulting image. Set in RunImpl(). + // The format (JPEG vs PNG) of the resulting image. Set in RunAsync(). ImageDetails::Format image_format_; - // Quality setting to use when encoding jpegs. Set in RunImpl(). + // Quality setting to use when encoding jpegs. Set in RunAsync(). int image_quality_; DISALLOW_COPY_AND_ASSIGN(CaptureWebContentsFunction); diff --git a/chrome/browser/extensions/api/cloud_print_private/cloud_print_private_api.cc b/chrome/browser/extensions/api/cloud_print_private/cloud_print_private_api.cc index 4c5f73e..e094f7a 100644 --- a/chrome/browser/extensions/api/cloud_print_private/cloud_print_private_api.cc +++ b/chrome/browser/extensions/api/cloud_print_private/cloud_print_private_api.cc @@ -37,8 +37,7 @@ CloudPrintPrivateSetupConnectorFunction:: ~CloudPrintPrivateSetupConnectorFunction() { } - -bool CloudPrintPrivateSetupConnectorFunction::RunImpl() { +bool CloudPrintPrivateSetupConnectorFunction::RunAsync() { #if defined(ENABLE_FULL_PRINTING) using api::cloud_print_private::SetupConnector::Params; scoped_ptr<Params> params(Params::Create(*args_)); @@ -73,7 +72,7 @@ CloudPrintPrivateGetHostNameFunction::CloudPrintPrivateGetHostNameFunction() { CloudPrintPrivateGetHostNameFunction::~CloudPrintPrivateGetHostNameFunction() { } -bool CloudPrintPrivateGetHostNameFunction::RunImpl() { +bool CloudPrintPrivateGetHostNameFunction::RunAsync() { SetResult(new base::StringValue( CloudPrintTestsDelegate::instance() ? CloudPrintTestsDelegate::instance()->GetHostName() : @@ -94,7 +93,7 @@ void CloudPrintPrivateGetPrintersFunction::SendResults( SendResponse(true); } -bool CloudPrintPrivateGetPrintersFunction::RunImpl() { +bool CloudPrintPrivateGetPrintersFunction::RunAsync() { #if defined(ENABLE_FULL_PRINTING) std::vector<std::string> result; if (CloudPrintTestsDelegate::instance()) { @@ -120,7 +119,7 @@ CloudPrintPrivateGetClientIdFunction::CloudPrintPrivateGetClientIdFunction() { CloudPrintPrivateGetClientIdFunction::~CloudPrintPrivateGetClientIdFunction() { } -bool CloudPrintPrivateGetClientIdFunction::RunImpl() { +bool CloudPrintPrivateGetClientIdFunction::RunAsync() { SetResult(new base::StringValue( CloudPrintTestsDelegate::instance() ? CloudPrintTestsDelegate::instance()->GetClientId() : diff --git a/chrome/browser/extensions/api/cloud_print_private/cloud_print_private_api.h b/chrome/browser/extensions/api/cloud_print_private/cloud_print_private_api.h index 8f1cc32..4585014 100644 --- a/chrome/browser/extensions/api/cloud_print_private/cloud_print_private_api.h +++ b/chrome/browser/extensions/api/cloud_print_private/cloud_print_private_api.h @@ -58,7 +58,7 @@ class CloudPrintPrivateSetupConnectorFunction virtual ~CloudPrintPrivateSetupConnectorFunction(); // ExtensionFunction: - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; }; class CloudPrintPrivateGetHostNameFunction @@ -73,7 +73,7 @@ class CloudPrintPrivateGetHostNameFunction virtual ~CloudPrintPrivateGetHostNameFunction(); // ExtensionFunction: - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; }; class CloudPrintPrivateGetPrintersFunction @@ -91,7 +91,7 @@ class CloudPrintPrivateGetPrintersFunction void SendResults(const std::vector<std::string>& printers); // ExtensionFunction: - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; }; class CloudPrintPrivateGetClientIdFunction @@ -106,7 +106,7 @@ class CloudPrintPrivateGetClientIdFunction virtual ~CloudPrintPrivateGetClientIdFunction(); // ExtensionFunction: - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; }; } // namespace extensions diff --git a/chrome/browser/extensions/api/content_settings/content_settings_api.cc b/chrome/browser/extensions/api/content_settings/content_settings_api.cc index 976b632..99f7fc0 100644 --- a/chrome/browser/extensions/api/content_settings/content_settings_api.cc +++ b/chrome/browser/extensions/api/content_settings/content_settings_api.cc @@ -246,7 +246,7 @@ bool ContentSettingsContentSettingSetFunction::RunSync() { return true; } -bool ContentSettingsContentSettingGetResourceIdentifiersFunction::RunImpl() { +bool ContentSettingsContentSettingGetResourceIdentifiersFunction::RunAsync() { ContentSettingsType content_type; EXTENSION_FUNCTION_VALIDATE(RemoveContentType(args_.get(), &content_type)); diff --git a/chrome/browser/extensions/api/content_settings/content_settings_api.h b/chrome/browser/extensions/api/content_settings/content_settings_api.h index cd18443..a138cf3 100644 --- a/chrome/browser/extensions/api/content_settings/content_settings_api.h +++ b/chrome/browser/extensions/api/content_settings/content_settings_api.h @@ -61,7 +61,7 @@ class ContentSettingsContentSettingGetResourceIdentifiersFunction virtual ~ContentSettingsContentSettingGetResourceIdentifiersFunction() {} // ExtensionFunction: - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; private: FRIEND_TEST_ALL_PREFIXES(ExtensionApiTest, diff --git a/chrome/browser/extensions/api/cookies/cookies_api.cc b/chrome/browser/extensions/api/cookies/cookies_api.cc index 2de26a1..ed95507 100644 --- a/chrome/browser/extensions/api/cookies/cookies_api.cc +++ b/chrome/browser/extensions/api/cookies/cookies_api.cc @@ -205,7 +205,7 @@ CookiesGetFunction::CookiesGetFunction() { CookiesGetFunction::~CookiesGetFunction() { } -bool CookiesGetFunction::RunImpl() { +bool CookiesGetFunction::RunAsync() { parsed_args_ = Get::Params::Create(*args_); EXTENSION_FUNCTION_VALIDATE(parsed_args_.get()); @@ -278,7 +278,7 @@ CookiesGetAllFunction::CookiesGetAllFunction() { CookiesGetAllFunction::~CookiesGetAllFunction() { } -bool CookiesGetAllFunction::RunImpl() { +bool CookiesGetAllFunction::RunAsync() { parsed_args_ = GetAll::Params::Create(*args_); EXTENSION_FUNCTION_VALIDATE(parsed_args_.get()); @@ -343,7 +343,7 @@ CookiesSetFunction::CookiesSetFunction() : success_(false) { CookiesSetFunction::~CookiesSetFunction() { } -bool CookiesSetFunction::RunImpl() { +bool CookiesSetFunction::RunAsync() { parsed_args_ = Set::Params::Create(*args_); EXTENSION_FUNCTION_VALIDATE(parsed_args_.get()); @@ -458,7 +458,7 @@ CookiesRemoveFunction::CookiesRemoveFunction() { CookiesRemoveFunction::~CookiesRemoveFunction() { } -bool CookiesRemoveFunction::RunImpl() { +bool CookiesRemoveFunction::RunAsync() { parsed_args_ = Remove::Params::Create(*args_); EXTENSION_FUNCTION_VALIDATE(parsed_args_.get()); diff --git a/chrome/browser/extensions/api/cookies/cookies_api.h b/chrome/browser/extensions/api/cookies/cookies_api.h index 1389ffc..a7a0876 100644 --- a/chrome/browser/extensions/api/cookies/cookies_api.h +++ b/chrome/browser/extensions/api/cookies/cookies_api.h @@ -71,7 +71,7 @@ class CookiesGetFunction : public ChromeAsyncExtensionFunction { virtual ~CookiesGetFunction(); // ExtensionFunction: - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; private: void GetCookieOnIOThread(); @@ -94,7 +94,7 @@ class CookiesGetAllFunction : public ChromeAsyncExtensionFunction { virtual ~CookiesGetAllFunction(); // ExtensionFunction: - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; private: void GetAllCookiesOnIOThread(); @@ -115,7 +115,7 @@ class CookiesSetFunction : public ChromeAsyncExtensionFunction { protected: virtual ~CookiesSetFunction(); - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; private: void SetCookieOnIOThread(); @@ -140,7 +140,7 @@ class CookiesRemoveFunction : public ChromeAsyncExtensionFunction { virtual ~CookiesRemoveFunction(); // ExtensionFunction: - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; private: void RemoveCookieOnIOThread(); diff --git a/chrome/browser/extensions/api/debugger/debugger_api.cc b/chrome/browser/extensions/api/debugger/debugger_api.cc index 35c0215..c4be23a 100644 --- a/chrome/browser/extensions/api/debugger/debugger_api.cc +++ b/chrome/browser/extensions/api/debugger/debugger_api.cc @@ -545,7 +545,7 @@ DebuggerAttachFunction::DebuggerAttachFunction() { DebuggerAttachFunction::~DebuggerAttachFunction() { } -bool DebuggerAttachFunction::RunImpl() { +bool DebuggerAttachFunction::RunAsync() { scoped_ptr<Attach::Params> params(Attach::Params::Create(*args_)); EXTENSION_FUNCTION_VALIDATE(params.get()); @@ -600,7 +600,7 @@ DebuggerDetachFunction::DebuggerDetachFunction() { DebuggerDetachFunction::~DebuggerDetachFunction() { } -bool DebuggerDetachFunction::RunImpl() { +bool DebuggerDetachFunction::RunAsync() { scoped_ptr<Detach::Params> params(Detach::Params::Create(*args_)); EXTENSION_FUNCTION_VALIDATE(params.get()); @@ -622,7 +622,7 @@ DebuggerSendCommandFunction::DebuggerSendCommandFunction() { DebuggerSendCommandFunction::~DebuggerSendCommandFunction() { } -bool DebuggerSendCommandFunction::RunImpl() { +bool DebuggerSendCommandFunction::RunAsync() { scoped_ptr<SendCommand::Params> params(SendCommand::Params::Create(*args_)); EXTENSION_FUNCTION_VALIDATE(params.get()); @@ -705,7 +705,7 @@ DebuggerGetTargetsFunction::DebuggerGetTargetsFunction() { DebuggerGetTargetsFunction::~DebuggerGetTargetsFunction() { } -bool DebuggerGetTargetsFunction::RunImpl() { +bool DebuggerGetTargetsFunction::RunAsync() { DevToolsTargetImpl::EnumerateAllTargets( base::Bind(&DebuggerGetTargetsFunction::SendTargetList, this)); return true; diff --git a/chrome/browser/extensions/api/debugger/debugger_api.h b/chrome/browser/extensions/api/debugger/debugger_api.h index e8a1048..bd81e12 100644 --- a/chrome/browser/extensions/api/debugger/debugger_api.h +++ b/chrome/browser/extensions/api/debugger/debugger_api.h @@ -56,7 +56,7 @@ class DebuggerAttachFunction : public DebuggerFunction { virtual ~DebuggerAttachFunction(); // ExtensionFunction: - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; }; // Implements the debugger.detach() extension function. @@ -70,7 +70,7 @@ class DebuggerDetachFunction : public DebuggerFunction { virtual ~DebuggerDetachFunction(); // ExtensionFunction: - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; }; // Implements the debugger.sendCommand() extension function. @@ -85,7 +85,7 @@ class DebuggerSendCommandFunction : public DebuggerFunction { virtual ~DebuggerSendCommandFunction(); // ExtensionFunction: - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; }; // Implements the debugger.getTargets() extension function. @@ -99,7 +99,7 @@ class DebuggerGetTargetsFunction : public DebuggerFunction { virtual ~DebuggerGetTargetsFunction(); // ExtensionFunction: - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; private: void SendTargetList(const std::vector<DevToolsTargetImpl*>& target_list); diff --git a/chrome/browser/extensions/api/declarative/declarative_api.cc b/chrome/browser/extensions/api/declarative/declarative_api.cc index 7a644c2..dbb22a6 100644 --- a/chrome/browser/extensions/api/declarative/declarative_api.cc +++ b/chrome/browser/extensions/api/declarative/declarative_api.cc @@ -68,7 +68,7 @@ bool RulesFunction::HasPermission() { return availability.is_available(); } -bool RulesFunction::RunImpl() { +bool RulesFunction::RunAsync() { std::string event_name; EXTENSION_FUNCTION_VALIDATE(args_->GetString(0, &event_name)); @@ -93,7 +93,7 @@ bool RulesFunction::RunImpl() { EXTENSION_FUNCTION_VALIDATE(rules_registry_.get()); if (content::BrowserThread::CurrentlyOn(rules_registry_->owner_thread())) { - bool success = RunImplOnCorrectThread(); + bool success = RunAsyncOnCorrectThread(); SendResponse(success); } else { scoped_refptr<base::MessageLoopProxy> message_loop_proxy = @@ -102,14 +102,14 @@ bool RulesFunction::RunImpl() { base::PostTaskAndReplyWithResult( message_loop_proxy.get(), FROM_HERE, - base::Bind(&RulesFunction::RunImplOnCorrectThread, this), + base::Bind(&RulesFunction::RunAsyncOnCorrectThread, this), base::Bind(&RulesFunction::SendResponse, this)); } return true; } -bool EventsEventAddRulesFunction::RunImplOnCorrectThread() { +bool EventsEventAddRulesFunction::RunAsyncOnCorrectThread() { scoped_ptr<AddRules::Params> params(AddRules::Params::Create(*args_)); EXTENSION_FUNCTION_VALIDATE(params.get()); @@ -121,7 +121,7 @@ bool EventsEventAddRulesFunction::RunImplOnCorrectThread() { return error_.empty(); } -bool EventsEventRemoveRulesFunction::RunImplOnCorrectThread() { +bool EventsEventRemoveRulesFunction::RunAsyncOnCorrectThread() { scoped_ptr<RemoveRules::Params> params(RemoveRules::Params::Create(*args_)); EXTENSION_FUNCTION_VALIDATE(params.get()); @@ -135,7 +135,7 @@ bool EventsEventRemoveRulesFunction::RunImplOnCorrectThread() { return error_.empty(); } -bool EventsEventGetRulesFunction::RunImplOnCorrectThread() { +bool EventsEventGetRulesFunction::RunAsyncOnCorrectThread() { scoped_ptr<GetRules::Params> params(GetRules::Params::Create(*args_)); EXTENSION_FUNCTION_VALIDATE(params.get()); diff --git a/chrome/browser/extensions/api/declarative/declarative_api.h b/chrome/browser/extensions/api/declarative/declarative_api.h index f740a3e..502e2fa 100644 --- a/chrome/browser/extensions/api/declarative/declarative_api.h +++ b/chrome/browser/extensions/api/declarative/declarative_api.h @@ -21,12 +21,12 @@ class RulesFunction : public ChromeAsyncExtensionFunction { // ExtensionFunction: virtual bool HasPermission() OVERRIDE; - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; // Concrete implementation of the RulesFunction that is being called // on the thread on which the respective RulesRegistry lives. // Returns false in case of errors. - virtual bool RunImplOnCorrectThread() = 0; + virtual bool RunAsyncOnCorrectThread() = 0; scoped_refptr<RulesRegistry> rules_registry_; }; @@ -39,7 +39,7 @@ class EventsEventAddRulesFunction : public RulesFunction { virtual ~EventsEventAddRulesFunction() {} // RulesFunction: - virtual bool RunImplOnCorrectThread() OVERRIDE; + virtual bool RunAsyncOnCorrectThread() OVERRIDE; }; class EventsEventRemoveRulesFunction : public RulesFunction { @@ -50,7 +50,7 @@ class EventsEventRemoveRulesFunction : public RulesFunction { virtual ~EventsEventRemoveRulesFunction() {} // RulesFunction: - virtual bool RunImplOnCorrectThread() OVERRIDE; + virtual bool RunAsyncOnCorrectThread() OVERRIDE; }; class EventsEventGetRulesFunction : public RulesFunction { @@ -61,7 +61,7 @@ class EventsEventGetRulesFunction : public RulesFunction { virtual ~EventsEventGetRulesFunction() {} // RulesFunction: - virtual bool RunImplOnCorrectThread() OVERRIDE; + virtual bool RunAsyncOnCorrectThread() OVERRIDE; }; } // namespace extensions diff --git a/chrome/browser/extensions/api/desktop_capture/desktop_capture_api.cc b/chrome/browser/extensions/api/desktop_capture/desktop_capture_api.cc index 42cff1f..a6ff794 100644 --- a/chrome/browser/extensions/api/desktop_capture/desktop_capture_api.cc +++ b/chrome/browser/extensions/api/desktop_capture/desktop_capture_api.cc @@ -76,7 +76,7 @@ void DesktopCaptureChooseDesktopMediaFunction::Cancel() { } } -bool DesktopCaptureChooseDesktopMediaFunction::RunImpl() { +bool DesktopCaptureChooseDesktopMediaFunction::RunAsync() { EXTENSION_FUNCTION_VALIDATE(args_->GetSize() > 0); EXTENSION_FUNCTION_VALIDATE(args_->GetInteger(0, &request_id_)); diff --git a/chrome/browser/extensions/api/desktop_capture/desktop_capture_api.h b/chrome/browser/extensions/api/desktop_capture/desktop_capture_api.h index dd62c98..6a8d19b 100644 --- a/chrome/browser/extensions/api/desktop_capture/desktop_capture_api.h +++ b/chrome/browser/extensions/api/desktop_capture/desktop_capture_api.h @@ -49,7 +49,7 @@ class DesktopCaptureChooseDesktopMediaFunction virtual ~DesktopCaptureChooseDesktopMediaFunction(); // ExtensionFunction overrides. - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; // content::WebContentsObserver overrides. virtual void WebContentsDestroyed( diff --git a/chrome/browser/extensions/api/developer_private/developer_private_api.cc b/chrome/browser/extensions/api/developer_private/developer_private_api.cc index 5f9ce42..08e7ee7 100644 --- a/chrome/browser/extensions/api/developer_private/developer_private_api.cc +++ b/chrome/browser/extensions/api/developer_private/developer_private_api.cc @@ -595,7 +595,7 @@ ItemInspectViewList DeveloperPrivateGetItemsInfoFunction:: return result; } -bool DeveloperPrivateGetItemsInfoFunction::RunImpl() { +bool DeveloperPrivateGetItemsInfoFunction::RunAsync() { scoped_ptr<developer::GetItemsInfo::Params> params( developer::GetItemsInfo::Params::Create(*args_)); EXTENSION_FUNCTION_VALIDATE(params.get() != NULL); @@ -889,7 +889,7 @@ bool DeveloperPrivateInspectFunction::RunSync() { DeveloperPrivateInspectFunction::~DeveloperPrivateInspectFunction() {} -bool DeveloperPrivateLoadUnpackedFunction::RunImpl() { +bool DeveloperPrivateLoadUnpackedFunction::RunAsync() { base::string16 select_title = l10n_util::GetStringUTF16(IDS_EXTENSION_LOAD_FROM_DIRECTORY); @@ -946,7 +946,9 @@ bool DeveloperPrivateChooseEntryFunction::ShowPicker( return true; } -bool DeveloperPrivateChooseEntryFunction::RunImpl() { return false; } +bool DeveloperPrivateChooseEntryFunction::RunAsync() { + return false; +} DeveloperPrivateChooseEntryFunction::~DeveloperPrivateChooseEntryFunction() {} @@ -980,7 +982,7 @@ void DeveloperPrivatePackDirectoryFunction::OnPackFailure( Release(); } -bool DeveloperPrivatePackDirectoryFunction::RunImpl() { +bool DeveloperPrivatePackDirectoryFunction::RunAsync() { scoped_ptr<PackDirectory::Params> params( PackDirectory::Params::Create(*args_)); EXTENSION_FUNCTION_VALIDATE(params.get()); @@ -1034,7 +1036,7 @@ DeveloperPrivatePackDirectoryFunction::~DeveloperPrivatePackDirectoryFunction() DeveloperPrivateLoadUnpackedFunction::~DeveloperPrivateLoadUnpackedFunction() {} -bool DeveloperPrivateLoadDirectoryFunction::RunImpl() { +bool DeveloperPrivateLoadDirectoryFunction::RunAsync() { // TODO(grv) : add unittests. std::string directory_url_str; std::string filesystem_name; @@ -1241,7 +1243,7 @@ DeveloperPrivateLoadDirectoryFunction::DeveloperPrivateLoadDirectoryFunction() DeveloperPrivateLoadDirectoryFunction::~DeveloperPrivateLoadDirectoryFunction() {} -bool DeveloperPrivateChoosePathFunction::RunImpl() { +bool DeveloperPrivateChoosePathFunction::RunAsync() { scoped_ptr<developer::ChoosePath::Params> params( developer::ChoosePath::Params::Create(*args_)); EXTENSION_FUNCTION_VALIDATE(params.get() != NULL); @@ -1310,7 +1312,7 @@ DeveloperPrivateRequestFileSourceFunction:: DeveloperPrivateRequestFileSourceFunction:: ~DeveloperPrivateRequestFileSourceFunction() {} -bool DeveloperPrivateRequestFileSourceFunction::RunImpl() { +bool DeveloperPrivateRequestFileSourceFunction::RunAsync() { scoped_ptr<developer::RequestFileSource::Params> params( developer::RequestFileSource::Params::Create(*args_)); EXTENSION_FUNCTION_VALIDATE(params.get() != NULL); @@ -1334,13 +1336,13 @@ void DeveloperPrivateRequestFileSourceFunction::LaunchCallback( const base::DictionaryValue& results) { SetResult(results.DeepCopy()); SendResponse(true); - Release(); // Balanced in RunImpl(). + Release(); // Balanced in RunAsync(). } DeveloperPrivateOpenDevToolsFunction::DeveloperPrivateOpenDevToolsFunction() {} DeveloperPrivateOpenDevToolsFunction::~DeveloperPrivateOpenDevToolsFunction() {} -bool DeveloperPrivateOpenDevToolsFunction::RunImpl() { +bool DeveloperPrivateOpenDevToolsFunction::RunAsync() { scoped_ptr<developer::OpenDevTools::Params> params( developer::OpenDevTools::Params::Create(*args_)); EXTENSION_FUNCTION_VALIDATE(params.get() != NULL); diff --git a/chrome/browser/extensions/api/developer_private/developer_private_api.h b/chrome/browser/extensions/api/developer_private/developer_private_api.h index 41ce8e4..d678eda 100644 --- a/chrome/browser/extensions/api/developer_private/developer_private_api.h +++ b/chrome/browser/extensions/api/developer_private/developer_private_api.h @@ -162,7 +162,7 @@ class DeveloperPrivateGetItemsInfoFunction virtual ~DeveloperPrivateGetItemsInfoFunction(); // ExtensionFunction: - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; private: scoped_ptr<developer::ItemInfo> CreateItemInfo(const Extension& item, @@ -291,7 +291,7 @@ class DeveloperPrivateChooseEntryFunction : public ChromeAsyncExtensionFunction, public EntryPickerClient { protected: virtual ~DeveloperPrivateChooseEntryFunction(); - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; bool ShowPicker(ui::SelectFileDialog::Type picker_type, const base::FilePath& last_directory, const base::string16& select_title, @@ -312,7 +312,7 @@ class DeveloperPrivateLoadUnpackedFunction protected: virtual ~DeveloperPrivateLoadUnpackedFunction(); - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; // EntryPickerCLient implementation. virtual void FileSelected(const base::FilePath& path) OVERRIDE; @@ -327,7 +327,7 @@ class DeveloperPrivateChoosePathFunction protected: virtual ~DeveloperPrivateChoosePathFunction(); - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; // EntryPickerClient functions. virtual void FileSelected(const base::FilePath& path) OVERRIDE; @@ -352,7 +352,7 @@ class DeveloperPrivatePackDirectoryFunction protected: virtual ~DeveloperPrivatePackDirectoryFunction(); - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; private: scoped_refptr<PackExtensionJob> pack_job_; @@ -385,7 +385,7 @@ class DeveloperPrivateLoadDirectoryFunction virtual ~DeveloperPrivateLoadDirectoryFunction(); // ExtensionFunction: - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; void ClearExistingDirectoryContent(const base::FilePath& project_path); @@ -442,7 +442,7 @@ class DeveloperPrivateRequestFileSourceFunction virtual ~DeveloperPrivateRequestFileSourceFunction(); // ExtensionFunction: - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; private: void LaunchCallback(const base::DictionaryValue& results); @@ -460,7 +460,7 @@ class DeveloperPrivateOpenDevToolsFunction virtual ~DeveloperPrivateOpenDevToolsFunction(); // ExtensionFunction: - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; }; } // namespace api diff --git a/chrome/browser/extensions/api/downloads/downloads_api.cc b/chrome/browser/extensions/api/downloads/downloads_api.cc index 15fc6b0..c51e4fb 100644 --- a/chrome/browser/extensions/api/downloads/downloads_api.cc +++ b/chrome/browser/extensions/api/downloads/downloads_api.cc @@ -989,7 +989,7 @@ DownloadsDownloadFunction::DownloadsDownloadFunction() {} DownloadsDownloadFunction::~DownloadsDownloadFunction() {} -bool DownloadsDownloadFunction::RunImpl() { +bool DownloadsDownloadFunction::RunAsync() { scoped_ptr<downloads::Download::Params> params( downloads::Download::Params::Create(*args_)); EXTENSION_FUNCTION_VALIDATE(params.get()); @@ -1238,7 +1238,7 @@ DownloadsRemoveFileFunction::DownloadsRemoveFileFunction() { DownloadsRemoveFileFunction::~DownloadsRemoveFileFunction() { } -bool DownloadsRemoveFileFunction::RunImpl() { +bool DownloadsRemoveFileFunction::RunAsync() { scoped_ptr<downloads::RemoveFile::Params> params( downloads::RemoveFile::Params::Create(*args_)); EXTENSION_FUNCTION_VALIDATE(params.get()); @@ -1271,7 +1271,7 @@ DownloadsAcceptDangerFunction::~DownloadsAcceptDangerFunction() {} DownloadsAcceptDangerFunction::OnPromptCreatedCallback* DownloadsAcceptDangerFunction::on_prompt_created_ = NULL; -bool DownloadsAcceptDangerFunction::RunImpl() { +bool DownloadsAcceptDangerFunction::RunAsync() { scoped_ptr<downloads::AcceptDanger::Params> params( downloads::AcceptDanger::Params::Create(*args_)); EXTENSION_FUNCTION_VALIDATE(params.get()); @@ -1348,7 +1348,7 @@ DownloadsShowFunction::DownloadsShowFunction() {} DownloadsShowFunction::~DownloadsShowFunction() {} -bool DownloadsShowFunction::RunImpl() { +bool DownloadsShowFunction::RunAsync() { scoped_ptr<downloads::Show::Params> params( downloads::Show::Params::Create(*args_)); EXTENSION_FUNCTION_VALIDATE(params.get()); @@ -1365,7 +1365,7 @@ DownloadsShowDefaultFolderFunction::DownloadsShowDefaultFolderFunction() {} DownloadsShowDefaultFolderFunction::~DownloadsShowDefaultFolderFunction() {} -bool DownloadsShowDefaultFolderFunction::RunImpl() { +bool DownloadsShowDefaultFolderFunction::RunAsync() { DownloadManager* manager = NULL; DownloadManager* incognito_manager = NULL; GetManagers(GetProfile(), include_incognito(), &manager, &incognito_manager); @@ -1403,7 +1403,7 @@ DownloadsDragFunction::DownloadsDragFunction() {} DownloadsDragFunction::~DownloadsDragFunction() {} -bool DownloadsDragFunction::RunImpl() { +bool DownloadsDragFunction::RunAsync() { scoped_ptr<downloads::Drag::Params> params( downloads::Drag::Params::Create(*args_)); EXTENSION_FUNCTION_VALIDATE(params.get()); @@ -1497,7 +1497,7 @@ void DownloadsGetFileIconFunction::SetIconExtractorForTesting( icon_extractor_.reset(extractor); } -bool DownloadsGetFileIconFunction::RunImpl() { +bool DownloadsGetFileIconFunction::RunAsync() { scoped_ptr<downloads::GetFileIcon::Params> params( downloads::GetFileIcon::Params::Create(*args_)); EXTENSION_FUNCTION_VALIDATE(params.get()); @@ -1604,7 +1604,7 @@ bool ExtensionDownloadsEventRouter::IsShelfEnabled() const { // // When the extension's event handler calls |suggestCallback|, // downloads_custom_bindings.js calls -// DownloadsInternalDetermineFilenameFunction::RunImpl, which calls +// DownloadsInternalDetermineFilenameFunction::RunAsync, which calls // EDER::DetermineFilename, which notifies the item's EDERD. // // When the last extension's event handler returns, EDERD calls one of the two diff --git a/chrome/browser/extensions/api/downloads/downloads_api.h b/chrome/browser/extensions/api/downloads/downloads_api.h index f809608..b24a938 100644 --- a/chrome/browser/extensions/api/downloads/downloads_api.h +++ b/chrome/browser/extensions/api/downloads/downloads_api.h @@ -92,7 +92,7 @@ class DownloadsDownloadFunction : public ChromeAsyncExtensionFunction { public: DECLARE_EXTENSION_FUNCTION("downloads.download", DOWNLOADS_DOWNLOAD) DownloadsDownloadFunction(); - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; protected: virtual ~DownloadsDownloadFunction(); @@ -176,7 +176,7 @@ class DownloadsRemoveFileFunction : public ChromeAsyncExtensionFunction { public: DECLARE_EXTENSION_FUNCTION("downloads.removeFile", DOWNLOADS_REMOVEFILE) DownloadsRemoveFileFunction(); - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; protected: virtual ~DownloadsRemoveFileFunction(); @@ -197,7 +197,7 @@ class DownloadsAcceptDangerFunction : public ChromeAsyncExtensionFunction { DECLARE_EXTENSION_FUNCTION("downloads.acceptDanger", DOWNLOADS_ACCEPTDANGER) DownloadsAcceptDangerFunction(); - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; protected: virtual ~DownloadsAcceptDangerFunction(); @@ -215,7 +215,7 @@ class DownloadsShowFunction : public ChromeAsyncExtensionFunction { public: DECLARE_EXTENSION_FUNCTION("downloads.show", DOWNLOADS_SHOW) DownloadsShowFunction(); - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; protected: virtual ~DownloadsShowFunction(); @@ -229,7 +229,7 @@ class DownloadsShowDefaultFolderFunction : public ChromeAsyncExtensionFunction { DECLARE_EXTENSION_FUNCTION( "downloads.showDefaultFolder", DOWNLOADS_SHOWDEFAULTFOLDER) DownloadsShowDefaultFolderFunction(); - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; protected: virtual ~DownloadsShowDefaultFolderFunction(); @@ -269,7 +269,7 @@ class DownloadsDragFunction : public ChromeAsyncExtensionFunction { public: DECLARE_EXTENSION_FUNCTION("downloads.drag", DOWNLOADS_DRAG) DownloadsDragFunction(); - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; protected: virtual ~DownloadsDragFunction(); @@ -282,7 +282,7 @@ class DownloadsGetFileIconFunction : public ChromeAsyncExtensionFunction { public: DECLARE_EXTENSION_FUNCTION("downloads.getFileIcon", DOWNLOADS_GETFILEICON) DownloadsGetFileIconFunction(); - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; void SetIconExtractorForTesting(DownloadFileIconExtractor* extractor); protected: diff --git a/chrome/browser/extensions/api/downloads_internal/downloads_internal_api.cc b/chrome/browser/extensions/api/downloads_internal/downloads_internal_api.cc index cb12918..299e0d3 100644 --- a/chrome/browser/extensions/api/downloads_internal/downloads_internal_api.cc +++ b/chrome/browser/extensions/api/downloads_internal/downloads_internal_api.cc @@ -19,7 +19,7 @@ DownloadsInternalDetermineFilenameFunction:: typedef extensions::api::downloads_internal::DetermineFilename::Params DetermineFilenameParams; -bool DownloadsInternalDetermineFilenameFunction::RunImpl() { +bool DownloadsInternalDetermineFilenameFunction::RunAsync() { scoped_ptr<DetermineFilenameParams> params( DetermineFilenameParams::Create(*args_)); EXTENSION_FUNCTION_VALIDATE(params.get()); diff --git a/chrome/browser/extensions/api/downloads_internal/downloads_internal_api.h b/chrome/browser/extensions/api/downloads_internal/downloads_internal_api.h index a88364e..94fef49 100644 --- a/chrome/browser/extensions/api/downloads_internal/downloads_internal_api.h +++ b/chrome/browser/extensions/api/downloads_internal/downloads_internal_api.h @@ -15,7 +15,7 @@ class DownloadsInternalDetermineFilenameFunction DECLARE_EXTENSION_FUNCTION("downloadsInternal.determineFilename", DOWNLOADSINTERNAL_DETERMINEFILENAME); DownloadsInternalDetermineFilenameFunction(); - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; protected: virtual ~DownloadsInternalDetermineFilenameFunction(); diff --git a/chrome/browser/extensions/api/enterprise_platform_keys_private/enterprise_platform_keys_private_api.cc b/chrome/browser/extensions/api/enterprise_platform_keys_private/enterprise_platform_keys_private_api.cc index 1413446..804c8c1 100644 --- a/chrome/browser/extensions/api/enterprise_platform_keys_private/enterprise_platform_keys_private_api.cc +++ b/chrome/browser/extensions/api/enterprise_platform_keys_private/enterprise_platform_keys_private_api.cc @@ -289,7 +289,7 @@ EPKPChallengeMachineKey::EPKPChallengeMachineKey( EPKPChallengeMachineKey::~EPKPChallengeMachineKey() { } -bool EPKPChallengeMachineKey::RunImpl() { +bool EPKPChallengeMachineKey::RunAsync() { scoped_ptr<api_epkp::ChallengeMachineKey::Params> params(api_epkp::ChallengeMachineKey::Params::Create(*args_)); EXTENSION_FUNCTION_VALIDATE(params.get()); @@ -416,7 +416,7 @@ void EPKPChallengeUserKey::RegisterProfilePrefs( user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); } -bool EPKPChallengeUserKey::RunImpl() { +bool EPKPChallengeUserKey::RunAsync() { scoped_ptr<api_epkp::ChallengeUserKey::Params> params( api_epkp::ChallengeUserKey::Params::Create(*args_)); EXTENSION_FUNCTION_VALIDATE(params.get()); diff --git a/chrome/browser/extensions/api/enterprise_platform_keys_private/enterprise_platform_keys_private_api.h b/chrome/browser/extensions/api/enterprise_platform_keys_private/enterprise_platform_keys_private_api.h index 49122ea7..8c91d1f 100644 --- a/chrome/browser/extensions/api/enterprise_platform_keys_private/enterprise_platform_keys_private_api.h +++ b/chrome/browser/extensions/api/enterprise_platform_keys_private/enterprise_platform_keys_private_api.h @@ -158,7 +158,7 @@ class EPKPChallengeMachineKey : public EPKPChallengeKeyBase { policy::EnterpriseInstallAttributes* install_attributes); protected: - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; private: static const char kKeyName[]; @@ -195,7 +195,7 @@ class EPKPChallengeUserKey : public EPKPChallengeKeyBase { static void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry); protected: - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; private: static const char kKeyName[]; diff --git a/chrome/browser/extensions/api/execute_code_function.cc b/chrome/browser/extensions/api/execute_code_function.cc index fd19219..f06c91c 100644 --- a/chrome/browser/extensions/api/execute_code_function.cc +++ b/chrome/browser/extensions/api/execute_code_function.cc @@ -162,7 +162,7 @@ bool ExecuteCodeFunction::HasPermission() { return true; } -bool ExecuteCodeFunction::RunImpl() { +bool ExecuteCodeFunction::RunAsync() { EXTENSION_FUNCTION_VALIDATE(Init()); if (!details_->code.get() && !details_->file.get()) { diff --git a/chrome/browser/extensions/api/execute_code_function.h b/chrome/browser/extensions/api/execute_code_function.h index 213998f..da7e73d 100644 --- a/chrome/browser/extensions/api/execute_code_function.h +++ b/chrome/browser/extensions/api/execute_code_function.h @@ -23,7 +23,7 @@ class ExecuteCodeFunction : public ChromeAsyncExtensionFunction { // ExtensionFunction implementation. virtual bool HasPermission() OVERRIDE; - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; // Initialize |details_| if it hasn't already been. virtual bool Init() = 0; diff --git a/chrome/browser/extensions/api/extension_action/extension_action_api.cc b/chrome/browser/extensions/api/extension_action/extension_action_api.cc index ecbe110..3b552b3 100644 --- a/chrome/browser/extensions/api/extension_action/extension_action_api.cc +++ b/chrome/browser/extensions/api/extension_action/extension_action_api.cc @@ -794,7 +794,7 @@ BrowserActionOpenPopupFunction::BrowserActionOpenPopupFunction() : response_sent_(false) { } -bool BrowserActionOpenPopupFunction::RunImpl() { +bool BrowserActionOpenPopupFunction::RunAsync() { ExtensionToolbarModel* model = ExtensionToolbarModel::Get(GetProfile()); if (!model) { error_ = kInternalError; diff --git a/chrome/browser/extensions/api/extension_action/extension_action_api.h b/chrome/browser/extensions/api/extension_action/extension_action_api.h index c000da5..dfd0e6e 100644 --- a/chrome/browser/extensions/api/extension_action/extension_action_api.h +++ b/chrome/browser/extensions/api/extension_action/extension_action_api.h @@ -363,7 +363,7 @@ class BrowserActionOpenPopupFunction : public ChromeAsyncExtensionFunction, virtual ~BrowserActionOpenPopupFunction() {} // ExtensionFunction: - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; virtual void Observe(int type, const content::NotificationSource& source, diff --git a/chrome/browser/extensions/api/feedback_private/feedback_private_api.cc b/chrome/browser/extensions/api/feedback_private/feedback_private_api.cc index 4a7eaae..cc05fca 100644 --- a/chrome/browser/extensions/api/feedback_private/feedback_private_api.cc +++ b/chrome/browser/extensions/api/feedback_private/feedback_private_api.cc @@ -142,7 +142,7 @@ bool FeedbackPrivateGetUserEmailFunction::RunSync() { return true; } -bool FeedbackPrivateGetSystemInformationFunction::RunImpl() { +bool FeedbackPrivateGetSystemInformationFunction::RunAsync() { // TODO(rkc): Remove logging once crbug.com/284662 is closed. LOG(WARNING) << "FEEDBACK_DEBUG: System information requested."; FeedbackService* service = @@ -161,7 +161,7 @@ void FeedbackPrivateGetSystemInformationFunction::OnCompleted( SendResponse(true); } -bool FeedbackPrivateSendFeedbackFunction::RunImpl() { +bool FeedbackPrivateSendFeedbackFunction::RunAsync() { scoped_ptr<feedback_private::SendFeedback::Params> params( feedback_private::SendFeedback::Params::Create(*args_)); EXTENSION_FUNCTION_VALIDATE(params.get()); diff --git a/chrome/browser/extensions/api/feedback_private/feedback_private_api.h b/chrome/browser/extensions/api/feedback_private/feedback_private_api.h index 02fabe3..43f4de2 100644 --- a/chrome/browser/extensions/api/feedback_private/feedback_private_api.h +++ b/chrome/browser/extensions/api/feedback_private/feedback_private_api.h @@ -85,7 +85,7 @@ class FeedbackPrivateGetSystemInformationFunction protected: virtual ~FeedbackPrivateGetSystemInformationFunction() {} - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; private: void OnCompleted( @@ -100,7 +100,7 @@ class FeedbackPrivateSendFeedbackFunction protected: virtual ~FeedbackPrivateSendFeedbackFunction() {} - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; private: void OnCompleted(bool success); diff --git a/chrome/browser/extensions/api/file_system/file_system_api.cc b/chrome/browser/extensions/api/file_system/file_system_api.cc index cafcb0e..56895d7 100644 --- a/chrome/browser/extensions/api/file_system/file_system_api.cc +++ b/chrome/browser/extensions/api/file_system/file_system_api.cc @@ -353,7 +353,7 @@ void FileSystemEntryFunction::HandleWritableFileError( SendResponse(false); } -bool FileSystemGetWritableEntryFunction::RunImpl() { +bool FileSystemGetWritableEntryFunction::RunAsync() { std::string filesystem_name; std::string filesystem_path; EXTENSION_FUNCTION_VALIDATE(args_->GetString(0, &filesystem_name)); @@ -833,7 +833,7 @@ void FileSystemChooseEntryFunction::BuildSuggestion( } } -bool FileSystemChooseEntryFunction::RunImpl() { +bool FileSystemChooseEntryFunction::RunAsync() { scoped_ptr<ChooseEntry::Params> params(ChooseEntry::Params::Create(*args_)); EXTENSION_FUNCTION_VALIDATE(params.get()); @@ -902,7 +902,7 @@ bool FileSystemChooseEntryFunction::RunImpl() { return true; } -bool FileSystemRetainEntryFunction::RunImpl() { +bool FileSystemRetainEntryFunction::RunAsync() { std::string entry_id; EXTENSION_FUNCTION_VALIDATE(args_->GetString(0, &entry_id)); SavedFilesService* saved_files_service = SavedFilesService::Get(GetProfile()); @@ -957,7 +957,7 @@ bool FileSystemIsRestorableFunction::RunSync() { return true; } -bool FileSystemRestoreEntryFunction::RunImpl() { +bool FileSystemRestoreEntryFunction::RunAsync() { std::string entry_id; bool needs_new_entry; EXTENSION_FUNCTION_VALIDATE(args_->GetString(0, &entry_id)); diff --git a/chrome/browser/extensions/api/file_system/file_system_api.h b/chrome/browser/extensions/api/file_system/file_system_api.h index a2a8c70..7aee4e5 100644 --- a/chrome/browser/extensions/api/file_system/file_system_api.h +++ b/chrome/browser/extensions/api/file_system/file_system_api.h @@ -88,7 +88,7 @@ class FileSystemGetWritableEntryFunction : public FileSystemEntryFunction { protected: virtual ~FileSystemGetWritableEntryFunction() {} - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; private: void CheckPermissionAndSendResponse(); @@ -145,7 +145,7 @@ class FileSystemChooseEntryFunction : public FileSystemEntryFunction { class FilePicker; virtual ~FileSystemChooseEntryFunction() {} - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; void ShowPicker(const ui::SelectFileDialog::FileTypeInfo& file_type_info, ui::SelectFileDialog::Type picker_type); @@ -176,7 +176,7 @@ class FileSystemRetainEntryFunction : public ChromeAsyncExtensionFunction { protected: virtual ~FileSystemRetainEntryFunction() {} - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; private: // Retains the file entry referenced by |entry_id| in apps::SavedFilesService. @@ -207,7 +207,7 @@ class FileSystemRestoreEntryFunction : public FileSystemEntryFunction { protected: virtual ~FileSystemRestoreEntryFunction() {} - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; }; } // namespace extensions diff --git a/chrome/browser/extensions/api/font_settings/font_settings_api.cc b/chrome/browser/extensions/api/font_settings/font_settings_api.cc index 2031cf7..cf01a958 100644 --- a/chrome/browser/extensions/api/font_settings/font_settings_api.cc +++ b/chrome/browser/extensions/api/font_settings/font_settings_api.cc @@ -298,7 +298,7 @@ bool FontSettingsSetFontFunction::RunSync() { return true; } -bool FontSettingsGetFontListFunction::RunImpl() { +bool FontSettingsGetFontListFunction::RunAsync() { content::GetFontListAsync( Bind(&FontSettingsGetFontListFunction::FontListHasLoaded, this)); return true; diff --git a/chrome/browser/extensions/api/font_settings/font_settings_api.h b/chrome/browser/extensions/api/font_settings/font_settings_api.h index 8aa6963..f5c8416 100644 --- a/chrome/browser/extensions/api/font_settings/font_settings_api.h +++ b/chrome/browser/extensions/api/font_settings/font_settings_api.h @@ -142,7 +142,7 @@ class FontSettingsGetFontListFunction : public ChromeAsyncExtensionFunction { virtual ~FontSettingsGetFontListFunction() {} // ExtensionFunction: - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; private: void FontListHasLoaded(scoped_ptr<base::ListValue> list); diff --git a/chrome/browser/extensions/api/gcm/gcm_api.cc b/chrome/browser/extensions/api/gcm/gcm_api.cc index 7fe632a..343299c 100644 --- a/chrome/browser/extensions/api/gcm/gcm_api.cc +++ b/chrome/browser/extensions/api/gcm/gcm_api.cc @@ -78,7 +78,7 @@ bool IsMessageKeyValid(const std::string& key) { namespace extensions { -bool GcmApiFunction::RunImpl() { +bool GcmApiFunction::RunAsync() { if (!IsGcmApiEnabled()) return false; diff --git a/chrome/browser/extensions/api/gcm/gcm_api.h b/chrome/browser/extensions/api/gcm/gcm_api.h index 07009a1..e5447c0 100644 --- a/chrome/browser/extensions/api/gcm/gcm_api.h +++ b/chrome/browser/extensions/api/gcm/gcm_api.h @@ -26,7 +26,7 @@ class GcmApiFunction : public AsyncExtensionFunction { virtual ~GcmApiFunction() {} // ExtensionFunction: - virtual bool RunImpl() OVERRIDE FINAL; + virtual bool RunAsync() OVERRIDE FINAL; // Actual implementation of specific functions. virtual bool DoWork() = 0; diff --git a/chrome/browser/extensions/api/history/history_api.cc b/chrome/browser/extensions/api/history/history_api.cc index 51670d2..bf06088 100644 --- a/chrome/browser/extensions/api/history/history_api.cc +++ b/chrome/browser/extensions/api/history/history_api.cc @@ -270,7 +270,7 @@ HistoryFunctionWithCallback::HistoryFunctionWithCallback() { HistoryFunctionWithCallback::~HistoryFunctionWithCallback() { } -bool HistoryFunctionWithCallback::RunImpl() { +bool HistoryFunctionWithCallback::RunAsync() { AddRef(); // Balanced in SendAysncRepose() and below. bool retval = RunAsyncImpl(); if (false == retval) @@ -286,7 +286,7 @@ void HistoryFunctionWithCallback::SendAsyncResponse() { void HistoryFunctionWithCallback::SendResponseToCallback() { SendResponse(true); - Release(); // Balanced in RunImpl(). + Release(); // Balanced in RunAsync(). } bool HistoryGetVisitsFunction::RunAsyncImpl() { @@ -370,7 +370,7 @@ void HistorySearchFunction::SearchComplete( SendAsyncResponse(); } -bool HistoryAddUrlFunction::RunImpl() { +bool HistoryAddUrlFunction::RunAsync() { scoped_ptr<AddUrl::Params> params(AddUrl::Params::Create(*args_)); EXTENSION_FUNCTION_VALIDATE(params.get()); @@ -386,7 +386,7 @@ bool HistoryAddUrlFunction::RunImpl() { return true; } -bool HistoryDeleteUrlFunction::RunImpl() { +bool HistoryDeleteUrlFunction::RunAsync() { scoped_ptr<DeleteUrl::Params> params(DeleteUrl::Params::Create(*args_)); EXTENSION_FUNCTION_VALIDATE(params.get()); diff --git a/chrome/browser/extensions/api/history/history_api.h b/chrome/browser/extensions/api/history/history_api.h index 3b13b28..32040b5 100644 --- a/chrome/browser/extensions/api/history/history_api.h +++ b/chrome/browser/extensions/api/history/history_api.h @@ -105,7 +105,7 @@ class HistoryFunctionWithCallback : public HistoryFunction { virtual ~HistoryFunctionWithCallback(); // ExtensionFunction: - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; // Return true if the async call was completed, false otherwise. virtual bool RunAsyncImpl() = 0; @@ -164,7 +164,7 @@ class HistoryAddUrlFunction : public HistoryFunction { virtual ~HistoryAddUrlFunction() {} // HistoryFunctionWithCallback: - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; }; class HistoryDeleteAllFunction : public HistoryFunctionWithCallback { @@ -190,7 +190,7 @@ class HistoryDeleteUrlFunction : public HistoryFunction { virtual ~HistoryDeleteUrlFunction() {} // HistoryFunctionWithCallback: - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; }; class HistoryDeleteRangeFunction : public HistoryFunctionWithCallback { diff --git a/chrome/browser/extensions/api/identity/identity_api.cc b/chrome/browser/extensions/api/identity/identity_api.cc index 65dc4a7..df6fdbd 100644 --- a/chrome/browser/extensions/api/identity/identity_api.cc +++ b/chrome/browser/extensions/api/identity/identity_api.cc @@ -230,7 +230,7 @@ IdentityGetAuthTokenFunction::IdentityGetAuthTokenFunction() IdentityGetAuthTokenFunction::~IdentityGetAuthTokenFunction() {} -bool IdentityGetAuthTokenFunction::RunImpl() { +bool IdentityGetAuthTokenFunction::RunAsync() { if (GetProfile()->IsOffTheRecord()) { error_ = identity_constants::kOffTheRecord; return false; @@ -710,7 +710,7 @@ IdentityLaunchWebAuthFlowFunction::~IdentityLaunchWebAuthFlowFunction() { auth_flow_.release()->DetachDelegateAndDelete(); } -bool IdentityLaunchWebAuthFlowFunction::RunImpl() { +bool IdentityLaunchWebAuthFlowFunction::RunAsync() { if (GetProfile()->IsOffTheRecord()) { error_ = identity_constants::kOffTheRecord; return false; @@ -767,7 +767,7 @@ void IdentityLaunchWebAuthFlowFunction::OnAuthFlowFailure( break; } SendResponse(false); - Release(); // Balanced in RunImpl. + Release(); // Balanced in RunAsync. } void IdentityLaunchWebAuthFlowFunction::OnAuthFlowURLChange( @@ -775,7 +775,7 @@ void IdentityLaunchWebAuthFlowFunction::OnAuthFlowURLChange( if (redirect_url.GetWithEmptyPath() == final_url_prefix_) { SetResult(new base::StringValue(redirect_url.spec())); SendResponse(true); - Release(); // Balanced in RunImpl. + Release(); // Balanced in RunAsync. } } diff --git a/chrome/browser/extensions/api/identity/identity_api.h b/chrome/browser/extensions/api/identity/identity_api.h index 79b5ee0..a434620 100644 --- a/chrome/browser/extensions/api/identity/identity_api.h +++ b/chrome/browser/extensions/api/identity/identity_api.h @@ -184,7 +184,7 @@ class IdentityGetAuthTokenFunction : public ChromeAsyncExtensionFunction, friend class MockGetAuthTokenFunction; // ExtensionFunction: - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; // Helpers to report async function results to the caller. void StartAsyncRun(); @@ -300,7 +300,7 @@ class IdentityLaunchWebAuthFlowFunction : public ChromeAsyncExtensionFunction, private: virtual ~IdentityLaunchWebAuthFlowFunction(); - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; // WebAuthFlow::Delegate implementation. virtual void OnAuthFlowFailure(WebAuthFlow::Failure failure) OVERRIDE; diff --git a/chrome/browser/extensions/api/identity/identity_apitest.cc b/chrome/browser/extensions/api/identity/identity_apitest.cc index 3b18d52..48a392a 100644 --- a/chrome/browser/extensions/api/identity/identity_apitest.cc +++ b/chrome/browser/extensions/api/identity/identity_apitest.cc @@ -48,7 +48,7 @@ namespace utils = extension_function_test_utils; static const char kAccessToken[] = "auth_token"; static const char kExtensionId[] = "ext_id"; -// This helps us be able to wait until an AsyncExtensionFunction calls +// This helps us be able to wait until an UIThreadExtensionFunction calls // SendResponse. class SendResponseDelegate : public UIThreadExtensionFunction::DelegateForTests { @@ -109,7 +109,7 @@ class AsyncExtensionBrowserTest : public ExtensionBrowserTest { function->set_browser_context(browser()->profile()); function->set_has_callback(true); - function->Run(); + function->Run()->Execute(); } std::string WaitForError(UIThreadExtensionFunction* function) { @@ -132,7 +132,7 @@ class AsyncExtensionBrowserTest : public ExtensionBrowserTest { private: void RunMessageLoopUntilResponse() { - // If the RunImpl of |function| didn't already call SendResponse, run the + // If the RunAsync of |function| didn't already call SendResponse, run the // message loop until they do. if (!response_delegate_->HasResponse()) { response_delegate_->set_should_post_quit(true); diff --git a/chrome/browser/extensions/api/idle/idle_api.cc b/chrome/browser/extensions/api/idle/idle_api.cc index a04d739..a80d0cf 100644 --- a/chrome/browser/extensions/api/idle/idle_api.cc +++ b/chrome/browser/extensions/api/idle/idle_api.cc @@ -30,7 +30,7 @@ int ClampThreshold(int threshold) { namespace extensions { -bool IdleQueryStateFunction::RunImpl() { +bool IdleQueryStateFunction::RunAsync() { int threshold; EXTENSION_FUNCTION_VALIDATE(args_->GetInteger(0, &threshold)); threshold = ClampThreshold(threshold); diff --git a/chrome/browser/extensions/api/idle/idle_api.h b/chrome/browser/extensions/api/idle/idle_api.h index 79070e4..6e18f47 100644 --- a/chrome/browser/extensions/api/idle/idle_api.h +++ b/chrome/browser/extensions/api/idle/idle_api.h @@ -19,7 +19,7 @@ class IdleQueryStateFunction : public ChromeAsyncExtensionFunction { virtual ~IdleQueryStateFunction() {} // ExtensionFunction: - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; private: void IdleStateCallback(IdleState state); diff --git a/chrome/browser/extensions/api/image_writer_private/image_writer_private_api.cc b/chrome/browser/extensions/api/image_writer_private/image_writer_private_api.cc index e89d460..54453c5 100644 --- a/chrome/browser/extensions/api/image_writer_private/image_writer_private_api.cc +++ b/chrome/browser/extensions/api/image_writer_private/image_writer_private_api.cc @@ -21,7 +21,7 @@ ImageWriterPrivateWriteFromUrlFunction:: ~ImageWriterPrivateWriteFromUrlFunction() { } -bool ImageWriterPrivateWriteFromUrlFunction::RunImpl() { +bool ImageWriterPrivateWriteFromUrlFunction::RunAsync() { scoped_ptr<image_writer_api::WriteFromUrl::Params> params( image_writer_api::WriteFromUrl::Params::Create(*args_)); EXTENSION_FUNCTION_VALIDATE(params.get()); @@ -65,7 +65,7 @@ ImageWriterPrivateWriteFromFileFunction:: ~ImageWriterPrivateWriteFromFileFunction() { } -bool ImageWriterPrivateWriteFromFileFunction::RunImpl() { +bool ImageWriterPrivateWriteFromFileFunction::RunAsync() { std::string filesystem_name; std::string filesystem_path; std::string storage_unit_id; @@ -109,7 +109,7 @@ ImageWriterPrivateCancelWriteFunction:: ~ImageWriterPrivateCancelWriteFunction() { } -bool ImageWriterPrivateCancelWriteFunction::RunImpl() { +bool ImageWriterPrivateCancelWriteFunction::RunAsync() { image_writer::OperationManager::Get(GetProfile())->CancelWrite( extension_id(), base::Bind(&ImageWriterPrivateCancelWriteFunction::OnWriteCancelled, @@ -134,7 +134,7 @@ ImageWriterPrivateDestroyPartitionsFunction:: ~ImageWriterPrivateDestroyPartitionsFunction() { } -bool ImageWriterPrivateDestroyPartitionsFunction::RunImpl() { +bool ImageWriterPrivateDestroyPartitionsFunction::RunAsync() { scoped_ptr<image_writer_api::DestroyPartitions::Params> params( image_writer_api::DestroyPartitions::Params::Create(*args_)); EXTENSION_FUNCTION_VALIDATE(params.get()); @@ -166,7 +166,7 @@ ImageWriterPrivateListRemovableStorageDevicesFunction:: ~ImageWriterPrivateListRemovableStorageDevicesFunction() { } -bool ImageWriterPrivateListRemovableStorageDevicesFunction::RunImpl() { +bool ImageWriterPrivateListRemovableStorageDevicesFunction::RunAsync() { RemovableStorageProvider::GetAllDevices( base::Bind( &ImageWriterPrivateListRemovableStorageDevicesFunction::OnDeviceListReady, diff --git a/chrome/browser/extensions/api/image_writer_private/image_writer_private_api.h b/chrome/browser/extensions/api/image_writer_private/image_writer_private_api.h index 9cccd0fc..56ee446 100644 --- a/chrome/browser/extensions/api/image_writer_private/image_writer_private_api.h +++ b/chrome/browser/extensions/api/image_writer_private/image_writer_private_api.h @@ -19,7 +19,7 @@ class ImageWriterPrivateWriteFromUrlFunction private: virtual ~ImageWriterPrivateWriteFromUrlFunction(); - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; void OnWriteStarted(bool success, const std::string& error); }; @@ -32,7 +32,7 @@ class ImageWriterPrivateWriteFromFileFunction private: virtual ~ImageWriterPrivateWriteFromFileFunction(); - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; void OnWriteStarted(bool success, const std::string& error); }; @@ -45,7 +45,7 @@ class ImageWriterPrivateCancelWriteFunction private: virtual ~ImageWriterPrivateCancelWriteFunction(); - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; void OnWriteCancelled(bool success, const std::string& error); }; @@ -58,7 +58,7 @@ class ImageWriterPrivateDestroyPartitionsFunction private: virtual ~ImageWriterPrivateDestroyPartitionsFunction(); - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; void OnDestroyComplete(bool success, const std::string& error); }; @@ -71,7 +71,7 @@ class ImageWriterPrivateListRemovableStorageDevicesFunction private: virtual ~ImageWriterPrivateListRemovableStorageDevicesFunction(); - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; void OnDeviceListReady(scoped_refptr<StorageDeviceList> device_list, bool success); }; diff --git a/chrome/browser/extensions/api/input_ime/input_ime_api.cc b/chrome/browser/extensions/api/input_ime/input_ime_api.cc index 8f05189..4d7c019 100644 --- a/chrome/browser/extensions/api/input_ime/input_ime_api.cc +++ b/chrome/browser/extensions/api/input_ime/input_ime_api.cc @@ -516,7 +516,7 @@ bool InputImeCommitTextFunction::RunSync() { return true; } -bool InputImeHideInputViewFunction::RunImpl() { +bool InputImeHideInputViewFunction::RunAsync() { InputMethodEngineInterface* engine = InputImeEventRouter::GetInstance()->GetActiveEngine(extension_id()); if (!engine) { @@ -526,7 +526,7 @@ bool InputImeHideInputViewFunction::RunImpl() { return true; } -bool InputImeSendKeyEventsFunction::RunImpl() { +bool InputImeSendKeyEventsFunction::RunAsync() { scoped_ptr<SendKeyEvents::Params> parent_params( SendKeyEvents::Params::Create(*args_)); const SendKeyEvents::Params::Parameters& params = @@ -765,7 +765,7 @@ bool InputImeDeleteSurroundingTextFunction::RunSync() { return true; } -bool InputImeKeyEventHandledFunction::RunImpl() { +bool InputImeKeyEventHandledFunction::RunAsync() { scoped_ptr<KeyEventHandled::Params> params( KeyEventHandled::Params::Create(*args_)); InputImeEventRouter::GetInstance()->OnKeyEventHandled( diff --git a/chrome/browser/extensions/api/input_ime/input_ime_api.h b/chrome/browser/extensions/api/input_ime/input_ime_api.h index 2f0d833..773d13b 100644 --- a/chrome/browser/extensions/api/input_ime/input_ime_api.h +++ b/chrome/browser/extensions/api/input_ime/input_ime_api.h @@ -192,7 +192,7 @@ class InputImeKeyEventHandledFunction : public AsyncExtensionFunction { virtual ~InputImeKeyEventHandledFunction() {} // ExtensionFunction: - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; }; class InputImeSendKeyEventsFunction : public AsyncExtensionFunction { @@ -204,7 +204,7 @@ class InputImeSendKeyEventsFunction : public AsyncExtensionFunction { virtual ~InputImeSendKeyEventsFunction() {} // ExtensionFunction: - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; }; class InputImeHideInputViewFunction : public AsyncExtensionFunction { @@ -216,7 +216,7 @@ class InputImeHideInputViewFunction : public AsyncExtensionFunction { virtual ~InputImeHideInputViewFunction() {} // ExtensionFunction: - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; }; class InputImeAPI : public BrowserContextKeyedAPI, diff --git a/chrome/browser/extensions/api/log_private/log_private_api.h b/chrome/browser/extensions/api/log_private/log_private_api.h index 24c8fcd..2b6648b 100644 --- a/chrome/browser/extensions/api/log_private/log_private_api.h +++ b/chrome/browser/extensions/api/log_private/log_private_api.h @@ -85,7 +85,7 @@ class LogPrivateGetHistoricalFunction : public AsyncExtensionFunction { protected: virtual ~LogPrivateGetHistoricalFunction(); - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; private: void OnSystemLogsLoaded(scoped_ptr<system_logs::SystemLogsResponse> sys_info); diff --git a/chrome/browser/extensions/api/log_private/log_private_api_chromeos.cc b/chrome/browser/extensions/api/log_private/log_private_api_chromeos.cc index e0ffc17..8cce97f 100644 --- a/chrome/browser/extensions/api/log_private/log_private_api_chromeos.cc +++ b/chrome/browser/extensions/api/log_private/log_private_api_chromeos.cc @@ -174,7 +174,7 @@ LogPrivateGetHistoricalFunction::LogPrivateGetHistoricalFunction() { LogPrivateGetHistoricalFunction::~LogPrivateGetHistoricalFunction() { } -bool LogPrivateGetHistoricalFunction::RunImpl() { +bool LogPrivateGetHistoricalFunction::RunAsync() { // Get parameters scoped_ptr<api::log_private::GetHistorical::Params> params( api::log_private::GetHistorical::Params::Create(*args_)); diff --git a/chrome/browser/extensions/api/management/management_api.cc b/chrome/browser/extensions/api/management/management_api.cc index 6351bb8..86f67ef 100644 --- a/chrome/browser/extensions/api/management/management_api.cc +++ b/chrome/browser/extensions/api/management/management_api.cc @@ -376,7 +376,7 @@ class SafeManifestJSONParser : public UtilityProcessHostClient { } // namespace -bool ManagementGetPermissionWarningsByManifestFunction::RunImpl() { +bool ManagementGetPermissionWarningsByManifestFunction::RunAsync() { scoped_ptr<management::GetPermissionWarningsByManifest::Params> params( management::GetPermissionWarningsByManifest::Params::Create(*args_)); EXTENSION_FUNCTION_VALIDATE(params.get()); @@ -409,7 +409,7 @@ void ManagementGetPermissionWarningsByManifestFunction::OnParseSuccess( management::GetPermissionWarningsByManifest::Results::Create(warnings); SendResponse(true); - // Matched with AddRef() in RunImpl(). + // Matched with AddRef() in RunAsync(). Release(); } @@ -418,7 +418,7 @@ void ManagementGetPermissionWarningsByManifestFunction::OnParseFailure( error_ = error; SendResponse(false); - // Matched with AddRef() in RunImpl(). + // Matched with AddRef() in RunAsync(). Release(); } @@ -460,7 +460,7 @@ ManagementSetEnabledFunction::ManagementSetEnabledFunction() { ManagementSetEnabledFunction::~ManagementSetEnabledFunction() { } -bool ManagementSetEnabledFunction::RunImpl() { +bool ManagementSetEnabledFunction::RunAsync() { scoped_ptr<management::SetEnabled::Params> params( management::SetEnabled::Params::Create(*args_)); EXTENSION_FUNCTION_VALIDATE(params.get()); @@ -611,7 +611,7 @@ ManagementUninstallFunction::ManagementUninstallFunction() { ManagementUninstallFunction::~ManagementUninstallFunction() { } -bool ManagementUninstallFunction::RunImpl() { +bool ManagementUninstallFunction::RunAsync() { scoped_ptr<management::Uninstall::Params> params( management::Uninstall::Params::Create(*args_)); EXTENSION_FUNCTION_VALIDATE(extension_); @@ -638,7 +638,7 @@ ManagementUninstallSelfFunction::ManagementUninstallSelfFunction() { ManagementUninstallSelfFunction::~ManagementUninstallSelfFunction() { } -bool ManagementUninstallSelfFunction::RunImpl() { +bool ManagementUninstallSelfFunction::RunAsync() { scoped_ptr<management::UninstallSelf::Params> params( management::UninstallSelf::Params::Create(*args_)); EXTENSION_FUNCTION_VALIDATE(params.get()); @@ -668,7 +668,7 @@ void ManagementCreateAppShortcutFunction::OnCloseShortcutPrompt(bool created) { Release(); } -bool ManagementCreateAppShortcutFunction::RunImpl() { +bool ManagementCreateAppShortcutFunction::RunAsync() { if (!user_gesture()) { error_ = keys::kGestureNeededForCreateAppShortcutError; return false; diff --git a/chrome/browser/extensions/api/management/management_api.h b/chrome/browser/extensions/api/management/management_api.h index af46ef9..3c348c9 100644 --- a/chrome/browser/extensions/api/management/management_api.h +++ b/chrome/browser/extensions/api/management/management_api.h @@ -83,7 +83,7 @@ class ManagementGetPermissionWarningsByManifestFunction virtual ~ManagementGetPermissionWarningsByManifestFunction() {} // ExtensionFunction: - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; }; class ManagementLaunchAppFunction : public ManagementFunction { @@ -108,7 +108,7 @@ class ManagementSetEnabledFunction : public AsyncManagementFunction, virtual ~ManagementSetEnabledFunction(); // ExtensionFunction: - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; // ExtensionInstallPrompt::Delegate. virtual void InstallUIProceed() OVERRIDE; @@ -140,7 +140,7 @@ class ManagementUninstallFunctionBase : public AsyncManagementFunction, // If should_uninstall is true, this method does the actual uninstall. // If |show_uninstall_dialog|, then this function will be called by one of the - // Accepted/Canceled callbacks. Otherwise, it's called directly from RunImpl. + // Accepted/Canceled callbacks. Otherwise, it's called directly from RunAsync. void Finish(bool should_uninstall); std::string extension_id_; @@ -156,7 +156,7 @@ class ManagementUninstallFunction : public ManagementUninstallFunctionBase { private: virtual ~ManagementUninstallFunction(); - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; }; class ManagementUninstallSelfFunction : public ManagementUninstallFunctionBase { @@ -169,7 +169,7 @@ class ManagementUninstallSelfFunction : public ManagementUninstallFunctionBase { private: virtual ~ManagementUninstallSelfFunction(); - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; }; class ManagementCreateAppShortcutFunction : public AsyncManagementFunction { @@ -186,7 +186,7 @@ class ManagementCreateAppShortcutFunction : public AsyncManagementFunction { protected: virtual ~ManagementCreateAppShortcutFunction(); - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; }; class ManagementEventRouter : public content::NotificationObserver { diff --git a/chrome/browser/extensions/api/media_galleries/media_galleries_api.cc b/chrome/browser/extensions/api/media_galleries/media_galleries_api.cc index 171111b..3e7aa8d 100644 --- a/chrome/browser/extensions/api/media_galleries/media_galleries_api.cc +++ b/chrome/browser/extensions/api/media_galleries/media_galleries_api.cc @@ -368,7 +368,7 @@ void MediaGalleriesEventRouter::DispatchEventToExtension( MediaGalleriesGetMediaFileSystemsFunction:: ~MediaGalleriesGetMediaFileSystemsFunction() {} -bool MediaGalleriesGetMediaFileSystemsFunction::RunImpl() { +bool MediaGalleriesGetMediaFileSystemsFunction::RunAsync() { media_galleries::UsageCount(media_galleries::GET_MEDIA_FILE_SYSTEMS); scoped_ptr<GetMediaFileSystems::Params> params( GetMediaFileSystems::Params::Create(*args_)); @@ -476,7 +476,7 @@ void MediaGalleriesGetMediaFileSystemsFunction::GetMediaFileSystemsForExtension( MediaGalleriesGetAllMediaFileSystemMetadataFunction:: ~MediaGalleriesGetAllMediaFileSystemMetadataFunction() {} -bool MediaGalleriesGetAllMediaFileSystemMetadataFunction::RunImpl() { +bool MediaGalleriesGetAllMediaFileSystemMetadataFunction::RunAsync() { media_galleries::UsageCount( media_galleries::GET_ALL_MEDIA_FILE_SYSTEM_METADATA); return Setup(GetProfile(), &error_, base::Bind( @@ -538,7 +538,7 @@ void MediaGalleriesGetAllMediaFileSystemMetadataFunction::OnGetGalleries( MediaGalleriesAddUserSelectedFolderFunction:: ~MediaGalleriesAddUserSelectedFolderFunction() {} -bool MediaGalleriesAddUserSelectedFolderFunction::RunImpl() { +bool MediaGalleriesAddUserSelectedFolderFunction::RunAsync() { media_galleries::UsageCount(media_galleries::ADD_USER_SELECTED_FOLDER); return Setup(GetProfile(), &error_, base::Bind( &MediaGalleriesAddUserSelectedFolderFunction::OnPreferencesInit, this)); @@ -647,7 +647,7 @@ MediaGalleriesAddUserSelectedFolderFunction::GetMediaFileSystemsForExtension( MediaGalleriesDropPermissionForMediaFileSystemFunction:: ~MediaGalleriesDropPermissionForMediaFileSystemFunction() {} -bool MediaGalleriesDropPermissionForMediaFileSystemFunction::RunImpl() { +bool MediaGalleriesDropPermissionForMediaFileSystemFunction::RunAsync() { media_galleries::UsageCount( media_galleries::DROP_PERMISSION_FOR_MEDIA_FILE_SYSTEM); @@ -689,7 +689,7 @@ void MediaGalleriesDropPermissionForMediaFileSystemFunction::OnPreferencesInit( MediaGalleriesStartMediaScanFunction::~MediaGalleriesStartMediaScanFunction() {} -bool MediaGalleriesStartMediaScanFunction::RunImpl() { +bool MediaGalleriesStartMediaScanFunction::RunAsync() { media_galleries::UsageCount(media_galleries::START_MEDIA_SCAN); if (!CheckScanPermission(GetExtension(), &error_)) { MediaGalleriesEventRouter::Get(GetProfile())->OnScanError( @@ -717,7 +717,7 @@ MediaGalleriesCancelMediaScanFunction:: ~MediaGalleriesCancelMediaScanFunction() { } -bool MediaGalleriesCancelMediaScanFunction::RunImpl() { +bool MediaGalleriesCancelMediaScanFunction::RunAsync() { media_galleries::UsageCount(media_galleries::CANCEL_MEDIA_SCAN); if (!CheckScanPermission(GetExtension(), &error_)) { MediaGalleriesEventRouter::Get(GetProfile())->OnScanError( @@ -736,7 +736,7 @@ void MediaGalleriesCancelMediaScanFunction::OnPreferencesInit() { MediaGalleriesAddScanResultsFunction::~MediaGalleriesAddScanResultsFunction() {} -bool MediaGalleriesAddScanResultsFunction::RunImpl() { +bool MediaGalleriesAddScanResultsFunction::RunAsync() { media_galleries::UsageCount(media_galleries::ADD_SCAN_RESULTS); if (!CheckScanPermission(GetExtension(), &error_)) { // We don't fire a scan progress error here, as it would be unintuitive. @@ -811,7 +811,7 @@ void MediaGalleriesAddScanResultsFunction::ReturnGalleries( MediaGalleriesGetMetadataFunction::~MediaGalleriesGetMetadataFunction() {} -bool MediaGalleriesGetMetadataFunction::RunImpl() { +bool MediaGalleriesGetMetadataFunction::RunAsync() { std::string blob_uuid; EXTENSION_FUNCTION_VALIDATE(args_->GetString(0, &blob_uuid)); diff --git a/chrome/browser/extensions/api/media_galleries/media_galleries_api.h b/chrome/browser/extensions/api/media_galleries/media_galleries_api.h index 4a85487..94762c4 100644 --- a/chrome/browser/extensions/api/media_galleries/media_galleries_api.h +++ b/chrome/browser/extensions/api/media_galleries/media_galleries_api.h @@ -95,10 +95,10 @@ class MediaGalleriesGetMediaFileSystemsFunction protected: virtual ~MediaGalleriesGetMediaFileSystemsFunction(); - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; private: - // Bottom half for RunImpl, invoked after the preferences is initialized. + // Bottom half for RunAsync, invoked after the preferences is initialized. void OnPreferencesInit( MediaGalleries::GetMediaFileSystemsInteractivity interactive); @@ -132,10 +132,10 @@ class MediaGalleriesGetAllMediaFileSystemMetadataFunction protected: virtual ~MediaGalleriesGetAllMediaFileSystemMetadataFunction(); - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; private: - // Bottom half for RunImpl, invoked after the preferences is initialized. + // Bottom half for RunAsync, invoked after the preferences is initialized. // Gets the list of permitted galleries and checks if they are available. void OnPreferencesInit(); @@ -154,10 +154,10 @@ class MediaGalleriesAddUserSelectedFolderFunction protected: virtual ~MediaGalleriesAddUserSelectedFolderFunction(); - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; private: - // Bottom half for RunImpl, invoked after the preferences is initialized. + // Bottom half for RunAsync, invoked after the preferences is initialized. void OnPreferencesInit(); // Callback for the directory prompt request, with the input from the user. @@ -187,10 +187,10 @@ class MediaGalleriesDropPermissionForMediaFileSystemFunction protected: virtual ~MediaGalleriesDropPermissionForMediaFileSystemFunction(); - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; private: - // Bottom half for RunImpl, invoked after the preferences is initialized. + // Bottom half for RunAsync, invoked after the preferences is initialized. void OnPreferencesInit(MediaGalleryPrefId pref_id); }; @@ -202,10 +202,10 @@ class MediaGalleriesStartMediaScanFunction protected: virtual ~MediaGalleriesStartMediaScanFunction(); - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; private: - // Bottom half for RunImpl, invoked after the preferences is initialized. + // Bottom half for RunAsync, invoked after the preferences is initialized. void OnPreferencesInit(); }; @@ -217,10 +217,10 @@ class MediaGalleriesCancelMediaScanFunction protected: virtual ~MediaGalleriesCancelMediaScanFunction(); - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; private: - // Bottom half for RunImpl, invoked after the preferences is initialized. + // Bottom half for RunAsync, invoked after the preferences is initialized. void OnPreferencesInit(); }; @@ -232,7 +232,7 @@ class MediaGalleriesAddScanResultsFunction protected: virtual ~MediaGalleriesAddScanResultsFunction(); - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; // Pulled out for testing. virtual MediaGalleriesScanResultDialogController* MakeDialog( @@ -241,7 +241,7 @@ class MediaGalleriesAddScanResultsFunction const base::Closure& on_finish); private: - // Bottom half for RunImpl, invoked after the preferences is initialized. + // Bottom half for RunAsync, invoked after the preferences is initialized. void OnPreferencesInit(); // Grabs galleries from the media file system registry and passes them to @@ -259,10 +259,10 @@ class MediaGalleriesGetMetadataFunction : public ChromeAsyncExtensionFunction { protected: virtual ~MediaGalleriesGetMetadataFunction(); - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; private: - // Bottom half for RunImpl, invoked after the preferences is initialized. + // Bottom half for RunAsync, invoked after the preferences is initialized. void OnPreferencesInit(bool mime_type_only, const std::string& blob_uuid); void SniffMimeType(bool mime_type_only, diff --git a/chrome/browser/extensions/api/media_galleries_private/media_galleries_private_api.cc b/chrome/browser/extensions/api/media_galleries_private/media_galleries_private_api.cc index 3bd212a..d54ee6e 100644 --- a/chrome/browser/extensions/api/media_galleries_private/media_galleries_private_api.cc +++ b/chrome/browser/extensions/api/media_galleries_private/media_galleries_private_api.cc @@ -159,7 +159,7 @@ MediaGalleriesPrivateAddGalleryWatchFunction:: ~MediaGalleriesPrivateAddGalleryWatchFunction() { } -bool MediaGalleriesPrivateAddGalleryWatchFunction::RunImpl() { +bool MediaGalleriesPrivateAddGalleryWatchFunction::RunAsync() { DCHECK(GetProfile()); DCHECK_CURRENTLY_ON(content::BrowserThread::UI); if (!render_view_host() || !render_view_host()->GetProcess()) @@ -245,7 +245,7 @@ MediaGalleriesPrivateRemoveGalleryWatchFunction:: ~MediaGalleriesPrivateRemoveGalleryWatchFunction() { } -bool MediaGalleriesPrivateRemoveGalleryWatchFunction::RunImpl() { +bool MediaGalleriesPrivateRemoveGalleryWatchFunction::RunAsync() { DCHECK_CURRENTLY_ON(content::BrowserThread::UI); if (!render_view_host() || !render_view_host()->GetProcess()) return false; @@ -304,7 +304,7 @@ MediaGalleriesPrivateGetAllGalleryWatchFunction:: ~MediaGalleriesPrivateGetAllGalleryWatchFunction() { } -bool MediaGalleriesPrivateGetAllGalleryWatchFunction::RunImpl() { +bool MediaGalleriesPrivateGetAllGalleryWatchFunction::RunAsync() { DCHECK_CURRENTLY_ON(content::BrowserThread::UI); if (!render_view_host() || !render_view_host()->GetProcess()) return false; @@ -342,7 +342,7 @@ MediaGalleriesPrivateRemoveAllGalleryWatchFunction:: ~MediaGalleriesPrivateRemoveAllGalleryWatchFunction() { } -bool MediaGalleriesPrivateRemoveAllGalleryWatchFunction::RunImpl() { +bool MediaGalleriesPrivateRemoveAllGalleryWatchFunction::RunAsync() { DCHECK_CURRENTLY_ON(content::BrowserThread::UI); if (!render_view_host() || !render_view_host()->GetProcess()) return false; @@ -377,7 +377,7 @@ MediaGalleriesPrivateGetHandlersFunction:: ~MediaGalleriesPrivateGetHandlersFunction() { } -bool MediaGalleriesPrivateGetHandlersFunction::RunImpl() { +bool MediaGalleriesPrivateGetHandlersFunction::RunAsync() { DCHECK_CURRENTLY_ON(content::BrowserThread::UI); ExtensionService* service = diff --git a/chrome/browser/extensions/api/media_galleries_private/media_galleries_private_api.h b/chrome/browser/extensions/api/media_galleries_private/media_galleries_private_api.h index bb897de..2f8e3e1 100644 --- a/chrome/browser/extensions/api/media_galleries_private/media_galleries_private_api.h +++ b/chrome/browser/extensions/api/media_galleries_private/media_galleries_private_api.h @@ -88,7 +88,7 @@ class MediaGalleriesPrivateAddGalleryWatchFunction virtual ~MediaGalleriesPrivateAddGalleryWatchFunction(); // AsyncExtensionFunction overrides. - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; private: void OnPreferencesInit(const std::string& pref_id); @@ -108,7 +108,7 @@ class MediaGalleriesPrivateRemoveGalleryWatchFunction virtual ~MediaGalleriesPrivateRemoveGalleryWatchFunction(); // SyncExtensionFunction overrides. - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; private: void OnPreferencesInit(const std::string& pref_id); @@ -124,7 +124,7 @@ class MediaGalleriesPrivateGetAllGalleryWatchFunction virtual ~MediaGalleriesPrivateGetAllGalleryWatchFunction(); // SyncExtensionFunction overrides. - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; private: void OnPreferencesInit(); @@ -140,7 +140,7 @@ class MediaGalleriesPrivateRemoveAllGalleryWatchFunction virtual ~MediaGalleriesPrivateRemoveAllGalleryWatchFunction(); // SyncExtensionFunction overrides. - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; private: void OnPreferencesInit(); @@ -157,7 +157,7 @@ class MediaGalleriesPrivateGetHandlersFunction virtual ~MediaGalleriesPrivateGetHandlersFunction(); // AsyncExtensionFunction overrides. - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; }; } // namespace extensions diff --git a/chrome/browser/extensions/api/music_manager_private/music_manager_private_api.cc b/chrome/browser/extensions/api/music_manager_private/music_manager_private_api.cc index 0495981..b51ec55 100644 --- a/chrome/browser/extensions/api/music_manager_private/music_manager_private_api.cc +++ b/chrome/browser/extensions/api/music_manager_private/music_manager_private_api.cc @@ -26,7 +26,7 @@ MusicManagerPrivateGetDeviceIdFunction:: ~MusicManagerPrivateGetDeviceIdFunction() { } -bool MusicManagerPrivateGetDeviceIdFunction::RunImpl() { +bool MusicManagerPrivateGetDeviceIdFunction::RunAsync() { DCHECK_CURRENTLY_ON(BrowserThread::UI); DeviceId::GetDeviceId( this->extension_id(), diff --git a/chrome/browser/extensions/api/music_manager_private/music_manager_private_api.h b/chrome/browser/extensions/api/music_manager_private/music_manager_private_api.h index 93eec43..9c43be2 100644 --- a/chrome/browser/extensions/api/music_manager_private/music_manager_private_api.h +++ b/chrome/browser/extensions/api/music_manager_private/music_manager_private_api.h @@ -21,7 +21,7 @@ class MusicManagerPrivateGetDeviceIdFunction : public AsyncExtensionFunction { virtual ~MusicManagerPrivateGetDeviceIdFunction(); // ExtensionFunction: - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; void DeviceIdCallback(const std::string& device_id); }; diff --git a/chrome/browser/extensions/api/networking_private/networking_private_api.h b/chrome/browser/extensions/api/networking_private/networking_private_api.h index 43057ee..e244e84 100644 --- a/chrome/browser/extensions/api/networking_private/networking_private_api.h +++ b/chrome/browser/extensions/api/networking_private/networking_private_api.h @@ -28,7 +28,7 @@ class NetworkingPrivateGetPropertiesFunction virtual ~NetworkingPrivateGetPropertiesFunction(); // AsyncExtensionFunction overrides. - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; private: void GetPropertiesSuccess(const std::string& service_path, @@ -50,7 +50,7 @@ class NetworkingPrivateGetManagedPropertiesFunction virtual ~NetworkingPrivateGetManagedPropertiesFunction(); // AsyncExtensionFunction overrides. - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; private: // Callbacks for ManagedNetworkConfigurationHandler::GetManagedProperties. @@ -73,7 +73,7 @@ class NetworkingPrivateGetStateFunction : public ChromeAsyncExtensionFunction { virtual ~NetworkingPrivateGetStateFunction(); // AsyncExtensionFunction overrides. - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; private: void Success(const std::string& service_path, @@ -96,7 +96,7 @@ class NetworkingPrivateSetPropertiesFunction virtual ~NetworkingPrivateSetPropertiesFunction(); // AsyncExtensionFunction overrides. - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; private: void ErrorCallback(const std::string& error_name, @@ -117,7 +117,7 @@ class NetworkingPrivateCreateNetworkFunction virtual ~NetworkingPrivateCreateNetworkFunction(); // AsyncExtensionFunction overrides. - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; private: void ErrorCallback(const std::string& error_name, @@ -138,7 +138,7 @@ class NetworkingPrivateGetVisibleNetworksFunction virtual ~NetworkingPrivateGetVisibleNetworksFunction(); // AsyncExtensionFunction overrides. - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; private: void ResultCallback(const base::ListValue& network_list); @@ -231,7 +231,7 @@ class NetworkingPrivateStartConnectFunction virtual ~NetworkingPrivateStartConnectFunction(); // AsyncExtensionFunction overrides. - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; private: // Called when the request to connect succeeds. Doesn't mean that the connect @@ -257,7 +257,7 @@ class NetworkingPrivateStartDisconnectFunction virtual ~NetworkingPrivateStartDisconnectFunction(); // AsyncExtensionFunction overrides. - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; private: // Called when the request to disconnect succeeds. Doesn't mean that the @@ -283,7 +283,7 @@ class NetworkingPrivateVerifyDestinationFunction virtual ~NetworkingPrivateVerifyDestinationFunction(); // AsyncExtensionFunction overrides. - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; void ResultCallback(bool result); void ErrorCallback(const std::string& error_name, const std::string& error); @@ -304,7 +304,7 @@ class NetworkingPrivateVerifyAndEncryptCredentialsFunction virtual ~NetworkingPrivateVerifyAndEncryptCredentialsFunction(); // AsyncExtensionFunction overrides. - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; void ResultCallback(const std::string& result); void ErrorCallback(const std::string& error_name, const std::string& error); @@ -326,7 +326,7 @@ class NetworkingPrivateVerifyAndEncryptDataFunction virtual ~NetworkingPrivateVerifyAndEncryptDataFunction(); // AsyncExtensionFunction overrides. - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; void ResultCallback(const std::string& result); void ErrorCallback(const std::string& error_name, const std::string& error); @@ -347,7 +347,7 @@ class NetworkingPrivateSetWifiTDLSEnabledStateFunction virtual ~NetworkingPrivateSetWifiTDLSEnabledStateFunction(); // AsyncExtensionFunction overrides. - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; void Success(const std::string& result); void Failure(const std::string& error_name, @@ -369,7 +369,7 @@ class NetworkingPrivateGetWifiTDLSStatusFunction virtual ~NetworkingPrivateGetWifiTDLSStatusFunction(); // AsyncExtensionFunction overrides. - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; void Success(const std::string& result); void Failure(const std::string& error_name, @@ -387,7 +387,7 @@ class NetworkingPrivateGetCaptivePortalStatusFunction NETWORKINGPRIVATE_GETCAPTIVEPORTALSTATUS); // AsyncExtensionFunction overrides. - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; protected: virtual ~NetworkingPrivateGetCaptivePortalStatusFunction(); diff --git a/chrome/browser/extensions/api/networking_private/networking_private_api_chromeos.cc b/chrome/browser/extensions/api/networking_private/networking_private_api_chromeos.cc index 9ec6aa4..685290e 100644 --- a/chrome/browser/extensions/api/networking_private/networking_private_api_chromeos.cc +++ b/chrome/browser/extensions/api/networking_private/networking_private_api_chromeos.cc @@ -80,7 +80,7 @@ NetworkingPrivateGetPropertiesFunction:: ~NetworkingPrivateGetPropertiesFunction() { } -bool NetworkingPrivateGetPropertiesFunction::RunImpl() { +bool NetworkingPrivateGetPropertiesFunction::RunAsync() { scoped_ptr<api::GetProperties::Params> params = api::GetProperties::Params::Create(*args_); EXTENSION_FUNCTION_VALIDATE(params); @@ -118,7 +118,7 @@ NetworkingPrivateGetManagedPropertiesFunction:: ~NetworkingPrivateGetManagedPropertiesFunction() { } -bool NetworkingPrivateGetManagedPropertiesFunction::RunImpl() { +bool NetworkingPrivateGetManagedPropertiesFunction::RunAsync() { scoped_ptr<api::GetManagedProperties::Params> params = api::GetManagedProperties::Params::Create(*args_); EXTENSION_FUNCTION_VALIDATE(params); @@ -160,7 +160,7 @@ NetworkingPrivateGetStateFunction:: ~NetworkingPrivateGetStateFunction() { } -bool NetworkingPrivateGetStateFunction::RunImpl() { +bool NetworkingPrivateGetStateFunction::RunAsync() { scoped_ptr<api::GetState::Params> params = api::GetState::Params::Create(*args_); EXTENSION_FUNCTION_VALIDATE(params); @@ -192,7 +192,7 @@ NetworkingPrivateSetPropertiesFunction:: ~NetworkingPrivateSetPropertiesFunction() { } -bool NetworkingPrivateSetPropertiesFunction::RunImpl() { +bool NetworkingPrivateSetPropertiesFunction::RunAsync() { scoped_ptr<api::SetProperties::Params> params = api::SetProperties::Params::Create(*args_); EXTENSION_FUNCTION_VALIDATE(params); @@ -228,7 +228,7 @@ NetworkingPrivateCreateNetworkFunction:: ~NetworkingPrivateCreateNetworkFunction() { } -bool NetworkingPrivateCreateNetworkFunction::RunImpl() { +bool NetworkingPrivateCreateNetworkFunction::RunAsync() { scoped_ptr<api::CreateNetwork::Params> params = api::CreateNetwork::Params::Create(*args_); EXTENSION_FUNCTION_VALIDATE(params); @@ -271,7 +271,7 @@ NetworkingPrivateGetVisibleNetworksFunction:: ~NetworkingPrivateGetVisibleNetworksFunction() { } -bool NetworkingPrivateGetVisibleNetworksFunction::RunImpl() { +bool NetworkingPrivateGetVisibleNetworksFunction::RunAsync() { scoped_ptr<api::GetVisibleNetworks::Params> params = api::GetVisibleNetworks::Params::Create(*args_); EXTENSION_FUNCTION_VALIDATE(params); @@ -435,7 +435,7 @@ void NetworkingPrivateStartConnectFunction::ConnectionStartFailed( SendResponse(false); } -bool NetworkingPrivateStartConnectFunction::RunImpl() { +bool NetworkingPrivateStartConnectFunction::RunAsync() { scoped_ptr<api::StartConnect::Params> params = api::StartConnect::Params::Create(*args_); EXTENSION_FUNCTION_VALIDATE(params); @@ -471,7 +471,7 @@ void NetworkingPrivateStartDisconnectFunction::DisconnectionStartFailed( SendResponse(false); } -bool NetworkingPrivateStartDisconnectFunction::RunImpl() { +bool NetworkingPrivateStartDisconnectFunction::RunAsync() { scoped_ptr<api::StartDisconnect::Params> params = api::StartDisconnect::Params::Create(*args_); EXTENSION_FUNCTION_VALIDATE(params); @@ -494,7 +494,7 @@ NetworkingPrivateVerifyDestinationFunction:: ~NetworkingPrivateVerifyDestinationFunction() { } -bool NetworkingPrivateVerifyDestinationFunction::RunImpl() { +bool NetworkingPrivateVerifyDestinationFunction::RunAsync() { scoped_ptr<api::VerifyDestination::Params> params = api::VerifyDestination::Params::Create(*args_); EXTENSION_FUNCTION_VALIDATE(params); @@ -532,7 +532,7 @@ NetworkingPrivateVerifyAndEncryptCredentialsFunction:: ~NetworkingPrivateVerifyAndEncryptCredentialsFunction() { } -bool NetworkingPrivateVerifyAndEncryptCredentialsFunction::RunImpl() { +bool NetworkingPrivateVerifyAndEncryptCredentialsFunction::RunAsync() { scoped_ptr<api::VerifyAndEncryptCredentials::Params> params = api::VerifyAndEncryptCredentials::Params::Create(*args_); EXTENSION_FUNCTION_VALIDATE(params); @@ -573,7 +573,7 @@ NetworkingPrivateVerifyAndEncryptDataFunction:: ~NetworkingPrivateVerifyAndEncryptDataFunction() { } -bool NetworkingPrivateVerifyAndEncryptDataFunction::RunImpl() { +bool NetworkingPrivateVerifyAndEncryptDataFunction::RunAsync() { scoped_ptr<api::VerifyAndEncryptData::Params> params = api::VerifyAndEncryptData::Params::Create(*args_); EXTENSION_FUNCTION_VALIDATE(params); @@ -613,7 +613,7 @@ NetworkingPrivateSetWifiTDLSEnabledStateFunction:: ~NetworkingPrivateSetWifiTDLSEnabledStateFunction() { } -bool NetworkingPrivateSetWifiTDLSEnabledStateFunction::RunImpl() { +bool NetworkingPrivateSetWifiTDLSEnabledStateFunction::RunAsync() { scoped_ptr<api::SetWifiTDLSEnabledState::Params> params = api::SetWifiTDLSEnabledState::Params::Create(*args_); EXTENSION_FUNCTION_VALIDATE(params); @@ -653,7 +653,7 @@ NetworkingPrivateGetWifiTDLSStatusFunction:: ~NetworkingPrivateGetWifiTDLSStatusFunction() { } -bool NetworkingPrivateGetWifiTDLSStatusFunction::RunImpl() { +bool NetworkingPrivateGetWifiTDLSStatusFunction::RunAsync() { scoped_ptr<api::GetWifiTDLSStatus::Params> params = api::GetWifiTDLSStatus::Params::Create(*args_); EXTENSION_FUNCTION_VALIDATE(params); @@ -690,7 +690,7 @@ void NetworkingPrivateGetWifiTDLSStatusFunction::Failure( NetworkingPrivateGetCaptivePortalStatusFunction:: ~NetworkingPrivateGetCaptivePortalStatusFunction() {} -bool NetworkingPrivateGetCaptivePortalStatusFunction::RunImpl() { +bool NetworkingPrivateGetCaptivePortalStatusFunction::RunAsync() { scoped_ptr<api::GetCaptivePortalStatus::Params> params = api::GetCaptivePortalStatus::Params::Create(*args_); EXTENSION_FUNCTION_VALIDATE(params); diff --git a/chrome/browser/extensions/api/networking_private/networking_private_api_nonchromeos.cc b/chrome/browser/extensions/api/networking_private/networking_private_api_nonchromeos.cc index ad5edbe..64d5dbf 100644 --- a/chrome/browser/extensions/api/networking_private/networking_private_api_nonchromeos.cc +++ b/chrome/browser/extensions/api/networking_private/networking_private_api_nonchromeos.cc @@ -30,7 +30,7 @@ NetworkingPrivateGetPropertiesFunction:: ~NetworkingPrivateGetPropertiesFunction() { } -bool NetworkingPrivateGetPropertiesFunction::RunImpl() { +bool NetworkingPrivateGetPropertiesFunction::RunAsync() { scoped_ptr<api::GetProperties::Params> params = api::GetProperties::Params::Create(*args_); EXTENSION_FUNCTION_VALIDATE(params); @@ -68,7 +68,7 @@ NetworkingPrivateGetManagedPropertiesFunction:: ~NetworkingPrivateGetManagedPropertiesFunction() { } -bool NetworkingPrivateGetManagedPropertiesFunction::RunImpl() { +bool NetworkingPrivateGetManagedPropertiesFunction::RunAsync() { scoped_ptr<api::GetManagedProperties::Params> params = api::GetManagedProperties::Params::Create(*args_); EXTENSION_FUNCTION_VALIDATE(params); @@ -108,7 +108,7 @@ NetworkingPrivateGetStateFunction:: ~NetworkingPrivateGetStateFunction() { } -bool NetworkingPrivateGetStateFunction::RunImpl() { +bool NetworkingPrivateGetStateFunction::RunAsync() { scoped_ptr<api::GetState::Params> params = api::GetState::Params::Create(*args_); EXTENSION_FUNCTION_VALIDATE(params); @@ -145,7 +145,7 @@ NetworkingPrivateSetPropertiesFunction:: ~NetworkingPrivateSetPropertiesFunction() { } -bool NetworkingPrivateSetPropertiesFunction::RunImpl() { +bool NetworkingPrivateSetPropertiesFunction::RunAsync() { scoped_ptr<api::SetProperties::Params> params = api::SetProperties::Params::Create(*args_); EXTENSION_FUNCTION_VALIDATE(params); @@ -181,7 +181,7 @@ NetworkingPrivateCreateNetworkFunction:: ~NetworkingPrivateCreateNetworkFunction() { } -bool NetworkingPrivateCreateNetworkFunction::RunImpl() { +bool NetworkingPrivateCreateNetworkFunction::RunAsync() { scoped_ptr<api::CreateNetwork::Params> params = api::CreateNetwork::Params::Create(*args_); EXTENSION_FUNCTION_VALIDATE(params); @@ -219,7 +219,7 @@ NetworkingPrivateGetVisibleNetworksFunction:: ~NetworkingPrivateGetVisibleNetworksFunction() { } -bool NetworkingPrivateGetVisibleNetworksFunction::RunImpl() { +bool NetworkingPrivateGetVisibleNetworksFunction::RunAsync() { scoped_ptr<api::GetVisibleNetworks::Params> params = api::GetVisibleNetworks::Params::Create(*args_); EXTENSION_FUNCTION_VALIDATE(params); @@ -304,7 +304,7 @@ NetworkingPrivateStartConnectFunction:: ~NetworkingPrivateStartConnectFunction() { } -bool NetworkingPrivateStartConnectFunction::RunImpl() { +bool NetworkingPrivateStartConnectFunction::RunAsync() { scoped_ptr<api::StartConnect::Params> params = api::StartConnect::Params::Create(*args_); EXTENSION_FUNCTION_VALIDATE(params); @@ -337,7 +337,7 @@ NetworkingPrivateStartDisconnectFunction:: ~NetworkingPrivateStartDisconnectFunction() { } -bool NetworkingPrivateStartDisconnectFunction::RunImpl() { +bool NetworkingPrivateStartDisconnectFunction::RunAsync() { scoped_ptr<api::StartDisconnect::Params> params = api::StartDisconnect::Params::Create(*args_); EXTENSION_FUNCTION_VALIDATE(params); @@ -371,7 +371,7 @@ void NetworkingPrivateStartDisconnectFunction::DisconnectionStartFailed( NetworkingPrivateVerifyDestinationFunction:: ~NetworkingPrivateVerifyDestinationFunction() {} -bool NetworkingPrivateVerifyDestinationFunction::RunImpl() { +bool NetworkingPrivateVerifyDestinationFunction::RunAsync() { scoped_ptr<api::VerifyDestination::Params> params = api::VerifyDestination::Params::Create(*args_); EXTENSION_FUNCTION_VALIDATE(params); @@ -406,7 +406,7 @@ NetworkingPrivateVerifyAndEncryptCredentialsFunction:: ~NetworkingPrivateVerifyAndEncryptCredentialsFunction() { } -bool NetworkingPrivateVerifyAndEncryptCredentialsFunction::RunImpl() { +bool NetworkingPrivateVerifyAndEncryptCredentialsFunction::RunAsync() { scoped_ptr<api::VerifyAndEncryptCredentials::Params> params = api::VerifyAndEncryptCredentials::Params::Create(*args_); EXTENSION_FUNCTION_VALIDATE(params); @@ -443,7 +443,7 @@ NetworkingPrivateVerifyAndEncryptDataFunction:: ~NetworkingPrivateVerifyAndEncryptDataFunction() { } -bool NetworkingPrivateVerifyAndEncryptDataFunction::RunImpl() { +bool NetworkingPrivateVerifyAndEncryptDataFunction::RunAsync() { scoped_ptr<api::VerifyAndEncryptData::Params> params = api::VerifyAndEncryptData::Params::Create(*args_); EXTENSION_FUNCTION_VALIDATE(params); @@ -479,7 +479,7 @@ NetworkingPrivateSetWifiTDLSEnabledStateFunction:: ~NetworkingPrivateSetWifiTDLSEnabledStateFunction() { } -bool NetworkingPrivateSetWifiTDLSEnabledStateFunction::RunImpl() { +bool NetworkingPrivateSetWifiTDLSEnabledStateFunction::RunAsync() { scoped_ptr<api::SetWifiTDLSEnabledState::Params> params = api::SetWifiTDLSEnabledState::Params::Create(*args_); EXTENSION_FUNCTION_VALIDATE(params); @@ -494,7 +494,7 @@ NetworkingPrivateGetWifiTDLSStatusFunction:: ~NetworkingPrivateGetWifiTDLSStatusFunction() { } -bool NetworkingPrivateGetWifiTDLSStatusFunction::RunImpl() { +bool NetworkingPrivateGetWifiTDLSStatusFunction::RunAsync() { scoped_ptr<api::GetWifiTDLSStatus::Params> params = api::GetWifiTDLSStatus::Params::Create(*args_); EXTENSION_FUNCTION_VALIDATE(params); @@ -508,7 +508,7 @@ bool NetworkingPrivateGetWifiTDLSStatusFunction::RunImpl() { NetworkingPrivateGetCaptivePortalStatusFunction:: ~NetworkingPrivateGetCaptivePortalStatusFunction() {} -bool NetworkingPrivateGetCaptivePortalStatusFunction::RunImpl() { +bool NetworkingPrivateGetCaptivePortalStatusFunction::RunAsync() { scoped_ptr<api::GetCaptivePortalStatus::Params> params = api::GetCaptivePortalStatus::Params::Create(*args_); EXTENSION_FUNCTION_VALIDATE(params); diff --git a/chrome/browser/extensions/api/notifications/notifications_api.cc b/chrome/browser/extensions/api/notifications/notifications_api.cc index 0e1e987..869cb1a 100644 --- a/chrome/browser/extensions/api/notifications/notifications_api.cc +++ b/chrome/browser/extensions/api/notifications/notifications_api.cc @@ -177,7 +177,7 @@ class NotificationsApiDelegate : public NotificationDelegate { virtual content::WebContents* GetWebContents() const OVERRIDE { // We're holding a reference to api_function_, so we know it'll be valid // until ReleaseRVH is called, and api_function_ (as a - // UIThreadExtensionFunction) will zero out its copy of render_view_host + // AsyncExtensionFunction) will zero out its copy of render_view_host // when the RVH goes away. if (!api_function_.get()) return NULL; @@ -451,7 +451,7 @@ bool NotificationsApiFunction::CanRunWhileDisabled() const { return false; } -bool NotificationsApiFunction::RunImpl() { +bool NotificationsApiFunction::RunAsync() { if (IsNotificationsApiAvailable() && IsNotificationsApiEnabled()) { return RunNotificationsApi(); } else { diff --git a/chrome/browser/extensions/api/notifications/notifications_api.h b/chrome/browser/extensions/api/notifications/notifications_api.h index 02fee4b..bd1b511 100644 --- a/chrome/browser/extensions/api/notifications/notifications_api.h +++ b/chrome/browser/extensions/api/notifications/notifications_api.h @@ -41,11 +41,11 @@ class NotificationsApiFunction : public ChromeAsyncExtensionFunction { // notifications for a notifier have been disabled. virtual bool CanRunWhileDisabled() const; - // Called inside of RunImpl. + // Called inside of RunAsync. virtual bool RunNotificationsApi() = 0; // UITHreadExtensionFunction: - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; message_center::NotificationType MapApiTemplateTypeToType( api::notifications::TemplateType type); diff --git a/chrome/browser/extensions/api/page_capture/page_capture_api.cc b/chrome/browser/extensions/api/page_capture/page_capture_api.cc index d82487c..046c5be 100644 --- a/chrome/browser/extensions/api/page_capture/page_capture_api.cc +++ b/chrome/browser/extensions/api/page_capture/page_capture_api.cc @@ -54,7 +54,7 @@ void PageCaptureSaveAsMHTMLFunction::SetTestDelegate(TestDelegate* delegate) { test_delegate_ = delegate; } -bool PageCaptureSaveAsMHTMLFunction::RunImpl() { +bool PageCaptureSaveAsMHTMLFunction::RunAsync() { params_ = SaveAsMHTML::Params::Create(*args_); EXTENSION_FUNCTION_VALIDATE(params_.get()); diff --git a/chrome/browser/extensions/api/page_capture/page_capture_api.h b/chrome/browser/extensions/api/page_capture/page_capture_api.h index 1bc5611..c58a781 100644 --- a/chrome/browser/extensions/api/page_capture/page_capture_api.h +++ b/chrome/browser/extensions/api/page_capture/page_capture_api.h @@ -37,7 +37,7 @@ class PageCaptureSaveAsMHTMLFunction : public ChromeAsyncExtensionFunction { private: virtual ~PageCaptureSaveAsMHTMLFunction(); - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; // Called on the file thread. diff --git a/chrome/browser/extensions/api/permissions/permissions_api.cc b/chrome/browser/extensions/api/permissions/permissions_api.cc index 162135e..76f875d 100644 --- a/chrome/browser/extensions/api/permissions/permissions_api.cc +++ b/chrome/browser/extensions/api/permissions/permissions_api.cc @@ -131,18 +131,18 @@ void PermissionsRequestFunction::InstallUIProceed() { results_ = Request::Results::Create(true); SendResponse(true); - Release(); // Balanced in RunImpl(). + Release(); // Balanced in RunAsync(). } void PermissionsRequestFunction::InstallUIAbort(bool user_initiated) { SendResponse(true); - Release(); // Balanced in RunImpl(). + Release(); // Balanced in RunAsync(). } PermissionsRequestFunction::~PermissionsRequestFunction() {} -bool PermissionsRequestFunction::RunImpl() { +bool PermissionsRequestFunction::RunAsync() { results_ = Request::Results::Create(false); if (!user_gesture() && diff --git a/chrome/browser/extensions/api/permissions/permissions_api.h b/chrome/browser/extensions/api/permissions/permissions_api.h index 43de8af..65597bb 100644 --- a/chrome/browser/extensions/api/permissions/permissions_api.h +++ b/chrome/browser/extensions/api/permissions/permissions_api.h @@ -72,7 +72,7 @@ class PermissionsRequestFunction : public ChromeAsyncExtensionFunction, virtual ~PermissionsRequestFunction(); // ExtensionFunction: - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; private: scoped_ptr<ExtensionInstallPrompt> install_ui_; diff --git a/chrome/browser/extensions/api/preferences_private/preferences_private_api.cc b/chrome/browser/extensions/api/preferences_private/preferences_private_api.cc index c85fc04..98a89f0 100644 --- a/chrome/browser/extensions/api/preferences_private/preferences_private_api.cc +++ b/chrome/browser/extensions/api/preferences_private/preferences_private_api.cc @@ -27,12 +27,12 @@ PreferencesPrivateGetSyncCategoriesWithoutPassphraseFunction::OnStateChanged() { ProfileSyncServiceFactory::GetForProfile(GetProfile()); if (sync_service->sync_initialized()) { sync_service->RemoveObserver(this); - RunImpl(); - Release(); // Balanced in RunImpl(). + RunAsync(); + Release(); // Balanced in RunAsync(). } } -bool PreferencesPrivateGetSyncCategoriesWithoutPassphraseFunction::RunImpl() { +bool PreferencesPrivateGetSyncCategoriesWithoutPassphraseFunction::RunAsync() { ProfileSyncService* sync_service = ProfileSyncServiceFactory::GetForProfile(GetProfile()); if (!sync_service) diff --git a/chrome/browser/extensions/api/preferences_private/preferences_private_api.h b/chrome/browser/extensions/api/preferences_private/preferences_private_api.h index 205342b..e88d022 100644 --- a/chrome/browser/extensions/api/preferences_private/preferences_private_api.h +++ b/chrome/browser/extensions/api/preferences_private/preferences_private_api.h @@ -29,7 +29,7 @@ class PreferencesPrivateGetSyncCategoriesWithoutPassphraseFunction virtual void OnStateChanged() OVERRIDE; // ExtensionFunction: - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; DISALLOW_COPY_AND_ASSIGN( PreferencesPrivateGetSyncCategoriesWithoutPassphraseFunction); 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(); diff --git a/chrome/browser/extensions/api/push_messaging/push_messaging_api.cc b/chrome/browser/extensions/api/push_messaging/push_messaging_api.cc index 5ed1365b..5180d85 100644 --- a/chrome/browser/extensions/api/push_messaging/push_messaging_api.cc +++ b/chrome/browser/extensions/api/push_messaging/push_messaging_api.cc @@ -90,7 +90,7 @@ PushMessagingGetChannelIdFunction::PushMessagingGetChannelIdFunction() PushMessagingGetChannelIdFunction::~PushMessagingGetChannelIdFunction() {} -bool PushMessagingGetChannelIdFunction::RunImpl() { +bool PushMessagingGetChannelIdFunction::RunAsync() { // Fetch the function arguments. scoped_ptr<glue::GetChannelId::Params> params( glue::GetChannelId::Params::Create(*args_)); @@ -222,7 +222,7 @@ void PushMessagingGetChannelIdFunction::ReportResult( timeout); } - // Balanced in RunImpl. + // Balanced in RunAsync. Release(); } diff --git a/chrome/browser/extensions/api/push_messaging/push_messaging_api.h b/chrome/browser/extensions/api/push_messaging/push_messaging_api.h index 264a766..0b5884b 100644 --- a/chrome/browser/extensions/api/push_messaging/push_messaging_api.h +++ b/chrome/browser/extensions/api/push_messaging/push_messaging_api.h @@ -66,7 +66,7 @@ class PushMessagingGetChannelIdFunction virtual ~PushMessagingGetChannelIdFunction(); // ExtensionFunction: - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; DECLARE_EXTENSION_FUNCTION("pushMessaging.getChannelId", PUSHMESSAGING_GETCHANNELID) diff --git a/chrome/browser/extensions/api/reading_list_private/reading_list_private_api.cc b/chrome/browser/extensions/api/reading_list_private/reading_list_private_api.cc index 605a648..7676c05 100644 --- a/chrome/browser/extensions/api/reading_list_private/reading_list_private_api.cc +++ b/chrome/browser/extensions/api/reading_list_private/reading_list_private_api.cc @@ -25,7 +25,7 @@ using dom_distiller::ArticleEntry; using dom_distiller::DomDistillerService; using dom_distiller::DomDistillerServiceFactory; -bool ReadingListPrivateAddEntryFunction::RunImpl() { +bool ReadingListPrivateAddEntryFunction::RunAsync() { scoped_ptr<AddEntry::Params> params(AddEntry::Params::Create(*args_)); EXTENSION_FUNCTION_VALIDATE(params); GURL url_to_add(params->entry.url); diff --git a/chrome/browser/extensions/api/reading_list_private/reading_list_private_api.h b/chrome/browser/extensions/api/reading_list_private/reading_list_private_api.h index c88cb01..bedc0fb 100644 --- a/chrome/browser/extensions/api/reading_list_private/reading_list_private_api.h +++ b/chrome/browser/extensions/api/reading_list_private/reading_list_private_api.h @@ -24,7 +24,7 @@ class ReadingListPrivateAddEntryFunction : public ChromeAsyncExtensionFunction { virtual ~ReadingListPrivateAddEntryFunction() {} // ExtensionFunction: - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; }; class ReadingListPrivateRemoveEntryFunction diff --git a/chrome/browser/extensions/api/runtime/runtime_api.cc b/chrome/browser/extensions/api/runtime/runtime_api.cc index 59ff72e..fbb35ed 100644 --- a/chrome/browser/extensions/api/runtime/runtime_api.cc +++ b/chrome/browser/extensions/api/runtime/runtime_api.cc @@ -470,7 +470,7 @@ void RuntimeEventRouter::OnExtensionUninstalled( #endif // defined(ENABLE_EXTENSIONS) } -bool RuntimeGetBackgroundPageFunction::RunImpl() { +bool RuntimeGetBackgroundPageFunction::RunAsync() { ExtensionSystem* system = ExtensionSystem::Get(GetProfile()); ExtensionHost* host = system->process_manager()-> GetBackgroundHostForExtension(extension_id()); @@ -525,7 +525,7 @@ RuntimeRequestUpdateCheckFunction::RuntimeRequestUpdateCheckFunction() { content::NotificationService::AllSources()); } -bool RuntimeRequestUpdateCheckFunction::RunImpl() { +bool RuntimeRequestUpdateCheckFunction::RunAsync() { ExtensionSystem* system = ExtensionSystem::Get(GetProfile()); ExtensionService* service = system->extension_service(); ExtensionUpdater* updater = service->updater(); diff --git a/chrome/browser/extensions/api/runtime/runtime_api.h b/chrome/browser/extensions/api/runtime/runtime_api.h index 4bc411ce..f648be1 100644 --- a/chrome/browser/extensions/api/runtime/runtime_api.h +++ b/chrome/browser/extensions/api/runtime/runtime_api.h @@ -129,7 +129,7 @@ class RuntimeGetBackgroundPageFunction : public ChromeAsyncExtensionFunction { protected: virtual ~RuntimeGetBackgroundPageFunction() {} - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; private: void OnPageLoaded(ExtensionHost*); @@ -163,7 +163,7 @@ class RuntimeRequestUpdateCheckFunction : public ChromeAsyncExtensionFunction, RuntimeRequestUpdateCheckFunction(); protected: virtual ~RuntimeRequestUpdateCheckFunction() {} - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; // Implements content::NotificationObserver interface. virtual void Observe(int type, diff --git a/chrome/browser/extensions/api/serial/serial_apitest.cc b/chrome/browser/extensions/api/serial/serial_apitest.cc index a53bb80..6bdad96 100644 --- a/chrome/browser/extensions/api/serial/serial_apitest.cc +++ b/chrome/browser/extensions/api/serial/serial_apitest.cc @@ -36,7 +36,7 @@ namespace extensions { class FakeSerialGetDevicesFunction : public AsyncExtensionFunction { public: - virtual bool RunImpl() OVERRIDE { + virtual bool RunAsync() OVERRIDE { base::ListValue* devices = new base::ListValue(); base::DictionaryValue* device0 = new base::DictionaryValue(); device0->SetString("path", "/dev/fakeserial"); diff --git a/chrome/browser/extensions/api/sessions/sessions_api.cc b/chrome/browser/extensions/api/sessions/sessions_api.cc index 1b7fc2d..f0f8ddb 100644 --- a/chrome/browser/extensions/api/sessions/sessions_api.cc +++ b/chrome/browser/extensions/api/sessions/sessions_api.cc @@ -342,7 +342,7 @@ SessionsGetDevicesFunction::CreateSessionModel( scoped_ptr<api::sessions::Device> SessionsGetDevicesFunction::CreateDeviceModel( const browser_sync::SyncedSession* session) { int max_results = api::sessions::MAX_SESSION_RESULTS; - // Already validated in RunImpl(). + // Already validated in RunAsync(). scoped_ptr<GetDevices::Params> params(GetDevices::Params::Create(*args_)); if (params->filter && params->filter->max_results) max_results = *params->filter->max_results; diff --git a/chrome/browser/extensions/api/sync_file_system/sync_file_system_api.cc b/chrome/browser/extensions/api/sync_file_system/sync_file_system_api.cc index f6bd637..dac14c1 100644 --- a/chrome/browser/extensions/api/sync_file_system/sync_file_system_api.cc +++ b/chrome/browser/extensions/api/sync_file_system/sync_file_system_api.cc @@ -65,7 +65,7 @@ std::string ErrorToString(SyncStatusCode code) { } // namespace -bool SyncFileSystemDeleteFileSystemFunction::RunImpl() { +bool SyncFileSystemDeleteFileSystemFunction::RunAsync() { std::string url; EXTENSION_FUNCTION_VALIDATE(args_->GetString(0, &url)); @@ -113,7 +113,7 @@ void SyncFileSystemDeleteFileSystemFunction::DidDeleteFileSystem( SendResponse(true); } -bool SyncFileSystemRequestFileSystemFunction::RunImpl() { +bool SyncFileSystemRequestFileSystemFunction::RunAsync() { // SyncFileSystem initialization is done in OpenFileSystem below, but we call // GetSyncFileSystemService here too to initialize sync event observer for // extensions API. @@ -168,7 +168,7 @@ void SyncFileSystemRequestFileSystemFunction::DidOpenFileSystem( SendResponse(true); } -bool SyncFileSystemGetFileStatusFunction::RunImpl() { +bool SyncFileSystemGetFileStatusFunction::RunAsync() { std::string url; EXTENSION_FUNCTION_VALIDATE(args_->GetString(0, &url)); @@ -207,7 +207,7 @@ SyncFileSystemGetFileStatusesFunction::SyncFileSystemGetFileStatusesFunction() { SyncFileSystemGetFileStatusesFunction::~SyncFileSystemGetFileStatusesFunction( ) {} -bool SyncFileSystemGetFileStatusesFunction::RunImpl() { +bool SyncFileSystemGetFileStatusesFunction::RunAsync() { // All FileEntries converted into array of URL Strings in JS custom bindings. base::ListValue* file_entry_urls = NULL; EXTENSION_FUNCTION_VALIDATE(args_->GetList(0, &file_entry_urls)); @@ -284,7 +284,7 @@ void SyncFileSystemGetFileStatusesFunction::DidGetFileStatus( SendResponse(true); } -bool SyncFileSystemGetUsageAndQuotaFunction::RunImpl() { +bool SyncFileSystemGetUsageAndQuotaFunction::RunAsync() { std::string url; EXTENSION_FUNCTION_VALIDATE(args_->GetString(0, &url)); diff --git a/chrome/browser/extensions/api/sync_file_system/sync_file_system_api.h b/chrome/browser/extensions/api/sync_file_system/sync_file_system_api.h index e0e9621..afc06dd 100644 --- a/chrome/browser/extensions/api/sync_file_system/sync_file_system_api.h +++ b/chrome/browser/extensions/api/sync_file_system/sync_file_system_api.h @@ -32,7 +32,7 @@ class SyncFileSystemDeleteFileSystemFunction protected: virtual ~SyncFileSystemDeleteFileSystemFunction() {} - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; private: void DidDeleteFileSystem(base::File::Error error); @@ -46,7 +46,7 @@ class SyncFileSystemGetFileStatusFunction protected: virtual ~SyncFileSystemGetFileStatusFunction() {} - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; private: void DidGetFileStatus( @@ -63,7 +63,7 @@ class SyncFileSystemGetFileStatusesFunction protected: virtual ~SyncFileSystemGetFileStatusesFunction(); - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; private: typedef std::pair<sync_file_system::SyncStatusCode, @@ -89,7 +89,7 @@ class SyncFileSystemGetUsageAndQuotaFunction protected: virtual ~SyncFileSystemGetUsageAndQuotaFunction() {} - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; private: void DidGetUsageAndQuota(quota::QuotaStatusCode status, @@ -105,7 +105,7 @@ class SyncFileSystemRequestFileSystemFunction protected: virtual ~SyncFileSystemRequestFileSystemFunction() {} - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; private: typedef SyncFileSystemRequestFileSystemFunction self; diff --git a/chrome/browser/extensions/api/system_cpu/system_cpu_api.cc b/chrome/browser/extensions/api/system_cpu/system_cpu_api.cc index 74040c5..4ace528 100644 --- a/chrome/browser/extensions/api/system_cpu/system_cpu_api.cc +++ b/chrome/browser/extensions/api/system_cpu/system_cpu_api.cc @@ -18,7 +18,7 @@ SystemCpuGetInfoFunction::SystemCpuGetInfoFunction() { SystemCpuGetInfoFunction::~SystemCpuGetInfoFunction() { } -bool SystemCpuGetInfoFunction::RunImpl() { +bool SystemCpuGetInfoFunction::RunAsync() { CpuInfoProvider::Get()->StartQueryInfo( base::Bind(&SystemCpuGetInfoFunction::OnGetCpuInfoCompleted, this)); return true; diff --git a/chrome/browser/extensions/api/system_cpu/system_cpu_api.h b/chrome/browser/extensions/api/system_cpu/system_cpu_api.h index d2b7ab8..3101390 100644 --- a/chrome/browser/extensions/api/system_cpu/system_cpu_api.h +++ b/chrome/browser/extensions/api/system_cpu/system_cpu_api.h @@ -16,7 +16,7 @@ class SystemCpuGetInfoFunction : public AsyncExtensionFunction { private: virtual ~SystemCpuGetInfoFunction(); - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; void OnGetCpuInfoCompleted(bool success); }; diff --git a/chrome/browser/extensions/api/system_memory/system_memory_api.cc b/chrome/browser/extensions/api/system_memory/system_memory_api.cc index 7556410..f0c4a24b 100644 --- a/chrome/browser/extensions/api/system_memory/system_memory_api.cc +++ b/chrome/browser/extensions/api/system_memory/system_memory_api.cc @@ -14,7 +14,7 @@ SystemMemoryGetInfoFunction::SystemMemoryGetInfoFunction() {} SystemMemoryGetInfoFunction::~SystemMemoryGetInfoFunction() {} -bool SystemMemoryGetInfoFunction::RunImpl() { +bool SystemMemoryGetInfoFunction::RunAsync() { MemoryInfoProvider::Get()->StartQueryInfo( base::Bind(&SystemMemoryGetInfoFunction::OnGetMemoryInfoCompleted, this)); return true; diff --git a/chrome/browser/extensions/api/system_memory/system_memory_api.h b/chrome/browser/extensions/api/system_memory/system_memory_api.h index 740cac2..af5436d 100644 --- a/chrome/browser/extensions/api/system_memory/system_memory_api.h +++ b/chrome/browser/extensions/api/system_memory/system_memory_api.h @@ -17,7 +17,7 @@ class SystemMemoryGetInfoFunction : public AsyncExtensionFunction { private: virtual ~SystemMemoryGetInfoFunction(); - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; void OnGetMemoryInfoCompleted(bool success); }; diff --git a/chrome/browser/extensions/api/system_network/system_network_api.cc b/chrome/browser/extensions/api/system_network/system_network_api.cc index 6710052..946bde5 100644 --- a/chrome/browser/extensions/api/system_network/system_network_api.cc +++ b/chrome/browser/extensions/api/system_network/system_network_api.cc @@ -17,7 +17,7 @@ SystemNetworkGetNetworkInterfacesFunction:: SystemNetworkGetNetworkInterfacesFunction:: ~SystemNetworkGetNetworkInterfacesFunction() {} -bool SystemNetworkGetNetworkInterfacesFunction::RunImpl() { +bool SystemNetworkGetNetworkInterfacesFunction::RunAsync() { content::BrowserThread::PostTask(content::BrowserThread::FILE, FROM_HERE, base::Bind(&SystemNetworkGetNetworkInterfacesFunction:: GetListOnFileThread, diff --git a/chrome/browser/extensions/api/system_network/system_network_api.h b/chrome/browser/extensions/api/system_network/system_network_api.h index ed14631..edd5707 100644 --- a/chrome/browser/extensions/api/system_network/system_network_api.h +++ b/chrome/browser/extensions/api/system_network/system_network_api.h @@ -24,7 +24,7 @@ class SystemNetworkGetNetworkInterfacesFunction virtual ~SystemNetworkGetNetworkInterfacesFunction(); // AsyncApiFunction: - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; private: void GetListOnFileThread(); diff --git a/chrome/browser/extensions/api/system_storage/system_storage_api.cc b/chrome/browser/extensions/api/system_storage/system_storage_api.cc index 6d8da0d..3b8407d 100644 --- a/chrome/browser/extensions/api/system_storage/system_storage_api.cc +++ b/chrome/browser/extensions/api/system_storage/system_storage_api.cc @@ -18,7 +18,7 @@ SystemStorageGetInfoFunction::SystemStorageGetInfoFunction() { SystemStorageGetInfoFunction::~SystemStorageGetInfoFunction() { } -bool SystemStorageGetInfoFunction::RunImpl() { +bool SystemStorageGetInfoFunction::RunAsync() { StorageInfoProvider::Get()->StartQueryInfo( base::Bind(&SystemStorageGetInfoFunction::OnGetStorageInfoCompleted, this)); @@ -39,7 +39,7 @@ void SystemStorageGetInfoFunction::OnGetStorageInfoCompleted(bool success) { SystemStorageEjectDeviceFunction::~SystemStorageEjectDeviceFunction() { } -bool SystemStorageEjectDeviceFunction::RunImpl() { +bool SystemStorageEjectDeviceFunction::RunAsync() { DCHECK_CURRENTLY_ON(content::BrowserThread::UI); scoped_ptr<EjectDevice::Params> params(EjectDevice::Params::Create(*args_)); @@ -103,7 +103,7 @@ SystemStorageGetAvailableCapacityFunction:: ~SystemStorageGetAvailableCapacityFunction() { } -bool SystemStorageGetAvailableCapacityFunction::RunImpl() { +bool SystemStorageGetAvailableCapacityFunction::RunAsync() { DCHECK_CURRENTLY_ON(content::BrowserThread::UI); scoped_ptr<GetAvailableCapacity::Params> params( diff --git a/chrome/browser/extensions/api/system_storage/system_storage_api.h b/chrome/browser/extensions/api/system_storage/system_storage_api.h index b619809..e8118af 100644 --- a/chrome/browser/extensions/api/system_storage/system_storage_api.h +++ b/chrome/browser/extensions/api/system_storage/system_storage_api.h @@ -20,7 +20,7 @@ class SystemStorageGetInfoFunction : public AsyncExtensionFunction { private: virtual ~SystemStorageGetInfoFunction(); - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; void OnGetStorageInfoCompleted(bool success); }; @@ -35,7 +35,7 @@ class SystemStorageEjectDeviceFunction virtual ~SystemStorageEjectDeviceFunction(); // AsyncExtensionFunction overrides. - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; private: void OnStorageMonitorInit(const std::string& transient_device_id); @@ -56,7 +56,7 @@ class SystemStorageGetAvailableCapacityFunction void OnQueryCompleted(const std::string& transient_id, double available_capacity); virtual ~SystemStorageGetAvailableCapacityFunction(); - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; }; } // namespace extensions diff --git a/chrome/browser/extensions/api/tabs/tabs_api.cc b/chrome/browser/extensions/api/tabs/tabs_api.cc index e551852..ae2261f 100644 --- a/chrome/browser/extensions/api/tabs/tabs_api.cc +++ b/chrome/browser/extensions/api/tabs/tabs_api.cc @@ -106,7 +106,7 @@ using api::tabs::InjectDetails; namespace { -bool GetBrowserFromWindowID(ChromeAsyncExtensionFunction* function, +bool GetBrowserFromWindowID(ChromeUIThreadExtensionFunction* function, int window_id, Browser** browser) { std::string error; @@ -1052,7 +1052,7 @@ bool TabsHighlightFunction::HighlightTab(TabStripModel* tabstrip, TabsUpdateFunction::TabsUpdateFunction() : web_contents_(NULL) { } -bool TabsUpdateFunction::RunImpl() { +bool TabsUpdateFunction::RunAsync() { scoped_ptr<tabs::Update::Params> params(tabs::Update::Params::Create(*args_)); EXTENSION_FUNCTION_VALIDATE(params.get()); @@ -1522,7 +1522,7 @@ void TabsCaptureVisibleTabFunction::RegisterProfilePrefs( user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); } -bool TabsDetectLanguageFunction::RunImpl() { +bool TabsDetectLanguageFunction::RunAsync() { scoped_ptr<tabs::DetectLanguage::Params> params( tabs::DetectLanguage::Params::Create(*args_)); EXTENSION_FUNCTION_VALIDATE(params.get()); diff --git a/chrome/browser/extensions/api/tabs/tabs_api.h b/chrome/browser/extensions/api/tabs/tabs_api.h index 605fcb9..720b93c 100644 --- a/chrome/browser/extensions/api/tabs/tabs_api.h +++ b/chrome/browser/extensions/api/tabs/tabs_api.h @@ -148,7 +148,7 @@ class TabsUpdateFunction : public ChromeAsyncExtensionFunction { content::WebContents* web_contents_; private: - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; void OnExecuteCodeFinished(const std::string& error, int32 on_page_id, const GURL& on_url, @@ -181,7 +181,7 @@ class TabsDetectLanguageFunction : public ChromeAsyncExtensionFunction, public content::NotificationObserver { private: virtual ~TabsDetectLanguageFunction() {} - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; virtual void Observe(int type, const content::NotificationSource& source, diff --git a/chrome/browser/extensions/api/tabs/windows_util.cc b/chrome/browser/extensions/api/tabs/windows_util.cc index 88363d1..a2b640d 100644 --- a/chrome/browser/extensions/api/tabs/windows_util.cc +++ b/chrome/browser/extensions/api/tabs/windows_util.cc @@ -15,7 +15,7 @@ namespace windows_util { -bool GetWindowFromWindowID(ChromeAsyncExtensionFunction* function, +bool GetWindowFromWindowID(ChromeUIThreadExtensionFunction* function, int window_id, extensions::WindowController** controller) { if (window_id == extension_misc::kCurrentWindowId) { diff --git a/chrome/browser/extensions/api/tabs/windows_util.h b/chrome/browser/extensions/api/tabs/windows_util.h index f3d6c5f..61f8c4b 100644 --- a/chrome/browser/extensions/api/tabs/windows_util.h +++ b/chrome/browser/extensions/api/tabs/windows_util.h @@ -5,7 +5,7 @@ #ifndef CHROME_BROWSER_EXTENSIONS_API_TABS_WINDOWS_UTIL_H__ #define CHROME_BROWSER_EXTENSIONS_API_TABS_WINDOWS_UTIL_H__ -class ChromeAsyncExtensionFunction; +class ChromeUIThreadExtensionFunction; namespace extensions { class WindowController; @@ -15,7 +15,7 @@ namespace windows_util { // Populates |controller| for given |window_id|. If the window is not found, // returns false and sets UIThreadExtensionFunction error_. -bool GetWindowFromWindowID(ChromeAsyncExtensionFunction* function, +bool GetWindowFromWindowID(ChromeUIThreadExtensionFunction* function, int window_id, extensions::WindowController** controller); diff --git a/chrome/browser/extensions/api/terminal/terminal_private_api.cc b/chrome/browser/extensions/api/terminal/terminal_private_api.cc index 8cfbfdd..76eb375 100644 --- a/chrome/browser/extensions/api/terminal/terminal_private_api.cc +++ b/chrome/browser/extensions/api/terminal/terminal_private_api.cc @@ -77,7 +77,7 @@ TerminalPrivateFunction::TerminalPrivateFunction() {} TerminalPrivateFunction::~TerminalPrivateFunction() {} -bool TerminalPrivateFunction::RunImpl() { +bool TerminalPrivateFunction::RunAsync() { return RunTerminalFunction(); } diff --git a/chrome/browser/extensions/api/terminal/terminal_private_api.h b/chrome/browser/extensions/api/terminal/terminal_private_api.h index ca79049..1764ab8 100644 --- a/chrome/browser/extensions/api/terminal/terminal_private_api.h +++ b/chrome/browser/extensions/api/terminal/terminal_private_api.h @@ -20,7 +20,7 @@ class TerminalPrivateFunction : public ChromeAsyncExtensionFunction { virtual ~TerminalPrivateFunction(); // ExtensionFunction: - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; // Override with actual extension function implementation. virtual bool RunTerminalFunction() = 0; diff --git a/chrome/browser/extensions/api/top_sites/top_sites_api.cc b/chrome/browser/extensions/api/top_sites/top_sites_api.cc index cead49a..940667a 100644 --- a/chrome/browser/extensions/api/top_sites/top_sites_api.cc +++ b/chrome/browser/extensions/api/top_sites/top_sites_api.cc @@ -17,7 +17,7 @@ TopSitesGetFunction::TopSitesGetFunction() TopSitesGetFunction::~TopSitesGetFunction() {} -bool TopSitesGetFunction::RunImpl() { +bool TopSitesGetFunction::RunAsync() { history::TopSites* ts = GetProfile()->GetTopSites(); if (!ts) return false; diff --git a/chrome/browser/extensions/api/top_sites/top_sites_api.h b/chrome/browser/extensions/api/top_sites/top_sites_api.h index 9cd2b78..21440a1 100644 --- a/chrome/browser/extensions/api/top_sites/top_sites_api.h +++ b/chrome/browser/extensions/api/top_sites/top_sites_api.h @@ -21,7 +21,7 @@ class TopSitesGetFunction : public ChromeAsyncExtensionFunction { virtual ~TopSitesGetFunction(); // ExtensionFunction: - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; private: void OnMostVisitedURLsAvailable(const history::MostVisitedURLList& data); diff --git a/chrome/browser/extensions/api/web_request/web_request_api.cc b/chrome/browser/extensions/api/web_request/web_request_api.cc index 1b4fe41..f7aae30 100644 --- a/chrome/browser/extensions/api/web_request/web_request_api.cc +++ b/chrome/browser/extensions/api/web_request/web_request_api.cc @@ -2417,7 +2417,7 @@ void WebRequestHandlerBehaviorChangedFunction::OnQuotaExceeded( profile_id(), warnings)); // Continue gracefully. - Run(); + RunSync(); } bool WebRequestHandlerBehaviorChangedFunction::RunSync() { diff --git a/chrome/browser/extensions/api/webrtc_audio_private/webrtc_audio_private_api.cc b/chrome/browser/extensions/api/webrtc_audio_private/webrtc_audio_private_api.cc index 6d4c178..0edc00b 100644 --- a/chrome/browser/extensions/api/webrtc_audio_private/webrtc_audio_private_api.cc +++ b/chrome/browser/extensions/api/webrtc_audio_private/webrtc_audio_private_api.cc @@ -204,7 +204,7 @@ content::ResourceContext* WebrtcAudioPrivateFunction::resource_context() const { return resource_context_; } -bool WebrtcAudioPrivateGetSinksFunction::RunImpl() { +bool WebrtcAudioPrivateGetSinksFunction::RunAsync() { DCHECK_CURRENTLY_ON(BrowserThread::UI); InitResourceContext(); @@ -233,7 +233,7 @@ void WebrtcAudioPrivateGetSinksFunction::OnOutputDeviceNames( // normally runs) because there is one instance of this object per // function call, no actor outside of this object is modifying the // results_ member, and the different method invocations on this - // object run strictly in sequence; first RunImpl on the UI thread, + // object run strictly in sequence; first RunAsync on the UI thread, // then DoQuery on the audio IO thread, then DoneOnUIThread on the // UI thread. results_.reset(wap::GetSinks::Results::Create(results).release()); @@ -248,7 +248,7 @@ void WebrtcAudioPrivateGetSinksFunction::DoneOnUIThread() { SendResponse(true); } -bool WebrtcAudioPrivateGetActiveSinkFunction::RunImpl() { +bool WebrtcAudioPrivateGetActiveSinkFunction::RunAsync() { DCHECK_CURRENTLY_ON(BrowserThread::UI); InitResourceContext(); @@ -306,7 +306,7 @@ WebrtcAudioPrivateSetActiveSinkFunction:: ~WebrtcAudioPrivateSetActiveSinkFunction() { } -bool WebrtcAudioPrivateSetActiveSinkFunction::RunImpl() { +bool WebrtcAudioPrivateSetActiveSinkFunction::RunAsync() { DCHECK_CURRENTLY_ON(BrowserThread::UI); scoped_ptr<wap::SetActiveSink::Params> params( wap::SetActiveSink::Params::Create(*args_)); @@ -391,7 +391,7 @@ WebrtcAudioPrivateGetAssociatedSinkFunction:: ~WebrtcAudioPrivateGetAssociatedSinkFunction() { } -bool WebrtcAudioPrivateGetAssociatedSinkFunction::RunImpl() { +bool WebrtcAudioPrivateGetAssociatedSinkFunction::RunAsync() { params_ = wap::GetAssociatedSink::Params::Create(*args_); DCHECK_CURRENTLY_ON(BrowserThread::UI); EXTENSION_FUNCTION_VALIDATE(params_.get()); diff --git a/chrome/browser/extensions/api/webrtc_audio_private/webrtc_audio_private_api.h b/chrome/browser/extensions/api/webrtc_audio_private/webrtc_audio_private_api.h index be4a9e8..be98154 100644 --- a/chrome/browser/extensions/api/webrtc_audio_private/webrtc_audio_private_api.h +++ b/chrome/browser/extensions/api/webrtc_audio_private/webrtc_audio_private_api.h @@ -117,7 +117,7 @@ class WebrtcAudioPrivateGetSinksFunction : public WebrtcAudioPrivateFunction { // Sequence of events is that we query the list of sinks on the // AudioManager's thread, then calculate HMACs on the IO thread, // then finish on the UI thread. - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; void DoQuery(); virtual void OnOutputDeviceNames( scoped_ptr<media::AudioDeviceNames> raw_ids) OVERRIDE; @@ -133,7 +133,7 @@ class WebrtcAudioPrivateGetActiveSinkFunction DECLARE_EXTENSION_FUNCTION("webrtcAudioPrivate.getActiveSink", WEBRTC_AUDIO_PRIVATE_GET_ACTIVE_SINK); - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; virtual void OnControllerList( const content::RenderViewHost::AudioOutputControllerList& controllers) OVERRIDE; @@ -152,7 +152,7 @@ class WebrtcAudioPrivateSetActiveSinkFunction DECLARE_EXTENSION_FUNCTION("webrtcAudioPrivate.setActiveSink", WEBRTC_AUDIO_PRIVATE_SET_ACTIVE_SINK); - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; virtual void OnControllerList( const content::RenderViewHost::AudioOutputControllerList& controllers) OVERRIDE; @@ -184,7 +184,7 @@ class WebrtcAudioPrivateGetAssociatedSinkFunction DECLARE_EXTENSION_FUNCTION("webrtcAudioPrivate.getAssociatedSink", WEBRTC_AUDIO_PRIVATE_GET_ASSOCIATED_SINK); - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; // This implementation is slightly complicated because of different // thread requirements for the various functions we need to invoke. diff --git a/chrome/browser/extensions/api/webrtc_logging_private/webrtc_logging_private_api.cc b/chrome/browser/extensions/api/webrtc_logging_private/webrtc_logging_private_api.cc index 6ea1163..01b478c 100644 --- a/chrome/browser/extensions/api/webrtc_logging_private/webrtc_logging_private_api.cc +++ b/chrome/browser/extensions/api/webrtc_logging_private/webrtc_logging_private_api.cc @@ -64,7 +64,7 @@ WebrtcLoggingPrivateSetMetaDataFunction() {} WebrtcLoggingPrivateSetMetaDataFunction:: ~WebrtcLoggingPrivateSetMetaDataFunction() {} -bool WebrtcLoggingPrivateSetMetaDataFunction::RunImpl() { +bool WebrtcLoggingPrivateSetMetaDataFunction::RunAsync() { scoped_ptr<SetMetaData::Params> params(SetMetaData::Params::Create(*args_)); EXTENSION_FUNCTION_VALIDATE(params.get()); @@ -104,7 +104,7 @@ WebrtcLoggingPrivateStartFunction::WebrtcLoggingPrivateStartFunction() {} WebrtcLoggingPrivateStartFunction::~WebrtcLoggingPrivateStartFunction() {} -bool WebrtcLoggingPrivateStartFunction::RunImpl() { +bool WebrtcLoggingPrivateStartFunction::RunAsync() { scoped_ptr<Start::Params> params(Start::Params::Create(*args_)); EXTENSION_FUNCTION_VALIDATE(params.get()); @@ -140,7 +140,7 @@ WebrtcLoggingPrivateSetUploadOnRenderCloseFunction() {} WebrtcLoggingPrivateSetUploadOnRenderCloseFunction:: ~WebrtcLoggingPrivateSetUploadOnRenderCloseFunction() {} -bool WebrtcLoggingPrivateSetUploadOnRenderCloseFunction::RunImpl() { +bool WebrtcLoggingPrivateSetUploadOnRenderCloseFunction::RunAsync() { scoped_ptr<SetUploadOnRenderClose::Params> params( SetUploadOnRenderClose::Params::Create(*args_)); EXTENSION_FUNCTION_VALIDATE(params.get()); @@ -163,7 +163,7 @@ WebrtcLoggingPrivateStopFunction::WebrtcLoggingPrivateStopFunction() {} WebrtcLoggingPrivateStopFunction::~WebrtcLoggingPrivateStopFunction() {} -bool WebrtcLoggingPrivateStopFunction::RunImpl() { +bool WebrtcLoggingPrivateStopFunction::RunAsync() { scoped_ptr<Stop::Params> params(Stop::Params::Create(*args_)); EXTENSION_FUNCTION_VALIDATE(params.get()); @@ -197,7 +197,7 @@ WebrtcLoggingPrivateUploadFunction::WebrtcLoggingPrivateUploadFunction() {} WebrtcLoggingPrivateUploadFunction::~WebrtcLoggingPrivateUploadFunction() {} -bool WebrtcLoggingPrivateUploadFunction::RunImpl() { +bool WebrtcLoggingPrivateUploadFunction::RunAsync() { scoped_ptr<Upload::Params> params(Upload::Params::Create(*args_)); EXTENSION_FUNCTION_VALIDATE(params.get()); @@ -237,7 +237,7 @@ WebrtcLoggingPrivateDiscardFunction::WebrtcLoggingPrivateDiscardFunction() {} WebrtcLoggingPrivateDiscardFunction::~WebrtcLoggingPrivateDiscardFunction() {} -bool WebrtcLoggingPrivateDiscardFunction::RunImpl() { +bool WebrtcLoggingPrivateDiscardFunction::RunAsync() { scoped_ptr<Discard::Params> params(Discard::Params::Create(*args_)); EXTENSION_FUNCTION_VALIDATE(params.get()); diff --git a/chrome/browser/extensions/api/webrtc_logging_private/webrtc_logging_private_api.h b/chrome/browser/extensions/api/webrtc_logging_private/webrtc_logging_private_api.h index 9bf1326..c6b6606 100644 --- a/chrome/browser/extensions/api/webrtc_logging_private/webrtc_logging_private_api.h +++ b/chrome/browser/extensions/api/webrtc_logging_private/webrtc_logging_private_api.h @@ -36,7 +36,7 @@ class WebrtcLoggingPrivateSetMetaDataFunction virtual ~WebrtcLoggingPrivateSetMetaDataFunction(); // ExtensionFunction overrides. - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; // Must be called on UI thread. void SetMetaDataCallback(bool success, const std::string& error_message); @@ -53,7 +53,7 @@ class WebrtcLoggingPrivateStartFunction virtual ~WebrtcLoggingPrivateStartFunction(); // ExtensionFunction overrides. - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; // Must be called on UI thread. void StartCallback(bool success, const std::string& error_message); @@ -70,7 +70,7 @@ class WebrtcLoggingPrivateSetUploadOnRenderCloseFunction virtual ~WebrtcLoggingPrivateSetUploadOnRenderCloseFunction(); // ExtensionFunction overrides. - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; }; class WebrtcLoggingPrivateStopFunction @@ -84,7 +84,7 @@ class WebrtcLoggingPrivateStopFunction virtual ~WebrtcLoggingPrivateStopFunction(); // ExtensionFunction overrides. - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; // Must be called on UI thread. void StopCallback(bool success, const std::string& error_message); @@ -101,7 +101,7 @@ class WebrtcLoggingPrivateUploadFunction virtual ~WebrtcLoggingPrivateUploadFunction(); // ExtensionFunction overrides. - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; // Must be called on UI thread. void UploadCallback(bool success, const std::string& report_id, @@ -119,7 +119,7 @@ class WebrtcLoggingPrivateDiscardFunction virtual ~WebrtcLoggingPrivateDiscardFunction(); // ExtensionFunction overrides. - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; // Must be called on UI thread. void DiscardCallback(bool success, const std::string& error_message); diff --git a/chrome/browser/extensions/api/webrtc_logging_private/webrtc_logging_private_api_stub.cc b/chrome/browser/extensions/api/webrtc_logging_private/webrtc_logging_private_api_stub.cc index 9d082da..b22e257 100644 --- a/chrome/browser/extensions/api/webrtc_logging_private/webrtc_logging_private_api_stub.cc +++ b/chrome/browser/extensions/api/webrtc_logging_private/webrtc_logging_private_api_stub.cc @@ -20,7 +20,7 @@ WebrtcLoggingPrivateSetMetaDataFunction() {} WebrtcLoggingPrivateSetMetaDataFunction:: ~WebrtcLoggingPrivateSetMetaDataFunction() {} -bool WebrtcLoggingPrivateSetMetaDataFunction::RunImpl() { +bool WebrtcLoggingPrivateSetMetaDataFunction::RunAsync() { SetError(kErrorNotSupported); SendResponse(false); return false; @@ -33,7 +33,7 @@ WebrtcLoggingPrivateStartFunction::WebrtcLoggingPrivateStartFunction() {} WebrtcLoggingPrivateStartFunction::~WebrtcLoggingPrivateStartFunction() {} -bool WebrtcLoggingPrivateStartFunction::RunImpl() { +bool WebrtcLoggingPrivateStartFunction::RunAsync() { SetError(kErrorNotSupported); SendResponse(false); return false; @@ -48,7 +48,7 @@ WebrtcLoggingPrivateSetUploadOnRenderCloseFunction() {} WebrtcLoggingPrivateSetUploadOnRenderCloseFunction:: ~WebrtcLoggingPrivateSetUploadOnRenderCloseFunction() {} -bool WebrtcLoggingPrivateSetUploadOnRenderCloseFunction::RunImpl() { +bool WebrtcLoggingPrivateSetUploadOnRenderCloseFunction::RunAsync() { SetError(kErrorNotSupported); SendResponse(false); return false; @@ -58,7 +58,7 @@ WebrtcLoggingPrivateStopFunction::WebrtcLoggingPrivateStopFunction() {} WebrtcLoggingPrivateStopFunction::~WebrtcLoggingPrivateStopFunction() {} -bool WebrtcLoggingPrivateStopFunction::RunImpl() { +bool WebrtcLoggingPrivateStopFunction::RunAsync() { SetError(kErrorNotSupported); SendResponse(false); return false; @@ -71,7 +71,7 @@ WebrtcLoggingPrivateUploadFunction::WebrtcLoggingPrivateUploadFunction() {} WebrtcLoggingPrivateUploadFunction::~WebrtcLoggingPrivateUploadFunction() {} -bool WebrtcLoggingPrivateUploadFunction::RunImpl() { +bool WebrtcLoggingPrivateUploadFunction::RunAsync() { SetError(kErrorNotSupported); SendResponse(false); return false; @@ -86,7 +86,7 @@ WebrtcLoggingPrivateDiscardFunction::WebrtcLoggingPrivateDiscardFunction() {} WebrtcLoggingPrivateDiscardFunction::~WebrtcLoggingPrivateDiscardFunction() {} -bool WebrtcLoggingPrivateDiscardFunction::RunImpl() { +bool WebrtcLoggingPrivateDiscardFunction::RunAsync() { SetError(kErrorNotSupported); SendResponse(false); return false; diff --git a/chrome/browser/extensions/api/webstore_private/webstore_private_api.cc b/chrome/browser/extensions/api/webstore_private/webstore_private_api.cc index 85e051c..8652336 100644 --- a/chrome/browser/extensions/api/webstore_private/webstore_private_api.cc +++ b/chrome/browser/extensions/api/webstore_private/webstore_private_api.cc @@ -215,7 +215,7 @@ WebstorePrivateApi::PopApprovalForTesting( WebstorePrivateInstallBundleFunction::WebstorePrivateInstallBundleFunction() {} WebstorePrivateInstallBundleFunction::~WebstorePrivateInstallBundleFunction() {} -bool WebstorePrivateInstallBundleFunction::RunImpl() { +bool WebstorePrivateInstallBundleFunction::RunAsync() { scoped_ptr<InstallBundle::Params> params( InstallBundle::Params::Create(*args_)); EXTENSION_FUNCTION_VALIDATE(params); @@ -261,13 +261,13 @@ void WebstorePrivateInstallBundleFunction::OnBundleInstallCanceled( SendResponse(false); - Release(); // Balanced in RunImpl(). + Release(); // Balanced in RunAsync(). } void WebstorePrivateInstallBundleFunction::OnBundleInstallCompleted() { SendResponse(true); - Release(); // Balanced in RunImpl(). + Release(); // Balanced in RunAsync(). } WebstorePrivateBeginInstallWithManifest3Function:: @@ -276,7 +276,7 @@ WebstorePrivateBeginInstallWithManifest3Function:: WebstorePrivateBeginInstallWithManifest3Function:: ~WebstorePrivateBeginInstallWithManifest3Function() {} -bool WebstorePrivateBeginInstallWithManifest3Function::RunImpl() { +bool WebstorePrivateBeginInstallWithManifest3Function::RunAsync() { params_ = BeginInstallWithManifest3::Params::Create(*args_); EXTENSION_FUNCTION_VALIDATE(params_); @@ -434,7 +434,7 @@ void WebstorePrivateBeginInstallWithManifest3Function::OnWebstoreParseFailure( g_pending_installs.Get().EraseInstall(GetProfile(), id); SendResponse(false); - // Matches the AddRef in RunImpl(). + // Matches the AddRef in RunAsync(). Release(); } @@ -447,7 +447,7 @@ void WebstorePrivateBeginInstallWithManifest3Function::SigninFailed( g_pending_installs.Get().EraseInstall(GetProfile(), params_->details.id); SendResponse(false); - // Matches the AddRef in RunImpl(). + // Matches the AddRef in RunAsync(). Release(); } @@ -503,7 +503,7 @@ void WebstorePrivateBeginInstallWithManifest3Function::InstallUIProceed() { ExtensionService::RecordPermissionMessagesHistogram( dummy_extension_.get(), "Extensions.Permissions_WebStoreInstall"); - // Matches the AddRef in RunImpl(). + // Matches the AddRef in RunAsync(). Release(); } @@ -529,7 +529,7 @@ void WebstorePrivateBeginInstallWithManifest3Function::InstallUIAbort( ExtensionService::RecordPermissionMessagesHistogram(dummy_extension_.get(), histogram_name.c_str()); - // Matches the AddRef in RunImpl(). + // Matches the AddRef in RunAsync(). Release(); } @@ -539,7 +539,7 @@ WebstorePrivateCompleteInstallFunction:: WebstorePrivateCompleteInstallFunction:: ~WebstorePrivateCompleteInstallFunction() {} -bool WebstorePrivateCompleteInstallFunction::RunImpl() { +bool WebstorePrivateCompleteInstallFunction::RunAsync() { scoped_ptr<CompleteInstall::Params> params( CompleteInstall::Params::Create(*args_)); EXTENSION_FUNCTION_VALIDATE(params); @@ -601,7 +601,7 @@ void WebstorePrivateCompleteInstallFunction::OnExtensionInstallSuccess( RecordWebstoreExtensionInstallResult(true); - // Matches the AddRef in RunImpl(). + // Matches the AddRef in RunAsync(). Release(); } @@ -621,7 +621,7 @@ void WebstorePrivateCompleteInstallFunction::OnExtensionInstallFailure( RecordWebstoreExtensionInstallResult(false); - // Matches the AddRef in RunImpl(). + // Matches the AddRef in RunAsync(). Release(); } @@ -673,7 +673,7 @@ void WebstorePrivateGetWebGLStatusFunction::CreateResult(bool webgl_allowed) { ParseWebgl_status(webgl_allowed ? "webgl_allowed" : "webgl_blocked")); } -bool WebstorePrivateGetWebGLStatusFunction::RunImpl() { +bool WebstorePrivateGetWebGLStatusFunction::RunAsync() { feature_checker_->CheckGPUFeatureAvailability(); return true; } @@ -699,7 +699,7 @@ WebstorePrivateSignInFunction::WebstorePrivateSignInFunction() : signin_manager_(NULL) {} WebstorePrivateSignInFunction::~WebstorePrivateSignInFunction() {} -bool WebstorePrivateSignInFunction::RunImpl() { +bool WebstorePrivateSignInFunction::RunAsync() { scoped_ptr<SignIn::Params> params = SignIn::Params::Create(*args_); EXTENSION_FUNCTION_VALIDATE(params); @@ -772,7 +772,7 @@ void WebstorePrivateSignInFunction::SigninFailed( SendResponse(false); SigninManagerFactory::GetInstance()->RemoveObserver(this); - Release(); // Balanced in RunImpl(). + Release(); // Balanced in RunAsync(). } void WebstorePrivateSignInFunction::SigninSuccess() { @@ -789,7 +789,7 @@ void WebstorePrivateSignInFunction::MergeSessionComplete( } SigninManagerFactory::GetInstance()->RemoveObserver(this); - Release(); // Balanced in RunImpl(). + Release(); // Balanced in RunAsync(). } } // namespace extensions diff --git a/chrome/browser/extensions/api/webstore_private/webstore_private_api.h b/chrome/browser/extensions/api/webstore_private/webstore_private_api.h index 6c6cd45..d733319 100644 --- a/chrome/browser/extensions/api/webstore_private/webstore_private_api.h +++ b/chrome/browser/extensions/api/webstore_private/webstore_private_api.h @@ -63,7 +63,7 @@ class WebstorePrivateInstallBundleFunction virtual ~WebstorePrivateInstallBundleFunction(); // ExtensionFunction: - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; // Reads the extension |details| into |items|. bool ReadBundleInfo( @@ -137,7 +137,7 @@ class WebstorePrivateBeginInstallWithManifest3Function virtual ~WebstorePrivateBeginInstallWithManifest3Function(); // ExtensionFunction: - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; // Sets the result_ as a string based on |code|. void SetResultCode(ResultCode code); @@ -191,7 +191,7 @@ class WebstorePrivateCompleteInstallFunction virtual ~WebstorePrivateCompleteInstallFunction(); // ExtensionFunction: - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; private: scoped_ptr<WebstoreInstaller::Approval> approval_; @@ -265,7 +265,7 @@ class WebstorePrivateGetWebGLStatusFunction void OnFeatureCheck(bool feature_allowed); // ExtensionFunction: - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; private: void CreateResult(bool webgl_allowed); @@ -319,7 +319,7 @@ class WebstorePrivateSignInFunction : public ChromeAsyncExtensionFunction, virtual ~WebstorePrivateSignInFunction(); // ExtensionFunction: - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; // SigninManagerFactory::Observer: virtual void SigninManagerShutdown(SigninManagerBase* manager) OVERRIDE; diff --git a/chrome/browser/extensions/api/webview/webview_api.cc b/chrome/browser/extensions/api/webview/webview_api.cc index a4be01a..d3bfeef 100644 --- a/chrome/browser/extensions/api/webview/webview_api.cc +++ b/chrome/browser/extensions/api/webview/webview_api.cc @@ -46,7 +46,7 @@ int MaskForKey(const char* key) { } // namespace -bool WebviewExtensionFunction::RunImpl() { +bool WebviewExtensionFunction::RunAsync() { int instance_id = 0; EXTENSION_FUNCTION_VALIDATE(args_->GetInteger(0, &instance_id)); WebViewGuest* guest = WebViewGuest::From( @@ -54,12 +54,12 @@ bool WebviewExtensionFunction::RunImpl() { if (!guest) return false; - return RunImplSafe(guest); + return RunAsyncSafe(guest); } // TODO(lazyboy): Add checks similar to -// WebviewExtensionFunction::RunImplSafe(WebViewGuest*). -bool WebviewContextMenusCreateFunction::RunImpl() { +// WebviewExtensionFunction::RunAsyncSafe(WebViewGuest*). +bool WebviewContextMenusCreateFunction::RunAsync() { scoped_ptr<webview::ContextMenusCreate::Params> params( webview::ContextMenusCreate::Params::Create(*args_)); EXTENSION_FUNCTION_VALIDATE(params.get()); @@ -89,7 +89,7 @@ bool WebviewContextMenusCreateFunction::RunImpl() { return success; } -bool WebviewContextMenusUpdateFunction::RunImpl() { +bool WebviewContextMenusUpdateFunction::RunAsync() { scoped_ptr<webview::ContextMenusUpdate::Params> params( webview::ContextMenusUpdate::Params::Create(*args_)); EXTENSION_FUNCTION_VALIDATE(params.get()); @@ -112,7 +112,7 @@ bool WebviewContextMenusUpdateFunction::RunImpl() { return success; } -bool WebviewContextMenusRemoveFunction::RunImpl() { +bool WebviewContextMenusRemoveFunction::RunAsync() { scoped_ptr<webview::ContextMenusRemove::Params> params( webview::ContextMenusRemove::Params::Create(*args_)); EXTENSION_FUNCTION_VALIDATE(params.get()); @@ -148,7 +148,7 @@ bool WebviewContextMenusRemoveFunction::RunImpl() { return success; } -bool WebviewContextMenusRemoveAllFunction::RunImpl() { +bool WebviewContextMenusRemoveAllFunction::RunAsync() { scoped_ptr<webview::ContextMenusRemoveAll::Params> params( webview::ContextMenusRemoveAll::Params::Create(*args_)); EXTENSION_FUNCTION_VALIDATE(params.get()); @@ -196,7 +196,7 @@ uint32 WebviewClearDataFunction::GetRemovalMask() { // TODO(lazyboy): Parameters in this extension function are similar (or a // sub-set) to BrowsingDataRemoverFunction. How can we share this code? -bool WebviewClearDataFunction::RunImplSafe(WebViewGuest* guest) { +bool WebviewClearDataFunction::RunAsyncSafe(WebViewGuest* guest) { // Grab the initial |options| parameter, and parse out the arguments. base::DictionaryValue* options; EXTENSION_FUNCTION_VALIDATE(args_->GetDictionary(1, &options)); @@ -242,7 +242,7 @@ bool WebviewClearDataFunction::RunImplSafe(WebViewGuest* guest) { } void WebviewClearDataFunction::ClearDataDone() { - Release(); // Balanced in RunImpl(). + Release(); // Balanced in RunAsync(). SendResponse(true); } @@ -355,7 +355,7 @@ WebviewSetZoomFunction::WebviewSetZoomFunction() { WebviewSetZoomFunction::~WebviewSetZoomFunction() { } -bool WebviewSetZoomFunction::RunImplSafe(WebViewGuest* guest) { +bool WebviewSetZoomFunction::RunAsyncSafe(WebViewGuest* guest) { scoped_ptr<webview::SetZoom::Params> params( webview::SetZoom::Params::Create(*args_)); EXTENSION_FUNCTION_VALIDATE(params.get()); @@ -371,7 +371,7 @@ WebviewGetZoomFunction::WebviewGetZoomFunction() { WebviewGetZoomFunction::~WebviewGetZoomFunction() { } -bool WebviewGetZoomFunction::RunImplSafe(WebViewGuest* guest) { +bool WebviewGetZoomFunction::RunAsyncSafe(WebViewGuest* guest) { scoped_ptr<webview::GetZoom::Params> params( webview::GetZoom::Params::Create(*args_)); EXTENSION_FUNCTION_VALIDATE(params.get()); @@ -388,7 +388,7 @@ WebviewFindFunction::WebviewFindFunction() { WebviewFindFunction::~WebviewFindFunction() { } -bool WebviewFindFunction::RunImplSafe(WebViewGuest* guest) { +bool WebviewFindFunction::RunAsyncSafe(WebViewGuest* guest) { scoped_ptr<webview::Find::Params> params( webview::Find::Params::Create(*args_)); EXTENSION_FUNCTION_VALIDATE(params.get()); @@ -418,7 +418,7 @@ WebviewStopFindingFunction::WebviewStopFindingFunction() { WebviewStopFindingFunction::~WebviewStopFindingFunction() { } -bool WebviewStopFindingFunction::RunImplSafe(WebViewGuest* guest) { +bool WebviewStopFindingFunction::RunAsyncSafe(WebViewGuest* guest) { scoped_ptr<webview::StopFinding::Params> params( webview::StopFinding::Params::Create(*args_)); EXTENSION_FUNCTION_VALIDATE(params.get()); @@ -449,7 +449,7 @@ WebviewGoFunction::WebviewGoFunction() { WebviewGoFunction::~WebviewGoFunction() { } -bool WebviewGoFunction::RunImplSafe(WebViewGuest* guest) { +bool WebviewGoFunction::RunAsyncSafe(WebViewGuest* guest) { scoped_ptr<webview::Go::Params> params(webview::Go::Params::Create(*args_)); EXTENSION_FUNCTION_VALIDATE(params.get()); @@ -463,7 +463,7 @@ WebviewReloadFunction::WebviewReloadFunction() { WebviewReloadFunction::~WebviewReloadFunction() { } -bool WebviewReloadFunction::RunImplSafe(WebViewGuest* guest) { +bool WebviewReloadFunction::RunAsyncSafe(WebViewGuest* guest) { guest->Reload(); return true; } @@ -474,7 +474,7 @@ WebviewSetPermissionFunction::WebviewSetPermissionFunction() { WebviewSetPermissionFunction::~WebviewSetPermissionFunction() { } -bool WebviewSetPermissionFunction::RunImplSafe(WebViewGuest* guest) { +bool WebviewSetPermissionFunction::RunAsyncSafe(WebViewGuest* guest) { scoped_ptr<webview::SetPermission::Params> params( webview::SetPermission::Params::Create(*args_)); EXTENSION_FUNCTION_VALIDATE(params.get()); @@ -514,7 +514,7 @@ WebviewOverrideUserAgentFunction::WebviewOverrideUserAgentFunction() { WebviewOverrideUserAgentFunction::~WebviewOverrideUserAgentFunction() { } -bool WebviewOverrideUserAgentFunction::RunImplSafe(WebViewGuest* guest) { +bool WebviewOverrideUserAgentFunction::RunAsyncSafe(WebViewGuest* guest) { scoped_ptr<extensions::api::webview::OverrideUserAgent::Params> params( extensions::api::webview::OverrideUserAgent::Params::Create(*args_)); EXTENSION_FUNCTION_VALIDATE(params.get()); @@ -529,7 +529,7 @@ WebviewStopFunction::WebviewStopFunction() { WebviewStopFunction::~WebviewStopFunction() { } -bool WebviewStopFunction::RunImplSafe(WebViewGuest* guest) { +bool WebviewStopFunction::RunAsyncSafe(WebViewGuest* guest) { guest->Stop(); return true; } @@ -540,7 +540,7 @@ WebviewTerminateFunction::WebviewTerminateFunction() { WebviewTerminateFunction::~WebviewTerminateFunction() { } -bool WebviewTerminateFunction::RunImplSafe(WebViewGuest* guest) { +bool WebviewTerminateFunction::RunAsyncSafe(WebViewGuest* guest) { guest->Terminate(); return true; } diff --git a/chrome/browser/extensions/api/webview/webview_api.h b/chrome/browser/extensions/api/webview/webview_api.h index b90eef7..5e0a4ad2c 100644 --- a/chrome/browser/extensions/api/webview/webview_api.h +++ b/chrome/browser/extensions/api/webview/webview_api.h @@ -18,7 +18,7 @@ namespace extensions { // An abstract base class for async webview APIs. It does a process ID check -// in RunImpl, and then calls RunImplSafe which must be overriden by all +// in RunAsync, and then calls RunAsyncSafe which must be overriden by all // subclasses. class WebviewExtensionFunction : public AsyncExtensionFunction { public: @@ -28,10 +28,10 @@ class WebviewExtensionFunction : public AsyncExtensionFunction { virtual ~WebviewExtensionFunction() {} // ExtensionFunction implementation. - virtual bool RunImpl() OVERRIDE FINAL; + virtual bool RunAsync() OVERRIDE FINAL; private: - virtual bool RunImplSafe(WebViewGuest* guest) = 0; + virtual bool RunAsyncSafe(WebViewGuest* guest) = 0; }; class WebviewContextMenusCreateFunction : public AsyncExtensionFunction { @@ -44,7 +44,7 @@ class WebviewContextMenusCreateFunction : public AsyncExtensionFunction { virtual ~WebviewContextMenusCreateFunction() {} // ExtensionFunction implementation. - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; private: DISALLOW_COPY_AND_ASSIGN(WebviewContextMenusCreateFunction); @@ -60,7 +60,7 @@ class WebviewContextMenusUpdateFunction : public AsyncExtensionFunction { virtual ~WebviewContextMenusUpdateFunction() {} // ExtensionFunction implementation. - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; private: DISALLOW_COPY_AND_ASSIGN(WebviewContextMenusUpdateFunction); @@ -76,7 +76,7 @@ class WebviewContextMenusRemoveFunction : public AsyncExtensionFunction { virtual ~WebviewContextMenusRemoveFunction() {} // ExtensionFunction implementation. - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; private: DISALLOW_COPY_AND_ASSIGN(WebviewContextMenusRemoveFunction); @@ -92,7 +92,7 @@ class WebviewContextMenusRemoveAllFunction : public AsyncExtensionFunction { virtual ~WebviewContextMenusRemoveAllFunction() {} // ExtensionFunction implementation. - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; private: DISALLOW_COPY_AND_ASSIGN(WebviewContextMenusRemoveAllFunction); @@ -109,7 +109,7 @@ class WebviewClearDataFunction : public WebviewExtensionFunction { private: // WebviewExtensionFunction implementation. - virtual bool RunImplSafe(WebViewGuest* guest) OVERRIDE; + virtual bool RunAsyncSafe(WebViewGuest* guest) OVERRIDE; uint32 GetRemovalMask(); void ClearDataDone(); @@ -214,7 +214,7 @@ class WebviewSetZoomFunction : public WebviewExtensionFunction { virtual ~WebviewSetZoomFunction(); private: - virtual bool RunImplSafe(WebViewGuest* guest) OVERRIDE; + virtual bool RunAsyncSafe(WebViewGuest* guest) OVERRIDE; DISALLOW_COPY_AND_ASSIGN(WebviewSetZoomFunction); }; @@ -229,7 +229,7 @@ class WebviewGetZoomFunction : public WebviewExtensionFunction { virtual ~WebviewGetZoomFunction(); private: - virtual bool RunImplSafe(WebViewGuest* guest) OVERRIDE; + virtual bool RunAsyncSafe(WebViewGuest* guest) OVERRIDE; DISALLOW_COPY_AND_ASSIGN(WebviewGetZoomFunction); }; @@ -248,7 +248,7 @@ class WebviewFindFunction : public WebviewExtensionFunction { private: // WebviewExtensionFunction implementation. - virtual bool RunImplSafe(WebViewGuest* guest) OVERRIDE; + virtual bool RunAsyncSafe(WebViewGuest* guest) OVERRIDE; DISALLOW_COPY_AND_ASSIGN(WebviewFindFunction); }; @@ -264,7 +264,7 @@ class WebviewStopFindingFunction : public WebviewExtensionFunction { private: // WebviewExtensionFunction implementation. - virtual bool RunImplSafe(WebViewGuest* guest) OVERRIDE; + virtual bool RunAsyncSafe(WebViewGuest* guest) OVERRIDE; DISALLOW_COPY_AND_ASSIGN(WebviewStopFindingFunction); }; @@ -280,7 +280,7 @@ class WebviewGoFunction : public WebviewExtensionFunction { private: // WebviewExtensionFunction implementation. - virtual bool RunImplSafe(WebViewGuest* guest) OVERRIDE; + virtual bool RunAsyncSafe(WebViewGuest* guest) OVERRIDE; DISALLOW_COPY_AND_ASSIGN(WebviewGoFunction); }; @@ -296,7 +296,7 @@ class WebviewReloadFunction : public WebviewExtensionFunction { private: // WebviewExtensionFunction implementation. - virtual bool RunImplSafe(WebViewGuest* guest) OVERRIDE; + virtual bool RunAsyncSafe(WebViewGuest* guest) OVERRIDE; DISALLOW_COPY_AND_ASSIGN(WebviewReloadFunction); }; @@ -312,7 +312,7 @@ class WebviewSetPermissionFunction : public WebviewExtensionFunction { private: // WebviewExtensionFunction implementation. - virtual bool RunImplSafe(WebViewGuest* guest) OVERRIDE; + virtual bool RunAsyncSafe(WebViewGuest* guest) OVERRIDE; DISALLOW_COPY_AND_ASSIGN(WebviewSetPermissionFunction); }; @@ -329,7 +329,7 @@ class WebviewOverrideUserAgentFunction: public WebviewExtensionFunction { private: // WebviewExtensionFunction implementation. - virtual bool RunImplSafe(WebViewGuest* guest) OVERRIDE; + virtual bool RunAsyncSafe(WebViewGuest* guest) OVERRIDE; DISALLOW_COPY_AND_ASSIGN(WebviewOverrideUserAgentFunction); }; @@ -345,7 +345,7 @@ class WebviewStopFunction : public WebviewExtensionFunction { private: // WebviewExtensionFunction implementation. - virtual bool RunImplSafe(WebViewGuest* guest) OVERRIDE; + virtual bool RunAsyncSafe(WebViewGuest* guest) OVERRIDE; DISALLOW_COPY_AND_ASSIGN(WebviewStopFunction); }; @@ -361,7 +361,7 @@ class WebviewTerminateFunction : public WebviewExtensionFunction { private: // WebviewExtensionFunction implementation. - virtual bool RunImplSafe(WebViewGuest* guest) OVERRIDE; + virtual bool RunAsyncSafe(WebViewGuest* guest) OVERRIDE; DISALLOW_COPY_AND_ASSIGN(WebviewTerminateFunction); }; diff --git a/chrome/browser/extensions/chrome_extension_function.cc b/chrome/browser/extensions/chrome_extension_function.cc index 24ccfc4..f9c7f28 100644 --- a/chrome/browser/extensions/chrome_extension_function.cc +++ b/chrome/browser/extensions/chrome_extension_function.cc @@ -17,13 +17,14 @@ using content::RenderViewHost; using content::WebContents; -ChromeAsyncExtensionFunction::ChromeAsyncExtensionFunction() {} +ChromeUIThreadExtensionFunction::ChromeUIThreadExtensionFunction() { +} -Profile* ChromeAsyncExtensionFunction::GetProfile() const { +Profile* ChromeUIThreadExtensionFunction::GetProfile() const { return Profile::FromBrowserContext(context_); } -bool ChromeAsyncExtensionFunction::CanOperateOnWindow( +bool ChromeUIThreadExtensionFunction::CanOperateOnWindow( const extensions::WindowController* window_controller) const { const extensions::Extension* extension = GetExtension(); // |extension| is NULL for unit tests only. @@ -41,7 +42,7 @@ bool ChromeAsyncExtensionFunction::CanOperateOnWindow( } // TODO(stevenjb): Replace this with GetExtensionWindowController(). -Browser* ChromeAsyncExtensionFunction::GetCurrentBrowser() { +Browser* ChromeUIThreadExtensionFunction::GetCurrentBrowser() { // If the delegate has an associated browser, return it. if (dispatcher()) { extensions::WindowController* window_controller = @@ -80,7 +81,7 @@ Browser* ChromeAsyncExtensionFunction::GetCurrentBrowser() { } extensions::WindowController* -ChromeAsyncExtensionFunction::GetExtensionWindowController() { +ChromeUIThreadExtensionFunction::GetExtensionWindowController() { // If the delegate has an associated window controller, return it. if (dispatcher()) { extensions::WindowController* window_controller = @@ -93,7 +94,8 @@ ChromeAsyncExtensionFunction::GetExtensionWindowController() { ->CurrentWindowForFunction(this); } -content::WebContents* ChromeAsyncExtensionFunction::GetAssociatedWebContents() { +content::WebContents* +ChromeUIThreadExtensionFunction::GetAssociatedWebContents() { content::WebContents* web_contents = UIThreadExtensionFunction::GetAssociatedWebContents(); if (web_contents) @@ -105,13 +107,24 @@ content::WebContents* ChromeAsyncExtensionFunction::GetAssociatedWebContents() { return browser->tab_strip_model()->GetActiveWebContents(); } +ChromeUIThreadExtensionFunction::~ChromeUIThreadExtensionFunction() { +} + +ChromeAsyncExtensionFunction::ChromeAsyncExtensionFunction() { +} + ChromeAsyncExtensionFunction::~ChromeAsyncExtensionFunction() {} -ChromeSyncExtensionFunction::ChromeSyncExtensionFunction() {} +ExtensionFunction::ResponseAction ChromeAsyncExtensionFunction::Run() { + return RunAsync() ? RespondLater() : RespondNow(Error(error_)); +} -bool ChromeSyncExtensionFunction::RunImpl() { - SendResponse(RunSync()); - return true; +ChromeSyncExtensionFunction::ChromeSyncExtensionFunction() { } ChromeSyncExtensionFunction::~ChromeSyncExtensionFunction() {} + +ExtensionFunction::ResponseAction ChromeSyncExtensionFunction::Run() { + return RespondNow(RunSync() ? MultipleArguments(results_.get()) + : Error(error_)); +} diff --git a/chrome/browser/extensions/chrome_extension_function.h b/chrome/browser/extensions/chrome_extension_function.h index 40fc539..6536a76 100644 --- a/chrome/browser/extensions/chrome_extension_function.h +++ b/chrome/browser/extensions/chrome_extension_function.h @@ -18,11 +18,11 @@ namespace extensions { class WindowController; } -// A chrome specific analog to AsyncExtensionFunction. This has access -// the a chrome Profile. -class ChromeAsyncExtensionFunction : public UIThreadExtensionFunction { +// A chrome specific analog to AsyncExtensionFunction. This has access to a +// chrome Profile. +class ChromeUIThreadExtensionFunction : public UIThreadExtensionFunction { public: - ChromeAsyncExtensionFunction(); + ChromeUIThreadExtensionFunction(); Profile* GetProfile() const; @@ -59,21 +59,39 @@ class ChromeAsyncExtensionFunction : public UIThreadExtensionFunction { virtual content::WebContents* GetAssociatedWebContents() OVERRIDE; protected: + virtual ~ChromeUIThreadExtensionFunction(); +}; + +// A chrome specific analog to AsyncExtensionFunction. This has access to a +// chrome Profile. +class ChromeAsyncExtensionFunction : public ChromeUIThreadExtensionFunction { + public: + ChromeAsyncExtensionFunction(); + + protected: virtual ~ChromeAsyncExtensionFunction(); + + // Deprecated, see AsyncExtensionFunction::RunAsync. + virtual bool RunAsync() = 0; + + private: + virtual ResponseAction Run() OVERRIDE; }; -// A chrome specific analog to SyncExtensionFunction. This has access -// the a chrome Profile. -class ChromeSyncExtensionFunction : public ChromeAsyncExtensionFunction { +// A chrome specific analog to SyncExtensionFunction. This has access to a +// chrome Profile. +class ChromeSyncExtensionFunction : public ChromeUIThreadExtensionFunction { public: ChromeSyncExtensionFunction(); - virtual bool RunImpl() OVERRIDE; + protected: + virtual ~ChromeSyncExtensionFunction(); + // Deprecated, see SyncExtensionFunction::RunSync. virtual bool RunSync() = 0; - protected: - virtual ~ChromeSyncExtensionFunction(); + private: + virtual ResponseAction Run() OVERRIDE; }; #endif // CHROME_BROWSER_EXTENSIONS_CHROME_EXTENSION_FUNCTION_H_ diff --git a/chrome/browser/extensions/extension_function_test_utils.cc b/chrome/browser/extensions/extension_function_test_utils.cc index e7de247..94951ca 100644 --- a/chrome/browser/extensions/extension_function_test_utils.cc +++ b/chrome/browser/extensions/extension_function_test_utils.cc @@ -257,9 +257,9 @@ bool RunFunction(UIThreadExtensionFunction* function, function->set_browser_context(browser->profile()); function->set_include_incognito(flags & INCLUDE_INCOGNITO); - function->Run(); + function->Run()->Execute(); - // If the RunImpl of |function| didn't already call SendResponse, run the + // If the RunAsync of |function| didn't already call SendResponse, run the // message loop until they do. if (!response_delegate.HasResponse()) { response_delegate.set_should_post_quit(true); diff --git a/chrome/browser/extensions/extension_function_test_utils.h b/chrome/browser/extensions/extension_function_test_utils.h index 7bd111c..37c7592 100644 --- a/chrome/browser/extensions/extension_function_test_utils.h +++ b/chrome/browser/extensions/extension_function_test_utils.h @@ -10,7 +10,6 @@ #include "base/memory/ref_counted.h" #include "extensions/common/manifest.h" -class AsyncExtensionFunction; class Browser; class UIThreadExtensionFunction; diff --git a/chrome/browser/extensions/extension_tab_util.cc b/chrome/browser/extensions/extension_tab_util.cc index 1537a33..7041441 100644 --- a/chrome/browser/extensions/extension_tab_util.cc +++ b/chrome/browser/extensions/extension_tab_util.cc @@ -87,7 +87,7 @@ Browser* GetBrowserInProfileWithId(Profile* profile, return NULL; } -Browser* CreateBrowser(ChromeAsyncExtensionFunction* function, +Browser* CreateBrowser(ChromeUIThreadExtensionFunction* function, int window_id, std::string* error) { content::WebContents* web_contents = function->GetAssociatedWebContents(); @@ -118,7 +118,7 @@ ExtensionTabUtil::OpenTabParams::~OpenTabParams() { // Opens a new tab for a given extension. Returns NULL and sets |error| if an // error occurs. base::DictionaryValue* ExtensionTabUtil::OpenTab( - ChromeAsyncExtensionFunction* function, + ChromeUIThreadExtensionFunction* function, const OpenTabParams& params, std::string* error) { // windowId defaults to "current" window. @@ -257,7 +257,7 @@ base::DictionaryValue* ExtensionTabUtil::OpenTab( } Browser* ExtensionTabUtil::GetBrowserFromWindowID( - ChromeAsyncExtensionFunction* function, + ChromeUIThreadExtensionFunction* function, int window_id, std::string* error) { if (window_id == extension_misc::kCurrentWindowId) { diff --git a/chrome/browser/extensions/extension_tab_util.h b/chrome/browser/extensions/extension_tab_util.h index bbf042b..b997aa3 100644 --- a/chrome/browser/extensions/extension_tab_util.h +++ b/chrome/browser/extensions/extension_tab_util.h @@ -12,7 +12,7 @@ #include "ui/base/window_open_disposition.h" class Browser; -class ChromeAsyncExtensionFunction; +class ChromeUIThreadExtensionFunction; class GURL; class Profile; class TabStripModel; @@ -53,9 +53,10 @@ class ExtensionTabUtil { // Opens a new tab given an extension function |function| and creation // parameters |params|. Returns a Tab object if successful, or NULL and // optionally sets |error| if an error occurs. - static base::DictionaryValue* OpenTab(ChromeAsyncExtensionFunction* function, - const OpenTabParams& params, - std::string* error); + static base::DictionaryValue* OpenTab( + ChromeUIThreadExtensionFunction* function, + const OpenTabParams& params, + std::string* error); static int GetWindowId(const Browser* browser); static int GetWindowIdOfTabStripModel(const TabStripModel* tab_strip_model); @@ -64,9 +65,10 @@ class ExtensionTabUtil { static int GetWindowIdOfTab(const content::WebContents* web_contents); static base::ListValue* CreateTabList(const Browser* browser, const Extension* extension); - static Browser* GetBrowserFromWindowID(ChromeAsyncExtensionFunction* function, - int window_id, - std::string* error_message); + static Browser* GetBrowserFromWindowID( + ChromeUIThreadExtensionFunction* function, + int window_id, + std::string* error_message); // Creates a Tab object (see chrome/common/extensions/api/tabs.json) with // information about the state of a browser tab. Depending on the diff --git a/chrome/browser/extensions/window_controller_list.cc b/chrome/browser/extensions/window_controller_list.cc index 608d3e5..230ec51 100644 --- a/chrome/browser/extensions/window_controller_list.cc +++ b/chrome/browser/extensions/window_controller_list.cc @@ -62,7 +62,7 @@ WindowController* WindowControllerList::FindWindowById(int id) const { } WindowController* WindowControllerList::FindWindowForFunctionById( - const ChromeAsyncExtensionFunction* function, + const ChromeUIThreadExtensionFunction* function, int id) const { WindowController* controller = FindWindowById(id); if (controller && function->CanOperateOnWindow(controller)) @@ -71,7 +71,7 @@ WindowController* WindowControllerList::FindWindowForFunctionById( } WindowController* WindowControllerList::CurrentWindowForFunction( - const ChromeAsyncExtensionFunction* function) const { + const ChromeUIThreadExtensionFunction* function) const { WindowController* result = NULL; // Returns either the focused window (if any), or the last window in the list. for (ControllerList::const_iterator iter = windows().begin(); diff --git a/chrome/browser/extensions/window_controller_list.h b/chrome/browser/extensions/window_controller_list.h index 103069f..a68c59f 100644 --- a/chrome/browser/extensions/window_controller_list.h +++ b/chrome/browser/extensions/window_controller_list.h @@ -13,7 +13,7 @@ #include "chrome/browser/extensions/window_controller.h" class Profile; -class ChromeAsyncExtensionFunction; +class ChromeUIThreadExtensionFunction; namespace extensions { @@ -38,13 +38,13 @@ class WindowControllerList { // Returns a window matching the context the function was invoked in. WindowController* FindWindowForFunctionById( - const ChromeAsyncExtensionFunction* function, + const ChromeUIThreadExtensionFunction* function, int id) const; // Returns the focused or last added window matching the context the function // was invoked in. WindowController* CurrentWindowForFunction( - const ChromeAsyncExtensionFunction* function) const; + const ChromeUIThreadExtensionFunction* function) const; const ControllerList& windows() const { return windows_; } diff --git a/chrome/browser/speech/extension_api/tts_extension_api.cc b/chrome/browser/speech/extension_api/tts_extension_api.cc index 36549ce..89db1c5 100644 --- a/chrome/browser/speech/extension_api/tts_extension_api.cc +++ b/chrome/browser/speech/extension_api/tts_extension_api.cc @@ -135,7 +135,7 @@ void TtsExtensionEventHandler::OnTtsEvent(Utterance* utterance, delete this; } -bool TtsSpeakFunction::RunImpl() { +bool TtsSpeakFunction::RunAsync() { std::string text; EXTENSION_FUNCTION_VALIDATE(args_->GetString(0, &text)); if (text.size() > 32768) { diff --git a/chrome/browser/speech/extension_api/tts_extension_api.h b/chrome/browser/speech/extension_api/tts_extension_api.h index b4dfcd6..bb96474 100644 --- a/chrome/browser/speech/extension_api/tts_extension_api.h +++ b/chrome/browser/speech/extension_api/tts_extension_api.h @@ -23,7 +23,7 @@ namespace extensions { class TtsSpeakFunction : public ChromeAsyncExtensionFunction { private: virtual ~TtsSpeakFunction() {} - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; DECLARE_EXTENSION_FUNCTION("tts.speak", TTS_SPEAK) }; diff --git a/extensions/browser/api/async_api_function.cc b/extensions/browser/api/async_api_function.cc index 1152f208..a4e40f6 100644 --- a/extensions/browser/api/async_api_function.cc +++ b/extensions/browser/api/async_api_function.cc @@ -16,7 +16,7 @@ AsyncApiFunction::AsyncApiFunction() : work_thread_id_(BrowserThread::IO) {} AsyncApiFunction::~AsyncApiFunction() {} -bool AsyncApiFunction::RunImpl() { +bool AsyncApiFunction::RunAsync() { DCHECK_CURRENTLY_ON(BrowserThread::UI); if (!PrePrepare() || !Prepare()) { diff --git a/extensions/browser/api/async_api_function.h b/extensions/browser/api/async_api_function.h index b18ec4d..dd586f1 100644 --- a/extensions/browser/api/async_api_function.h +++ b/extensions/browser/api/async_api_function.h @@ -12,7 +12,7 @@ namespace extensions { // AsyncApiFunction provides convenient thread management for APIs that need to // do essentially all their work on a thread other than the UI thread. -class AsyncApiFunction : public UIThreadExtensionFunction { +class AsyncApiFunction : public AsyncExtensionFunction { protected: AsyncApiFunction(); virtual ~AsyncApiFunction(); @@ -38,8 +38,8 @@ class AsyncApiFunction : public UIThreadExtensionFunction { // Respond. Guaranteed to happen on UI thread. virtual bool Respond() = 0; - // ExtensionFunction::RunImpl() - virtual bool RunImpl() OVERRIDE; + // ExtensionFunction::RunAsync() + virtual bool RunAsync() OVERRIDE; protected: content::BrowserThread::ID work_thread_id() const { return work_thread_id_; } diff --git a/extensions/browser/api/dns/dns_api.cc b/extensions/browser/api/dns/dns_api.cc index a3a7eb1..ef270c7 100644 --- a/extensions/browser/api/dns/dns_api.cc +++ b/extensions/browser/api/dns/dns_api.cc @@ -30,7 +30,7 @@ DnsResolveFunction::DnsResolveFunction() DnsResolveFunction::~DnsResolveFunction() {} -bool DnsResolveFunction::RunImpl() { +bool DnsResolveFunction::RunAsync() { scoped_ptr<Resolve::Params> params(Resolve::Params::Create(*args_)); EXTENSION_FUNCTION_VALIDATE(params.get()); diff --git a/extensions/browser/api/dns/dns_api.h b/extensions/browser/api/dns/dns_api.h index f14769b..8261564 100644 --- a/extensions/browser/api/dns/dns_api.h +++ b/extensions/browser/api/dns/dns_api.h @@ -28,7 +28,7 @@ class DnsResolveFunction : public AsyncExtensionFunction { virtual ~DnsResolveFunction(); // ExtensionFunction: - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; void WorkOnIOThread(); void RespondOnUIThread(); diff --git a/extensions/browser/api/socket/socket_api.cc b/extensions/browser/api/socket/socket_api.cc index 5d40b84..229cfdd 100644 --- a/extensions/browser/api/socket/socket_api.cc +++ b/extensions/browser/api/socket/socket_api.cc @@ -638,7 +638,7 @@ void SocketGetInfoFunction::Work() { SetResult(info.ToValue().release()); } -bool SocketGetNetworkListFunction::RunImpl() { +bool SocketGetNetworkListFunction::RunAsync() { content::BrowserThread::PostTask( content::BrowserThread::FILE, FROM_HERE, diff --git a/extensions/browser/api/socket/socket_api.h b/extensions/browser/api/socket/socket_api.h index 60bd765..cd93f7a 100644 --- a/extensions/browser/api/socket/socket_api.h +++ b/extensions/browser/api/socket/socket_api.h @@ -407,7 +407,7 @@ class SocketGetNetworkListFunction : public AsyncExtensionFunction { protected: virtual ~SocketGetNetworkListFunction() {} - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; private: void GetNetworkListOnFileThread(); diff --git a/extensions/browser/api/storage/storage_api.cc b/extensions/browser/api/storage/storage_api.cc index 3f1882d..012fe41 100644 --- a/extensions/browser/api/storage/storage_api.cc +++ b/extensions/browser/api/storage/storage_api.cc @@ -32,14 +32,13 @@ bool SettingsFunction::ShouldSkipQuotaLimiting() const { std::string settings_namespace_string; if (!args_->GetString(0, &settings_namespace_string)) { // This should be EXTENSION_FUNCTION_VALIDATE(false) but there is no way - // to signify that from this function. It will be caught in - // RunImplTypesafe(). + // to signify that from this function. It will be caught in Run(). return false; } return settings_namespace_string != "sync"; } -ExtensionFunction::ResponseAction SettingsFunction::RunImplTypesafe() { +ExtensionFunction::ResponseAction SettingsFunction::Run() { std::string settings_namespace_string; EXTENSION_FUNCTION_VALIDATE_TYPESAFE( args_->GetString(0, &settings_namespace_string)); @@ -66,11 +65,10 @@ ExtensionFunction::ResponseAction SettingsFunction::RunImplTypesafe() { void SettingsFunction::AsyncRunWithStorage(ValueStore* storage) { ResponseValue response = RunWithStorage(storage); - BrowserThread::PostTask(BrowserThread::UI, - FROM_HERE, - base::Bind(&SettingsFunction::SendResponseTypesafe, - this, - base::Passed(&response))); + BrowserThread::PostTask( + BrowserThread::UI, + FROM_HERE, + base::Bind(&SettingsFunction::Respond, this, base::Passed(&response))); } ExtensionFunction::ResponseValue SettingsFunction::UseReadResult( diff --git a/extensions/browser/api/storage/storage_api.h b/extensions/browser/api/storage/storage_api.h index 9f1091c..b4b97da 100644 --- a/extensions/browser/api/storage/storage_api.h +++ b/extensions/browser/api/storage/storage_api.h @@ -22,7 +22,7 @@ class SettingsFunction : public UIThreadExtensionFunction { // ExtensionFunction: virtual bool ShouldSkipQuotaLimiting() const OVERRIDE; - virtual ResponseAction RunImplTypesafe() OVERRIDE; + virtual ResponseAction Run() OVERRIDE; // Extension settings function implementations should do their work here. // The StorageFrontend makes sure this is posted to the appropriate thread. @@ -48,7 +48,7 @@ class SettingsFunction : public UIThreadExtensionFunction { ValueStore* storage); private: - // Called via PostTask from RunImplTypesafe. Calls RunWithStorage and then + // Called via PostTask from Run. Calls RunWithStorage and then // SendResponse with its success value. void AsyncRunWithStorage(ValueStore* storage); diff --git a/extensions/browser/api/test/test_api.cc b/extensions/browser/api/test/test_api.cc index b052946..87252b7 100644 --- a/extensions/browser/api/test/test_api.cc +++ b/extensions/browser/api/test/test_api.cc @@ -87,7 +87,7 @@ bool TestResetQuotaFunction::RunSafe() { return true; } -bool TestSendMessageFunction::RunImpl() { +bool TestSendMessageFunction::RunAsync() { scoped_ptr<PassMessage::Params> params(PassMessage::Params::Create(*args_)); EXTENSION_FUNCTION_VALIDATE(params.get()); content::NotificationService::current()->Notify( diff --git a/extensions/browser/api/test/test_api.h b/extensions/browser/api/test/test_api.h index 9511abf..ea5a639 100644 --- a/extensions/browser/api/test/test_api.h +++ b/extensions/browser/api/test/test_api.h @@ -81,7 +81,7 @@ class TestSendMessageFunction : public AsyncExtensionFunction { virtual ~TestSendMessageFunction(); // ExtensionFunction: - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; }; class TestGetConfigFunction : public TestExtensionFunction { diff --git a/extensions/browser/extension_function.cc b/extensions/browser/extension_function.cc index 7e9a194..470ae55 100644 --- a/extensions/browser/extension_function.cc +++ b/extensions/browser/extension_function.cc @@ -34,7 +34,9 @@ class MultipleArgumentsResponseValue } else { function->SetResultList(make_scoped_ptr(result)); } - DCHECK_EQ("", function->GetError()); + // It would be nice to DCHECK(error.empty()) but some legacy extension + // function implementations... I'm looking at chrome.input.ime... do this + // for some reason. } virtual ~MultipleArgumentsResponseValue() {} @@ -45,7 +47,8 @@ class MultipleArgumentsResponseValue class ErrorResponseValue : public ExtensionFunction::ResponseValueObject { public: ErrorResponseValue(ExtensionFunction* function, const std::string& error) { - DCHECK_NE("", error); + // It would be nice to DCHECK(!error.empty()) but too many legacy extension + // function implementations don't set error but signal failure. function->SetError(error); } @@ -232,24 +235,8 @@ ExtensionFunction::ResponseAction ExtensionFunction::RespondLater() { return scoped_ptr<ResponseActionObject>(new RespondLaterAction()); } -void ExtensionFunction::Run() { - if (!RunImpl()) - SendResponse(false); -} - -bool ExtensionFunction::RunImpl() { - RunImplTypesafe()->Execute(); - return true; -} - -ExtensionFunction::ResponseAction ExtensionFunction::RunImplTypesafe() { - NOTREACHED() - << "ExtensionFunctions must override either RunImpl or RunImplTypesafe"; - return RespondNow(NoArguments()); -} - -void ExtensionFunction::SendResponseTypesafe(ResponseValue response) { - SendResponse(response->Apply()); +void ExtensionFunction::Respond(ResponseValue result) { + SendResponse(result->Apply()); } bool ExtensionFunction::ShouldSkipQuotaLimiting() const { @@ -277,6 +264,10 @@ void ExtensionFunction::SendResponseImpl(bool success) { response_callback_.Run(type, *results_, GetError()); } +void ExtensionFunction::OnRespondingLater(ResponseValue value) { + SendResponse(value->Apply()); +} + UIThreadExtensionFunction::UIThreadExtensionFunction() : render_view_host_(NULL), render_frame_host_(NULL), @@ -369,15 +360,19 @@ AsyncExtensionFunction::AsyncExtensionFunction() { AsyncExtensionFunction::~AsyncExtensionFunction() { } +ExtensionFunction::ResponseAction AsyncExtensionFunction::Run() { + return RunAsync() ? RespondLater() : RespondNow(Error(error_)); +} + SyncExtensionFunction::SyncExtensionFunction() { } SyncExtensionFunction::~SyncExtensionFunction() { } -bool SyncExtensionFunction::RunImpl() { - SendResponse(RunSync()); - return true; +ExtensionFunction::ResponseAction SyncExtensionFunction::Run() { + return RespondNow(RunSync() ? MultipleArguments(results_.get()) + : Error(error_)); } SyncIOThreadExtensionFunction::SyncIOThreadExtensionFunction() { @@ -386,7 +381,7 @@ SyncIOThreadExtensionFunction::SyncIOThreadExtensionFunction() { SyncIOThreadExtensionFunction::~SyncIOThreadExtensionFunction() { } -bool SyncIOThreadExtensionFunction::RunImpl() { - SendResponse(RunSync()); - return true; +ExtensionFunction::ResponseAction SyncIOThreadExtensionFunction::Run() { + return RespondNow(RunSync() ? MultipleArguments(results_.get()) + : Error(error_)); } diff --git a/extensions/browser/extension_function.h b/extensions/browser/extension_function.h index ee5f97a..259b86a 100644 --- a/extensions/browser/extension_function.h +++ b/extensions/browser/extension_function.h @@ -118,13 +118,41 @@ class ExtensionFunction // This will be run after the function has been set up but before Run(). virtual bool HasPermission(); - // Execute the API. Clients should initialize the ExtensionFunction using - // SetArgs(), set_request_id(), and the other setters before calling this - // method. + // The result of a function call. + // + // Use NoArguments(), SingleArgument(), MultipleArguments(), or Error() + // rather than this class directly. + class ResponseValueObject { + public: + virtual ~ResponseValueObject() {} + + // Returns true for success, false for failure. + virtual bool Apply() = 0; + }; + typedef scoped_ptr<ResponseValueObject> ResponseValue; + + // The action to use when returning from RunAsync. + // + // Use RespondNow() or RespondLater() rather than this class directly. + class ResponseActionObject { + public: + virtual ~ResponseActionObject() {} + + virtual void Execute() = 0; + }; + typedef scoped_ptr<ResponseActionObject> ResponseAction; + + // Runs the function and returns the action to take when the caller is ready + // to respond. + // + // Callers must call Execute() on the return ResponseAction at some point, + // exactly once. // - // Note that once Run() returns, dispatcher() can be NULL, so be sure to - // NULL-check. - void Run(); + // SyncExtensionFunction and AsyncExtensionFunction implement this in terms + // of SyncExtensionFunction::RunSync and AsyncExtensionFunction::RunAsync, + // but this is deprecated. ExtensionFunction implementations are encouraged + // to just implement Run. + virtual ResponseAction Run() WARN_UNUSED_RESULT = 0; // Gets whether quota should be applied to this individual function // invocation. This is different to GetQuotaLimitHeuristics which is only @@ -208,30 +236,6 @@ class ExtensionFunction void set_source_tab_id(int source_tab_id) { source_tab_id_ = source_tab_id; } int source_tab_id() const { return source_tab_id_; } - // The result of a function call. - // - // Use NoArguments(), SingleArgument(), MultipleArguments(), or Error() - // rather than this class directly. - class ResponseValueObject { - public: - virtual ~ResponseValueObject() {} - - // Returns true for success, false for failure. - virtual bool Apply() = 0; - }; - typedef scoped_ptr<ResponseValueObject> ResponseValue; - - // The action to use when returning from RunImpl. - // - // Use RespondNow() or RespondLater() rather than this class directly. - class ResponseActionObject { - public: - virtual ~ResponseActionObject() {} - - virtual void Execute() = 0; - }; - typedef scoped_ptr<ResponseActionObject> ResponseAction; - protected: friend struct ExtensionFunctionDeleteTraits; @@ -252,28 +256,23 @@ class ExtensionFunction // // Respond to the extension immediately with |result|. ResponseAction RespondNow(ResponseValue result); - // Don't respond now, but promise to call SendResponse later. + // Don't respond now, but promise to call Respond() later. ResponseAction RespondLater(); + // If RespondLater() was used, functions must at some point call Respond() + // with |result| as their result. + void Respond(ResponseValue result); + virtual ~ExtensionFunction(); // Helper method for ExtensionFunctionDeleteTraits. Deletes this object. virtual void Destruct() const = 0; - // Derived classes should implement one of these methods to do their work. - // - // Returns the action to take. DO NOT USE WITH SyncExtensionFunction. - virtual ResponseAction RunImplTypesafe(); - // Deprecated. Returns true on success. SendResponse() must be called later. - // Return false to indicate an error and respond immediately. - virtual bool RunImpl(); - - // Sends the result back to the extension. + // Do not call this function directly, return the appropriate ResponseAction + // from Run() instead. If using RespondLater then call Respond(). // - // Responds with |response|. - void SendResponseTypesafe(ResponseValue response); - // Deprecated. Call with true to indicate success, false to indicate failure, - // in which case please set |error_|. + // Call with true to indicate success, false to indicate failure, in which + // case please set |error_|. virtual void SendResponse(bool success) = 0; // Common implementation for SendResponse. @@ -337,6 +336,8 @@ class ExtensionFunction int source_tab_id_; private: + void OnRespondingLater(ResponseValue response); + DISALLOW_COPY_AND_ASSIGN(ExtensionFunction); }; @@ -489,6 +490,16 @@ class AsyncExtensionFunction : public UIThreadExtensionFunction { protected: virtual ~AsyncExtensionFunction(); + + // Deprecated: Override UIThreadExtensionFunction and implement Run() instead. + // + // AsyncExtensionFunctions implement this method. Return true to indicate that + // nothing has gone wrong yet; SendResponse must be called later. Return true + // to respond immediately with an error. + virtual bool RunAsync() = 0; + + private: + virtual ResponseAction Run() OVERRIDE; }; // A SyncExtensionFunction is an ExtensionFunction that runs synchronously @@ -502,24 +513,35 @@ class SyncExtensionFunction : public UIThreadExtensionFunction { public: SyncExtensionFunction(); - virtual bool RunImpl() OVERRIDE; - protected: + virtual ~SyncExtensionFunction(); + + // Deprecated: Override UIThreadExtensionFunction and implement Run() instead. + // + // SyncExtensionFunctions implement this method. Return true to respond + // immediately with success, false to respond immediately with an error. virtual bool RunSync() = 0; - virtual ~SyncExtensionFunction(); + private: + virtual ResponseAction Run() OVERRIDE; }; class SyncIOThreadExtensionFunction : public IOThreadExtensionFunction { public: SyncIOThreadExtensionFunction(); - virtual bool RunImpl() OVERRIDE; - protected: + virtual ~SyncIOThreadExtensionFunction(); + + // Deprecated: Override IOThreadExtensionFunction and implement Run() instead. + // + // SyncIOThreadExtensionFunctions implement this method. Return true to + // respond immediately with success, false to respond immediately with an + // error. virtual bool RunSync() = 0; - virtual ~SyncIOThreadExtensionFunction(); + private: + virtual ResponseAction Run() OVERRIDE; }; #endif // EXTENSIONS_BROWSER_EXTENSION_FUNCTION_H_ diff --git a/extensions/browser/extension_function_dispatcher.cc b/extensions/browser/extension_function_dispatcher.cc index dd5f30a..fb3b50d 100644 --- a/extensions/browser/extension_function_dispatcher.cc +++ b/extensions/browser/extension_function_dispatcher.cc @@ -274,7 +274,7 @@ void ExtensionFunctionDispatcher::DispatchOnIOThread( static_cast<content::BrowserContext*>(profile_id)); UMA_HISTOGRAM_SPARSE_SLOWLY("Extensions.FunctionCalls", function->histogram_value()); - function->Run(); + function->Run()->Execute(); } else { function->OnQuotaExceeded(violation_error); } @@ -382,7 +382,7 @@ void ExtensionFunctionDispatcher::DispatchWithCallbackInternal( extension->id(), params.name, args.Pass(), browser_context_); UMA_HISTOGRAM_SPARSE_SLOWLY("Extensions.FunctionCalls", function->histogram_value()); - function->Run(); + function->Run()->Execute(); } else { function->OnQuotaExceeded(violation_error); } diff --git a/extensions/browser/quota_service_unittest.cc b/extensions/browser/quota_service_unittest.cc index d9501ba..8a684c7 100644 --- a/extensions/browser/quota_service_unittest.cc +++ b/extensions/browser/quota_service_unittest.cc @@ -67,7 +67,7 @@ class MockFunction : public ExtensionFunction { virtual std::string GetError() const OVERRIDE { return std::string(); } virtual void SetError(const std::string& error) OVERRIDE {} virtual void Destruct() const OVERRIDE { delete this; } - virtual bool RunImpl() OVERRIDE { return true; } + virtual ResponseAction Run() OVERRIDE { return RespondLater(); } virtual void SendResponse(bool) OVERRIDE {} protected: |