diff options
Diffstat (limited to 'chrome/browser/chromeos/extensions/file_system_provider')
4 files changed, 19 insertions, 12 deletions
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(); |